about summary refs log tree commit diff stats
path: root/common/latex/preamble/core/margindate.tex
diff options
context:
space:
mode:
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}
+}