[Last update: 12/1/2008 5:33:26 PM]
This is a very introductory start-guide to use LaTeX in the writing of Economics papers. The guide is based on a sample file that you can edit to write your first paper with LaTeX. From then on, just look at more complete manuals (links available below) or search for what you want to do in the web.
What you should get
(if a link is broken, search in Google for the resource)
There are several editors that can be used with a LaTeX compiler. The standard compiler seems to be MiKTeX. You can use it with a text editor, like TeXnicCenter (free – I use this!) or Winedt (proprietary, ~$30), wich are interface editors (they still require to learn some coding, but (if you don’t want to learn math codes) you can use Mathtype or TeXaide (free), which write mathematical language in WYSIWYG (“what you see is what you get”) like Word Equation Editor does and then simply copy-and-paste into the LaTeX file that you are editing).
Thus, to get started, download and install MiKTeX and TexnicCenter. Then, you need a basic guide that will help you with the most basic commands. I wrote the one below, which uses the approach of learning-by-copying (i.e., you get a sample file so that you can start practicing by just changing the parameters and the text content). A more complete manual available in the web is the Not-so-short introductory manual (download this manual and use it as a reference).
I highly recommend you to get these two additional software programs.
Excel-to-LaTeX is a free Excel macro that convert an excel selection to a LaTeX table. You can do most of the work on tables using Excel and just converting it to LaTeX with this macro.
LaTeX2rtf – free software to convert from LaTeX to rtf file (which can be converted to doc files). The conversion is not perfect (there are problems with footnote numbering, table alignments, citations, references, etc.) Some journals still cannot accept LaTeX or pdf files when you submit a manuscript (What????? Unfortunately, it’s true!), thus requiring you to convert to a doc file!).
Note: An alternative to the LaTeX
editors above is Scientific Word
(proprietary ~ $200 for students), which is just an interface editor (the need
to learn codes is highly reduced, and the math environment is incorporated,
i.e., you edit math expression in a WYSIWYG environment; there is a problem of
compatibility with other LaTeX programs and some bugs
that I personally dislike. I
used it for some time, but I DON’T RECOMMEND IT. You will get more flexibility
by learning to write latex codes directly. The initial learning cost is higher,
but it is rewarding. Of course, you also save money.
Other (less useful) resources
· To put figures in a LaTeX file: It is common to get your original graphs and other figures as a jpg file, so you need to convert it to eps or pdf to insert it in your LaTeX file.
1) easiest option: convert your figure to pdf (use a pdf creator software, like PrimoPDF); notice that the resulting file must have only one page. Insert your figures at the end of the paper, one figure per page, so that you don’t have to worry about the size of the figures (the guide below will tell you how to insert figures).
2) if you want your figures to have a proper size (for instance, if you want to insert the figures within the text), you need to crop the pdf file that you created before inserting it in the LaTeX file. You must crop the blank spaces at the margins, so that the resulting file has only the figure (and almost no margin). To do so, use a pdf editor program (I use PDFill PDF Tools). Then, insert the resulting file where you want it to be in your paper.
3) you may prefer to insert eps files (instead of pdf files). Then, you will need jpeg2ps, which is a free software to convert from jpg to eps file. This little program generate small, but high-quality eps files, but it works in a DOS environment, so you must learn how to use it.
· Other resources for other uses:
Rtf2LaTeX2e – free software to convert from rtf (MS-Word) file to LaTeX. It saves a lot of work when converting existent papers written in Word like programs, but it is not perfect (tables, graphs, equations, and formats may not convert well).
LaTeX.org – information and free programs for lots of uses
Ctan.org – information and free programs for lots of uses
(Boston College) Economics’ resources – information and links for LaTeX typesetting (includes an introduction manual)
Sourceforge – free open source LaTeX programs for lots of uses (look for LaTex in the software search)
How to publish in Economics – by Prof. Kwan Choi (Editor, Review of International Economics)
WOPEC – to share working papers
Rejected ideas (in Prof. Xavier Sala-I-Martin website)
Most cited economists (1992~2002) – Thomson-ISI
Tip: Look for instructions on formatting your
paper in the journal’s
website (where you are submitting your paper). In general, you don’t have
to follow the instructions strictly when you submit a manuscript for refereeing
(you only really need to follow the instructions when you submit the final
version for publication, if your paper is accepted – good luck with that!).
In the following, red
words are LaTeX codes, and bold words are parameters that you should personalize, like the
name of a section, captions, etc.
§ SAMPLE ECONOMICS WORKING PAPER (use this as the base for your working paper):
[workingpaper.tex] [filename.pdf] (download both files and put them in the same folder)
[workingpaper.pdf] (this is the output that you should get after compiling the tex file with MiKTeX)
Note 1: The working paper sample above is just a very simple sample to get you started. There are many things that you will learn over time to make your life even easier. For instance, how to make better looking tables, change the way citations appear, use BibTeX. And so on.
Note 2: Choose filenames that have no space in it. Also, put all the associated files (the LaTeX file and figures) in the same folder.
Note 3: When generating pdf output, you must close a previous pdf output before generating a new one. Pdf output may not work properly if there are eps figures in your file (if you have eps figures, you may have to create a dvi file first, and then convert to pdf with a pdf creator). When you are working in your paper, it’s easier to generate dvi output (instead of pdf output) because it is faster and the dvi viewer will open on the page where you made the last change (also, you don’t have to close a previous dvi output before generating a new one). The problem is that if you ask for a dvi output, pdf figures won’t be shown.
§ Use the LaTeX editor (TexnicCenter) to open the workingpaper.tex file and then learn how to compile and build a pdf output (it’s pretty easy – explore the commands at the top – later, learn to customize the shortcut buttons; they will be VERY helpful). Notice that you may have to ask twice to compile the file (the first attempt sometimes doesn’t work well, not sure why). You should be able to get an output that is exactly the same as the one I posted above (the pdf file). After that, just change the text, format, etc. to your taste/work. Good luck and have fun!
§
The next topics are additional comments on how
to personalize your paper according to your needs. There may be mistakes or
easier ways to do. This guide wasn’t revised since years ago when I was still a
newbie.
If you find this guide useful, would you
kindly email me (ogural“at”gvsu.edu) to let me know that I didn’t waste my
valuable time writing it? The more people write me, the more I’ll be willing to
improve/update this guide in the future. Thanks!
§ USE PACKAGES
For most of the changes in the format of your document, you have to use packages. Packages must be inserted using
\usepackage{nameofthepackage}
You must insert this code in the preamble (just after the beginning of the document, but before the text (i.e., the Title, Author, etc)).
§
LINE SPACING: add package {setspace} and then
write the following where you want spacing to have effect
singlespacing
or \onehalfspacing
or \doublespacing
If you add this command before the start of the text, the space that you set will be the one for the entire document. To set different line spacing for a portion of the document, add the corresponding command in the start of the portion. At the end of portion, you have to write the original command to return to the original spacing. Instead of the spacing commands above, you can use
\setstretch{#}
where # is the spacing parameter (1=single, 2=double, 3=triple).
§ PAGINATION: to set the starting page number
\setcounter{#ofthepageinthispage} (example, \setcounter{2} makes the page where this command is written to be “2” and the following pages will follow this number.
If you don’t want page number on one of the pages (usually the first one in a working paper), write the following on the part of the text where you don’t want the page number to be shown:
\thispagestyle{empty}
§ HIPHENATION
To avoid excessive hyphenation (i.e., word-breaks between lines), add the following to where you want the command to start having effect (usually before the beginning of your text).
\sloppy
This command does not completely eliminate hyphenation, but it reduces it a lot. LaTeX was create to generate a nice looking output, so the compiler tries the best it can to avoid hyphenation, but sometimes it would create large spaces between words, so the compiler prefer to hyphenate the word of the line.
§ JUSTIFICATION: not useful in working papers, but here it is.
To have text justified to the left, use
\flushright
To have text justified to the right, use
\flushleft
To have text centered, use
\begin{center}
(write text that you want to be centered)
\end{center}
§ INDENT
To eliminated indent in a given paragraph (useful when preparing presentation slides), start the paragraph with
\noindent
§ MARGINS
Change parameters in
\geometry{left=1.0in,right=1.0in,top=1.0in,bottom=1.0in}
Instead of inches (in), you could use centimeters (cm).
You must be using the geometry package, i.e., make sure the following is in the preamble of your tex file:
\usepackage[nohead]{geometry}
§ FOOTNOTES
Footnotes are inserted with
\footnote{Text
that you want to go to the footnote}
You should write this just at the place where you want to have the footnote mark. Numbering of footnotes is automatic. Be careful that you should not include footnotes in equations or equation arrays (or any other math environment).
§ REFERENCES
You may want to learn how to use BibTeX. In the long term, it should be worth. Search for a BibTeX guide somewhere else.
For your first paper, you may just use a simpler way. To add references (at the end of your paper), write
\begin{thebibliography}{9}
\bibitem[(year)] {label}Your
reference (author, article, journal, year, volume, page, etc)
\bibitem[(year2)] {label}Your
reference2 (author, article, journal, year2, volume, page, etc)
\end{thebibliography}
The “[(year)]” is optional. It’s not very useful, but you will see how it is used shortly below.
The label (anything you want, but make it a short code) allows you to cite the reference in the text by calling the label. The number {9} just after \begin{thebibliography} is the size of the widest-label. I don’t know if it actually matters, but I guess if you use short labels, then it has no effect.
For numbered references, like Smith [4], using labels are useful! The numbering is automatically sorted by the order in your list of references. So, if the Smith reference is the forth that you listed, then it will appear numbered as [4]. In order to automatically show the number in the text, you have to call the label by writing
Smith \ref{yourlabelforSmith}
For references with year, like Smith (1996), using labels is not that useful because it is faster to just write the year yourself. To call the year using the label, write
Smith\cite{yourlabelforSmith}
or, if the reference is already within parentheses, write
(Smith,
\citeyear{yourlabelforSmith})
§ FONT SIZES
Font sizes depend on the initial shell. In the article shell (a shell is like a basic template, with predetermined formats), which is the one you will be using mostly, the following is the most used font sizes if the standard size is set to 12pt (like in the workingpaper.tex file that you have here). Write the command for font size in the beginning of the text that you want to have that size. If you want to go back to the first size (or change to another size) later, write the new font size command again. And so on. If you want to change the font size of a table, you have to write the font size command inside the table environment (not before it).
\Huge for size 25 (useful for presentations)
\LARGE for size 20 (useful for presentations)
\Large for size 17 (useful for presentations)
\large for size 14
\normalsize for size 12
\footnotesize for size 10
\scriptsize for size 8 (useful only to reduce large tables)
Instead, TexnicCenter also allows you change font size by selecting the text and then clicking in Format/Font size (other size options are possible; the ones above are just the most used).
§ FIGURES/PICTURES
To add a picture, use eps or pdf files.
If you want use pdf figures within your text (not at the end of paper), you have to crop the margins of the pdf page so that the file has only the picture (and no large blank spaces at the margins). I guess this is easier to do then to use eps figures, but if you don’t know how to create a pdf version of your figure and then to crop it, you can try to use an eps version of the figure. I won’t explain this here because I think it’s too much work and confusing.
Add the figure (where you want it to be) with:
\begin{figure}[htbp]
\centering
\includegraphics[width=0.95\textwidth]{filename.pdf}
\caption{titleofthefigure}
\label{yourkey}
\end{figure}
where htbp is for the location in the page: here, top of the page, bottom, of floating in an exclusive page, 0.95\textwidth gives the width (you can use a measure in inches or cm instead), filename.pdf is the name of the file of the figure, which should be in the same folder of your tex file, titleofthefigure is the caption that appears at the bottom of the figure, and yourkey is the key that you can use to refer to the figure in the text (you have to write \ref{yourkey} in order to have the reference (the number of the figure) shown in the text).
Hint: where can you create figures? Powerpoint is great to draw diagrams. Excel draws several types of graphs. Mathematica or Matlab creates plots.
§ NO SECTION NUMBER
If you don’t want to have the Section (or subsection, or sub-subsection) number showed in the text, write
\section*{sectionname}
Note that this section won’t be automatically counted (in the numbering of sections). This is useful to add an Appendix (there is another way to add an appendix, but I prefer to just add a non-numbered section called Appendix).
§ ENDNOTES
To have all footnotes shown at the end of the document, write in the preamble
\renewcommand{\footnote}{\endnote}
Then, at the point of the text that you want your notes to begin (usually before or after the references), write
\begingroup
\theendnotes
\endgroup
§ NAVIGATOR
TexnicCenter has a very useful feature called Navigator, which allows you see a tree with sections, subsections, graphs, tables, etc. to help you navigate inside your file. To use the navigator, you have to start a project (File, New Project) and then copy your text file to it. Then, when you open the project, the text file will be opened automatically.
§ SLIDES
There are several ways to make slides in LaTeX. The easiest way (which I still use), although not the prettiest one, is to make a copy of your article file, then change the format to landscape, reduce margins, and increase letter size to \Huge (use smaller font sizes for tables). Use \bullet, \blacktriangleright, etc. for lists of topics. The advantage of this method is that the font size will be just right! and you won’t be able to overstuff each slide with a lot of words, equations, etc. The greatest advantage, though, is that you don’t have to learn anything else!!! It’s pretty obvious what you can/should do and you can just delete part of your article to make the presentation!
You can also make dynamic presentations with LaTeX, but for that you have use other shells and learn how to use them. Search over the internet.