0

Please see my MWE. I would like the \marginnote paragraph to be aligned with the point in which I invoke it. In the inner margin I have a wrap figure environment that contains text very big (46pt). If I don't use \sloppy, text of margin paragraph and of main paragraph overlap. If I use \sloppy, I run into problems with alignment. Please, what am I doing wrong? Thanks.

\documentclass[10pt]{book}
\usepackage{lipsum}
\usepackage{marginnote}
 \renewcommand*{\marginfont}{\scriptsize \sffamily}
   \renewcommand\raggedrightmarginnote{}
\renewcommand\raggedleftmarginnote{}

\usepackage[ paperwidth=160mm, paperheight=240mm, textheight=18cm, textwidth=8cm, inner=2cm, marginparwidth=2.5cm, marginparsep=0.5cm] {geometry} \usepackage{wrapfig} \usepackage{fontspec} \begin{document} %\sloppy

\newpage

\paragraph{First} \begin{wrapfigure}{i}{0.64\textwidth}% \vspace{5pt} \noindent {\fontsize{46pt}{46pt}\selectfont \hspace{-5pt} Big} \end{wrapfigure} This\marginnote{I want this to be aligned. \lipsum[1]} is a paragraph. \lipsum[1]

\newpage

\paragraph{First} \begin{wrapfigure}{i}{0.64\textwidth}% \vspace{5pt} \noindent {\fontsize{46pt}{46pt}\selectfont \hspace{-5pt} Big} \end{wrapfigure} This\marginnote{I want this to be aligned. \lipsum[1]} is a paragraph. \lipsum[1]

\newpage \paragraph{Forth} \begin{wrapfigure}{i}{0.64\textwidth}% \vspace{5pt} \noindent {\fontsize{46pt}{46pt}\selectfont \hspace{-5pt} Big} \end{wrapfigure} This\marginnote{I want this to be aligned. \lipsum[1]} is a paragraph. \lipsum[1]

\end{document}

Haim
  • 487
  • When I compile it (yes, with xelatex) in page 3 the paragraph at the margin shift one line down. – Haim Aug 22 '23 at 14:10
  • I see that if I place the \marginnote immediately after the \paragraph, it gets solved. But in my real world text I'm running into a lot of misalignment issues that I'm not able to correct... So I don't know if you can see something in my setup that could bring to problems? – Haim Aug 22 '23 at 14:21
  • It appears that the margin note is being aligned to "is" instead of "This". If you place a ~ between the two, "is" gets moved up to the same line as "This". The difference is due to "Fourth" vs. "First". – John Kormylo Aug 22 '23 at 14:29
  • Plcing the margin nute in front of "This" instead of after works. – John Kormylo Aug 22 '23 at 14:44
  • Yes you are right. Then it means that I have to solve problem by problem in my book... But you are confirming that the way I'm using \wrapfigure together with \marginnote is fine? Thanks – Haim Aug 22 '23 at 14:58
  • Wrapfigure doesn;t really change the text (except for the margins). Now a marginnote inside the wrapfigure would be another problem altogether. – John Kormylo Aug 22 '23 at 15:01
  • Understood thanks – Haim Aug 22 '23 at 15:22
  • Please see this related question: https://tex.stackexchange.com/questions/694149/page-number-alignment-when-using-marginnote – Haim Aug 23 '23 at 00:08

0 Answers0