refactor(latex): add base template and unify designs

We add a base template for all latex documents to unify the desings and improve maintainability. Also
the table definitions are simplified fixing the various width issues.
Christian Merten 10 months ago
parent ada7c220f4
commit 0419dba98c
Signed by: christian.merten
GPG Key ID: D953D69721B948B3

@ -1,79 +1,15 @@
{% extends "members/tex_base.tex" %}
{% load static common tex_extras %}
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
% remove all undefined unicode characters instead of throwing an error
\makeatletter
\def\UTFviii@undefined@err#1{}
\makeatother
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage{cmbright}
\usepackage{graphicx}
\usepackage{textpos}
\usepackage[colorlinks, breaklinks]{hyperref}
\usepackage{float}
\usepackage[margin=2cm]{geometry}
\usepackage{array}
\usepackage{tabularx}
\usepackage{ltablex}
\newcommand{\picpos}[4]{
\begin{textblock*}{#1}(#2, #3)
\includegraphics[width=\textwidth]{#4}
\end{textblock*}
}
% custom url command for properly formatting emails
\DeclareUrlCommand\Email{\urlstyle{same}}
% allow linebreak after every character
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks
\do\/\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k
\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v
\do\w\do\x\do\y\do\z
\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K
\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V
\do\W\do\X\do\Y\do\Z}
\renewcommand{\arraystretch}{1.5}
\newcolumntype{L}{>{\hspace{0pt}\raggedright\arraybackslash}X}
\newcolumntype{S}{>{\raggedright\arraybackslash\hsize=0.7\hsize}X}
\newcommand{\tickedbox}{
\makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.1em}$\checkmark$}
}
\newcommand{\checkbox}{
\makebox[0pt][l]{$\square$}
}
\begin{document}
% HEADER RIGHT
{% settings_value 'DEFAULT_STATIC_PATH' as static_root %}
\picpos{4.5cm}{11.5cm}{0cm}{%
{{ static_root }}/general/img/dav_logo_sektion.png%
}
\begin{textblock*}{5cm}(12cm, 2.3cm)
\begin{flushright}
\small
\noindent Deutscher Alpenverein e. V. \\
Sektion {{ settings.SEKTION }} \\
{{ settings.SEKTION_STREET }} \\
{{ settings.SEKTION_TOWN }} \\
Tel.: {{ settings.SEKTION_TELEPHONE }} \\
Fax: {{ settings.SEKTION_TELEFAX }} \\
{{ settings.SEKTION_CONTACT_MAIL }} \\
\end{flushright}
\end{textblock*}
% HEADLINE
{\noindent\LARGE{Abrechnungs- und Zuschussbeleg\\[2mm]Sektionsveranstaltung}}\\[1mm]
\textit{Erstellt: {{ creation_date }} }\\
{% block title %}Abrechnungs- und Zuschussbeleg\\[2mm]Sektionsveranstaltung{% endblock %}
{% block content %}
{% if excursion %}
\noindent\textbf{\large Ausfahrt}
% DESCRIPTION TABLE
\begin{table}[H]
% DESCRIPTION TABLE
\begin{table}[H]
\begin{tabular}{ll}
Aktivität: & {{ excursion.name|esc_all }} \\
Ordnungsnummer & {{ excursion.code|esc_all }} \\
@ -88,15 +24,16 @@
{% checked_if_true 'Muskelkraft' excursion.get_tour_approach %}
{% checked_if_true 'Fahrgemeinschaften' excursion.get_tour_approach %}
\end{tabular}
\end{table}
\end{table}
\noindent\textbf{\large Zuschüsse und Aufwandsentschädigung}
{% if excursion.approved_staff_count > 0 %}
\noindent Gemäß Beschluss des Jugendausschusses gelten folgende Sätze für Zuschüsse pro genehmigter Jugendleiter*in:
\begin{table}[H]
\noindent Gemäß Beschluss des Jugendausschusses gelten folgende Sätze für Zuschüsse pro genehmigter Jugendleiter*in:
\begin{table}[H]
\centering
\begin{tabular}{lllr}
\begin{tabularx}{.97\textwidth}{Xllr}
\toprule
\textbf{Posten} & \textbf{Einzelsatz} & \textbf{Anzahl} & \textbf{Gesamtbetrag pro JL} \\
\midrule
@ -106,8 +43,8 @@
\midrule
\textbf{Summe}& & & \textbf{ {{ statement.total_per_yl }} }\\
\bottomrule
\end{tabular}
\end{table}
\end{tabularx}
\end{table}
\noindent Gemäß JDAV-Betreuungsschlüssel können bei {{ excursion.participant_count }} Teilnehmer*innen
bis zu {{ excursion.approved_staff_count }} Jugendleiter*innen {% if excursion.approved_extra_youth_leader_count %}
@ -147,14 +84,14 @@ Zuschüsse und Aufwandsentschädigung werden wie folgt abgerufen:
\nopagebreak
\begin{table}[H]
\centering
\begin{tabular}{lllr}
\begin{tabularx}{.97\textwidth}{lXlr}
\toprule
\textbf{Titel} & \textbf{Beschreibung} & \textbf{Auszahlung an} & \textbf{Betrag} \\
\midrule
{% if statement.bills_covered %}
{% for bill in statement.bills_covered %}
{{ forloop.counter }}. {{ bill.short_description}} & {{ bill.explanation}} & {{ bill.paid_by.name }} & {{ bill.amount }}\\
{{ forloop.counter }}. {{ bill.short_description}} & {{ bill.explanation}} & {{ bill.paid_by.name|esc_all }} & {{ bill.amount }}\\
{% endfor %}
\midrule
\multicolumn{3}{l}{\textbf{Summe übernommene Ausgaben}} & \textbf{ {{ statement.total_bills }} }\\
@ -163,7 +100,7 @@ Zuschüsse und Aufwandsentschädigung werden wie folgt abgerufen:
\midrule
{% if statement.allowances_paid > 0 %}
{% for m in statement.allowance_to.all %}
Aufwandsentschädigung & & {{ m.name }} & {{ statement.allowance_per_yl }}\\
Aufwandsentschädigung & & {{ m.name|esc_all }} & {{ statement.allowance_per_yl }}\\
{% endfor %}
{% endif %}
{% if statement.subsidy_to %}
@ -177,10 +114,9 @@ Zuschüsse und Aufwandsentschädigung werden wie folgt abgerufen:
\textbf{Gesamtsumme}& & & \textbf{ {{ statement.total }} }\\
{% endif %}
\bottomrule
\end{tabular}
\end{tabularx}
\end{table}
\noindent Dieser Beleg wird automatisch erstellt und daher nicht unterschrieben.
\end{document}
{% endblock %}

