about summary refs log tree commit diff stats
path: root/common/latex/preamble/core/margindate.tex
blob: 5579f98dd25f01929d5dbcd4ac608d912c997702 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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}
}