0

I sometimes put longer texts in a \marginpar{...}-command and if the text where the \marginpar{...}-command is located is at the end of a page the text falls off the page instead of being placed on the next page or moves up to line up with the regular text block:

\documentclass[a4paper,11pt]{memoir}

\usepackage{lipsum}

\begin{document}
\lipsum[1]
\lipsum[1]
\lipsum[1]
\marginpar{\lipsum[1]}
\pagebreak
\lipsum[1] 
\end{document}

How can I prevent this from happening besides of putting the \marginpar{...} elsewhere in the text?

2
  • 1
    Try with \marginpar{\parbox[b]{\marginparwidth}{\lipsum[1]}}. – Bernard Oct 9 '19 at 13:53
  • @Bernard that works, if you write it as an answer I will accept it. – Ackdari Oct 9 '19 at 14:07
1

Surprisingly, there doesn't seem to be any vertical placement key for the placement of marginboxes in one of the dedicated packages. As a workaround, you can put its contents in a \parbox using one of these keys:

\documentclass[a4paper,11pt]{memoir}
\usepackage{xcolor, lipsum}

\begin{document}

\color{blue}
\lipsum[1-3]
\marginpar{\parbox[b]{\marginparwidth}{\color{red}\lipsum[11]}}

\color{black}
\lipsum[4-10]

\end{document}} 

enter image description here

0

The memoir class provides several means of placing text in the margin.

\marginpar Text put in the margin level with where the macro is called but vertical space is applied between sequential notes if they would overlap.

\sidepar Text put in the margin level where the macro is called but does not float like \marginpar so texts may overlap.

\sidebar Like \marginpar but the text starts near the top of the page and may continue onto later pages if it is too long for the current page. Multiple \sidebar are set one after the other.

Perhaps you should consider using \sidebar instead of \marginpar.

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.