@ -1,74 +1,9 @@
{% extends "members/tex_base.tex" %}
{% load static common tex_extras %}
\documentclass[a4paper]{article}
{% block title %}Teilnehmer*innenliste Sektionsveranstaltung{% endblock %}
\usepackage[utf8]{inputenc}
% remove all undefined unicode characters instead of throwing an error
\makeatletter
\def\UTFviii@undefined@err#1{}
\makeatother
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage{cmbright}
\usepackage{graphicx}
\usepackage{textpos}
\usepackage[colorlinks, breaklinks]{hyperref}
\usepackage{float}
\usepackage[margin=2cm]{geometry}
\usepackage{array}
\usepackage{tabularx}
\usepackage{ltablex}
\newcommand{\picpos}[4]{
\begin{textblock*}{#1}(#2, #3)
\includegraphics[width=\textwidth]{#4}
\end{textblock*}
}
% custom url command for properly formatting emails
\DeclareUrlCommand\Email{\urlstyle{same}}
% allow linebreak after every character
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks
\do\/\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k
\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v
\do\w\do\x\do\y\do\z
\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K
\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V
\do\W\do\X\do\Y\do\Z}
\renewcommand{\arraystretch}{1.5}
\newcolumntype{L}{>{\hspace{0pt}\raggedright\arraybackslash}X}
\newcolumntype{S}{>{\raggedright\arraybackslash\hsize=0.7\hsize}X}
\newcommand{\tickedbox}{
\makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.1em}$\checkmark$}
}
\newcommand{\checkbox}{
\makebox[0pt][l]{$\square$}
}
\begin{document}
% HEADER RIGHT
{% settings_value 'DEFAULT_STATIC_PATH' as static_root %}
\picpos{4.5cm}{11.5cm}{0cm}{%
{{ static_root }}/general/img/dav_logo_sektion.png%
}
\begin{textblock*}{5cm}(12cm, 2.3cm)
\begin{flushright}
\small
\noindent Deutscher Alpenverein e. V. \\
Sektion {{ settings.SEKTION }} \\
{{ settings.SEKTION_STREET }} \\
{{ settings.SEKTION_TOWN }} \\
Tel.: {{ settings.SEKTION_TELEPHONE }} \\
Fax: {{ settings.SEKTION_TELEFAX }} \\
{{ settings.SEKTION_CONTACT_MAIL }} \\
\end{flushright}
\end{textblock*}
% HEADLINE
{\noindent\LARGE{Teilnehmer*innenliste\\[2mm]Sektionsveranstaltung}}\\[1mm]
\textit{Erstellt: {{ creation_date }} }\\
{% block content %}
% DESCRIPTION TABLE
\begin{table}[H]
@ -89,7 +24,7 @@
\end{tabular}
\end{table}
\begin{tabularx}{1\linewidth}{lSLSL}
\begin{tabularx}{.97\linewidth}{lXXXX}
\toprule
\# & \textbf{Name} & \textbf{Anschrift} & \textbf{Telefon} & \textbf{Notfallkontakte} \\
\midrule
@ -115,4 +50,4 @@
\noindent Bitte die ausgefüllte Teilnehmerliste vor Antritt der Aktivität per E-Mail an
\href{mailto:{{ settings.SEKTION_CRISIS_INTERVENTION_MAIL }}}{ {{ settings.SEKTION_CRISIS_INTERVENTION_MAIL }} } senden.
\end{document}
{% endblock content %}

