### LaTeX

 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.

#### Find location of TeX files

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.

#### Use XeTeX engine by default on a specific file

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 OptionsClick "TeX Command" and find the "Command List" drop down.Click INSIn the Name: box type "XeTeX"In the Command: box type: "%'xelatex -synctex=1%(mode)%' %tIn 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 AQUAMACSIn 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 and this will run XeTeX on your document.

#### Insert Cites Keyboard Shortcuts - Bibtex/Emacs

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: \bibliography{}Replace 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.

#### Turn Endnotes to Footnotes

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.

#### Sideways Longtables in LaTeX

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}

#### Adding Figures with Captions in Latex

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}

#### Ubuntu Stata

posted Jul 8, 2010, 12:13 AM by David Eagle   [ updated Oct 9, 2010, 4:59 AM ]

#### Convert LaTeX to Word

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 bestLatex2rtf 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.http://latex2rtf.sourceforge.net/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.http://hutchinson.belmont.ma.us/tth/manual.cgi#tth_sEc1.3 Pandoc handles simple LaTeX files and can convert them to a number of formats that Word will read: http://johnmacfarlane.net/pandoc/ Hyperlatex is a solution that employs emacs macros. In my experience, it doesn't work terribly well. Latex2rtf and TTH seem to work better.

1-10 of 13