Skip to content

Commit

Permalink
Changed appendix structure and include of appendix chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStuber committed Nov 12, 2021
1 parent 20a5b00 commit 5ba0934
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 23 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,24 @@ Das Abstract wird allein durch die zwei Dateien im Ordner abstract/ editiert. In

### Anhang

Ein Anhangskapitel wird wie in den Beispieldateien im Order appendix/ erstellt. Um dieses Kapitel in den Anhang der Thesis aufzunehmen, muss in der Datei appendix.tex innerhalb der appendices-Umgebung folgender Befehl angehängt werden. (Siehe Beispielanhang.)
Ein Anhangskapitel wird, wie in den Beispieldateien, im Order appendix/ erstellt. Um dieses Kapitel in den Anhang der Thesis aufzunehmen, muss in der Datei appendix.tex innerhalb der appendices-Umgebung folgender Befehl verwendet werden. (Siehe Beispielanhang.)

```LaTeX
\appendixnum
\include{appendix/<Name der Datei>}
```

Durch Voranstellen entsprechender Befehle kann die Nummerierung eingebundener Elemente entfernt werden. So kann, wenn z. B. nur eine Abbildung verwendet wird, diese als Abbildung A (statt Abbildung A1) betitelt werden.
Soll in einem Anhangskapitel nur je eine Abbildung, Tabelle oder ein Quelltextbeispiel verwendet werden, können dem Kapitel entsprechend folgende Befehle vorangestellt werden. Diese unterdrücken für dieses Kapitel die Nummerierung des entsprechenden Elements. So kann, wenn z. B. nur eine Abbildung verwendet wird, diese als Abbildung A (statt Abbildung A1) betitelt werden.

```LaTeX
\appendixnum
\appendixsinglefig % Nur eine Abbildung
\appendixsingletab % Nur eine Tabelle
\appendixsinglelst % Nur ein Quellcodebeispiel
\include{appendix/<Name der Datei>}
\appendixsinglelst % Nur ein Quelltextbeispiel
\chapter{...}
```

In der Datei appendix.tex finden sich zusätzlich die Optionen, Abschnitte und Unterabschnitte innerhalb von Anhängen aus dem Inhaltsverzeichnis, sowie Abbildungen, Tabellen und Quelltextbeispiele aus ihren entsprechenden Verzeichnissen zu entfernen. Diese Optionen können separat durch ein- / auskommentieren verwendet oder ignoriert werden.

### Kapitel

Kapitel der Thesis werden je als Datei in dem Ordner content/ angelegt. Eingebunden werden Kapitel über die Datei content.tex mit folgendem Befehl.
Expand Down
33 changes: 19 additions & 14 deletions appendix.tex
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
%----------------------------------------------------------
% General appendix settings
%----------------------------------------------------------

% Remove page number from appendix divider page
\makeatletter
\patchcmd{\@chap@pppage}{\thispagestyle{plain}}{\thispagestyle{empty}}{}{}
\makeatother

% Appendix page
\appendix

% Reset counters and add letters to counters on every include
\pretocmd{\include}{\appendixnum}{}{}

% Change pagestyle of appendix to include appendix name in header
\pagestyle{fancyappendix}

% Reformat chapter and section numbering
\appendixchap
\appendixsec

%----------------------------------------------------------
% Prevent sections and subsections from being added to table of contents (OPTIONAL)
%----------------------------------------------------------

\appendixtoc

%----------------------------------------------------------
% Remove figures, tables and listings from LOF, LOT and LOL (OPTIONAL)
%----------------------------------------------------------
%\let\svaddcontentsline\addcontentsline
%\renewcommand\addcontentsline[3]{%
% \ifthenelse{\equal{#1}{lof}}{}%
% {\ifthenelse{\equal{#1}{lot}}{}%
% {{\ifthenelse{\equal{#1}{lol}}{}{\svaddcontentsline{#1}{#2}{#3}}}}}}

%\appendixlists

%----------------------------------------------------------
% Appendix chapters
% Must always be preceded by \appendixnum
% If only a single figure / table / listing is used can also be preceded by
% \appendixsinglefig, \appendixsingletab or \appendixsinglelst
%----------------------------------------------------------

\begin{appendices}
\pagestyle{fancyappendix}
\appendixchap
\appendixsec
\appendixnum
\include{appendix/1_Beispiel}
\appendixnum
\appendixsinglefig
\include{appendix/2_Beispiel}
\end{appendices}
11 changes: 11 additions & 0 deletions appendix/1_Beispiel.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
% If only a single figure / table / listing is used in this chapter
%\appendixsinglefig
%\appendixsingletab
%\appendixsinglelst

\chapter{Beispiel Anhang Eins}
\label{chp:Beispiel_Anhang_Eins}

\blindtext

\section{Abschnitt im Anhang}

\subsection{Unterabschnitt im Anhang}

\blindtext
7 changes: 6 additions & 1 deletion appendix/2_Beispiel.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
% If only a single figure / table / listing is used in this chapter
\appendixsinglefig
%\appendixsingletab
%\appendixsinglelst

\chapter{Beispiel Anhang Zwei}
\label{chp:Beispiel_Anhang_Zwei}

Expand All @@ -8,4 +13,4 @@ \chapter{Beispiel Anhang Zwei}
\includegraphics[width=0.25\linewidth]{images/example-image.png}
\caption{Einziges Bild in diesem Anhang}
\label{fig:appendiximgsingle}
\end{figure}
\end{figure}
18 changes: 16 additions & 2 deletions format.tex
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@
% (Uses etoolbox package)
% (Must be before including hyperref package as it changes \@chapter to \Hy@org@chapter)
\makeatletter
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}% LoF
\patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{}% LoT
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}%
\patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{}%
\makeatother

%----------------------------------------------------------
Expand Down Expand Up @@ -270,6 +270,20 @@
\renewcommand{\thelstlisting}{\Alph{chapter}}
}

% To remove figures, tables and listings from LOF, LOT and LOL
\usepackage{ifthen}

\let\tmpaddcontentsline\addcontentsline
\newcommand{\appendixaddcontentsline}[3]{%
\ifthenelse{\equal{#1}{lof}}{}%
{\ifthenelse{\equal{#1}{lot}}{}%
{{\ifthenelse{\equal{#1}{lol}}{}%
{\tmpaddcontentsline{#1}{#2}{#3}}}}}}

\newcommand{\appendixlists}{
\renewcommand{\addcontentsline}{\appendixaddcontentsline}
}

%----------------------------------------------------------
% Source code (listings)
%----------------------------------------------------------
Expand Down

0 comments on commit 5ba0934

Please sign in to comment.