LaTeX forum ⇒ 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

Re: Margin notes like footnotes?

Postby erasmuse » Wed Jul 11, 2012 8:42 pm

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.

  1. \newcommand{\margincomment}[1]{% a simple margin note
  2. \refstepcounter{mynote}% step counter
  3. \mbox{\textsuperscript{\themynote }*}% the number (superscript) in text followed by a star
  4. \marginpar{\tiny \mbox{ \textsuperscript{\themynote}*}#1}% the note with number
  5. }
  6. \newcounter{mynote}% a new counter for use in margin notes
  7.  
  8.  
  9. 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.
Reason: code marked

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

Postby erasmuse » Wed Jul 11, 2012 8:45 pm

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.

  1. \newcommand{\margincomment}[1]{% a simple margin note
  2. \refstepcounter{mynote}% step counter
  3. \mbox{\textsuperscript{m\themynote } }% the number (superscript) in text preceded by m
  4. \marginpar{\tiny \mbox{ \textsuperscript{m\themynote} }#1}% the note with number
  5. }
  6. \newcounter{mynote}% a new counter for use in margin notes
  7.  
  8.  
  9.  
  10. 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.
Reason: code marked

themarshian
Posts: 3
Joined: Wed Jul 11, 2012 8:16 pm

Postby themarshian » Tue Oct 16, 2012 12:10 am

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.
Reason: added inline code markup and CTAN link

boitata
Posts: 8
Joined: Tue Nov 15, 2016 3:05 am

Postby boitata » Sat Aug 12, 2017 12:04 am

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: 8296
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sat Aug 12, 2017 11:07 am

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
Site admin


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 5 guests