Text FormattingMargin notes like footnotes?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
erasmuse
Posts: 2
Joined: Wed Jul 11, 2012 8:41 pm

Margin notes like footnotes?

Post by erasmuse »

MARGINAL NOTES WITH NUMBERS
Here's a way to have a floating margin note, with special numbers for the marginal notes with an "m" before each number so the footnotes are m1, m2, m3, etc.

Code: Select all

\newcommand{\margincomment}[1]{% a simple margin note
        \refstepcounter{mynote}% step counter
        \mbox{\textsuperscript{\themynote  }*}% the number (superscript) in text followed by a star
        \marginpar{\tiny \mbox{ \textsuperscript{\themynote}*}#1}% the note with number
}
\newcounter{mynote}% a new counter for use in margin notes


Here is my text.\margincomment{Here is my marginal note.}
Last edited by Stefan Kottwitz on Wed Jul 11, 2012 9:58 pm, edited 1 time in total.

Recommended reading 2024:

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

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

erasmuse
Posts: 2
Joined: Wed Jul 11, 2012 8:41 pm

Margin notes like footnotes?

Post by erasmuse »

Oops-- in my last post I submitted a version that has not m preceding but * after the number. Here's the m versino.

MARGINAL NOTES WITH NUMBERS
Here's a way to have a floating margin note, with special numbers for the marginal notes with an "m" before each number so the footnotes are m1, m2, m3, etc.

Code: Select all

\newcommand{\margincomment}[1]{% a simple margin note
        \refstepcounter{mynote}% step counter
        \mbox{\textsuperscript{m\themynote  } }% the number (superscript) in text preceded by m
        \marginpar{\tiny \mbox{ \textsuperscript{m\themynote} }#1}% the note with number
}
\newcounter{mynote}% a new counter for use in margin notes



Here is my text.\margincomment{Here is my marginal note.}
Last edited by Stefan Kottwitz on Wed Jul 11, 2012 9:58 pm, edited 1 time in total.
themarshian
Posts: 3
Joined: Wed Jul 11, 2012 8:16 pm

Margin notes like footnotes?

Post by themarshian »

Thanks for this! Two questions.
1) I would like to have my margin notes in the opposite margin. I tried to change the \marginpar to \reversemarginpar, but it did not work. It actually put my margin notes into the main body of text!
2) Is there any way to have these fit into paragraph style? (I use the fnpara package to accomplish a similar effect with my footnotes.)
Thoughts?
James

EDIT: Sorry, I just realized that I was just reading page 2 of this conversation. I am currently using the solution presented by erasmuse, but am willing to try another, if it might work better.
Thanks!
Last edited by cgnieder on Tue Oct 16, 2012 11:07 am, edited 1 time in total.
boitata
Posts: 8
Joined: Tue Nov 15, 2016 3:05 am

Margin notes like footnotes?

Post by boitata »

That's an excellent solution. I will use it, but I have a problem: the margin note using \mynote{This is a margin note example} uses a line and half spaces. How can I do margin notes with single line spacing? Regards.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Margin notes like footnotes?

Post by Stefan Kottwitz »

Hi boitata!

It may be better to post your question in a new topic. It is hard to see on the bottom of page 2 of this topic of 2011/2012. And please post your code with the problem, because it's hard to reproduce with the old code snippets from above that may not match your code anyway.

Stefan
LaTeX.org admin
Post Reply