I am slowly sorting out how to use LaTeX to format papers. LaTeX is a great language to use for typesetting papers and does an especially good job handling figures and tables. The add-on BibTeX handles references very nicely. LaTeX is a strange language, though, and there are plenty of things that are not self evident. Here are some random posts on a variety of LaTeX issues that I frequently encounter in formatting papers. |
posted Dec 10, 2011, 9:40 PM by David Eagle
[
updated Dec 10, 2011, 9:42 PM
]
This handy utility locates TeX files: kpsewhich; mktexlsr makes the appropriate links. |
posted Nov 21, 2011, 8:58 AM by David Eagle
[
updated Apr 30, 2012, 10:21 AM
]
Most of my files use the LaTeX rendering system to process my files. Some, especially those with customized fonts, use XeLaTeX. There are two ways to make Aquamacs process this file using the XeTeX engine. First, choose the menu options: command->TeXing Options->Use XeTeX engine. The other is to make a new command to run XeTeX automatically. To do this:
- Go to LaTeX->Customize AUCTex->Browse Options
- Click "TeX Command" and find the "Command List" drop down.
- Click INS
- In the Name: box type "XeTeX"
- In the Command: box type: "%'xelatex -synctex=1%(mode)%' %t
- In the How: select "TeX-run-command"
- In the Modes: select "Value Menu" and check LaTeX, ConTeXt, and AmSTeX.
- "Save for future sessions"
Now you have a custom menu option under the Command menu that says XeTeX.
THIS WORKS ON AQUAMACS In order to set this as the default on a specific file add the following local variables to your document. Add these at the end of the document, with the comment characters: % Local Variables: % mode: LaTeX % TeX-command-default: "XeTeX" % coding: utf-8 % End:
THIS WORKS ON EMACS %Local Variables: %TeX-engine: xetex %End:
Close and reopen the document. Click ^C-^C <ret> and this will run XeTeX on your document. |
posted Oct 26, 2011, 8:47 AM by David Eagle
Here's how to insert cites using keyboard shortcuts in Emacs with a Bibtex file that you've created.
In the preamble make sure that you include: \usepackage{natbib}
Where you want the bibliography, type:
Replace <bibfile> with the full path to your Bibtex file. Don't include the .bib extension. (e.g. /User/user/bibfile)
Where you want to insert a cite type: Ctrl-c-[
Then select the cite type from the list.
Then type the terms you want to search for and hit enter. A list will appear on the right. Select the reference you want and press enter. |
posted Apr 21, 2011, 7:09 AM by David Eagle
[
updated Apr 21, 2011, 7:17 AM
]
Here's how to turn your footnotes into endnotes easily.
1. add \usepackage{endnotes} to the preamble to enable the endnotes package that is included with standard latex distributions.
2. add \let\footnote=\endnote to convert all instances of \footnote{} to \endnote{} When you want to add an endnote, just type \footnote{TEXT} where you want the reference to appear.
3. add \listofendnotes where you want the list of endnotes to appear. |
posted Feb 21, 2011, 10:30 AM by David Eagle
Here's how to create tables that span multiple pages and are rotated sideways (landscape). In the preamble type:
\usepackage{longtable,lscape}
When you want to add the table type:
\begin{landscape} \begin{longtable}{lccccccll} %note the lccccll are the standard column alignments \caption{CAPTION} \label{tab:1}\\ %label is referenced in the text with \ref{tab:1} .... \end{longtable} \end{lscape}
|
posted Sep 24, 2010, 6:24 AM by David Eagle
[
updated Sep 24, 2010, 6:25 AM
]
Here's the snippet to add reasonable nice figures in a paper with centered captions that are the same width as the figure:
\begin{figure}[htp] \centering \includegraphics[width=.8\textwidth]{NAME.pdf} \parbox[t]{0.8\linewidth}{% \caption{NAME}% \label{fig:fig1}} \end{figure}
|
posted Jul 8, 2010, 12:13 AM by David Eagle
[
updated Oct 9, 2010, 4:59 AM
]
Yes, it can be done. It takes a little work, but here are the steps: sudo mkdir /usr/local/stata11 %create directory for Stata - sudo ln -s /usr/local/stata11 /user/local/stata %symbolic link for easy updating
sudo /media/Stata/install %run the installer
cd /usr/local/stata11 sudo ./stinit %run the license program add the following to your ~/.profile file (with an text editor) PATH="/bin:/usr/bin:/usr/bin/local:$HOME/bin:/usr/local/stata" Log out and in.
the command stata should work in a terminal xstata will not! (this is the GUI version) Add the following links:
sudo ln -s /usr/lib/libgtk2.0-0 /usr/lib/libgtk-1.2.0
sudo ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3
sudo ln -s /usr/lib/libgtksourceview-2.0.so.0 /usr/lib/libgtksourceview-1.0.so.0
Stata can be tricked into using the newer version instead of the old version it is expecting. Stata 11 may close unexpectedly when starting the .do file editor. If that happens installing libgtksourceview 1.0 may fix the problem: sudo apt-get install libgtksourceview1
|
posted Apr 30, 2010, 8:14 PM by Dungeon Dwellers
To add a link to a section in the document, the hyperref package works very well. as \usepackage{hyperref} in the preamble and then type:
\hyperref[label]{text to draw the ref around}
Very slick and lots of customizations available. |
posted Apr 16, 2010, 10:07 AM by David Eagle
Here's a great set of applications, run at the command line, to convert various bibliographic citation formats from one to the other, using an intermediate (xml) format. This is great for converting Endnote .ris files from databases into BibTeX format as the BibTeX export option is not always available (e.g. for JSSR).
To run these commands on a mac, either unzip the archive into you /opt/local/bin directory, or specify the path the files in your ~/.profile file by editing this file and adding the line: export PATH=/opt/local/bin:/opt/local/sbin:$PATH |
posted Mar 31, 2010, 11:37 AM by David Eagle
[
updated Oct 9, 2010, 4:58 AM
]
Many journals won't take LaTeX files and insist on a word format. There's no great solution to this problem, but here are the best
Latex2rtf is my go-to program. It is very simple to use, and handles many basic formating issues. If you keep your latex document simple, this will do the trick.
TTH - works very well, but doesn't handle a lot of special formatting. It converts equations to text rather than images. This is a TEX --> html converter and uses a command-line interface. This is my go-to option for converting tables into an Excel-readable format. |
|