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 using the latex commnad \marginpar{}, however for some reason I get the warning:

Underfull \hbox <badness 10000> in paragraph ...   

each time I create a comment on the margin. Is there any way to avoid this?

This is how I use \marginpar{}:

\setlength{\marginparwidth}{1.2in}
\let\oldmarginpar\marginpar\reversemarginpar
 \renewcommand\marginpar[1]{\-\oldmarginpar[\footnotesize #1]  {\raggedright\footnotesize #1}}

How could I modify the above? I read that \makebox[0pt]{} might help - but don't understand how?

share|improve this question
    
make a complete example, I do not get an underfull hbox –  Herbert Oct 6 '11 at 10:30

1 Answer 1

I don't understand \-; however, it seems that adding \raggedright also in the optional argument to \oldmarginpar will work as you want:

\let\oldmarginpar\marginpar
\reversemarginpar
\renewcommand\marginpar[1]{%
  \oldmarginpar[\raggedright\footnotesize #1]%
    {\raggedright\footnotesize #1}}
share|improve this answer
1  
Depending on the needs, \RaggedRight defined in the package ragged2e might produce better results. –  Patrick Häcker Jun 24 '12 at 8:53
    
@MMM I concur; the main difference is that \RaggedRight allows hyphenation. This may be desired or not. –  egreg Jun 24 '12 at 9:08

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.