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

2
  • 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, 2013 at 17:10
  • There's the sidenotes package and the snotez package. IIRC the memoir class also provides sidenotes.
    – cgnieder
    Oct 12, 2013 at 17:27

2 Answers 2

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

1
  • thanks,it's simple and beautiful, Does not use any package or class.that is the best.
    – wanze
    Oct 13, 2013 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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .