TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I try to write a longer story. To make the structure more clear I use the command \marginpar. But that is still time consuming when it comes to the point when I need to find a certain passage. That is the reason, why it would be helpful to have some kind of Table of Marginpars.

My question: Is it possible to force the marginpar elements to appear in the ToC and/or even better in a separated Table of Marginpars?

Note: I am aware that an alternative solution could be to define the section command in a way that it is typeset as a marginpar.

share|improve this question
up vote 3 down vote accepted

I picked an example from this TeXblog.org entry on "new lists of..." and added a hint for adding definitions to macros (since I was not in the mood to look for \marginpar definition and rewrite it) from this other TeXblog.net entry on \expandafter

% First we create new list of marginpars with the help of tocloft package:
\newcommand{\listmarginparname}{List of Margin Pars}
% Then we define a command that increments a counter and writes it in the created list
% Now we have to make \marginpar command to include the counting macro
\section{Two marginpars}
\blindtext \marginpar{First Marginpar Test}
\blindtext \marginpar{Second Marginpar Test}
\section{One marginpar}
\blindtext \marginpar{Third marginpar Test}

and it worked.

share|improve this answer
Thank you. That works perfectly well. – Philip Feb 23 '12 at 10:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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