@ -1,34 +1,12 @@
{% load tex_extras %}
{% extends "members/tex_base.tex" %}
{% load static common tex_extras %}
\documentclass{article}
{% block title %}{{ memberlist.title|esc_all }}{% endblock %}
{% block contact %}{% endblock %}
\usepackage[utf8]{inputenc}
% remove all undefined unicode characters instead of throwing an error
\makeatletter
\def\UTFviii@undefined@err#1{}
\makeatother
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{ragged2e}
\usepackage{amssymb}
\usepackage{cmbright}
\usepackage{graphicx}
\usepackage{textpos}
\usepackage[colorlinks]{hyperref}
\usepackage{float}
\usepackage[margin=1cm]{geometry}
{% block content %}
\renewcommand{\arraystretch}{1.5}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}
\begin{document}
% HEADLINE
{\noindent\LARGE\textsc{ {{ memberlist.title|esc_all }} }}\\
\textit{Erstellt: {{ creation_date }} }\\
\begin{table}[H]
\begin{tabularx}{\textwidth}{@{} l l Y @{}}
\begin{tabularx}{\textwidth}{l X}
\toprule
\textbf{Name} & \textbf{Kommentare} \\
\midrule
@ -36,7 +14,6 @@
{{ m.member.name|esc_all }} & {{ m.comments_tex|esc_all }} \\
{% endfor %}
\bottomrule
\end{tabularx}
\end{table}
\end{tabularx}
\end{document}
{% endblock %}

@ -1,32 +1,9 @@
{% load tex_extras %}
{% extends "members/tex_base.tex" %}
{% load static common tex_extras %}
\documentclass[a4paper]{article}
{% block title %}Teilnehmer*innenübersicht{% endblock %}
\usepackage[utf8]{inputenc}
% remove all undefined unicode characters instead of throwing an error
\makeatletter
\def\UTFviii@undefined@err#1{}
\makeatother
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{ragged2e}
\usepackage{amssymb}
\usepackage{cmbright}
\usepackage{graphicx}
\usepackage{textpos}
\usepackage[colorlinks]{hyperref}
\usepackage{float}
\usepackage[margin=1cm]{geometry}
\usepackage{ltablex}
\renewcommand{\arraystretch}{1.5}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}p{0.4\linewidth}}
\begin{document}
% HEADLINE
{\noindent\LARGE{Teilnehmer*innenübersicht}}\\[1mm]
\textit{Erstellt: {{ creation_date }} }\\
{% block content %}
% DESCRIPTION
\begin{table}[H]
@ -40,20 +17,21 @@
\end{tabular}
\end{table}
\begin{tabularx}{1\linewidth}{ l l l Y}
\begin{tabularx}{.97\linewidth}{lXXX}
\toprule
\# & \textbf{Name} & \textbf{Fähigkeiten (max. 100)} & \textbf{Kommentare} \\
\midrule
\endhead
\bottomrule
\endfoot
{% for p in people %}
{{ forloop.counter }} & {{ p.name|esc_all }} & {{ p.qualities|esc_all }} & {{ p.comments|esc_all }} \\
{% endfor %}
\bottomrule
\end{tabularx}
\noindent\large Fähigkeiten der Gruppe\\
\begin{table}[H]
\begin{tabular*}{1\linewidth}{@{\extracolsep{\fill}}llll}
\noindent{\large Fähigkeiten der Gruppe}\\
\begin{tabularx}{.97\linewidth}{Xlll}
\toprule
\textbf{Name} & \textbf{Durchschnitt} & \textbf{Minimum} & \textbf{Maximum} \\
\midrule
@ -61,9 +39,6 @@
{{ skill.name|esc_all }} & {{ skill.skill_avg|esc_all }} & {{ skill.skill_min|esc_all }} & {{ skill.skill_max|esc_all }} \\
{% endfor %}
\bottomrule
\end{tabular*}
\end{table}
\vspace{1cm}
\end{tabularx}
\end{document}
{% endblock %}

