two-em dash?

21 views
Skip to first unread message

Col. Sicherman

unread,
Sep 26, 1994, 8:34:47 PM9/26/94
to
How do you print a two-em dash in TeX? I've tried two em-dashes with
a negative kern, but TeX sometimes breaks it in the middle, even with
\nobreaks inserted.

-:-
Since barbarisms like "1th" and "3th" are barbaric, synonyms
like "1st" and "3st" are accepted as well.

--B. W. Kernighan, "PIC -- A Graphics Language for
Typesetting: Revised User Manual"
--
Col. G. L. Sicherman
g...@hrcms.ATT.COM

Donald Arseneau

unread,
Sep 29, 1994, 6:30:00 AM9/29/94
to
In article <36cm2l$d...@wizard.uark.edu>,

g...@hrcms.att.com (Col. Sicherman) writes:

>How do you print a two-em dash in TeX? I've tried two em-dashes with
>a negative kern, but TeX sometimes breaks it in the middle, even with
>\nobreaks inserted.

Dan Leuking makes a correct comment, but incorrect assessment:

% TeX will break a line before a \kern if it is immediately followed by
% glue. Amazingly, of all the permissable break points, this one ignores
% adjacent penalties! etc...

That is not the problem. The break is occuring at an explicit hyphenation
point, with penalty \exhyphenpenalty. This is the same way TeX allows
breaks at hyphenated-compound-words, but the break is allowed not only
after hyphen characters, but also any ligature ending with the hyphen
character. This includes ---.

Several solutions:

\mbox (or \hbox):

\mbox{---\kern-1pt---} \mbox{---}\kern-1pt---

The second is better because it allows a linebreak at the very end;
which could be done explicitly with:

\mbox{---\kern-1pt---}\penalty\exhyphenpenalty

Or, you can type the em-dash character without using a ligature:

\char"7C\kern-.1em---
|\kern-1pt---

Donald Arseneau as...@reg.triumf.ca

Daniel Luecking

unread,
Sep 28, 1994, 5:09:41 PM9/28/94
to
g...@hrcms.att.com (Col. Sicherman) writes:

>How do you print a two-em dash in TeX? I've tried two em-dashes with
>a negative kern, but TeX sometimes breaks it in the middle, even with
>\nobreaks inserted.

TeX will break a line before a \kern if it is immediately followed by


glue. Amazingly, of all the permissable break points, this one ignores

adjacent penalties! Also, it doesn't behave like glue alone in that a
break can occur even if the preceeding item is discardable. The solution
is to make sure that no glue sneaks in after the \kern, or use glue only
(with \nobreak). Thus either of the following should work (I am
guessing at the dimension -.2em):

---\kern -.2em---
---\nobreak\hskip-.2em---

If they don't work, then wrap it up in an \hbox.

Dan Luecking

--
luec...@comp.uark.edu | Anti-disclaimer:
Department of Mathematical Sciences | You are free to ascribe any
University of Arkansas | opinions herein contained
Fayetteville, AR 72701 USA | to anyone or anything.

Reply all
Reply to author
Forward
0 new messages