Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a main text column with margin a line separation of 1.05 (\setstretch{1.05}), and margin texts generated with a tighter line separation with the following macro:

\newcommand{\mnote}[1]{\marginpar{\raggedright\textsf{\footnotesize{%
\textsf{\footnotesize{%
\begin{spacing}{1.025}%
#1%
\end{spacing}%
}}}}}}%

This results in the following output, where the margin paragraph is not properly algined with the first line of the paragraph of the adjacent main text:

misaligned margin note

This is kind of a tough problem to solve. Does someone have any suggestions?

share|improve this question
    
It's not entirely clear what you want the output to be. The baseline of the marginpar text should align with the baseline of the line of the main text? –  Seamus May 16 '12 at 18:28
    
Beside David’s observation you could also take a look at package marginnote, which places margin notes on the current line. The macro \marginnote provides an optional argument for the vertical adjustment (and the package itself has options regarding this). –  Speravir May 16 '12 at 19:51
    
Yes, the baseline of the marginpar text should be aligned with the baseline of the main text line. –  Koffiman May 18 '12 at 14:45
add comment

1 Answer

up vote 5 down vote accepted

It's the spacing environment:

enter image description here

\documentclass{article}
\usepackage{setspace}

\newcommand{\mnote}[1]{\marginpar{\raggedright
\textsf{\footnotesize{%
\begin{spacing}{1.025}%
#1%
\end{spacing}%
}}}}

\newcommand{\mnoteb}[1]{{\marginpar{\raggedright\sffamily\footnotesize
\setstretch{1.025}%
#1}}}

\def\a{One two three four five. }

\begin{document}
\setstretch{1.5}

\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\mnote{\a\a}
\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\mnoteb{\a\a}
\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a
\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a

\end{document}
share|improve this answer
    
Works perfectly. Thank you. –  Koffiman May 18 '12 at 14:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.