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:

Continue reading “Line spacing in footnotes”

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 “Check whether variable exists in if-conditions”

Write strikethrough text in LaTeX

Strikethrough text with LaTeX

Especially when making changes in collaborations, it is quite useful to have strikethrough text, so that collaborators can see the deleted text (which can thereafter be deleted). While there are ways to use track changes for LaTeX (see our earlier post here), strikethrough text is probably easier to implement. For a very simple way of striking through text in LaTeX, you can use the soul package and then use \st{Strike through this text}

Continue reading “Write strikethrough text in LaTeX”

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 “Add time stamp to Stata figures”

Changing font color in table columns

In my ongoing search to further improve table layout for my beamer-presentations, I just came across a simple way to change the font color in tables. This comes in handy, for example, to highlight results regression results in specific tables.

Continue reading “Changing font color in table columns”

Subfigures in LaTeX

To combine multiple figures in one figure environment in LaTeX, e.g. to show scatter plots for different groups, the usepackage subfig is there to help. It allows to create several subfigures while also adjusting the subtitles of each of the subfigures. Simple call the package in the preamble by adding

Continue reading “Subfigures in LaTeX”

Avoiding widows and orphans in LaTeX documents

To avoid paragraphs ending with a single line on the following page often looks a bit ugly. Especially when they are then followed by figures or tables. Single lines of a page-overlapping paragraph are called “widows” and “orphans”. How can we tell TeX to avoid those? With the following code, you tell TeX that it should put a penalty on these types of layouts. Setting this penalty very high (typically 10.000) avoids widows and orphans almost entirely. Just add the following code in the preamble of your document.

Continue reading “Avoiding widows and orphans in LaTeX documents”