23

I'm trying to use marginnote on document class book with twoside, but I can't see to get the margin notes strictly on the left. I don't want to be putting \reversemarginpar on all the odd pages. Can someone help me or direct me to help please.

lockstep
  • 250,273

1 Answers1

19

You can use the etoolbox package to patch the \@mn@margintest command to set \if@tempswa to be always true and then issue a global \reversemarginpar:

\documentclass[twoside]{book}
\usepackage[centering,marginparwidth=2.5cm,paperheight=10cm]{geometry}
\usepackage{marginnote}
\usepackage{lipsum}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\@mn@margintest}{\@tempswafalse}{\@tempswatrue}{}{}
\patchcmd{\@mn@margintest}{\@tempswafalse}{\@tempswatrue}{}{}
\reversemarginpar 
\makeatother

\begin{document}

\lipsum[1]\marginnote{test test test test test}
\lipsum[1-2]\marginnote{test test test test test}
\lipsum[1-2]\marginnote{test test test test test}
\lipsum[1-2]\marginnote{test test test test test}
\lipsum[1-2]\marginnote{test test test test test}
\lipsum[1-2]

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • Gonzalo Medina, thank you so much!!!!!!!!!!!!!!! It works perfect! – jorge aldana Sep 22 '12 at 18:36
  • 1
    If you want it on the right instead, leave off the \reversemarginpar in Gonzalo's answer. I'm mentioning this because it took me a bit to figure it out. Also it is much simpler than Gonzalo's answer to the same problem here. (This should be a comment, but I don't have have enough reputation.) – Jason Rute Apr 21 '13 at 04:10
  • 3
    This solution has recently stopped working with an updated version of marginnote I think... – Bart Snapp Sep 07 '18 at 15:46
  • Can this patch be used with sidenotes also? – Damitr Apr 20 '21 at 10:22