Export page to Open Document format


- my standard-preamble

- my minimal document

Subversion information




in document. set the subversion property


of them to

HeadURL LastChangedDate LastChangedRevision LastChangedBy

commit! the information can be added to the document, see my preamble on how to do that…

More information on LaTeX and Subversion can be found in this article by Mark Eli Kalderon in the PracTeX Journal 2007.

embedded movies in the resulting pdf

Fast way:


with the according manual (pdf, 460 kB)

Longer way: a walkthrough to a pdf with playable movie is described here.

Authors with multiple institutions/affiliations

\title{How to bowl properly}
  The Dude\footremember{alley}{Holly Star Lanes Bowling Alley}%
  \and Walter Sobchak\footremember{trailer}{probably in a trailer park}%
  \and Jesus Quintana\footrecall{alley} \footnote{Mexico?}%
  \and Uli Kunkel\footrecall{trailer} \footnote{Germany?}%
The whole example is taken from \href{http://anthony.liekens.net/index.php/LaTeX/MultipleFootnoteReferences}{anthony liekens}\ldots

[expanded a bit from anthony liekens]

Footnotes in Tables


      some & text & is\footnote{footnote 1} & written & here\\
      XYZ\footnote{explain the acronym!} & 1 & 2 & 3	& 4 \\
      ASDF\footnote{explain this, too!} & 5 & 6 & 7 & 8 \\


      some & things & are & written & here \\
      1\tnote{a}	& 2 & 3 	& 4          &  5 \\
      6 & 7 & 8\tnote{b}& 9\tnote{c} & 10 \\
      \item[b]{second note}
      \item[c]{here is a very, very, very, very, very, very long note.}


full page pdfs

generate figures, so that they fill the whole pdf. comes in handy for talks, like seen in slide 21 of “Quality guided wide field x-raytomographic imaging ” in talks. (scrubbed from here). This version using \begin{preview} and \end{preview} is an all-purpose way of achieving the effect. The scale bar example below shows how to do it using \PreviewEnvironment{tikzpicture}.

%\setlength\PreviewBorder{2mm} % use to add a border around the image
  \shade (0,0) circle(2);	% background
  \draw (0,0) circle(2); 	% rim
  \draw (.75,1) circle(.5);	% right eye
  \fill (.66,.9) circle(.25);	% right pupil
  \draw (-.75,1) circle(.5);	% left eye
  \fill (-.66,.9) circle(.25);% left pupil
  \fill (.2,0) circle (.1);	% right nostril
  \fill (-.2,0) circle (.1);	% left nostril
  \draw (-135:1) arc (-135:-45:1) -- cycle; % mouth

scale bars

TikZ can be used to overlay stuff on images, this is used for adding arbitrary scalebars (with correct text-size and length according to the needs…). The output of the code below can be seen in this pdf (175 kB).

  \pgfmathsetlength{\imagewidth}{\linewidth} % desired displayed width of image
  \pgfmathsetlength{\imagescale}{\imagewidth/670} % pixel width of imagefile used below
  %% adjust scale of tikzpicture (and direction of y) such that pixel
  %% coordinates can be used for drawing overlays:
    % place image (integer coordinates refer to pixel centers):
    \node[anchor=north west,inner sep=0pt,outer sep=0pt] at (0,0)
    %\draw (100,500) node ;
    \draw[|-|,thick] (25,500) -- (175,500) node[midway,above] {\SI{300}{\micro\meter}}; % coordinates where the scalebar should be drawn, scaled with the size of the image.

a complete guide to generating scale-bars with correct lengths and placement is explained here, including a fancy matlab-file for easy calculation!

misc short notes



\begin{figure}[p] % [tb] for small, [p] for big pictures

for figures, since [htbp] does sound good, but can lead to weird float-placement if the figure is big.

hidden sections and labels


and then cite the phantom-section with \ref{blablabla} or \pageref{blablabla} somewhere in the text. [via this]

watermarking a document

\usepackage[]{draftwatermark} % try firstpage as option
\title{Lorem ipsum}
\author{David Haberth\"ur}
% Use the following to make modification
\SetWatermarkText{confidentidal, do not redistribute!}

[via Jean Martina]


    \tiny          \verb+\tiny+\\
    \scriptsize    \verb+\scriptsize+\\
    \footnotesize  \verb+\footnotesize+\\
    \small         \verb+\small+\\
    \normalsize    \verb+\normalsize+\\
    \large         \verb+\large+\\
    \Large         \verb+\Large+\\
    \LARGE         \verb+\LARGE+\\
    \huge          \verb+\huge+\\
    \Huge          \verb+\Huge+\\

cases or "programming"

  \or eis%
  \or zwöi%
  \or drü%
  \else ERROR!%
\case{1} - \case{2} - \case{3} - \case{4} - \case{18}

coloring table rows

\verb+\usepackage[table]{xcolor}+ and \verb+\rowcolor{color}+ in tables
    \rowcolor{red} red\\
    \rowcolor{green} green\\
    \rowcolor{blue} blue\\
    \rowcolor{cyan} cyan\\
    \rowcolor{magenta} magenta\\
    \rowcolor{yellow} yellow\\
    \rowcolor{white} white\\
    \rowcolor{lightgray} lightgray\\
    \rowcolor{gray} gray\\
    \rowcolor{darkgray} darkgray\\
    \rowcolor{black} \textcolor{white}{black}


Each chapter can have its own bibliography, this can come in handy for huge documents, like PhD-Theses.

To do this, you need to add the chapterbib-package to your preamble and add the sectionbib-option to natbib.


Iclude chapter-files with


and add the bibliography to the end of each chapter with


you can have multiple Bibliography-files, but have to keep in mind to add the correct path.

After running pdflatex on your file, you should have a Chapter01.aux-file in the Subdir-Directory. Running

bibtex Chapter01

and afterwards running pdflatex twice should give you a nice document with Bibliographies at the end of each chapter.

This small example on my LaTeX-GitHub-repository should be fully self-contained and explain it from start to finish.

Record and correct Errata in documents

\title{Full of Errors}
Here we have \erratumAdd{forgotten word}{three} errata in one \erratumDelete{superfluous phrase}{darned} long \erratumReplace{translated}{Zeile}{line}.
\begin{erratum}[date=2006-07-19,reported-by=Michael Kohlhase,type=Replacement]{Text was replaced, added and deleted}
This is a test of a long erratum: We can replace\eReplace{old text}{new text} and \eAdd{add new text} and finally delete old text\eDelete{alltogether}\ldots
\section{List of all \erratumReplace{replaced}{Erros}{Errors}}
\PrintErrata % if you want to print errata from another document, use "\printerrata{path/to/otherdocument}" and use the option [record] for the errata-package in said document...

Make a CD-Cover with \LaTeX

\usepackage[a4paper, margin=0pt]{geometry}
\setcdlatchmatter{\textsf{\textbf{\LARGE Artist\\Album}\\CD 1/2}}
\setcdbackmatter{\textbf{\LARGE Artist\\[0.25\baselineskip]
CD 1/2
\item Track 1
\item Track 2
\item Track 3
\item Track 4
\item Track 5
\item Track 6
\item Track 7
\item Track 8
\item Track 9
\item Track 10
\setcdspinematter{\textbf{\Large Spine Text}}

print and fold according to this pdf


And because I always forget:

		\lambda&=&\frac{\SI{4.136e-15}{\electronvolt\second} \SI{2.997e8}{\metre\per\second}}{\SI{12.6}{\kilo\electronvolt}}\\

Add a small (text) overlay to a collection of PDFs


is quite a nifty way to collect several pdfs into one document1)

If your collated document should have correct numbering and references in the footer of the collected pages, \AddToShipoutPicture comes in handy.

If you add


to your preamble you can add (e.g.) a discreet Footer like that:

  pagecommand={\AddToShipoutPicture*{\put(10,10){Page \thepage/\pageref{LastPage}: Text}}}%
  • “pages=-” adds all pages from “PDF_to_be_added.pdf”
  • “pagecommand=” tells pdfpages to add this command to the included pdf
    • \AddToShipoutPicture* actually adds to the page. Use the starred variant to add and replace the existing add, the unstarred just adds, leading to gibberish :)
    • “\put(10,10)” shifts a bit into the page
    • “{Page \thepage/\pageref{LastPage}: Text}” adds “Page X/Y: Text”. A “\pagestyle{empty}” in the surrounding document comes in handy to get rid of the original pagenumbers.

Doesn't look pretty, but does the trick with the collation of several documents

Especially if you have to do something a bit complicated, for example, submit a Travel Award Application