From 1361108a9e872a1d2a8e8ac5acf50fb3113d9c59 Mon Sep 17 00:00:00 2001 From: Carl Kittelberger Date: Wed, 15 Feb 2017 14:01:45 +0100 Subject: [PATCH] export/latex: Update template. --- export/latex/template.go | 52 ++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/export/latex/template.go b/export/latex/template.go index 8af3c35..c93a0e8 100644 --- a/export/latex/template.go +++ b/export/latex/template.go @@ -34,12 +34,13 @@ var exportTemplate = template.Must(template. \documentclass[11pt,a4paper,oneside]{article} -\usepackage{fancyhdr} -\usepackage{tabularx} \usepackage[left=2cm,right=2cm,top=2cm,bottom=6cm,includeheadfoot]{geometry} \usepackage{csquotes} +\usepackage{fancyhdr} \usepackage{fontspec} \usepackage{ifluatex} +\usepackage{tabularx} +\usepackage{titling} \ifluatex \else \usepackage[utf8]{inputenc} @@ -49,8 +50,13 @@ var exportTemplate = template.Must(template. \fancyhf{} \setlength{\headheight}{2cm} -\newcommand{\Name}{<.Project.Name>} -\newcommand{\Department}{<.Project.Department>} +\newcommand{\department}[1]{\global\def\wrDepartment{#1}} +\newcommand{\workreportNumber}[1]{\global\def\wrNumber{#1}} +\newcommand{\workreportDateFrom}[1]{\global\def\wrDateFrom{#1}} +\newcommand{\workreportDateTo}[1]{\global\def\wrDateTo{#1}} + +\author{<.Project.Name>} +\department{<.Project.Department>} \newcommand{\wrSigningField}[0]{ \begin{tabularx}{\textwidth}{| X | X | X |} @@ -62,35 +68,42 @@ var exportTemplate = template.Must(template. \end{tabularx} } -\newenvironment{weeklyreport}{ -}{ +\fancypagestyle{weeklyreport} { \fancyfoot[C]{\wrSigningField} } -\newcommand{\preweeklyreporthead}[3]{} - -\newcommand{\weeklyreporthead}[3]{ - \preweeklyreporthead{#1}{#2}{#3} +\newenvironment{weeklyreport}[3]{ + \newpage + \thispagestyle{weeklyreport} \fancyhead[R]{ \begin{tabularx}{8cm}{rl} - \textbf{}: & \Name \\ - \textbf{}: & \Department \\ - \textbf{}: & #2 - #3 \\ + \textbf{}: & \theauthor \\ + \textbf{}: & \wrDepartment \\ + \textbf{}: & \wrDateFrom~-~\wrDateTo \\ \end{tabularx} } - \fancyfoot{} - \newpage - \setcounter{section}{#1} + + \workreportNumber{#1} + \workreportDateFrom{#2} + \workreportDateTo{#3} + + \setcounter{section}{\wrNumber} \setcounter{subsection}{0} - \section*{} - \addcontentsline{toc}{section}{} + \section*{Ausbildungsnachweis Nr. \wrNumber} + \addcontentsline{toc}{section}{Ausbildungsnachweis Nr. \wrNumber} +}{ } +\newcommand{\weeklyreporthead}[3]{} + \newcommand{\weeklyreportsection}[1]{ \subsection*{#1} } + +% Includes + \input{<.>} @@ -100,8 +113,7 @@ var exportTemplate = template.Must(template. \tableofcontents -\begin{weeklyreport} - \weeklyreporthead{}{}{} +\begin{weeklyreport}{}{}{} \weeklyreportsection{}