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 use this command to show the headword in dictionary.

\newcommand{\entry}[2]{\hangpara{2em}{1}\textsf{\textbf{#1}}\ #2 \markboth{#1}{#1}\par}\nopagebreak[4]

When the headword is exactly as long as the line, there appears an extra line below the headword. What can I do with it?

share|improve this question
    
Welcome to TeX.sx! It's not necessary to sign your questions (as there is already a box with your username below it) or to begin them with a greeting. –  Andrey Vihrov Oct 5 '11 at 16:33
1  
If, by "headword" you mean the entire contents printed by \entry (in other words, both arguments #1 and #2), does removing the space between #2 and \markboth correct the behaviour? –  Werner Oct 5 '11 at 16:40
2  
It is always best to compose a MWE that exactly illustrates the problem including the \documentclass so that those trying to help don't have to recreate it. –  Peter Grill Oct 5 '11 at 16:47
    
Yes, removing the space between #2 and \markboth corrected the behaviour. Thank you. –  chejnik Oct 5 '11 at 17:46
add comment

1 Answer

up vote 8 down vote accepted

The spurious space between #2 and \markboth might cause an unexpected line break at the end of typesetting #2 if #2 finishes close to the line margin. As such removing it should fix your "extra line" problem.

share|improve this answer
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.