Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I was trying to understand what Leslie Lamport said in his book about \marginpar options. He says that

... \marginpar[$\Rightarrow$]{$\Leftarrow$} makes an arrow that points towards the text, whichever margin the note appears in. (Page 59)

I am not sure what he meant by "text". I was hoping that it is the non-marginal text and the arrow would appear in the margin before the margin text. The following is an experiment to test this hypothesis.

\documentclass[11pt]{article}
\usepackage[margin=2in]{geometry}

\begin{document}
This is normal text.%
\marginpar{\em This is a marginal note.}

\vspace{100pt}
This is normal text.%
\marginpar[$\Rightarrow$]{$\Leftarrow$}{\em This is a marginal note.}
\end{document}  

As you can see the hypothesis is false.

enter image description here

Is it possible to make the arrow followed by the marginal note appear in the margin?

EDIT: Apparently, I did not make myself clear in my first attempt. As you can see in the second example (\marginpar with options) the marginal text (in italic) which is supposed to be in the margin is not in the margin anymore. What I was hoping to see is the following.

enter image description here

If this is not what the options for \Marginpar are there for, then I do not see why I need these options.

share|improve this question
1  
Perhaps I am missing something, but doesn't the arrow point towards the text? –  Peter Grill Dec 23 '11 at 3:22
6  
The fact that \marginpar[<left>]{<right>} takes only two arguments (<left> being set on the left of an even page and <right> being set on the right of an odd page) is visualized by the fact that your third "argument" - in your 2nd example - is set as part of the text body, and not as part of \marginpar. I think this note explains it really well. –  Werner Dec 23 '11 at 3:33
    
@PeterGrill: I tried to make it clear with an edit. Hope I succeed. –  Sony Dec 23 '11 at 13:16
1  
You are looking for \marginpar[{\em This is a marginal note.}$\Rightarrow$]{$\Leftarrow${\em This is a marginal note.}} or \marginpar[\emph{This is a marginal note.}$\Rightarrow$]{$\Leftarrow$\emph{This is a marginal note.}}. –  Stephen May 7 '12 at 16:09

2 Answers 2

up vote 8 down vote accepted

lamport didn't say anything about additional text when using the arrows. what he did say is that if you use the option, that's what goes on the odd page instead of what's in the required argument. each argument must be complete with what you want in that margin.

share|improve this answer

What that meant was that in two-sided layouts, marginal text will change sides depending on whether the page is even or odd – and the optional argument to \marginpar will make it set different text in each case. A more full example would be:

\documentclass{book}

\begin{document}
Odd page\marginpar[$\Rightarrow$]{$\Leftarrow$}
\clearpage
Even page\marginpar[$\Rightarrow$]{$\Leftarrow$}
\end{document}

On an odd page, it sets $\Leftarrow$ in the margin. On an even page, it sets $\Rightarrow$. So the arrow is always pointing toward the body text.

To get an arrow pointing toward the margin note, just say:

\marginpar{$\Rightarrow$ Some text}

Or for an arrow that always points from the body to the margin:

\marginpar[Some text$\Leftarrow$]{$\Rightarrow$ Some text}
share|improve this answer
    
This (starting from To get an arrow pointing towards the margin note ... in your answer) is an interesting interpretation. Perhaps, you are right. However, this is not what Lamport said in his book. Quoting Lamport: ... to make an arrow pointing to the text, you need a left pointing arrow in the right margin and a right pointing one in the left margin. Further down he explains: the first argument is optional and the second argument is mandatory. The command \marginpar[$rightarrow$]{$\Leftarrow$} makes an arrow that points towards the text, whichever margin the note appears to be in. –  Sony Dec 23 '11 at 13:26
    
@Sony That means the body text. See my more complete example with the book class. –  rdhs Dec 24 '11 at 8:06

Your Answer

 
discard

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.