\marginpar
on the right sideIn twoside
documents, LaTeX makes stirling attempts to put
\marginpar
s in the correct margin (the outer or the gutter margin,
according to the user's command). However, a booby-trap arises
because TeX runs its page maker asynchronously. If a
\marginpar
is processed while page n is being being built, but
doesn't get used until page n+1, then the \marginpar
will turn
up on the wrong side of the page.
The solution to the problem is for LaTeX to 'remember' which side
of the page each \marginpar
should be on. The
mparhack package does this, using marks stored in the .aux
file.