3

I will start write my master thesis very soon. In it I like to have a preamble. I use basic-miktex-2.9.5105 and as an editor TeXmaker -- installed on a windows machine.

Also: can I find a distro or bundle like MikTeX (or a version of it) containing all current LaTeX packages?

8
  • 1
    If you want a distribution with all the packages, simply use texlive (tug.org/texlive/acquire-netinstall.html). Works fine on windows. Jan 18, 2017 at 14:50
  • 2
    I would not search for a preamble, better start with a basic document class (for example book) and while you go, add the packages you need. Jan 18, 2017 at 14:52
  • 2
    It's very easy to install missing packages with MikTeX Package Manager.
    – Bernard
    Jan 18, 2017 at 14:57
  • 4
    There is no standard preamble for any thesis!
    – user31729
    Jan 18, 2017 at 15:38
  • 1
    Be careful though: your university may have specific requirements about how a thesis or dissertation should look. Check with them; perhaps a template is available. Jan 18, 2017 at 18:33

1 Answer 1

9

Normally I'd recommend to build every document from scratch because every document has its own requirements. However, looking at your question a second time, I thought there are indeed things nearly every thesis will need to do. So here is a "minimal working preamble" for theses:

\documentclass{report} % or even: book | or the koma classes: scrreprt, scrbook
% or for a small thesis 'article' or the corresponding 'scrartcl'
\usepackage{microtype}
\usepackage[<encoding>]{fontenc} % probabilly: T1
\usepackage[<encoding>]{inputenc} % probabilly: utf8
%\usepackage{palatino} % just as a matter of taste
\usepackage[<your language(s)>]{babel}
\usepackage{geometry} % and then \geometry{<settings>}
\usepackage{csquotes} % probabilly with the option: autostyle=true
\usepackage{ellipsis}
\usepackage{natbib} % or biblatex
\usepackage{graphicx}
%\graphicspath{ {images/} } % or whatever your "images"-directory is
\usepackage{todonotes} % or fixme
\usepackage{fancyhdr}
\usepackage{emptypage}
\usepackage{hyperref}

...

%declaration environment
\usepackage{titling}

\makeatletter
\newif\if@decltotoc
\newcommand\declarationname{Declaration of Authorship}
\newcommand\ltx@sectionings{chapter,section,subsection,subsubsection,subparagraph}
\newcommand\decl@rationsect{chapter}
\ifdefined\chapter\else\renewcommand\decl@rationsect{section}\fi
\newenvironment{declaration}[2][\decl@rationsect]{%
  \edef\@tempa{\decl@rationsect}%
  \edef\reserved@a{#1}%
  \gdef\theplace{#2}%
  \@decltotocfalse
  \@ifundefined{#1}{\@latex@warning{#1 not defined}}{%
    \@tempswafalse%
    \@for\sec:=\ltx@sectionings\do{\ifx\sec\reserved@a\@tempswatrue\fi}%
    \if@tempswa\let\@tempa\reserved@a\else
      \@latex@warning{#1 is not a sectioning command, so I overrode it}\fi}
  \csname\@tempa\endcsname*{\declarationname}
  \if@decltotoc\addcontentsline{toc}{\@tempa}{\declarationname}\fi
}{%
  \par\vskip6em\par\noindent\theauthor\hfill\theplace,\space\thedate\par
  \global\let\declaration\gobble@env
  \global\let\enddeclaration\relax
  \global\expandafter\let\csname enddeclaration*\endcsname\relax
}
\expandafter\def\csname declaration*\endcsname{\let\@decltotocfalse\@decltotoctrue\declaration}
\expandafter\let\csname enddeclaration*\endcsname\enddeclaration
\def\gobble@env{\@ifnextchar[{\@gobble@env}{\@gobble@env[]}}
\def\@gobble@env[#1]{\@bsphack\@@gobble@env}
\def\@@gobble@env#1\end{\@esphack\end}
\makeatother

The last part of the code defines a declaration environment as a declaration of authorship mostly is an integral part of (nearly) each thesis. Its use is prety straightforward:

\begin{declaration}{City}
  Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
  sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
  sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
  Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{declaration}

If it should appear in the toc you can say \begin{declaration*}{City}...\end{declaration*}.

Remarks

  • For a bigger thesis you will most likely need a documentclass that supports \chapters in the sectioning. Anyways, there are a few more classes to consider here. For this you may want to see the CTAN class overview.
  • A few packages are really somehow default everywhere (assuming pdfLaTeX): microtype to include pdfTeXs mi­cro-ty­po­graphic ex­ten­sions, inputenc and fontenc to control encodings; if you are using XeLaTeX or LuaLaTeX those packages are unusable
  • babel to gurantee language-dependent tasks are done correctly
  • Every university places (most likely ridiculous) requirements regarding the page geometry
  • You will most likely need to quote: csquotes; and as a supplement ellipsis, which corrects the often wrong white space of \dots in text-mode
  • You will for sure need to cite in a customised style: natbib, biblatex, etc.
  • In case you have external figures: graphicx
  • It comes in handy to store to-do-notes while writing on a big project -- that have to be excluded in the final version, hence todonotes; often people like to use the alternative fixme package as it overcomes boundaries of the todonotes package regarding the placement of the notes
  • Often you want to have clickable cross references: hyperref; note that you have to load hyperref (nearly) as the last package to ensure that your document compiles properly. Here you can find a thorough discussion on this topic -- for instance you have to load geometry after hyperref; the above preamlbe is technically wrong so to speak; it is just on a higher position because of the "hirarchy" in the listing
  • The last two ones are more or less optional: fancyhdr is the standard tool to set headers and footers and emptypage may be included if you want empty pages to be actually empty
  • In addition to the todonotes package you might also want to use the comment package as a pseudo version control system
  • Depending on your subject or if you need to produce drawings and diagrams inside of LaTeX you might also need

Addendum

It is worth noting that the memoir documentation dedicates a whole chapter (21. "An example thesis design", pp. 357-375) to explain how to design a thesis style. There might be a few clues about additional features one might want to incorporate into the own preamble. However, it should also be said that this manual focuses on the thesis style from a package/class designer point of view.

5
  • 2
    I usually use fixme instead of todonotes as with the layout=marginnote,innerlayout=noinline the notes can be used anywhere, whereas \todo cannot (as it is using \marginpar) other than that I mostly agree with the list.
    – daleif
    Jan 18, 2017 at 16:05
  • 1
    Perhaps add that if you are using XeTeX or LuaTeX then skip the inputenc/fontenc part.
    – Joseph Wright
    Jan 18, 2017 at 16:06
  • 3
    I'd consider moving hyperref last and commenting that very few packages should come after it.
    – Joseph Wright
    Jan 18, 2017 at 16:06
  • @daleif and @JosephWright -- thank you! Ill add a remark on the \todo section and clarify matters regarding 'inputenc/fontenc' and hyperref
    – Ruben
    Jan 18, 2017 at 16:08
  • 1
    The memoir class manual (texdoc memoir) provides an extensive example setting up the typesetting for a thesis. Jan 18, 2017 at 19:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .