Skip to content

Instantly share code, notes, and snippets.

@X4
Last active December 26, 2015 21:09
Show Gist options
  • Select an option

  • Save X4/7213912 to your computer and use it in GitHub Desktop.

Select an option

Save X4/7213912 to your computer and use it in GitHub Desktop.
Thesis Master Template
%&Thesis
% Create a binary preamble:
% fmtutil --byfmt pdflatex
% check for mistakes in the code
\RequirePackage[l2tabu, orthodox]{nag}
% permit Computer Modern fonts at arbitrary sizes.
\RequirePackage{fix-cm}
%%----------------------------------------------------------------
%% Document Class (Koma Script) %%----------------------------------------------------------------
\documentclass[%
%draft=true, % draft mode (no images, layout errors shown)
draft=false, % final mode
%%% --- Paper Settings ---
paper=a4,% [Todo: add alternatives]
paper=portrait, % landscape
pagesize=auto, % driver
%%% --- Base Font Size ---
fontsize=11pt,%
%%% --- Koma Script Version ---
version=last, %
%%% --- Global Package Options ---
english, % language (passed to babel and other packages)
% (ngerman, english, french, ...)
]{scrbook} % Classes: scrartcl, scrreprt, scrbook
%%----------------------------------------------------------------
%% Must be loaded first!
%%----------------------------------------------------------------
% Description: This package is meant to be a solution for the
% error "no room for a new \write"
% Doc: morewrites.pdf
\usepackage{morewrites}
% see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=noroom
\usepackage{etex}
\reserveinserts{28}
% packages required for the template
\usepackage{codesection}
\usepackage{templatetools}
%%----------------------------------------------------------------
%% Encoding
%%----------------------------------------------------------------
% automatic selection of encoding
% insert chars for umlaut a and sz
\usepackage{selinput}
\SelectInputMappings{adieresis={ä},germandbls={ß},Euro={€}}
% Encoding of _files and directories_
% (ensures that any file can be loaded without problems)
\usepackage[%
extendedchars, encoding, multidot, space,
filenameencoding=utf8, % Linux, OS X
% filenameencoding=latin1, % Windows XP, Vista, 7, 8
]{grffile}
%%----------------------------------------------------------------
%% Preamble
%%----------------------------------------------------------------
%% setup document variables
\input{Config/Variables}
%% select/load fonts
\input{Config/Typography/PDFTeX}
%\input{Config/Typography/Fonts/font-commercial.tex}
%% load packages
\input{Config/Preamble/packages}
%% apply style settings
\input{Config/Preamble/style}
%% new commands / definitions (required by the template!)
\input{Config/Preamble/commands}
% display the layouts
%\IfPackageLoaded{geometry}{\geometry{showframe}}
%%----------------------------------------------------------------
%% Configuration
%%----------------------------------------------------------------
%%% Switch between colored links (web) and black links (print)
\IfDefined{UseDefinition}{%
%\UseDefinition{Target}{Print}
\UseDefinition{Target}{Web}
}% end of UseDefinition
\IfPackageLoaded{hyperref}{%
%%% set layout of PDF pages
\hypersetup{%
pdfpagelayout=OneColumn,
pdftitle={\myDegree},
pdfsubject={\myTitle},
pdfauthor={\textcopyright -- \myName, \myUni, \myFaculty},
pdfkeywords={\myKeywordsEn},
pdflang={en},
}
% options:
% SinglePage Displays a single page; advancing flips the page
% OneColumn Displays the document in one column; continuous scrolling.
% TwoColumnLeft Displays the document in two columns,
% odd-numbered pages to the left.
% TwoColumnRight Displays the document in two columns,
% odd-numbered pages to the right.
% TwoPageLeft Displays two pages, odd-numbered pages to the left
% TwoPageRight Displays two pages, odd-numbered pages to the right
}% (end of hyperref)
%%----------------------------------------------------------------
%% Customizations
%%----------------------------------------------------------------
\input{Config/Macros/NewCommands}
%% Hyphenation (Silbentrennung)
\input{Config/Hyphenation}
%% Load Glossary
\input{Content/INP-00-Glossary}
%%----------------------------------------------------------------
%% Execute required commands
%%----------------------------------------------------------------
\input{Config/Preamble/makeCommands}
% List all loaded files at end of document
\listfiles
%%----------------------------------------------------------------
%% BIBLIOGRAPHY (now in preamble !)
%%----------------------------------------------------------------
%%% bibtex file(s)
% add multiple files with comma separation
% biblatex requires files before document
\IfPackageLoaded{biblatex}{
% \bibliography{Data/Bibliography/Bibliographies.bib}
\addbibresource{Data/Bibliography/Journals.bib}
\addbibresource{Data/Bibliography/References.bib}
}% end: biblatex
%% document content %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\includeonly{
%\include{Document/Title/Titlepage}
%\include{Document/Title/Titleback}
%\include{Document/Frontmatter/Abstract}
%\include{Document/Frontmatter/Declaration}
%\include{Content/Chapter/01} % Introduction
%\include{Content/Chapter/02} % Theory
%\include{Content/Chapter/03} % Experiments
%\include{Content/Chapter/04} % Results
%\include{Content/Chapter/05} % Summary
%} % end includeonly
%%% document start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%----------------------------------------------------------------
%% PRE-CONTENT - SECTION
%%----------------------------------------------------------------
% end of binary preamble
\csname endofdump\endcsname
% Load acronym definitions
\input{Content/INP-00-Acronyms}
% Add todo list (remove for final document!)
%\input{Content/ToDos}
% Required for hyperref (not displayed)
\pagenumbering{alph}\setcounter{page}{1}%
\pagestyle{empty}
%% Title cover
%\input{Document/Title/Titlecover}
%% Title pages
\input{Document/Title/Titlepage}
\input{Document/Title/Titleback}
\cleardoublepage
%%----------------------------------------------------------------
%% THESIS FRONTMATTER - SECTION
%%----------------------------------------------------------------
\frontmatter
%% Copyright/Informal Statement - Terms of a license
\input{Document/Frontmatter/Copyright}
\cleardoublepage
%% Dedication/Motto - Devotement & Short Acknowledgement
%\input{Document/Frontmatter/Dedication}
%\cleardoublepage
%% Foreword - Prolog, (by someone other than the author)
%\input{Document/Frontmatter/Foreword}
%\cleardoublepage
%% Preface - Prolog, (by the author)
%\input{Document/Frontmatter/Preface}
%\cleardoublepage
%% Acknowledgments - Credits
%\input{Document/Frontmatter/Acknowledgments}
%\cleardoublepage
%% (only in phd thesis)
%% Abstract - Essence without judgement (DIN 1426)
%%% Doc: http://tinyurl.com/Richtlinien-Wiss-Arbeitens
\include{Document/Frontmatter/Abstract}
\cleardoublepage
%% Originality Statement - Statment of authorship (only in bachelor/master thesis)
\input{Document/Frontmatter/Declaration}
\cleardoublepage
%%----------------------------------------------------------------
%% Table of Contents
%%----------------------------------------------------------------
%% Contents, list of figures/tables/listings and acronyms
\input{Document/Frontmatter/Contents}
\cleardoublepage
%%----------------------------------------------------------------
%% THESIS MAIN CONTENT - CHAPTERS
%%----------------------------------------------------------------
\mainmatter
\include{Content/Chapter/01}
\include{Content/Chapter/02}
\include{Content/Chapter/03}
\include{Content/Chapter/04}
\include{Content/Chapter/05}
%%----------------------------------------------------------------
%% THESIS BIBLIOGRAPHY - SECTION
%%----------------------------------------------------------------
% (must be placed _before_ appendix)
% (only in phd thesis)
\input{Document/Backmatter/Bibliography}
%%----------------------------------------------------------------
%% THESIS LISTS - SECTION
%%----------------------------------------------------------------
%% -- List of Figures --
\IfDefined{listoffigures}{%
\cleardoublepage
\IfDefined{phantomsection}{\phantomsection}\label{sec:lof}
\listoffigures
} % end of figures
%% -- List of Tables --
\IfDefined{listoftables}{%
\cleardoublepage
\IfDefined{phantomsection}{\phantomsection}\label{sec:lot}
\listoftables
} % end of tables
%% -- List of Listings --
\IfDefined{lstlistoflistings}{%
\cleardoublepage
\IfDefined{phantomsection}{\phantomsection}\label{sec:lol}
\lstlistoflistings
} % end of listings
%%----------------------------------------------------------------
%% THESIS CONTENT - APPENDICES
%%----------------------------------------------------------------
\cleardoublepage
\appendix
% Add `Appendix` to TOC
\addcontentsline{toc}{part}{\appendixname}
% must be _input_, otherwise the TOC entry is at the wrong place
\input{Document/Backmatter/Appendix}
%%----------------------------------------------------------------
%% POST-CONTENT THESIS PAGES
%%----------------------------------------------------------------
\input{Document/Backmatter/Index}
%\input{Document/Backmatter/Colophon}
%%% document END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% !TeX encoding=utf8
% !TeX program = pdflatex
% !TeX spellcheck = en-US
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment