TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
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
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

Your Answer


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.