We present the latest IT news and tips, and information about our IT courses. Brought to you by Dr. Daniel Wong and Mr. Jude How
Latest news and events
August 2017
M T W T F S S
« Jul
123456
78910111213
14151617181920
21222324252627
28293031

## Archive for the ‘LaTeX’ Category

(for those who are not aware of TeX and LaTeX, LaTeX is a more user friendly version of TeX, and both TeX and LaTeX are popular software for writing scientific documents, especially when equations are involved. Equations in TeX/LaTeX look far more beautiful than those produced with Microsoft Word’s Equation Editor, for example)

If you use LaTeX on windows, and specifically mikTeX with TeXnicCenter, you may find that the default setting for the dvi previewer yap is to only use one window. So if you wish to open a second dvi document, it will remove the first one from the existing yap window and replace it with the second one. However, I usually would prefer to have multiple yap windows open at the same time. You can easily change it by editing your output profile (e.g., alt-F7 or select Define Output Profiles under Build), click on the “Viewer” tab and delete the “-1” argument that goes to yap. Thus, instead of “-1 %bm.dvi”, you will have “%bm.dvi”

(for those who are not aware of TeX and LaTeX, LaTeX is a more user friendly version of TeX, and both TeX and LaTeX are popular software for writing scientific documents, especially when equations are involved. Equations in TeX/LaTeX look far more beautiful than those produced with Microsoft Word’s Equation Editor, for example)

When I am writing, especially in my personal notes, I sometimes would have written about a particular topic in another document and just like to be able to refer to that other document rather than rewrite or copy and paste those paragraphs into the current document. I could always mention the name of that other document, but to be more precise, I would like to refer to specific sections, equations, etc., in that other document. Is it possible to do that in LaTeX? Yes, it is, with the “xr” package!

You might write something like:

``````\usepackage{xr}
\externaldocument{chapterI}
``````

as explained in http://tex.stackexchange.com/questions/14364/cross-reference-between-files-in-latex. One thing to add: often, the other LaTeX document is in another directory/folder. In particular, “xr” looks for the “.aux” file. In that case, you would write \externaldocument{[path of external file]} where [path of external file] is the path of the external file. I can verify that it works for relative paths, at least. Enjoy!

(for those who are not aware of TeX and LaTeX, LaTeX is a more user friendly version of TeX, and both TeX and LaTeX are popular software for writing scientific documents, especially when equations are involved. Equations in TeX/LaTeX look far more beautiful than those produced with Microsoft Word’s Equation Editor, for example)

There’s a curious problem with teXnicCenter (a popular LaTeX IDE for windows that is often used with mikTex, the windows implementation of LaTeX) in that it will only search for .bib files in the same folder as the .tex files. This doesn’t allow all the .bib files to be placed in a common folder, for instance, which is often very useful, especially when multiple documents (in different folders) share the same .bib file(s).

It has been reported that relative or absolute path names might work, but it would be more convenient if the latex files do NOT have to contain any path information, just the name of the .bib files, and mikTex will find the files when bibtex is run. In fact, if you run bibtex from the command line (part of mikTex), it will correctly locate .bib files in any folder that are specified in the environment variable BIBINPUTS (if you don’t know how to set environment variables, google search, or just go to the control panel, select system and advanced system settings). However, teXnicCenter appears to ignore BIBINPUTS. My proposed solution: set BIBINPUTS, and then turn of the automatic inclusion of bibtex in teXnicCenter, and simply go “outside” to the command line to run bibtex whenever you need to, and then return to teXnicCenter.