7

how can i make the marginpar note have a number like footnote command does? just like this picture show, this picture is going to show the marginpar note have the auto numbered label like footnote command does

  • It does not answer the question, but I thought worth mentioning: check the side option of the footmisc package (but it turns all footnotes into marginpars) – henrique Oct 12 '13 at 17:10
  • There's the sidenotes package and the snotez package. IIRC the memoir class also provides sidenotes. – clemens Oct 12 '13 at 17:27
8
\documentclass{article}
\usepackage{blindtext}
\newcounter{mparcnt}
\renewcommand\themparcnt{\textbf{\arabic{mparcnt}: }}
\newcommand\mpar[1]{\refstepcounter{mparcnt}\marginpar{\themparcnt#1}}

\begin{document}
\mpar{test}\blindtext
\mpar{test\label{p:test}}\blindtext
\mpar{test}\blindtext
\mpar{test}\blindtext

See margin~\ref{p:test} for a labeltest
\end{document} 

enter image description here

  • thanks,it's simple and beautiful, Does not use any package or class.that is the best. – wanze Oct 13 '13 at 4:16
1

Just a little improvement, to use the same style as \footnote:

\documentclass{article}
\usepackage{blindtext}
\newcounter{mparcnt}
\renewcommand\themparcnt{\textbf{{}^{\arabic{mparcnt}:}}}
\newcommand\mpar[1]{\refstepcounter{mparcnt}$\themparcnt$ \marginpar{$\themparcnt$ #1}}

\begin{document}
\mpar{test}\blindtext
\mpar{test\label{p:test}}\blindtext
\mpar{test}\blindtext
\mpar{test}\blindtext

See margin~\ref{p:test} for a labeltest
\end{document}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.