This shows you the differences between two versions of the page.

Link to this comparison view

code:latex:preamble [2013/07/04 08:45] (current)
Line 1: Line 1:
 +This is the [[http://​www.latex-project.org/​|LaTeX]] preamble I normally use (copying might be easier if you [[http://​www.ana.unibe.ch/​~haberthuer/​code/​latex/​preamble?​do=edit&​rev=|look at the page-source]])
 +===== Info =====
 +The preamble uses a little trick with \ifhtml to help with the generation of [[wp>​SVG]]-files from the [[:​latex#​tikz|Tikz]]-images in the file, to convert the .tex into .html and ultimatively into .doc (to send to collaborators for easy correction tracking if they refuse to use SVN).
 +This means that if you want to use htlatex for typesetting into a .html-file, uncomment \htmltrue, comment \htmlfalse, scud the file at least three times through "​htlatex"​ and then you should have a nice file with svg-images.
 +If you want a good pdf, use \htmlfalse, "​pdflatex"​ the file at least three times((while ignoring the errors the first two times)), and then you get a nice pdf out of it.
 +To be able to see the SVN-Info in the typeset .pdf, you should remember to set the [[:​latex#​subversion_information|SVN keywords]] of the .tex-file!
 +===== Preamble =====
 +<code latex>
 +\ifhtml % In case of web format output...
 + \def\pgfsysdriver{pgfsys-tex4ht.def}
 + \usepackage[dvips]{graphicx}
 + \DeclareGraphicsExtensions{.png}
 + \usepackage{graphicx}
 + \usepackage[disable]{todonotes}
 + \usepackage{todonotes}
 + \usepackage{lineno}
 + \linenumbers
 + \modulolinenumbers[2]
 + \usepackage{setspace,​savetrees}
 + \onehalfspacing
 + \usepackage{hyperref}
 + \hypersetup{%
 + pdfauthor={David Haberth\"​{u}r},​%
 + pdftitle={Title},​%
 + pdfsubject={Subject},​%
 + pdfkeywords={keyword1,​keyword2},​%
 + pdfpagemode=UseThumbs%,​
 + %colorlinks=true%
 +                        }
 +% Subversion Information
 +{$HeadURL: $}
 +{$LastChangedDate:​ $}
 +{$LastChangedRevision:​ $}
 +{$LastChangedBy:​ $}
 +\svnid{$Id$} ​
 +\fancyfoot[OR]{\tiny \href{\svnkw{HeadURL}}{Revision \svnkw{LastChangedRevision}} --- last commit on \svnkw{LastChangedDate} --- page \thepage}
 +\fancyfoot[EL]{\tiny page \thepage\ --- \href{\svnkw{HeadURL}}{Revision \svnkw{LastChangedRevision}} --- last commit on \svnkw{LastChangedDate}}
 + \subtitle{(SVN-revision:​ \svnkw{LastChangedRevision},​ compiled \today, \thistime)}
 +\author{David Haberth\"​{u}r}
 +\emph{Did you sort out all todos?}
 +\section{first section}
 +\todo{write the document!}\lipsum[1]
 +\section{second section}
 +\section{third section}
 +\bibliography{../​references} % since my LaTeX-files sit in folders like p:​\#​docs\thisdocument\file.tex and the reference.bib is saved in p:\#doc