From e6e06e15ff0b96d99d85655fb395e17693a980bd Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Thu, 15 Apr 2021 13:18:23 +0200 Subject: [PATCH 1/4] #52 better design for quote environment --- config.tex | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config.tex b/config.tex index 36e3144..f265f37 100644 --- a/config.tex +++ b/config.tex @@ -81,6 +81,9 @@ % Für die Befehle \toprule, \midrule und \bottomrule, z.B. in Tabellen \usepackage{booktabs} +\usepackage[table]{xcolor} +\definecolor{tableshadow}{RGB}{240,240,240} + % Erlaubt die Benutzung von Farben \usepackage{color} @@ -229,3 +232,18 @@ % Pandoc Integration \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} + +% schickere \quotes +\usepackage{framed} +\renewenvironment{quote}{ + \FrameSep3pt + \def\FrameCommand{% + \hspace{12pt} % defaults to font size + {\color{black}\vrule width \heavyrulewidth}% + {\color{tableshadow}\vrule width 3pt}% + \colorbox{tableshadow}% + } + \vspace{-.25\topsep} + \MakeFramed{\advance\hsize-\width\FrameRestore} +} +{\endMakeFramed \vspace{-.75\topsep}} From 76f9c8117fc308deef49df17c0625f52865962d4 Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Thu, 15 Apr 2021 13:25:28 +0200 Subject: [PATCH 2/4] #52 added various configs * pdfpages for PDF Input * lscape for landscape pages (use pdflscape for rotated pages in PDF) * enumitem for configurable referencable items and enums * csvsimple for tables from CSV * longtable for multipage tables * changed to \addbibresource (new BibLaTex style for referencing bib files) * removed spacing from booktabs table rules and changed to larger arraystretch instead * added \tabularxmulticolumn for correct aligned multicolumns in tabularx tables --- config.tex | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/config.tex b/config.tex index f265f37..8778ba8 100644 --- a/config.tex +++ b/config.tex @@ -69,6 +69,12 @@ % Tabellenzellen über mehrere Reihen oder Spalten \usepackage{multirow} +% \multicolumn vernünftig in tabularx nutzen - siehe https://tex.stackexchange.com/questions/236155/tabularx-and-multicolumn +\newcommand{\tabularxmulticolumn}[3] + {\multicolumn{#1} + {>{\hsize=\dimexpr#1\hsize+#1\tabcolsep+\arrayrulewidth\relax}#2} + {#3}} + % Möglichkeit für Zeilenumbrüche in Tabellen \usepackage{makecell} @@ -76,14 +82,24 @@ \usepackage{rotating} % mehr Zeilenabstand in Tabellen -\renewcommand{\arraystretch}{1.15} +\renewcommand{\arraystretch}{1.4} % Für die Befehle \toprule, \midrule und \bottomrule, z.B. in Tabellen \usepackage{booktabs} +% vertikale Abstände entfernen - siehe https://tex.stackexchange.com/questions/381718/how-to-remove-the-space-after-midrule-in-a-table +\aboverulesep = 0mm +\belowrulesep = 0mm +% mehrseitige Tabellen +\usepackage{longtable} + +% Farben in Tabellenzeilen \usepackage[table]{xcolor} \definecolor{tableshadow}{RGB}{240,240,240} +% Tabellen aus CSV +\usepackage{csvsimple} + % Erlaubt die Benutzung von Farben \usepackage{color} @@ -102,6 +118,9 @@ % Listen ohne Abstände \begin{compactlist}...\end{compactlist} \usepackage{paralist} +% bessere Konfiguration + Referenzen auf enums und items +\usepackage{enumitem} + % Ausgabe der aktuellen Uhrzeit für die Draft-Versionen \usepackage{datetime} @@ -146,7 +165,7 @@ ibidpage=true, citetracker=true ]{biblatex} -\bibliography{library/library} +\addbibresource{library/library.bib} \DeclareLabeldate{ \field{year} \field{date} @@ -233,6 +252,12 @@ \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +% PDF Input +\usepackage{pdfpages} + +% Seiten im Querformat - wir wollen nicht pdflscape benutzen, da es komplette Seiten im PDF ins Querformat legt, was zu Problemen beim Druck führt (siehe https://texblog.org/2007/11/10/landscape-in-latex/) +\usepackage{lscape} + % schickere \quotes \usepackage{framed} \renewenvironment{quote}{ From e3b15a6c92be0a2849374b412498fde5fa3de5ec Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Thu, 15 Apr 2021 13:26:54 +0200 Subject: [PATCH 3/4] 52 modularized build script into functions and added possibility to have markdown appendices --- appendix/01_example.tex | 4 -- appendix/appendix.tex | 6 ++- appendix/generated/.gitkeep | 0 build.sh | 99 +++++++++++++++++++++++++++++++------ 4 files changed, 88 insertions(+), 21 deletions(-) delete mode 100644 appendix/01_example.tex create mode 100644 appendix/generated/.gitkeep diff --git a/appendix/01_example.tex b/appendix/01_example.tex deleted file mode 100644 index e8004c1..0000000 --- a/appendix/01_example.tex +++ /dev/null @@ -1,4 +0,0 @@ -%!TEX root = ../main.tex - -\section{Example} -\label{app:example} \ No newline at end of file diff --git a/appendix/appendix.tex b/appendix/appendix.tex index 464a38a..f7f7abe 100644 --- a/appendix/appendix.tex +++ b/appendix/appendix.tex @@ -1,5 +1,7 @@ %!TEX root = ../main.tex % input the appendix files here like this: -\input{appendix/01_example.tex} -\newpage +% \input{appendix/01_example.tex} +% \newpage +% when using markdown based appendices, they'll be generated to appendix/generated/${filename}.tex +% appendices need to be \sections! diff --git a/appendix/generated/.gitkeep b/appendix/generated/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/build.sh b/build.sh index 6889bcb..eb0f7e1 100755 --- a/build.sh +++ b/build.sh @@ -1,25 +1,94 @@ #!/bin/bash -# cleanup -latexmk -C -if [ -f chapter/out.tex ] -then - rm chapter/out.md - rm chapter/out.tex -fi +function run_clean { + latexmk -C -# run pandoc -if [ $1 == "pandoc" ] -then + if [ -f main.bbl ] + then + rm main.bbl + fi + + if [ -f main.lol ] + then + rm main.lol + fi + + if [ -f main.ptc ] + then + rm main.ptc + fi + + if [ -f main.run.xml ] + then + rm main.run.xml + fi + + if [ -f chapter/out.tex ] + then + rm chapter/out.md + rm chapter/out.tex + fi + + shopt -s nullglob + for f in appendix/generated/*.tex + do + rm $f + done +} + +function run_pandoc { + if [ -f chapter/out.tex ] + then + rm chapter/out.md + rm chapter/out.tex + fi + cat chapter/*.md > chapter/out.md pandoc --lua-filter templates/germanquotes.lua --citeproc --filter pandoc-crossref \ -M cref=true --top-level-division=chapter \ --bibliography library/library.bib --biblatex \ -o chapter/out.tex chapter/out.md -fi +} -# run latex build -if [ $1 != "clean" ] -then +function run_latexmk { latexmk -latexoption="-shell-escape" main.tex -fi +} + +function run_pandoc_appendix { + shopt -s nullglob + + for f in appendix/generated/*.tex + do + rm $f + done + + for f in appendix/*.md + do + filename=$(basename -- "$f") + filename="${filename%.*}" + pandoc --lua-filter templates/germanquotes.lua --citeproc --filter pandoc-crossref \ + -M cref=true --top-level-division=chapter \ + --bibliography library/library.bib --biblatex \ + -o appendix/generated/$filename.tex appendix/$filename.md + done +} + +case $1 in + "clean") + run_clean + ;; + "pandoc") + run_pandoc + run_pandoc_appendix + run_latexmk + ;; + "latex") + run_latexmk + ;; + "appendix") + run_pandoc_appendix + ;; + *) + echo $"Usage: $0 {clean|pandoc|latex}" + exit 1 +esac From 4d2a65eeac1fa8f9828db980047d552f30d65499 Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Thu, 15 Apr 2021 13:57:25 +0200 Subject: [PATCH 4/4] #51 Bugfixes for Appendix TOC Handling --- config.tex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.tex b/config.tex index 8778ba8..e7ea424 100644 --- a/config.tex +++ b/config.tex @@ -25,6 +25,10 @@ \usepackage{tocvsec2} \usepackage{titletoc} \newenvironment{custom_appendix}{% + % normale Zeilenabstände + \singlespacing + % keine Einträge mehr im Abbildungs-/Tabellenverzeichnis + \captionsetup{list=no} % ab hier keine Einträge mehr im Inhaltsverzeichnis - dafür haben wir das Anhangverzeichnis \addtocontents{toc}{\string\setcounter{tocdepth}{0}} \renewcommand{\thechapter}{\MakeUppercase{\Alph{chapter}}}% @@ -37,7 +41,7 @@ \newpage }{ - %\stopcontents + \stopcontents \renewcommand{\thechapter}{\arabic{chapter}}% \setcounter{chapter}{1} }