My document contains some info graphics in the margin.
I realise it by the marginnote
package.
How do I align the top of an image to the top of the paragraph (\baseline+\height
) with different factors in \setstretch
?
Here is a MWE:
\documentclass{scrartcl}
% load packages
\usepackage{blindtext, setspace}
\usepackage{marginnote}
\usepackage{showframe}
\renewcommand*{\marginfont}{\tiny}
\begin{document}
\raggedleft
\blindtext
\marginnote{\rule{5mm}{20mm}}
X
\blindtext
\clearpage
\setstretch{1.6}
\blindtext
\marginnote{\rule{5mm}{20mm}}
X
\blindtext
\end{document}
The interesting parts are the top alignment of X
to the top of \rule
.
A small difference with no setstretch
:
And a bigger difference with \setstretch{1.6}
:
My aim is, to align the top of the X with the top of the image by a length variable, to be independent from different line spaces.
Edit:
Unfortunately, I forget one command in my MWE.
I add the line \renewcommand*{\marginfont}{\tiny}
because I would like to have a solution which is independent of the size of the chosen fontsize in marginnote.
I tried to get the correct length in raise=
but I failed.
Is this possible?