@ -1,80 +1,9 @@
{% extends "members/tex_base.tex" %}
{% load static common tex_extras %}
\documentclass[a4paper]{article}
{% block title %}Seminarbericht{% endblock %}
\usepackage[utf8]{inputenc}
% remove all undefined unicode characters instead of throwing an error
\makeatletter
\def\UTFviii@undefined@err#1{}
\makeatother
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage{cmbright}
\usepackage{graphicx}
\usepackage{textpos}
\usepackage[colorlinks, breaklinks]{hyperref}
\usepackage{float}
\usepackage[margin=1in]{geometry}
\usepackage{array}
\usepackage{ragged2e}
\usepackage{tabularx}
\usepackage{titlesec}
\usepackage{ltablex}
\titleformat{\section}
{\Large\slshape}{\thesection\;}
{0em}{}
\newcommand{\picpos}[4]{
\begin{textblock*}{#1}(#2, #3)
\includegraphics[width=\textwidth]{#4}
\end{textblock*}
}
% custom url command for properly formatting emails
\DeclareUrlCommand\Email{\urlstyle{same}}
% allow linebreak after every character
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks
\do\/\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k
\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v
\do\w\do\x\do\y\do\z
\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K
\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V
\do\W\do\X\do\Y\do\Z}
\renewcommand{\arraystretch}{1.5}
\newcolumntype{L}{>{\hspace{0pt}}X}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}
\newcommand{\tickedbox}{
\makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.1em}$\checkmark$}
}
\newcommand{\checkbox}{
\makebox[0pt][l]{$\square$}
}
\begin{document}
% HEADER RIGHT
{% settings_value 'DEFAULT_STATIC_PATH' as static_root %}
\picpos{4.5cm}{11.5cm}{0cm}{%
{{ static_root }}/general/img/dav_logo_sektion.png%
}
\begin{textblock*}{5cm}(11.5cm, 2.3cm)
\begin{flushright}
\small
\noindent Deutscher Alpenverein e. V. \\
Sektion {{ settings.SEKTION }} \\
{{ settings.SEKTION_STREET }} \\
{{ settings.SEKTION_TOWN }} \\
Tel.: {{ settings.SEKTION_TELEPHONE }} \\
Fax: {{ settings.SEKTION_TELEFAX }} \\
{{ settings.RESPONSIBLE_MAIL }} \\
\end{flushright}
\end{textblock*}
% HEADLINE
{\noindent\LARGE{Seminarbericht}}\\[1mm]
\textit{Erstellt: {{ creation_date }} }\\
{% block content %}
% DESCRIPTION TABLE
\begin{table}[H]
@ -89,54 +18,14 @@
\end{tabular}
\end{table}
{% if mode == 'full' %}
{% if memberlist.ljpproposal %}
\section{Alpintechnische Ziele}
{{ memberlist.ljpproposal.goals_alpinistic|esc_all }}
\section{Pädagogische Ziele}
{{ memberlist.ljpproposal.goals_pedagogic|esc_all }}
\section{Inhalte und Methoden}
{{ memberlist.ljpproposal.methods|esc_all }}
\section{Wertung}
{{ memberlist.ljpproposal.evaluation|esc_all }}
\section{Erfahrungen und Verbesserungsvorschläge}
{{ memberlist.ljpproposal.experiences|esc_all }}
\section{Zeitlicher und methodischer Ablauf}
\begin{table}[H]
\begin{tabularx}{1\linewidth}{@{}l l Y @{}}
\toprule
\textbf{Zeitpunkt} & \textbf{Dauer} & \textbf{Art der Aktion inkl. Methode} \\
\midrule
{% for intervention in memberlist.ljpproposal.intervention_set.all %}
{{ intervention.date_start|datetime_short }} & {{ intervention.duration }} h & {{ intervention.activity|esc_all }} \\
{% endfor %}
\bottomrule
\end{tabularx}
\end{table}
{% endif %}
{% endif %}
\section{Teilnehmer*innenliste}
\begin{tabularx}{1\linewidth}{p{0.01\linewidth}>{\RaggedRight\arraybackslash}p{0.22\linewidth}>{\RaggedRight\arraybackslash}p{0.38\linewidth}p{0.14\linewidth}|c|c|c}
\hline
\begin{tabularx}{.97\linewidth}{lp{0.2\textwidth}Xlccc}
\toprule
\# & \textbf{Name} & \textbf{Anschrift} & \textbf{Geburtsdatum} & \textbf{m} & \textbf{w} & \textbf{d} \\
\hline
\midrule
\endhead
\hline
\bottomrule
\endfoot
{% for m in memberlist.membersonlist.all %}
{{ forloop.counter }} & {{ m.member.name|esc_all }} & {{ m.member.address|esc_all }} & {{ m.member.birth_date_str|esc_all }}
@ -150,7 +39,7 @@
\section{Kosten}
\begin{tabularx}{1\linewidth}{@{\extracolsep{\fill}}Lr}
\begin{tabularx}{.97\textwidth}{Xr}
\toprule
\textbf{Beschreibung} & \textbf{Betrag} \\
\midrule
@ -160,10 +49,11 @@
{% for bill in memberlist.statement.grouped_bills %}
{{ bill.short_description|esc_all }} & {{ bill.amount }}\\
{% endfor %}
\bottomrule
\midrule
Gesamt & {{ memberlist.statement.total_theoretic }}\\
\bottomrule
\end{tabularx}
{% endif %}
\end{document}
{% endblock %}

