1

I'm drafting a document using a required style file for a conference, which is a two sided style. (i.e. odd and even pages are different.)

During the drafting process, I like to use the marginnote package to put comments to myself and colleagues in the margin. Sometimes I want these notes to appear on the right and sometimes the left. I know that the side the notes appear on can be controlled using \reversemarginpar and \normalmarginpar.

However, since it's a two-sided document, the side that's considered "normal" changes depending on whether it's an odd or an even page. I don't want that. How can I put a note in the margin that will always be on the right or always on the left, regardless of odd or even pages?

Note that this is only a 'temporary' measure, in that all margin comments will be removed before submitting the paper, so if the solution changes (for example) the running head etc. I don't mind. However, I don't want to remove the style file or use a different one, since it's important to make sure the text will fit within the page limit when the final style is applied.

The following mwe demonstrates the issue, using the twoside option to the article class instead of a style file. (Sorry it's not quite as minimal as it could be - it seems there has to be a certain amount of text on the page otherwise \marginnote just goes mad and positions things randomly, but that's a separate issue.)

\documentclass[a4paper,twoside]{article}

\usepackage[margin=1.75in,marginparwidth=1.4in]{geometry}

\usepackage{marginnote}

\begin{document}
Some text.
{\marginnote{On the right}}%
{\reversemarginpar\marginnote{On the left}}%
Some more text.

Some more text.

Some more text.

Some more text.
{\marginnote{Still right}}%
{\reversemarginpar\marginnote{Still left}}%
Some more text.

Some more text.

\raggedbottom
\pagebreak

Some text.
{\marginnote{On the right?}}%
{\reversemarginpar\marginnote{On the left?}}%
Some more text.

Some more text.

Some more text.
{\marginnote{Still right?}}%
{\reversemarginpar\marginnote{Still left?}}%
Some more text.

Some more text.

\end{document}

Page 1 of the output looks like this:

enter image description here

but page 2 looks like this, with the "normal" marginpars on the left and the "reverse" ones on the right.

enter image description here

(Note: there are some similar old questions, but as far as I can tell none quite cover my situtation. This one, this one and this one could all be solved with a twoside=semi option that the third-party style file I'm using doesn't accept, the solution to this one seems to be specific to a two-column document, and the solutions to this one seem to put all the notes on the left, so that \reversemarginpar cannot be used to put them on the right.)

1
1

Putting my comments to a full answer... here's what could potentially solve your issue:

Define two new commands \leftmarginnote{...} and \rightmarginnote{...} that would work equally across even and odd pages.

\documentclass[a5paper,twoside]{article}

\usepackage[margin=1.75in,marginparwidth=1.4in]{geometry}
\usepackage{marginnote}

\usepackage{ifthen,changepage}
\usepackage{xargs}

\newcommandx{\leftmarginnote}[2][2=0pt]
           {\checkoddpage
            \ifoddpage
              {\reversemarginpar\marginnote{#1}[#2]}
            \else
              {\marginnote{#1}[#2]}
            \fi}
\newcommandx{\rightmarginnote}[2][2=0pt]
           {\checkoddpage
            \ifoddpage
              {\marginnote{#1}[#2]}
            \else
              {\reversemarginpar\marginnote{#1}[#2]}
            \fi}

\begin{document}
Some text.
\rightmarginnote{On the right}%
\leftmarginnote{On the left}%

Some more text.

Some more text.

Some more text.

Some more text.
\rightmarginnote{Still right}%
\leftmarginnote{Still left}%

Some more text.

Some more text.

\raggedbottom
\pagebreak

Some text.
\rightmarginnote{On the right!}%
\leftmarginnote{On the left!}%

Some more text.

Some more text.

Some more text.
\rightmarginnote{Still right!}%
\leftmarginnote{Still left!}%

Some more text.

Some more text.

\end{document}

I changed the papersize to A5, to get a full compact screenshot.

Margin Notes fixed

2
  • Thank you, this is great! Sorry for the delay accepting it. I hope you don't mind, I edited your solution to pass on marginnote's optional argument, which determines the vertical position of the note. Feel free to revert or change my edit if you don't like that or see a better way to do it.
    – N. Virgo
    Jun 5 '21 at 0:38
  • 1
    Whatever works best for your problem is your answer. In fact I came to learn the \newcommandx from your edit-- Thanks for that !
    – Partha D.
    Jun 5 '21 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.