Skip to content

Commit

Permalink
simplify creation of appendix (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-te authored Feb 9, 2023
1 parent a9dfed8 commit 4d58304
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 44 deletions.
4 changes: 4 additions & 0 deletions .template/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ figPrefix:
secPrefix:
- "Abschnitt"
- "Abschnitten"

print-bibliography: |
::: {#refs}
:::
55 changes: 24 additions & 31 deletions .template/tex/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -485,40 +485,33 @@
\printnoidxglossary[sort=word]
$endif$
\pagebreak
\pagenumbering{arabic}
$body$

$if(natbib)$
$if(bibliography)$
$if(biblio-title)$
$if(book-class)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
$if(beamer)$
\begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
$endif$
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
$if(beamer)$
\end{frame}
$endif$
\newcommand{\prepareappendix}{
\pagebreak
\pagenumbering{roman}
\setcounter{page}{\value{lastromanpage}}
}

$endif$
$endif$
$if(biblatex)$
$if(beamer)$
\begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
\printbibliography[heading=none]
\end{frame}
$else$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$
\newcommand{\printbibliography}{
$if(bibliography)$
\section*{Literaturverzeichnis}
\addcontentsline{toc}{section}{Literaturverzeichnis}
$print-bibliography$
\pagebreak
$endif$
}

\newcommand{\shiftappendixnumbering}{
\renewcommand{\thesection}{}
\renewcommand{\thesubsection}{\Alph{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
}

\newcounter{lastromanpage}
\setcounter{lastromanpage}{\value{page}}
\pagenumbering{arabic}
$body$

$endif$
$for(include-after)$
$include-after$
$endfor$
Expand Down
18 changes: 5 additions & 13 deletions src/90_appendix.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
\pagebreak
\pagenumbering{roman}
\setcounter{page}{4}

\section*{Literaturverzeichnis}
\addcontentsline{toc}{section}{Literaturverzeichnis}

<div id="refs"></div>

\pagebreak
\prepareappendix
\printbibliography
\appendix
\section*{Appendix}
\addcontentsline{toc}{section}{Appendix}
\renewcommand{\thesubsection}{\Alph{subsection}}
\shiftappendixnumbering

# Anhang {-}

## Abbildungen

Expand Down

0 comments on commit 4d58304

Please sign in to comment.