GeneralCan margin note be used in the math mode?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
umb365
Posts: 6
Joined: Sat Jun 28, 2008 3:19 am

Can margin note be used in the math mode?

Post by umb365 »

Hi all.
I am a new comer for LaTeX. I meet a problem in writing tex.
I wanna add some margin note beside the math equation by \marginpar. but LaTeX tells me: "not in outer par mode".
I have read some documents and searched the internet, but found nothing.
Does LaTeX (or its philosophy) don't "tolerate" margin note in the math mode?

Hope someone can give me some advice.
THANK A LOT advanced.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Can margin note be used in the math mode?

Post by gmedina »

Hi umb365,

You can control the placement of the marginal notes using \vspace, as the following example suggests:

Code: Select all

\documentclass{book} 
\usepackage{amsmath}

\begin{document} 

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
%
\begin{equation}
x^n+y^n=z^n
\end{equation} 
\marginpar{This marginal note will appear after the equation}%
% 
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
% 
\begin{equation}
x^n+y^n=z^n
\end{equation} 
\marginpar{\vspace{-3\baselineskip}This marginal note will appear in front of the equation}%
%
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text 

\end{document}
Of course, according to your needs, you can use any valid LaTeX length as the argument of \vspace.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Can margin note be used in the math mode?

Post by localghost »

Additional capability for marginal notes is provided by the marginnote package.


Best regards and welcome to the board
Thorsten¹
umb365
Posts: 6
Joined: Sat Jun 28, 2008 3:19 am

Re: Can margin note be used in the math mode?

Post by umb365 »

gmedina localghost: Thanks for your warn advice. I will try them. Hope one of them may works.

Thanks for localghost's welcome. ;)

Thanks again.
umb365
Posts: 6
Joined: Sat Jun 28, 2008 3:19 am

Re: Can margin note be used in the math mode?

Post by umb365 »

Aha.

Both of them do work! :D

THANKS both of you.
Post Reply