@ -0,0 +1,98 @@
{% load static common tex_extras %}
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
% remove all undefined unicode characters instead of throwing an error
\makeatletter
\def\UTFviii@undefined@err#1{}
\makeatother
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage{cmbright}
\usepackage{graphicx}
\usepackage{textpos}
\usepackage[colorlinks, breaklinks]{hyperref}
\usepackage{float}
\usepackage[margin=2cm]{geometry}
\usepackage{array}
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{ragged2e}
\usepackage{titlesec}
\keepXColumns
\titleformat{\section}
{\Large\slshape}{\thesection\;}
{0em}{}
\newcommand{\picpos}[4]{
\begin{textblock*}{#1}(#2, #3)
\includegraphics[width=\textwidth]{#4}
\end{textblock*}
}
% custom url command for properly formatting emails
\DeclareUrlCommand\Email{\urlstyle{same}}
% allow linebreak after every character
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks
\do\/\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k
\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v
\do\w\do\x\do\y\do\z
\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K
\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V
\do\W\do\X\do\Y\do\Z}
\renewcommand{\arraystretch}{1.5}
\newcolumntype{L}{>{\hspace{0pt}\raggedright\arraybackslash}X}
\newcolumntype{S}{>{\raggedright\arraybackslash\hsize=0.7\hsize}X}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}p{0.4\linewidth}}
\newcommand{\tickedbox}{
\makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.1em}$\checkmark$}
}
\newcommand{\checkbox}{
\makebox[0pt][l]{$\square$}
}
{% block extra-preamble %}
{% endblock extra-preamble %}
\begin{document}
{% block contact %}
% HEADER RIGHT
{% settings_value 'DEFAULT_STATIC_PATH' as static_root %}
\picpos{4.5cm}{11.7cm}{0cm}{%
{{ static_root }}/general/img/dav_logo_sektion.png%
}
\begin{textblock*}{5cm}(11.7cm, 2.3cm)
\begin{flushright}
\small
\noindent Deutscher Alpenverein e. V. \\
Sektion {{ settings.SEKTION }} \\
{{ settings.SEKTION_STREET }} \\
{{ settings.SEKTION_TOWN }} \\
Tel.: {{ settings.SEKTION_TELEPHONE }} \\
Fax: {{ settings.SEKTION_TELEFAX }} \\
{{ settings.RESPONSIBLE_MAIL }} \\
\end{flushright}
\end{textblock*}
{% endblock contact %}
{% block headline %}
% HEADLINE
{\LARGE{\noindent {% block title %}{% endblock title %} }}\\[1mm]
\textit{Erstellt: {{ creation_date }} }\\
{% endblock headline %}
{% block content %}
{% endblock content %}
\end{document}
Loading…
Cancel
Save