2

A wrapfigure on the left side of the page interferes with the mechanism that marginnote uses to determine horizontal position, pushing it to the right by the width of the wrapfigure.

The marginnote package has the macros \marginnoteleftadjust and \marginnoterightadjust for custom horizontal adjustment, but I haven't had any luck getting these to move the notes at all.

\documentclass{article}

\usepackage{wrapfig}
\usepackage{marginnote}
\usepackage{lipsum}
\usepackage{graphicx} 

\begin{document}

\begin{wrapfigure}[8]{L}{3cm}
  \includegraphics[width=3cm]{example-grid-100x100pt} 
\end{wrapfigure}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum
\marginnote{This margin note is too far right}
\lipsum[1-2]
\marginnote{This one is not too far right}
\lipsum[3]
\end{document}

enter image description here

5

The problem is that the outer \parshape is used inside the marginnote too and so the first line of the margin note are indented like the lines of your paragraph. marginnote imho should better use \parbox instead of the primitive \vbox then the code from wrapfig which tries to avoid this side effects would have a chance. You can try this patch:

\documentclass{article}

\usepackage{wrapfig}
\usepackage{marginnote}
\usepackage{lipsum}
\usepackage{graphicx,tikz}
\usepackage{xpatch}


\makeatletter %two replacements!
\patchcmd\@mn@@@marginnote{\hsize\marginparwidth}{\@parboxrestore\hsize=\marginparwidth}{}{\fail}
\patchcmd\@mn@@@marginnote{\hsize\marginparwidth}{\@parboxrestore\hsize=\marginparwidth}{}{\fail}
\makeatother


\begin{document}


\begin{wrapfigure}[8]{L}{3cm}
  \includegraphics[width=3cm]{example-grid-100x100pt}
\end{wrapfigure}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum\marginnote{This margin note is too far right} 

\lipsum[1-2]
\marginnote{This one is not too far right}
\lipsum[3] 
\end{document}

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.