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.

In many bibliography styles repeating authors are indicated with three emdashes, forming a single line. This works well with some fonts, while for others it leaves gaps:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\newcommand*{\threeemdashes}{\textemdash\kern-1pt\textemdash\kern-1pt\textemdash}

\begin{document}
\raggedright
\fontfamily{lmr}\selectfont%
Latin Modern \textemdash{}\textemdash{}\textemdash{} Latin Modern \linebreak
Latin Modern \threeemdashes{} Latin Modern \linebreak
Latin Modern \rule[0.6ex]{2.3em}{.4pt} Latin Modern\linebreak
Latin Modern mmm Latin Modern


\fontfamily{LinuxLibertineO-OsF}\selectfont
Linux Libertine \textemdash{}\textemdash{}\textemdash{} Linux Libertine \linebreak
Linux Libertine \threeemdashes{} Linux Libertine \linebreak
Linux Libertine \rule[.55ex]{2.2em}{.5pt} Linux Libertine\linebreak
Linux Libertine mmm Linux Libertine
\end{document}

As you can see, I tried to fiddle with the kerning by myself, but this does not scale well, compare, e.g., {\tiny\threeemdashes} and {\Huge\threeemdashes}. I already learned that I can not fix this with additional kerning pairs myself, via TeX at least. I even tried to paint a long rule by hand, but that does not scale either, and LaTeX rules are rectangles, while the rounded ends of the dashes look much better. Moreover, getting the right values for thickness and raise seems hard. To my surprise I also learned that emdashes are not as wide as m in most fonts, and the length 1em does not describe the width of an m!?

I would figure that this is not a niche problem, and many solutions should be around. So is there a One True Solution that scales with font size, font type etc.?

And yes, I absolutely want to use pdflatex.

share|improve this question
2  
I haven't the font so can't test but if you changed your -1pt to a font dependent length like -0.1em it would scale better with font size changes. –  David Carlisle Nov 23 '12 at 17:12
1  
Of course unicode has a character for that: U+2E3B. So using that would be an option - iff you find a font or a typesetting machine that honors that. –  Martin Schröder Nov 24 '12 at 12:32
    
@MartinSchröder Good to know! Unfortunately, this glyph is seldomly implemented, at least it seems so (I just scanned Latin Modern and Libertine, the fonts in my question.) –  mafp Nov 24 '12 at 16:58
    
@mafp: It is quite new in Unicode 6.1 –  Martin Schröder Nov 24 '12 at 17:04
add comment

2 Answers

up vote 6 down vote accepted

As already said, the quad is not necessarily the width of an uppercase M, but rather what the font designer thought best.

A way to get a long dash could be this:

\documentclass[a4paper]{article}

\newcommand*{\threeemdashes}{%
  \makebox[3\fontcharwd\font`M]{% or \makebox[3em]
    \rlap{\textemdash}\kern.5em
    \cleaders\hbox{\kern-.3em\textemdash\kern-.3em}\hfill\kern.5em
    \llap{\textemdash}}%
}

\begin{document}

\raggedright
\fontfamily{lmr}\selectfont%
Latin Modern \threeemdashes{} Latin Modern \linebreak
Latin Modern MMM Latin Modern

\fontfamily{LinuxLibertineO-OsF}\selectfont
Linux Libertine \threeemdashes{} Linux Libertine \linebreak
Linux Libertine MMM Linux Libertine

\end{document}

The three em dash is produced by repeating dashes making sure that there's a suitable amount of backup and that the width is exactly what we want.

enter image description here

share|improve this answer
    
Thanks, that is perfect! And I even learned some new TeX (cleaders, fontcharwd). Great. –  mafp Nov 23 '12 at 21:44
add comment

the ams document classes define this rule as

\def\bysame{\leavevmode\hbox to3em{\hrulefill}\thinspace}

which completely avoids any possible gaps between em-dashes.

regarding the length of 1em, it is traditionally the same value as the nominal size of the particular font, and does not depend on the style of the font; even in an extended or compressed font, 1em = 10pt for a 10pt font. the letter "M" might or might not be 1em wide, although it often is in an ordinary medium or "book" weight font. also, the em-dash in a particular font, in metal, would be on a block that is 1em square; however, the printable width of the dash might or might not encompass the entire width, depending on the whim of the font designer. this discrepancy carries over to digital type.

share|improve this answer
    
Thank you, I learned something today (about 1em). But that means that ams does not care about the surrounding font, because the rule has always the same height, right? Maybe I am too obsessed with such details, but I chose egreg's answer. Upvote nonetheless. –  mafp Nov 23 '12 at 21:42
1  
you are correct that the thickness of the \hruule doesn't change. however, the ams style, as illustrated in the first edition (1971) of "mathematics into type", by ellen swanson, is to place the dash at the baseline, and not at the usual height of the em dash. this is not a universal practice; "chicago" places the dash at em-dash height. there are not many composition manuals devoted to technical works, so i haven't been able to determine the history of the lowered version. no guidance from knuth; he repeats the complete author names in his works. –  barbara beeton Nov 24 '12 at 17:41
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.