Handout-mode in LaTeX slides

Whether it is lecture slides or presentations, you often wants to distribute pdf-versions of your beamertex file. If you are using overlay to blockwise show text or blockwise highlighting parts of tables (see here and here for ways to color parts of tables with overlay), it makes little sense to distribute the pdf versions where one and the same slide is repeated with each overlay step. Luckily, there is a extremely simple solution

Continue reading

Supress labels in Stata figures

A great feature of Stata figures is that you can mix several plot types in one by using the twoway (...) (...) command. If you have several plots merged into one twoway graph and also want to add a legend, the legend might become a bit crowded. In the following example, legends are specified with the , legend(lab(1 "Scatter 1") lab (4 "Scatter 2")) option because I only wanted to mark the diamonds and circles in the legend:

Continue reading

Produce multiple pdfs in LaTeX with automated cross-references

For some time I looked for a way to simplify the process of linking LaTeX files of my manuscripts with the replies to editors and referees. In particular, I was looking for a way to automatically update cross-references (i.e. to put a \ref in the replies and link it to a \label in the mansuctipt – for example for a table), and also to put direct quotes of the from the main text into a report (e.g. if you want to tell the editor/referee if you have a specific sentence, paragraph or even table added to the revised manuscript).

Continue reading

Line spacing in footnotes

When submitting papers, journals often require double-spaced footnotes. While there seem to be different approaches to it, this one worked quite well. It requires the footnotemisc package. You simply need to enter the following code in the preamble of your LaTeX file:

\usepackage{footmisc}
\renewcommand{\footnotelayout}{\setstretch{2}}

Check whether variable exists in if-conditions

In some applications, e.g. if you want to save coefficient estimates from a regression with many dummies (e.g. fixed effects), you might want to store coefficients as estimates. In this example, we are interested in storing the estimates of the GROUPVAR dummies, but not the dummies of OTHERVAR. While this is usually straightforward by writing

Continue reading

Add time stamp to Stata figures

Especially in the early stages of a research project it might be good to “time stamp” figure so that you can later figure out when you created a certain figure. Of course you could just check the date in the explorer / finder, but you can also simply add a note to the figure with time and date of its creation:

Continue reading