commit c8db6e56c426a8eb4002e0ffc31a2d7598e78a61 Author: Florian Walch Date: Wed Mar 26 11:08:54 2014 +0100 Initial commit. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26302bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/build/* +!/build/main.pdf +/logos/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1f0bacc --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +FILE := main +OUT := build + +all: + mkdir -p $(OUT) + pdflatex -output-directory $(OUT) $(FILE) + biber $(OUT)/$(FILE) + cd $(OUT) && makeglossaries $(FILE) + pdflatex -output-directory $(OUT) $(FILE) + pdflatex -output-directory $(OUT) $(FILE) + +clean: + rm -rf $(OUT) diff --git a/README.md b/README.md new file mode 100644 index 0000000..29c9238 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# LaTeX template for TUM theses + +This is a LaTeX template created according to the [guidelines for TUM informatics theses][thesis-guidelines]. However, this might be useful for you even if you're a member of another faculty. See [`build/main.pdf`][sample-pdf] for an example PDF created with this template. + +Note: Because of copyright considerations, TUM logos are not included in this template and have to be downloaded separately. + +Comments & contributions welcome! + +## Quickstart + + * [Download][template-download] and extract the template. + * Download the TUM logos in PDF format: + * Log in to [MyTUM][mytum]. + * Download the TUM logo from [here][mytum-logo-tum] and save it to `logos/tum.pdf`. + * Download your faculty's logo from [here][mytum-logo-faculty] and save it to `logos/faculty.pdf`. + * Some logos might not be cropped; execute the `crop-logos` script to do that for you. + * Configure your latex editor to use `biber` for bibliography and `makeglossaries` for glossary generation. Set `main.tex` as the master document. + * You can also use the provided Makefile, which will create a PDF in the `build` directory. + * Look for `TODO` comments in the provided files. Start at `main.tex`. + +## License + +[![Creative Commons License][license-image]][license] + +This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License][license]. + +[thesis-guidelines]: http://www.in.tum.de/fuer-studierende/pruefungen-und-formalitaeten/abschlussarbeit.html +[sample-pdf]: https://raw.github.com/fwalch/tum-thesis-latex/master/build/main.pdf +[template-download]: https://github.com/fwalch/tum-thesis-latex/archive/master.zip +[mytum]: https://portal.mytum.de +[mytum-logo-tum]: https://portal.mytum.de/corporatedesign/download/TUM_Logo/index_html +[mytum-logo-faculty]: https://portal.mytum.de/corporatedesign/download/fakultaetslogos/index_html +[license]: https://creativecommons.org/licenses/by-sa/4.0/ +[license-image]: https://i.creativecommons.org/l/by-sa/4.0/88x31.png diff --git a/bibliography/literature.bib b/bibliography/literature.bib new file mode 100644 index 0000000..7f56ca0 --- /dev/null +++ b/bibliography/literature.bib @@ -0,0 +1,7 @@ +@book{latex, + title = {LaTeX : A Documentation Preparation System User's Guide and Reference Manual}, + publisher = {Addison-Wesley Professional}, + year = {1994}, + author = {Leslie Lamport} +} + diff --git a/build/main.pdf b/build/main.pdf new file mode 100644 index 0000000..3ab2c55 Binary files /dev/null and b/build/main.pdf differ diff --git a/chapters/introduction.tex b/chapters/introduction.tex new file mode 100644 index 0000000..7c91a5f --- /dev/null +++ b/chapters/introduction.tex @@ -0,0 +1,96 @@ +\chapter{Introduction}\label{chapter:introduction} + +\section{Section} +Citation test~\parencite{latex}. + +\subsection{Subsection} +See~\autoref{fig:sample}. + +\begin{figure}[htsb] + \centering + \includegraphics{logos/tum} + \caption[Example figure]{An example for a figure.}\label{fig:sample} +\end{figure} + +\section{Section} + +See~\autoref{tab:sample}, \autoref{fig:sample-drawing}, \autoref{fig:sample-plot}, \autoref{fig:sample-listing}. + +\begin{table}[htsb] + \caption[Example table]{An example for a simple table.}\label{tab:sample} + \centering + \begin{tabular}{l l l l} + \toprule + A & B & C & D \\ + \midrule + 1 & 2 & 1 & 2 \\ + 2 & 3 & 2 & 3 \\ + \bottomrule + \end{tabular} +\end{table} + +\begin{figure}[htsb] + \centering + % This should probably go into a file in figures/ + \begin{tikzpicture}[node distance=3cm] + \node (R0) {$R_1$}; + \node (R1) [right of=R0] {$R_2$}; + \node (R2) [below of=R1] {$R_4$}; + \node (R3) [below of=R0] {$R_3$}; + \node (R4) [right of=R1] {$R_5$}; + + \path[every node] + (R0) edge (R1) + (R0) edge (R3) + (R3) edge (R2) + (R2) edge (R1) + (R1) edge (R4); + \end{tikzpicture} + \caption[Example drawing]{An example for a simple drawing.}\label{fig:sample-drawing} +\end{figure} + +\begin{figure}[htsb] + \centering + + \pgfplotstableset{col sep=&, row sep=\\} + % This should probably go into a file in data/ + \pgfplotstableread{ + a & b \\ + 1 & 1000 \\ + 2 & 1500 \\ + 3 & 1600 \\ + }\exampleA + \pgfplotstableread{ + a & b \\ + 1 & 1200 \\ + 2 & 800 \\ + 3 & 1400 \\ + }\exampleB + % This should probably go into a file in figures/ + \begin{tikzpicture} + \begin{axis}[ + ymin=0, + legend style={legend pos=south east}, + grid, + thick, + ylabel=Y, + xlabel=X + ] + \addplot table[x=a, y=b]{\exampleA}; + \addlegendentry{Example A}; + \addplot table[x=a, y=b]{\exampleB}; + \addlegendentry{Example B}; + \end{axis} + \end{tikzpicture} + \caption[Example plot]{An example for a simple plot.}\label{fig:sample-plot} +\end{figure} + +\begin{figure}[htsb] + \centering + \begin{tabular}{c} + \begin{lstlisting}[language=SQL] + SELECT * FROM tbl WHERE tbl.str = "str" + \end{lstlisting} + \end{tabular} + \caption[Example listing]{An example for a source code listing.}\label{fig:sample-listing} +\end{figure} diff --git a/crop-logos.cmd b/crop-logos.cmd new file mode 100644 index 0000000..607090a --- /dev/null +++ b/crop-logos.cmd @@ -0,0 +1,6 @@ +@echo off + +pdfcrop logos\tum.pdf logos\tum.pdf +pdfcrop logos\faculty.pdf logos\faculty.pdf + +pause diff --git a/crop-logos.sh b/crop-logos.sh new file mode 100755 index 0000000..1fe11d8 --- /dev/null +++ b/crop-logos.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +command -v pdfcrop >/dev/null 2>&1 || { + echo >&2 "pdfcrop executable not found in PATH:" + echo >&2 "${PATH}" + exit 1 +} + +LOGOS=(tum faculty) + +for logo in ${LOGOS[@]} +do + pdfcrop "logos/${logo}.pdf" "logos/${logo}.pdf" +done diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/figures/.gitkeep b/figures/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/glossary/acronyms.tex b/glossary/acronyms.tex new file mode 100644 index 0000000..2c0833a --- /dev/null +++ b/glossary/acronyms.tex @@ -0,0 +1 @@ +\newacronym{tum}{TUM}{Technische Universität München} diff --git a/glossary/terms.tex b/glossary/terms.tex new file mode 100644 index 0000000..8c87da4 --- /dev/null +++ b/glossary/terms.tex @@ -0,0 +1,5 @@ +\newglossaryentry{computer} +{ + name=computer, + description={is a machine that\ldots} +} diff --git a/main.tex b/main.tex new file mode 100644 index 0000000..49c3b57 --- /dev/null +++ b/main.tex @@ -0,0 +1,46 @@ +\RequirePackage[l2tabu, orthodox]{nag} + +% TODO: decide if one-sided/two-sided +%\documentclass[headsepline,footsepline,footinclude=false,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc,BCOR=12mm,DIV=calc} % two-sided +\documentclass[headsepline,footsepline,footinclude=false,oneside,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc]{scrbook} % one-sided + +\input{settings/packages} +\input{settings/settings} +\input{settings/commands} + +% TODO: remove if glossary not needed +\input{glossary/terms} +\input{glossary/acronyms} + +\begin{document} + +\input{pages/cover} + +\frontmatter{} + +\input{pages/title} +\input{pages/disclaimer} +\input{pages/acknowledgements} +\input{pages/abstract} +\microtypesetup{protrusion=false} +\tableofcontents{} +\microtypesetup{protrusion=true} + +\mainmatter{} + +\input{chapters/introduction} +% TODO: add more chapters here + +\appendix{} + + % TODO: remove if glossary not needed +\glsaddall{} % add all defined terms to glossary, even if not referenced in text +\printglossaries{} + +\microtypesetup{protrusion=false} +\listoffigures{} +\listoftables{} +\microtypesetup{protrusion=true} +\printbibliography{} + +\end{document} diff --git a/pages/abstract.tex b/pages/abstract.tex new file mode 100644 index 0000000..7531fb1 --- /dev/null +++ b/pages/abstract.tex @@ -0,0 +1,5 @@ +\chapter{\abstractname} + +%TODO: Abstract + + diff --git a/pages/acknowledgements.tex b/pages/acknowledgements.tex new file mode 100644 index 0000000..345b801 --- /dev/null +++ b/pages/acknowledgements.tex @@ -0,0 +1,14 @@ +\addcontentsline{toc}{chapter}{Acknowledgments} +\thispagestyle{empty} + +\vspace*{2cm} + +\begin{center} +{\usekomafont{section} Acknowledgments} +\end{center} + +\vspace{1cm} + +%TODO: Acknowledgments + +\cleardoublepage{} diff --git a/pages/cover.tex b/pages/cover.tex new file mode 100644 index 0000000..cd0d024 --- /dev/null +++ b/pages/cover.tex @@ -0,0 +1,32 @@ +\thispagestyle{empty} + +\vspace{40mm} +\begin{center} + \includegraphics[width=40mm]{logos/tum} + + \vspace{5mm} + \Huge \textsc{\getFaculty{}}\\ + \vspace{5mm} + \Large \textsc{Technische Universität München}\\ + \vspace{1mm} +\end{center} + +\vspace{15mm} + +\begin{center} + {\Large \getDoctype{}} + + \vspace{20mm} + + {\huge\bfseries \getTitle{}} + + \vspace{15mm} + + {\LARGE \getAuthor{}} + + \vspace{20mm} + + \includegraphics[width=20mm]{logos/faculty} +\end{center} + +\cleardoublepage{} diff --git a/pages/disclaimer.tex b/pages/disclaimer.tex new file mode 100644 index 0000000..b1fcd6a --- /dev/null +++ b/pages/disclaimer.tex @@ -0,0 +1,10 @@ +\thispagestyle{empty} +\vspace*{0.8\textheight} +\noindent +I assure the single handed composition of this \MakeLowercase{\getDoctype{}} only supported by declared resources. + +\vspace{15mm} +\noindent +Munich, \getSubmissionDate{} \hspace{5cm} \getAuthor{} + +\cleardoublepage{} diff --git a/pages/title.tex b/pages/title.tex new file mode 100644 index 0000000..620fa69 --- /dev/null +++ b/pages/title.tex @@ -0,0 +1,41 @@ +\thispagestyle{empty} + +\vspace{40mm} +\begin{center} + \includegraphics[width=40mm]{logos/tum} + + \vspace{5mm} + \Huge \textsc{\getFaculty{}}\\ + \vspace{5mm} + \Large \textsc{Technische Universität München}\\ + \vspace{1mm} +\end{center} + +\vspace{15mm} + +\begin{center} + {\Large \getDoctype{}} + + \vspace{20mm} + + {\huge\bfseries \getTitle{}} + + \vspace{10mm} + + {\huge\bfseries \getTitleGer{}} + + \vspace{15mm} + + \begin{tabular}{l l} + Author: & \getAuthor{} \\ + Supervisor: & \getSupervisor{} \\ + Advisor: & \getAdvisor{} \\ + Submission Date: & \getSubmissionDate{} \\ + \end{tabular} + + \vspace{7mm} + + \includegraphics[width=20mm]{logos/faculty} +\end{center} + +\cleardoublepage{} diff --git a/settings/commands.tex b/settings/commands.tex new file mode 100644 index 0000000..db649e3 --- /dev/null +++ b/settings/commands.tex @@ -0,0 +1,11 @@ +% Basic information for cover & title page +\newcommand*{\getFaculty}{Fakultät für Informatik} +\newcommand*{\getTitle}{TODO: Thesis title} +\newcommand*{\getTitleGer}{TODO: Titel der Abschlussarbeit} +\newcommand*{\getAuthor}{TODO: Author} +\newcommand*{\getDoctype}{TODO: Thesis type (Bachelor's Thesis, \ldots)} +\newcommand*{\getSupervisor}{TODO: Supervisor} +\newcommand*{\getAdvisor}{TODO: Advisor} +\newcommand*{\getSubmissionDate}{TODO: Submission date} + +% TODO: add custom commands etc. diff --git a/settings/packages.tex b/settings/packages.tex new file mode 100644 index 0000000..64667d8 --- /dev/null +++ b/settings/packages.tex @@ -0,0 +1,21 @@ +\PassOptionsToPackage{table,svgnames,dvipsnames}{xcolor} + +\usepackage[utf8]{inputenc} +\usepackage[sc]{mathpazo} +\usepackage[T1]{fontenc} +\usepackage[american]{babel} +\usepackage[autostyle]{csquotes} +\usepackage[backend=biber,url=false,style=alphabetic,maxnames=4,minnames=3,maxbibnames=99,firstinits,uniquename=init]{biblatex} % TODO: adapt bibliography style +\usepackage{graphicx} +\usepackage{scrhack} +\usepackage{listings} +\usepackage{lstautogobble} +\usepackage{tikz} +\usepackage{pgfplots} +\usepackage{pgfplotstable} +\usepackage{booktabs} +\usepackage[final]{microtype} +\usepackage{caption} +\usepackage{hyperref} +\usepackage[xindy={language=american,codepage=utf8},toc,nonumberlist,acronym]{glossaries} % TODO: remove if glossary not needed + diff --git a/settings/settings.tex b/settings/settings.tex new file mode 100644 index 0000000..727c721 --- /dev/null +++ b/settings/settings.tex @@ -0,0 +1,24 @@ +\bibliography{bibliography/literature} + +\setkomafont{disposition}{\normalfont\bfseries} % use serif font for headings +\linespread{1.05} % adjust line spread for mathpazo font + +% Settings for glossaries TODO: remove the following block if glossary not needed +\renewcommand{\glsnamefont}[1]{\normalfont\bfseries #1} % use serif font for glossary entry titles +\makeglossaries{} + +% Settings for pgfplots +\pgfplotsset{compat=1.9} % TODO: adjust to your installed version +\pgfplotsset{ + % For available color names, see http://www.latextemplates.com/svgnames-colors + cycle list={CornflowerBlue\\Dandelion\\ForestGreen\\BrickRed\\}, +} + +% Settings for lstlistings +\lstset{% + basicstyle=\ttfamily, + columns=fullflexible, + autogobble, + keywordstyle=\bfseries\color{MediumBlue}, + stringstyle=\color{DarkGreen} +}