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’m adding explanations for definitions in the margin paragraph. I have a macro which looks as follows (simplified):

\newcommand*\define[2]{%
  \marginpar{{\sffamily\footnotesize\textbf{#1}: #2}}}

This works fine, but unfortunately it uses the baseline skip from the main text, which is of course much too large for the footnote-sized font.

So I tried changing the inter-line spacing, but to no avail. These are the two alternatives that I have tried:

  1. Using \fontsize instead of \footnotesize:

    \marginpar{{\sffamily\fontsize{8}{8}\selectfont\textbf{#1}: #2}}
    
  2. Setting \baselineskip:

    \marginpar{{%
      \sffamily\footnotesize%
      \setlength\baselineskip{1ex}%
      \textbf{#1}: #2}}
    

Neither variant works (and I’ve tried other values: the inter-line spacing won’t budge). So here’s my question:

How do I re-assign the baseline skip for margin paragraphs?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

Add \par after #2. (No, I don't know why this works.)

EDIT: Or simply omit the additional set of braces in the macro definition.

\documentclass{article}

\newcommand*\defineA[2]{%
  \marginpar{{\sffamily\footnotesize\textbf{#1}: #2}}}

\newcommand*\defineB[2]{%
  \marginpar{{\sffamily\footnotesize\textbf{#1}: #2\par}}}

\newcommand*\defineC[2]{%
  \marginpar{\sffamily\footnotesize\textbf{#1}: #2}}

\usepackage{blindtext}

\begin{document}

Some text.\defineA{foo}{\blindtext} \blindtext

\clearpage

Some text.\defineB{foo}{\blindtext} \blindtext

\clearpage

Some text.\defineC{foo}{\blindtext} \blindtext

\end{document}
share|improve this answer
2  
Ah. I think I know what the problem is … the inter-line spacing can only be set for the whole paragraph. If I force a re-set before the end of the paragraph (implied by the \endgroup) then my changing the value doesn’t have any effect. –  Konrad Rudolph Mar 4 '11 at 9:51
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.