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?

  • 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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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