LaTeX

go back to the homepage
go back to the economics page
LaTeX is the language behind a powerful set of tools that you can use to create nifty journal articles, papers, books, banners, letters, memos, etc. Essentially, you tell it exactly what to do by coding it in, LaTeX compiles the information and then it produces a very clean, professional output.  

There is a learning curve. But, after that, you're much less limited than you are with a word processor like MS Word. For smaller documents, MS Word may be better but, when producing larger works, LaTeX is far superior. In general, it has been popularly used to typeset mathematical equations and proofs but its usage extends far beyond that. If you want to read more, check out the blurb on EconSpace or use Tex Users Groups (TUG) as a point of reference.

Tutorial on setting up LaTeX

Where do I start??? Installation (trickier said than done).

LaTeX is not a proprietary software or some sort of stand-alone product.  You need two things: the backbone (that has the instructions of how to form fancy looking documents) and a program to compile the code you write.   It's a little time consuming to get set up perfectly but everything is smooth thereafter.  Here are the easy steps to follow:

1.  Install MikTex (currently v2.7).  It's the backbone with the LaTeX libraries and styles.  You will be given an option to install packages on the fly or automatically.  Choose automatically for ease.
2.  You may need to install Aspell dictionaries for spell check to work (link is for Windows).
3.  Install a package like WinEdt (other choices include BaKoMa TeXLyx or TexMaker) so you can write code.
      You can use Notepad but that's like torture.  If you are used to MS Word, I suggest you pick up BaKoMa TeX (WYSIWYG) or Lyx (WYSIWYM).  I am not a huge fan of the former (it's not free or as good as WinEdt, IMHO), but it has positive feedback by Martin Osborne.  The latter is helpful for exporting your first few documents to see how the code looks.  Personally, I'd abandon those interfaces and go for TeXnicCenter (free open source), TexMaker (free shareware) or WinEdt ($30 student license, $40 educational license).  I'm 100% content with WinEdt.  I have not used TeXnicCenter.  TexMaker is good but WinEdt allows you to call up other applications, spell checks on the fly, allows for easy forward and inverse searching, color codes your source, etc.  In summary, I installed WinEdt and paid the subscription after the 30-day free trial period...and I don't like to pay for software!!!  Generally, I prefer to use open source, but WinEdt hasn't required me to register again so I haven't needed to consider switching to TeXnicCenter.

4.  Fine tune your code editing package.  

    Modify the toolbar
    I would suggest modifying your toolbar to your needs.  I put in icons that links to Matlab and for the command prompt.  Here are the steps to make a button in WinEdt open a program (modify as need be):

a)  Copy the icon you want to use into  C:\Program Files\WinEdt\Bitmaps\Buttons
b)  Modify C:\Program Files\WinEdt\winedt.btn to include the name of your program on one of the last lines, like "204 %B\Bitmaps\Buttons\matlab.bmp."
c)  It'll now pop-up on the toolbar.  Right click on menu>enter tool bar setup to see it.
d)  Now you need to make the button do something.  Right click on menu>menu setup.
e)  Make a new item like "My Programs" via the insert command.  If it doesn't bring a new window up, double-click on it.
f)   Make new items under My Programs.   Do insert>utility and name it "Matlab."
g)  Under utility paste "matlab.exe" without quotes.  
h)  Under start in paste the folder like "c:\matlab\" without quotes. 
i)  Under images and hint select the image you want to use.  Click OK twice and you're done!
...for starters, here are bmp images I created for ArcView, Matlab, and Stata as well as my modified winedt.btn file.

    Tables to LaTex
    Putting tables into LaTeX is a pain!  I used to make them real nice in Excel and then program them by hand.  That's inefficient and, luckily, there are great solutions and plugins for WinEdt.
    Excel2LateX - Put it in your add-ins folder for MS Excel, tell Excel to use it by Tools>Add-In and restart the app to find a new button on your toolbar.   Also, in your TeX preamble code, add \usepackage{booktabs}.
    Tablas (web site in Spanish but program version in English) or the array plugin to make tables. 
    format Tex-tables to help reduce extra space with and without blanks (if you do tables by hand).  
    To get plug-ins running in WinEdt, click Macros > Execute Macro Script and then navigate to the directory where you put the plugin (preferably beneath WinEdt).

    Easy fix for quick regression output
    I didn't know about this for a while, but download outreg2 if you're using Stata (type "findit outreg2").  You can easily export regression output from Stata to LaTeX and even compile it in your DO file.  The formatting is limited, but it's a nice way to quickly output table results.  And speaking of formatting, you can actually install a configuration component to write Stata DO files (with color) in WinEdt.

One final side comment.  With Yap (a program included with MikTex), make it print out to dvips.  If you have TexMaker, there are a few tweaks that you need to do...make sure the dvi code is going to your correct MikTex installation directory, that it updates the DVI after compiling, and any quick build preferences you may have.


Everything is installed.  What now?

Read about LaTeX programming commands and how to use the language.  A great place to start is the "Not So Short Guide to Latex."  I think it took me 2 or 2.5 hrs to read it but it was well worth it.  Once you get a basic understanding of how things work, learning is by doing. 

At the top of the page, I mention that LaTeX can be used to write journal articles, papers, books, banners, letters, memos, and many other documents.  All of that is true but you need to also have a general preamble to begin many of these.  Some documents will make you modify your preamble but below is something to get you started.  Copy-and-paste it into the .tex file, save it and then start typing between the \begin{document} and \end{document} tags.

