2

For marginnotes sized the same as the text, the first line of the marginnote is aligned on exactly the same height as the text line.

enter image description here


I however want the marginnotes to be \footnotesize and be sans-serif. Setting those specifications using

\renewcommand*{\marginfont}{\footnotesize\sffamily}

however leads to the first line of the marginnote not being at the same height as the text.

enter image description here


How can I align the first line of the marginnote with the line of text, i.e. have the Ut purus elit in the marginnote be exactly on the same line as the text on the left?


Complete MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{lipsum}

\usepackage[fulladjust]{marginnote}
\renewcommand*{\marginfont}{\footnotesize\sffamily}

\begin{document}

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

\end{document}
0

1 Answer 1

3

Add a \strut before going into \footnotesize.

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{lipsum}

\usepackage[fulladjust]{marginnote}
\renewcommand*{\marginfont}{\strut\footnotesize\sffamily}

\begin{document}

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

\end{document}

enter image description here

4
  • 1
    30 seconds faster and same answer +1 :-) Jun 16, 2021 at 13:08
  • I was thinking about that too but I noted it messes the horizontal placement of the marginnote, or at least it does on my system, because your snapshot looks fine. Something's weird...
    – campa
    Jun 16, 2021 at 13:22
  • @campa It is strange to contemplate how a vertical strut can mess with horizontal placement. In your case, does it do so even on this simple MWE? Jun 16, 2021 at 13:24
  • Yes it does, but I also get a no-line-to-end-here error from \\ after \lipsum. However I'm working with TL2017, so who knows what else is happening...
    – campa
    Jun 16, 2021 at 13:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .