summaryrefslogtreecommitdiff
path: root/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-marginparside.html
blob: 2746486f12f00ff9d656524f9f84b5e296f9b361 (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 &ldquo;analogous&rdquo; 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&rsquo;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
&ldquo;obvious&rdquo; 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&rsquo;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

&ldquo;<a href="FAQ-oddpage.html">finding if you&rsquo;re on an odd or an even page</a>&rdquo;.
<p/>The solution to the problem is for LaTeX to &lsquo;remember&rsquo; 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="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/memoir.zip">macros/latex/contrib/memoir</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/memoir.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/memoir/">browse</a>)
<dt><tt><i>mparhack.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/mparhack.zip">macros/latex/contrib/mparhack</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/mparhack.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/mparhack/">browse</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>