SVN ignore

Sometimes you have files in your SVN folder that you don’t want to include in the svn. For example let’s say svn status gives the following result:

M       data/data.tex
?       data/data.aux
?       mydoc.bbl
?       mydoc.blg
?       mydoc.log
?       mydoc.out
M       mydoc.tex
M       mydoc.pdf
?       mydoc.toc

All these files are temporary files that LaTeX creates and I don’t want them in my SVN. Is there some way that I don’t have to see them anymore everytime I check what I have changed? YES! There’s a SVN property that you can set for a folder which is called "ignore".

So to ignore all files with the extension aux in the current directory, you can do this:

svn propset svn:ignore *.aux .

But doing that for every one of the five filetypes is already too much for me. Also, the setting applies only to one folder, I would need to repeat the same thing for each subfolder! Fortunately, you can (a) specify a file which contains the stuff to be ignored and (b) call the command recursively on all subfolders. So I write all the things I want to ignore (*.aux, *.bbl, *.blg, *.out, *.toc) into the file ignorethisyoustupidsvn.txt (one pattern per line) and execute the following command:

svn propset svn:ignore -R -F ignorethisyoustupidsvn.txt .

Now let’s do svn status again:

M       data/data.tex
M       mydoc.tex
M       mydoc.pdf

Yay 🙂

Links: SVN properties documentation, Getting svn to ignore files and directories (superchlorine)

Handouts from slides

Creating handouts from slides created with LaTeX beamer is simple. Just specify the option “handout” in the documentclass:

\documentclass[handout]{beamer}

In your slides, you can use the marker presentation and handout to give specific instructions that apply only when the pdf is created in presentation mode or in handout mode. So for example you can have different templates for your slides [there are spaces around the < because otherwise they are not displayed in this blog... delete them when you write real LaTeX]:

\mode < presentation >
{
\usetheme{Madrid}
}
\mode < handout >
{
\usetheme{Szeged}
\usecolortheme{beaver}
}

You can have things only on the handout or only on the slides:

\visible<1->{This is the same for handout and slides.}
\visible<1-|handout:0>{This won't be in the handout.}
\visible<1|handout:2>{This is on the same slide for the presentation,
but on a different slide for the handout.}
\visible<2|handout:1>{This is on a different slide for the presentation,
but on the same slide for the handout.}

Typesetting text in math mode (2)

In a previous post (Typesetting text in math mode) I advertised the use of \mbox to write text in mathematical formulas. This works when you are in the "standard size", but looks funny if you have subscripts because the sizes are off:

$ 50 \mbox{ apples}_{\mbox{yellow}} \times 
100 \mbox{ apples}_{\mbox{red-green}} 
= \mbox{lots of apples}^{\mbox{to eat}} $

looks like
50 \mbox{ apples}_{\mbox{yellow}} \times 100 \mbox{ apples}_{\mbox{red-green}} = \mbox{lots of apples}^{\mbox{to eat}}

In these cases (and also in the standard cases but there it looks the same), you can use the command \text which will come out in the right font size. In addition to just \text, there is also \textbf (bold face), \textit (italics) and \texttt (typewriter).

$ 50 \text{ apples}_{\text{yellow}} \times 
100 \textit{ apples}_{\texttt{red-green}} 
= \textbf{lots of apples}^\text{to eat} $

looks like
50 \text{ apples}_{\text{yellow}} \times 100 \textit{ apples}_{\texttt{red-green}} = \textbf{lots of apples}^\text{to eat}

Note: Most of the time \text should just work in math mode without any packages, but for some distributions you need to explicitly load the package amstext or amsmath.

List your publications before the bibliography

Usually, in academic texts you cite stuff and at the end there is the bibliography that contains the full entries for all things referenced in the text. But there are some situations where you want to list some complete bibliography entries beforehand, somewhere in the text. For example you may want a list of prior work somewhere near the beginning of a grant proposal or a list of things published during the grant period somewhere at the end, but separate from the bibliography. Of course, you can write this list by hand, but where would be the fun in that?

And of course there is a LaTeX package for that, bibentry. You include the package with your bibliography style in the preamble. You can include it together with natbib.

\bibliographystyle{apalike} % or any other style you like
\usepackage{natbib} % optional, but combination is possible
\usepackage{bibentry}

Then, also in the preamble, you "turn off" the regular bibliography with \nobibliography. After that you can create your list of stuff somewhere in the document, but you will not have a bibliography at the end. Which is probably not what you want. So to additionally be able to include the references in the usual way, use this snippet:

\nobibliography*
\let\oldthebibliography=\thebibliography
\let\endoldthebibliography=\endthebibliography
\renewenvironment{thebibliography}[1]{%
   \begin{oldthebibliography}{#1}%
   \setlength{\parskip}{0ex}%
   \setlength{\itemsep}{0ex}%
}%
{%
   \end{oldthebibliography}%
}

The citing commands (\cite, \citep, etc.) and what they produce are unchanged, but now you can use \bibentry at any point in the text to create the full bibliographic entry. The formatting will be the same as for the references in the bibliography:

Parts of this work have been published in: \bibentry{Kessler2014}