about summary refs log tree commit diff stats
path: root/common/latex/preamble/core/margindate.tex
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-03 11:17:29 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-03 11:17:29 +0200
commit1b0d1d4b8f373d9c05996055fb85ea8a2bb949a7 (patch)
tree93781d3a88a498ec27ea1e3f550e899476f11496 /common/latex/preamble/core/margindate.tex
parentfix(templates/latex/{academia,letter}): Share files and update to lpm v2.0 (diff)
downloadflake-templates-1b0d1d4b8f373d9c05996055fb85ea8a2bb949a7.tar.gz
flake-templates-1b0d1d4b8f373d9c05996055fb85ea8a2bb949a7.zip
refactor(templates/latex): Split the preamble up into multiple files
Diffstat (limited to 'common/latex/preamble/core/margindate.tex')
-rw-r--r--common/latex/preamble/core/margindate.tex37
1 files changed, 37 insertions, 0 deletions
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}
+}