Merge branch '4-migrate-to-xelatex-and-scrbook' into 'master'
Resolve "Migrate to XeLaTex and scrbook" Closes #4 See merge request dominik/latex-boilerplate!4
This commit is contained in:
commit
10b220e418
|
@ -11,7 +11,7 @@ latexmk:
|
|||
- main.pdf
|
||||
expire_in: 2d
|
||||
script:
|
||||
- latexmk -pdf
|
||||
- latexmk -xelatex main.tex
|
||||
|
||||
hunspell:
|
||||
stage: test
|
||||
|
|
36
README.md
36
README.md
|
@ -1,23 +1,23 @@
|
|||
# LaTex Boilerplate
|
||||
|
||||
This is a simple preconfigured boilerplate for medium-sized LaTex projects including continuous integration for GitLab CI.
|
||||
It's based on the `scrartcl` document class and currently layed out for german scientiefic documents.
|
||||
It's based on the `scrbook` document class and currently layed out for german scientiefic documents.
|
||||
|
||||
|
||||
## Basic Structure
|
||||
The main entry point for the document compilation is the file `main.tex` in the repo root.
|
||||
Besides setting some common parameters for the document (like author name, title, date etc.), the basic document structure is created here (mostly by including seperate files) in the following order:
|
||||
|
||||
* configuration (`configuration/config.tex`)
|
||||
* title page (`config/title.tex`)
|
||||
* configuration (`config/config.tex`)
|
||||
* title page (`additionals/title.tex`)
|
||||
* table of contents
|
||||
* list of acronyms (`config/abkuerzungen.tex`)
|
||||
* list of acronyms (`additionals/acronyms.tex`)
|
||||
* list of figures
|
||||
* list of tables
|
||||
* list of code listings
|
||||
* chapter files (`chapter/*`, needs to be filled up manually)
|
||||
* bibliography (`config/quellenverzeichnis.tex`, using the entries defined in `library/library.bib`)
|
||||
* declaration of authorship (`config/ehrenwoertliche_erklaerung.tex`)
|
||||
* bibliography (`config/references.tex`, using the entries defined in `library/library.bib`)
|
||||
* declaration of authorship (`additionals/affirmation.tex`)
|
||||
|
||||
If you don't need one of the predefined document parts or want to omit it, simply remove or comment out the corresponding statements in `main.tex`.
|
||||
|
||||
|
@ -79,6 +79,17 @@ The predefined document layout is the following:
|
|||
Further configuration can be done in `config/config.tex`.
|
||||
|
||||
|
||||
## Document Outline
|
||||
The `scrbook` document class provides the following elements (in said order) to outlining a document:
|
||||
|
||||
* `\part{}`: roman numbering, e.g. *I*
|
||||
* `\chapter{}`: arabic 1st level numbering, e.g. *1*
|
||||
* `\section{}`: arabic 2nd level numbering, e.g. *1.1*
|
||||
* `\subsection{}`: arabic 3rd level numbering, e.g. *1.1.1*
|
||||
* `\subsubsection{}`: arabic 3rd level numbering, e.g. *1.1.1.1*
|
||||
* `\paragraph{}`: no numbering and independent from preceding hierarchy elements
|
||||
|
||||
|
||||
## Continuous Integration
|
||||
The `.gitlab-ci.yml` file comes preconfigured to spellcheck and compile the LaTex document.
|
||||
|
||||
|
@ -93,8 +104,10 @@ This is a simple word list structured by one word per line.
|
|||
By default, the spellcheck job is allowed to fail.
|
||||
|
||||
### Building the PDF
|
||||
The CI pipeline will build `main.tex` (and everything included here) to PDF using `pdflatex`.
|
||||
Build output is the file `main.pdf`, which can be downloaded from GitLab coordinator for two days (each pipeline run).
|
||||
The CI pipeline will build `main.tex` (and everything included here) to PDF using `xelatex`.
|
||||
It provides better handling of unicode characters and typesets special characters (like german umlauts) more precise.
|
||||
|
||||
The build output is generated to `main.pdf`, which can be downloaded from GitLab coordinator for two days (each pipeline run).
|
||||
|
||||
**(!)** Please adapt the configuration to your own runner setup if neccessary.
|
||||
|
||||
|
@ -144,11 +157,10 @@ Config for syntax highlighting is centrally provided in `config/config.tex` usin
|
|||
It may be done individually for each listing.
|
||||
Please see official docs for that.
|
||||
|
||||
### Paragraph distances
|
||||
You may wrap the blocks (lists, images, tables, paragraphs etc.) with a
|
||||
### Paragraph Distances and Onehalf Spacing
|
||||
There are certain LaTex environments that cause huge paragraph distances in combination with the `onehalfspacing` option (1.5 line height).
|
||||
For that reason you may wrap such environments (e.g. lists, images, tables, paragraphs etc.) with a `vspace`:
|
||||
|
||||
```latex
|
||||
\vspace{-\topsep}
|
||||
```
|
||||
|
||||
if the paragraph distances above and/or below seem too large to you.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%!TEX root = ../main.tex
|
||||
|
||||
\section*{Abkürzungsverzeichnis}
|
||||
\addcontentsline{toc}{section}{Abkürzungsverzeichnis}
|
||||
\chapter*{Abkürzungsverzeichnis}
|
||||
\addcontentsline{toc}{chapter}{Abkürzungsverzeichnis}
|
||||
|
||||
\begin{acronym}[ABCD]
|
||||
% declare your own acronyms here:
|
|
@ -1,7 +1,7 @@
|
|||
%!TEX root = ../main.tex
|
||||
|
||||
\section*{Ehrenwörtliche Erklärung}
|
||||
\addcontentsline{toc}{section}{Ehrenwörtliche Erklärung}
|
||||
\chapter*{Ehrenwörtliche Erklärung}
|
||||
\addcontentsline{toc}{chapter}{Ehrenwörtliche Erklärung}
|
||||
|
||||
Hiermit erkläre ich, dass ich die vorliegende Arbeit selbständig angefertigt habe.
|
||||
Es wurden nur die in der Arbeit ausdrücklich benannten Quellen und Hilfsmittel benutzt.
|
|
@ -1,6 +0,0 @@
|
|||
%!TEX root = ../main.tex
|
||||
|
||||
\section*{Anhang}
|
||||
\addcontentsline{toc}{section}{Anhang}
|
||||
|
||||
\anhangsverzeichnis
|
|
@ -1,74 +1,42 @@
|
|||
%!TEX root = ../main.tex
|
||||
|
||||
%% Basierend auf TeXnicCenter-Vorlage von Mark Müller
|
||||
%% Willi Nüßer
|
||||
%% Waldemar Penner
|
||||
%% Ulrich Reus
|
||||
%% Frank Plass
|
||||
%% Oliver Tribeß
|
||||
%% Daniel Hintze
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
% Wählen Sie die Optionen aus, indem Sie % vor der Option entfernen
|
||||
% Dokumentation des KOMA-Script-Packets: scrguide
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Optionen zum Layout des Artikels %%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\documentclass[%
|
||||
paper=A4, % alle weiteren Papierformat einstellbar
|
||||
fontsize=12pt, % Schriftgröße (12pt, 11pt (Standard))
|
||||
%BCOR12mm, % Bindekorrektur, bspw. 1 cm
|
||||
DIV14, % breiter Satzspiegel
|
||||
parskip=half, % Absatzformatierung s. scrguide 3.1
|
||||
%headsepline, % Trennline zum Seitenkopf
|
||||
%footsepline, % Trennline zum Seitenfuß
|
||||
%normalheadings, % Überschriften etwas kleiner (smallheadings)
|
||||
listof=totoc, % Tabellen & Abbildungsverzeichnis ins Inhaltsverzeichnis
|
||||
%bibtotoc, % Literaturverzeichnis im Inhalt
|
||||
%draft % Überlangen Zeilen in Ausgabe gekennzeichnet
|
||||
footinclude=false,% Fußzeile in die Satzspiegelberechnung einbeziehen
|
||||
headinclude=false, % Kopfzeile in die Satzspiegelberechnung einbeziehen
|
||||
final % draft beschleunigt die Kompilierung
|
||||
]
|
||||
{scrartcl}
|
||||
|
||||
% Reduzierung der Abstände zwischen Überschriften und Text
|
||||
\RedeclareSectionCommand[
|
||||
beforeskip=1\baselineskip,
|
||||
afterskip=.0001\baselineskip]{section}
|
||||
\RedeclareSectionCommand[
|
||||
beforeskip=.75\baselineskip,
|
||||
afterskip=.0001\baselineskip]{subsection}
|
||||
\RedeclareSectionCommand[
|
||||
beforeskip=.5\baselineskip,
|
||||
afterskip=.0001\baselineskip]{subsubsection}
|
||||
\documentclass[
|
||||
paper=A4,
|
||||
fontsize=12pt,
|
||||
parskip=half,
|
||||
headsepline,
|
||||
listof=totoc,
|
||||
draft=false,
|
||||
headings=small,
|
||||
oneside,
|
||||
final
|
||||
]{scrbook}
|
||||
|
||||
% Seitenränder
|
||||
\usepackage[left=40mm, right=20mm, top=25mm, bottom=25mm]{geometry}
|
||||
\usepackage[
|
||||
left=40mm,
|
||||
right=20mm,
|
||||
top=25mm,
|
||||
bottom=25mm
|
||||
]{geometry}
|
||||
|
||||
%\setuptoc{toc}{totoc} % Inhaltsverzeichnis ins Inhaltsverzeichnis
|
||||
% Reduzierung der Abstände zwischen Überschriften und Text
|
||||
\RedeclareSectionCommand[afterskip=.0001\baselineskip]{section}
|
||||
\RedeclareSectionCommand[afterskip=.0001\baselineskip]{subsection}
|
||||
\RedeclareSectionCommand[afterskip=.0001\baselineskip]{subsubsection}
|
||||
\RedeclareSectionCommand[beforeskip=.0001\baselineskip]{paragraph}
|
||||
|
||||
% Umlaute können verwendet werden
|
||||
\usepackage[utf8]{inputenc}
|
||||
% Schriftauswahl
|
||||
\usepackage{fontspec}
|
||||
|
||||
% Neue Deutsche Rechtschreibung und Deutsche Standardtexte
|
||||
\usepackage[ngerman]{babel}
|
||||
|
||||
% Echte Umlaute
|
||||
\usepackage[T1]{fontenc}
|
||||
|
||||
% Latin Modern Font, Type1-Schriftart für nicht-englische Texte
|
||||
\usepackage{lmodern}
|
||||
|
||||
% 1/2-zeiliger Zeilenabstand
|
||||
\usepackage[onehalfspacing]{setspace}
|
||||
|
||||
% Für die Defenition eigener Kopf- und Fußzeilen
|
||||
% \usepackage{fancyhdr}
|
||||
|
||||
% Für die Verwendung von Grafiken
|
||||
\usepackage[pdftex]{graphicx}
|
||||
\usepackage{graphicx}
|
||||
|
||||
% Bessere Tabellen
|
||||
\usepackage{tabularx}
|
||||
|
@ -81,6 +49,12 @@ final % draft beschleunigt die Kompilierung
|
|||
|
||||
% Links im PDF
|
||||
\usepackage{hyperref}
|
||||
\hypersetup{
|
||||
colorlinks=false,
|
||||
pdfborder={0 0 0},
|
||||
pdftitle=\dokumententitel,
|
||||
pdfauthor=\dokumentenautor
|
||||
}
|
||||
|
||||
% Verbessertes URL-Handling mit \url{http://...}
|
||||
\usepackage{url}
|
||||
|
@ -98,10 +72,16 @@ final % draft beschleunigt die Kompilierung
|
|||
\usepackage[german,capitalise]{cleveref}
|
||||
|
||||
% Konfiguration der Abbildungs- und Tabellenbezeichnungen
|
||||
\usepackage[format=hang, font={footnotesize, sf}, labelfont=bf, justification=raggedright,singlelinecheck=false]{caption}
|
||||
\usepackage[
|
||||
format=hang,
|
||||
font={footnotesize, sf},
|
||||
labelfont=bf,
|
||||
justification=raggedright,
|
||||
singlelinecheck=false
|
||||
]{caption}
|
||||
|
||||
% Verbessert die Lesbarkeit durch Mikrotypografie
|
||||
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
|
||||
% Macro für Quellenangaben unter Abbildungen und Tabellen
|
||||
\newcommand{\source}[1]{\vspace{-.5\topsep}\caption*{\textsf{\textbf{Quelle:}} \textsf{#1}} }
|
||||
|
||||
% Abbildungen am exakten Ort platzieren
|
||||
\usepackage{float}
|
||||
|
@ -109,39 +89,42 @@ final % draft beschleunigt die Kompilierung
|
|||
% Fußnoten an Überschriften
|
||||
\usepackage[stable]{footmisc}
|
||||
|
||||
|
||||
% Zitate und Quellenverzeichnis
|
||||
\usepackage[
|
||||
style=authoryear, % Zitierstil
|
||||
firstinits=false, % false = Vornamen werden ausgeschrieben
|
||||
style=authoryear,
|
||||
giveninits=false,
|
||||
natbib=true,
|
||||
urldate=long, % "besucht am" - Datum
|
||||
%url=false,
|
||||
urldate=long,
|
||||
url=true,
|
||||
date=long,
|
||||
dashed=false,
|
||||
maxcitenames=2, % max. Anzahl Autorennamen in Zitaten
|
||||
maxbibnames=99, % max. Anzahl Autorennamen im Quellenverzeichnis
|
||||
%backend=bibtex % Ggf. für ältere Distributionen bibtex verwenden
|
||||
maxcitenames=2,
|
||||
maxbibnames=99,
|
||||
backend=biber,
|
||||
autocite=footnote,
|
||||
uniquelist=false
|
||||
]{biblatex}
|
||||
|
||||
% Bibliograpthy
|
||||
\bibliography{library/library}
|
||||
|
||||
% Keine Einrückung bei einem neuen Absatz
|
||||
\parindent 0pt
|
||||
|
||||
% Ebenentiefe der Nummerierung
|
||||
\setcounter{secnumdepth}{3}
|
||||
|
||||
% Gliederungstiefe im Inhaltsverzeichnis
|
||||
\setcounter{tocdepth}{3}
|
||||
|
||||
% Tabellen- und Abbildungsverzeichnis mit Bezeichnung:
|
||||
% Inhaltsverzeichnis ins Inhaltsverzeichnis
|
||||
\setuptoc{toc}{totoc}
|
||||
|
||||
% Tabellen- und Abbildungsverzeichnis mit Bezeichnung
|
||||
\usepackage[titles]{tocloft}
|
||||
|
||||
% Abkürzungen
|
||||
\usepackage{acronym}
|
||||
|
||||
% Bestimmte Warnungen unterdrücken
|
||||
% siehe http://tex.stackexchange.com/questions/51867/koma-warning-about-toc
|
||||
\usepackage{scrhack}
|
||||
|
||||
% Sourcecode-Listings
|
||||
\usepackage{listings}
|
||||
|
||||
|
@ -175,32 +158,6 @@ numbersep=5pt,
|
|||
escapeinside=||
|
||||
}
|
||||
|
||||
% Line-Functions %
|
||||
|
||||
\let\origthelstnumber\thelstnumber
|
||||
\makeatletter
|
||||
\newcommand*\Suppressnumber{%
|
||||
\lst@AddToHook{OnNewLine}{%
|
||||
\let\thelstnumber\relax%
|
||||
\advance\c@lstnumber-\@ne\relax%
|
||||
}%
|
||||
}
|
||||
|
||||
\newcommand*\Reactivatenumber{%
|
||||
\lst@AddToHook{OnNewLine}{%
|
||||
\let\thelstnumber\origthelstnumber%
|
||||
\advance\c@lstnumber\@ne\relax}%
|
||||
}
|
||||
\makeatother
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% Bestimmte Warnungen unterdrücken
|
||||
% siehe http://tex.stackexchange.com/questions/51867/koma-warning-about-toc
|
||||
\usepackage{scrhack}
|
||||
|
||||
%% http://tex.stackexchange.com/questions/126839/how-to-add-a-colon-after-listing-label
|
||||
\makeatletter
|
||||
\begingroup\let\newcounter\@gobble\let\setcounter\@gobbletwo
|
||||
|
@ -225,60 +182,6 @@ escapeinside=||
|
|||
|
||||
\renewcommand\lstlistlistingname{Listingverzeichnis}
|
||||
|
||||
% Style für Kopf- und Fußzeilenfelder
|
||||
% \pagestyle{fancy}
|
||||
% \fancyhf{}
|
||||
% \fancyhead[R]{\leftmark}
|
||||
% \fancyfoot[R]{\thepage}
|
||||
% \renewcommand{\sectionmark}[1]{\markboth{#1}{#1}}
|
||||
% \fancypagestyle{plain}{}
|
||||
|
||||
% Macro für Quellenangaben unter Abbildungen und Tabellen
|
||||
\newcommand{\source}[1]{\vspace{-.5\topsep}\caption*{\textsf{\textbf{Quelle:}} \textsf{#1}} }
|
||||
|
||||
%\makeatletter
|
||||
%\def\l@lstlisting#1#2{\@dottedtocline{1}{0em}{1.5em}{\lstlistingname\space{#1}}{#2}}
|
||||
%\makeatother
|
||||
|
||||
% Anhangsverzeichnis
|
||||
\usepackage[nohints]{minitoc} %Anhangsverzeichnis
|
||||
|
||||
\makeatletter
|
||||
\newcounter{fktnr}\setcounter{fktnr}{0}
|
||||
\newcounter{subfktnr}[fktnr]\setcounter{subfktnr}{0}
|
||||
|
||||
\renewcommand\thesubfktnr{\arabic{fktnr}.\arabic{subfktnr}}
|
||||
\newcounter{anhangcounter}
|
||||
\newcommand{\blatt}{\stepcounter{anhangcounter}}
|
||||
|
||||
\newcommand{\anhang}[1]{\setcounter{anhangcounter}{0}\refstepcounter{fktnr}
|
||||
\addcontentsline{fk}{subsection}{Anhang~\thefktnr: \hspace*{1em}#1}
|
||||
\subsection*{{Anhang~\thefktnr \hspace*{1em} #1 \hspace*{-1em}}}
|
||||
}
|
||||
|
||||
\newcommand{\subanhang}[1]{\setcounter{anhangcounter}{0}\refstepcounter{subfktnr}
|
||||
\addcontentsline{fk}{subsubsection}{Anhang~\thesubfktnr: \hspace*{1em}#1}
|
||||
\subsubsection*{{Anhang~\thesubfktnr \hspace*{1em} #1 \hspace*{-1em}}}
|
||||
}
|
||||
|
||||
\newcommand{\anhangsverzeichnis}{\mtcaddsection{\subsection*{Anhangsverzeichnis \@mkboth{FKT}{FKT}}}\@starttoc{fk}\newpage}
|
||||
|
||||
% Abkürzungsverzeichnis
|
||||
% \usepackage[acronym, % create list of acronyms
|
||||
% nonumberlist,
|
||||
% toc,
|
||||
% section,
|
||||
% nomain, % don't need main glossary for this example
|
||||
% hyperfirst=false,% don't hyperlink first use
|
||||
% sanitize=none % switch off sanitization as description
|
||||
% ]{glossaries}
|
||||
% \newglossarystyle{mylist}{%
|
||||
% \glossarystyle{long}% base this style on the list style
|
||||
% \renewcommand*{\glossaryentryfield}[5]{%
|
||||
% \glsentryitem{##1}\textbf{##2} & ##3 \\}%
|
||||
% }
|
||||
|
||||
% \input{config/Abkuerzungen}
|
||||
% \makeglossaries\makeglossaries
|
||||
|
||||
\usepackage{acronym}
|
||||
\def\l@lstlisting#1#2{\@dottedtocline{1}{0em}{1.5em}{\lstlistingname\space{#1}}{#2}}
|
||||
\makeatother
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
%!TEX root = ../main.tex
|
||||
|
||||
\section*{Quellenverzeichnis}
|
||||
\addcontentsline{toc}{section}{Quellenverzeichnis}
|
||||
\chapter*{Quellenverzeichnis}
|
||||
\addcontentsline{toc}{chapter}{Quellenverzeichnis}
|
||||
|
||||
\defbibheading{mono}{\subsection*{Monographien}}
|
||||
\defbibheading{mag}{\subsection*{Aufsätze in Sammelbänden und Zeitschriften}}
|
||||
\defbibheading{art}{\subsection*{Zeitungsartikel}}
|
||||
\defbibheading{web}{\subsection*{Internetquellen}}
|
||||
\defbibheading{leg}{\subsection*{Rechtsprechung}}
|
||||
\defbibheading{comp}{\subsection*{Unternehmensunterlagen/Gesprächsnotizen}}
|
||||
\defbibheading{mono}{\section*{Monographien}}
|
||||
\defbibheading{mag}{\section*{Aufsätze in Sammelbänden und Zeitschriften}}
|
||||
\defbibheading{art}{\section*{Zeitungsartikel}}
|
||||
\defbibheading{web}{\section*{Internetquellen}}
|
||||
\defbibheading{leg}{\section*{Rechtsprechung}}
|
||||
\defbibheading{comp}{\section*{Unternehmensunterlagen/Gesprächsnotizen}}
|
||||
|
||||
\setlength\bibitemsep{1.5\itemsep}
|
||||
\setlength{\bibhang}{2em}
|
21
main.tex
21
main.tex
|
@ -1,5 +1,3 @@
|
|||
\input{config/config}
|
||||
|
||||
% Makros
|
||||
\newcommand{\dokumententyp}{Dokumententyp}
|
||||
\newcommand{\abgabedatum}{\today}
|
||||
|
@ -14,19 +12,14 @@
|
|||
\newcommand{\studiengruppe}{Studiengruppe}
|
||||
\newcommand{\institution}{Institution}
|
||||
|
||||
% PDF-Setup
|
||||
\hypersetup{
|
||||
colorlinks=false,
|
||||
pdfborder={0 0 0},
|
||||
pdftitle=\dokumententitel,
|
||||
pdfauthor=\dokumentenautor
|
||||
}
|
||||
% Config
|
||||
\input{config/config.tex}
|
||||
|
||||
\begin{document}
|
||||
%%%%%%%%%%%%%%%
|
||||
%% Deckblatt %%
|
||||
%%%%%%%%%%%%%%%
|
||||
\input{config/title}
|
||||
\input{additionals/title.tex}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%
|
||||
%% Verzeichnisse %%
|
||||
|
@ -38,7 +31,7 @@
|
|||
\newpage
|
||||
|
||||
% Abkürzungsverzeichnis
|
||||
\input{config/abkuerzungen}
|
||||
\input{additionals/acronyms.tex}
|
||||
\newpage
|
||||
|
||||
% Abbildungsverzeichnis
|
||||
|
@ -50,7 +43,7 @@
|
|||
\newpage
|
||||
|
||||
% Listingverzeichnis
|
||||
\lstlistoflistings\newpage
|
||||
\lstlistoflistings
|
||||
\newpage
|
||||
|
||||
%%%%%%%%%%%%
|
||||
|
@ -66,10 +59,10 @@
|
|||
%% Schluss %%
|
||||
%%%%%%%%%%%%%
|
||||
% Quellenverzeichnis
|
||||
\input{config/quellenverzeichnis}
|
||||
\input{config/references.tex}
|
||||
\newpage
|
||||
|
||||
% Ehrenwörtliche Erklärung
|
||||
\input{config/ehrenwoertliche_erklaerung}
|
||||
\input{additionals/affirmation.tex}
|
||||
|
||||
\end{document}
|
Loading…
Reference in New Issue
Block a user