• Dr. Roee Sarel

Technical Tips for the frustrated economist #1

Ok, so I always wanted to start a series of posts that give small but useful tips for those working with various programs in the economic profession, notably for Stata, Latex, and Z-tree. Now I feel ready to give it a go, so here are the first two tips, both for Latex:

Latex tip #1: Spellchecking using Word. Those of you using Latex (at least those using TexLive) have probably noticed that the program does not come with a built-in spellcheck as, e.g., Microsoft word. There are several ways to overcome this problem, most of which are tedious and require downloading dictionaries and playing around with definitions. And still, things like updating a dictionary so that the same word doesn't get tagged again and again is a bit more complex (as one example, try downloading a standard U.S dictionary and look at whether common terms used in economics such as "Incentivized", "Endogenous" or "Disutility" are tagged or not). Thus, my suggestion for this problem is (silly as it may sound): use Microsoft word for spellchecking Latex documents! How does it work? Funny enough, if you compile a PDF using latex (this works at least for PDFlatex) and then try to open it in Word - it will convert and open. Then, simply run the usual word SpellCheck.

Latex tip #2. Aligning multiple equations. If you ever wrote a theory paper (or even an empirical paper), you probably came across the annoying technical issue of how to align a series of equation on the document so that they look nice. There are here also several options, but the most useful option seems to be simply the align (or align* if you want to get rid of the equation number). It goes like this: suppose you have two equation:

(1) y1 = b0 + b1x2 + b2x2

(2) y2 = x + z + g +b4k + 55d + 88o + b7g8 + x2 +b99

i.e. equations when one is short and the other is long. You could split the long one, but it looks bad. The solution is:


y1 & = & b0 + b1x2 + b2x2 \\

y2 & = & x + z + g +b4k + 55d + 88o + b7g8 + x2 +b99


The important feature here is the use of the "&" marks, which ensures that the "=" always appear above one another at the same point.

Latex tip #3. Numbering of tables/figures in an appendix. When you start an appendix, the tables are usually numbered inside sequentially so that if the last table before the appendix was "table 5" then the first table in the appendix will be "table 6". But that is usually not what journals require: they want the first table in Appendix A to be "A1". The solution here is simple: add the following


\section*{Appendix A}

\setcounter{figure}{0} \renewcommand \thefigure{A\arabic{figure}} %

\setcounter{table}{0} \renewcommand{\thetable}{A\arabic{table}}

This ensures that tables are not only correctly numbered, but also when when you refer to these tables the right number will appear. For example, if you want to write "As can be seen in table A1 in appendix A, ...."

You can proceed as follows:

1. Add a label inside the table. e.g.


\caption{table} \label{tab:A1}





2. refer to the table: "As can be seen in table \ref{tab:A1} in appendix A, ....".

The output will be as you wanted.

That's it for the first post, hope this helps some of you frustrated researchers! On the next post: some Stata tips.

6 views0 comments

Recent Posts

See All