summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-marginparside.html
blob: c18b99b122e6a50f24e5d4d68243351f69e8db6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<head>
<title>UK TeX FAQ -- question label marginparside</title>
</head><body>
<h3>Getting <code>\</code><code>marginpar</code> on the right side</h3>
<p/>In an ideal world, marginal notes would be in &#8220;analogous&#8221; places on
every page: notes on an even-side page would be in the left margin,
while those on an odd-side page would be in the right margin.  A
moment&#8217;s thought shows that a marginal note on the left needs to be
typeset differently from a marginal note on the right.  The LaTeX
<code>\</code><code>marginpar</code> command therefore takes two arguments in a
<code>twoside</code> documents: 
<code>\</code><code>marginpar[</code><em>left text</em><code>]{</code><em>right text</em><code>}</code>.  LaTeX uses the
&#8220;obvious&#8221; test to
get the <code>\</code><code>marginpar</code>s in the correct margin, but a booby-trap arises
because TeX runs its page maker asynchronously.  If a
<code>\</code><code>marginpar</code> is processed while page n is being built, but
doesn&#8217;t get used until page n+1, then the <code>\</code><code>marginpar</code> will turn
up on the wrong side of the page.  This is an instance of a general
problem: see

&#8220;<a href="FAQ-oddpage.html">finding if you&#8217;re on an odd or an even page</a>&#8221;.
<p/>The solution to the problem is for LaTeX to &#8216;remember&#8217; which side
of the page each <code>\</code><code>marginpar</code> <em>should</em> be on.  The
<i>mparhack</i> package does this, using label-like marks stored in
the <code>.aux</code> file; the <i>memoir</i> class does likewise.
<dl>
<dt><tt><i>memoir.cls</i></tt><dd><a href="http://mirror.ctan.org/macros/latex/contrib/memoir.zip">macros/latex/contrib/memoir</a> (or <a href="http://mirror.ctan.org/macros/latex/contrib/memoir/">browse the directory</a>); <a href="http://mirror.ctan.org/help/Catalogue/entries/memoir.html">catalogue entry</a>
<dt><tt><i>mparhack.sty</i></tt><dd><a href="http://mirror.ctan.org/macros/latex/contrib/mparhack.zip">macros/latex/contrib/mparhack</a> (or <a href="http://mirror.ctan.org/macros/latex/contrib/mparhack/">browse the directory</a>); <a href="http://mirror.ctan.org/help/Catalogue/entries/mparhack.html">catalogue entry</a>
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=marginparside">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=marginparside</a>
</body>