From 1b0d1d4b8f373d9c05996055fb85ea8a2bb949a7 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 3 Oct 2024 11:17:29 +0200 Subject: refactor(templates/latex): Split the preamble up into multiple files --- common/latex/preamble/core/margindate.tex | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 common/latex/preamble/core/margindate.tex (limited to 'common/latex/preamble/core/margindate.tex') diff --git a/common/latex/preamble/core/margindate.tex b/common/latex/preamble/core/margindate.tex new file mode 100644 index 0000000..5579f98 --- /dev/null +++ b/common/latex/preamble/core/margindate.tex @@ -0,0 +1,37 @@ +\DTMnewdatestyle{margindate}{ + \renewcommand*\DTMdisplaydate[4]{ + \MakeLowercase{\DTMshortweekdayname{##4}}\space + \number##3\relax\space + \MakeLowercase{\DTMshortmonthname{##2}}\space + \DTMtwodigits{\DTMtwodigits{##1}} + } + \renewcommand*\DTMDisplaydate[4]{ + \DTMshortweekdayname{##4}\space + ##3\space + \DTMshortmonthname{##2}\space + \DTMtwodigits{\DTMtwodigits{##1}} + } +} + +\NewDocumentCommand\MarginContent{m}{ + \marginpar{ + \small\textsf{\mbox{#1}} + }\relax +} + +\NewDocumentCommand\MarginDate{m}{ + { + \DTMsetdatestyle{margindate} + + \MarginContent{\DTMDate{#1}} + } +} + +\NewDocumentCommand\AnnotatedSection{m m}{ + \section{#1} + \MarginContent{#2} +} +\NewDocumentCommand\DatedSection{m m}{ + \section{#1} + \MarginDate{#2} +} -- cgit 1.4.1