\documentclass[10pt,letterpaper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{graphicx}
\usepackage{geometry}
\geometry{verbose,letterpaper,tmargin=3cm,bmargin=3cm,lmargin=3cm,rmargin=3cm}
\usepackage{hyperref}
\begin{document}
%  This is what is in your article
\end{document}

To cut down on your search costs, below are links to download several zipped packages that I use.

pdfpages - good for joining multiple pdf pages into one document
tth - converts LaTeX to HTML via the command prompt
moderncv - neat examples of how you can spice up your CV
ghostscript - a program I use for custom-made vector graphics (in Inkscape or LaTeXDraw) to compile from dvi -> ps then ps -> pdf

If you want to create your bibliography style files, it's pretty easy.  Open up the DOS command from WinEdt in the directory where you have your TEX file and type in latex makebst then hit enter.  You will be walked through a number of questions to set up the exact style.  I only recommend this if you're trying to submit an article to a journal and it requires a specific style, but does not supply the BST file.  Otherwise, just use econometrica or some other style in your tags below...setting up the BST isn't hard, but it takes time and you should be familiar with Natbib or Bibtex before playing around.

\bibliography{references}
\bibliographystyle{econometrica}

How do you make cool-looking presentations?

The era of Powerpoint is gone.  LaTeX is the streamlined professional way to do things.  Doing fancy stuff like embedding videos and audio is possible, but purposely difficult to do.  Use the "beamer" package to create clean presentations that are far superior to MS Powerpoint.

Beamer is great because you can make presentations viewable in PDF.  Changing from presentation to handout mode takes literally about 20 seconds to comment out the presentation section and comment in the handout section at the beginning of the files.  You can specify the # of slides per page, background color, etc.

The downfall is that while it's real easy to pick up beamer, it's a pain to customize it.  Don't try until you get all the basics down well.  There are plenty of things to explore like the themes, split layout, navigation symbols, and using hyperlinks with beamer buttons to jump between pages.  Most of the normal LaTeX commands and packages work the same, but you will find a few finicky things along the way.  To include tables and figures, I simply take screen shots, paste them into GIMP, crop them, save as EPS and then use the MSDos command "epstopdf figurename.eps" ("shell" or "!" will get you into MSDos from Stata).  Adobe Photoshop is expensive and sometimes outputs odd EPS files.

What does my basic preamble look like?
It depends on if I'm in handout mode or presentation mode.  Comment out whichever ones does not apply.  I'll assume you're in presentation mode.

\documentclass[compress, red, pdf]{beamer} % Changes color to red instead of that all-too-common blue
%\documentclass[handout]{beamer} % To print handouts

% ------------------------------------------------------
%                       HANDOUT LAYOUT
% ------------------------------------------------------
%\usepackage{pgfpages}
%\pgfpagesuselayout{2 on 1}[letterpaper, border shrink=5mm]     % Puts 2 on 1 pg
%\mode<handout>{\setbeamercolor{background canvas}{bg=black!10}} % Helpful for slides with white background

% ------------------------------------------------------
%                  PRESENTATION SLIDE LAYOUT
% ------------------------------------------------------
\usetheme{Frankfurt}
\usepackage{beamerthemesplit}
\setbeamertemplate{navigation symbols}{\insertslidenavigationsymbol, \insertbackfindforwardnavigationsymbol}    % suppresses all navigation symbols

% ------------------------------------------------------
%                       LaTex Packages
%       Note: Beamer automatically includes some so I
%             already eliminated them from the preamble
% ------------------------------------------------------
\usepackage{amssymb, amsmath, amsfonts}   % use mathematical symbols and fonts
\usepackage{soul}                    % \hl{highlight this text}
% NB: \hl{} may not work with newer versions of MikTex.  Instead, type \colorbox{red}{highlight this text}
\usepackage{mathrsfs}
\usepackage{graphicx}           % Put .eps and .pdf images into document
% ------------------------------------------------------
%                       TITLE PAGE INPUT
% ------------------------------------------------------
\title[Title appearing at bottom of page]{``What you'll see on the initial page''}
\author[Author at bottom of page]{Name under title box on initial page}
\institute{Florida State University} % Where held
\date{Presentation on DayofWeek MM DD, YYYY}
\subject{Presentation for ECO XXX: My Class}

% ------------------------------------------------------
%                         TITLE PAGE
% ------------------------------------------------------
\begin{document}
    \begin{frame}%<handout:0>
    \titlepage
    \begin{center}
        {\small \emph{Additional notes for Journal Name, Vol. (No.), Year, Pages.}
    \end{center}
\end{frame}

% ------------------------------------------------------
%                         TABLE OF CONTENTS
% ------------------------------------------------------

\begin{frame}
    \frametitle{Outline}
    \tableofcontents%[pausesections]
\end{frame}

% ------------------------------------------------------
%                     BEGIN PRESENTATION
% ------------------------------------------------------
% After \begin{frame}[allowdisplaybreaks, allowframebreaks] you sometimes need one (or both) of those options.  If compiling isn't working, remove or add one for that frame.
% Useful: \includegraphics[width=0.75\textwidth]{figures/author(year)-figureXXX}
\section{Intro}
% \begin{block} Put things in a box.  Try itemized lists! \end{block}
       \begin{frame}\frametitle{Starting out}  What is the motivation?  How does it fit into the lit?  \end{frame}
\section{Model}
        \begin{frame}  Theory or Empirical  \end{frame}
\section{Results}
        \begin{frame}  Include tables here  \end{frame}
\section{Critique/Extensions}
        \begin{frame}  Any flaws?  Subsequent studies?  \end{frame}
\section{Conclusion}
        \begin{frame}  Wrap it up!  \end{frame}
\end{document}