I have a macro (defined with the xparse package) that creates a marginnote
. It works as I would like when prepended to normal paragraph text:
\NewDocumentCommand\dates{m g}{%
\IfNoValueTF{#2}
{\marginnote{\scriptsize{#1}}}
{\marginnote{\scriptsize{#2\\#1}}}}
I'd like to use it in a similar way against an item
in a description
environment, something like:
\begin{description}
\item[Coding and data representation] \dates{June 2009}{September 2009} Some description
\end{description}
However the above snippet places the margin note under the label text, I would like it to appear on the far left of the page lined up with with item. I am happy to create a NewDocumentEnvironment
with xparse if that would help me achieve this easier and I am open to better ways of achieving this sort of layout.
Here is a minimal example replicating the issues:
\documentclass{article}
\usepackage{xparse}
\usepackage{marginnote}
\begin{document}
\NewDocumentCommand\dates{m g}{%
\IfNoValueTF{#2}
{\marginnote{\scriptsize{#1}}}
{\marginnote{\scriptsize{#2\\#1}}}}
\renewcommand*{\raggedleftmarginnote}{}
\setlength{\marginparsep}{7pt}
\reversemarginpar
\begin{description}
\item[Coding and data representation] \dates{June 2009}{September 2009} Some description
\end{description}
\end{document}
marginnote
andxparse
. Also include the versions of these packages by adding\listfiles
before\documentclass
, and include that in an edit to your question.