# To kern double em-dashes

In Virginia Woolf's novels, she used double em-dashes quite often. In Latin Modern, the two dashes closely set together without gap. However, In ebgaramond there is a little gap which is quite unpleasant.

I found online this will do the trick:

\newcommand{\dmd}{{{---\kern-1pt---}\penalty\exhyphenpenalty}}


However, it doesn't do it for me, my code is the following in LyX Preamble with document class of Book KOMA-SCRIPT:

\usepackage{ebgaramond}
\usepackage[T1]{fontenc}
\newcommand{\dmd}{{{---\kern-1pt---}\penalty\exhyphenpenalty}}


The text in concern:

This one, thanks to the hospitality of the host, had lasted far into the afternoon. The beautiful October day was fading and the leaves were falling from the trees in the avenue as I walked through it. Gate after gate seemed to close with gentle finality behind me. Innumerable beadles were fitting innumerable keys into well-oiled locks; the treasure-house was being made secure for another night. After the avenue one comes out upon a road---I forget its name---which leads you, if you take the right turning, along to Fernham. But there was plenty of time. Dinner was not till half-past seven. One could almost do without dinner after such a luncheon. It is strange how a scrap of poetry works in the mind and makes the legs move in time to it along the road. Those words------

-
Hello! So you would like the two dashed to become one very long? Try to change -1pt to -0.4em in your code. If it helps, then you can try to find the minimal value that works. –  yo' Feb 2 '13 at 13:01
And 2nd point: you have to input ------ as \dmd{} in your code to make it work. –  yo' Feb 2 '13 at 13:02
Related: Three emdashes bound together –  egreg Feb 2 '13 at 14:11
@tohecz The -0.4em didn't work, whatever I modified the numbers, it doesn't seem to do anything. As regards to your second point of ------, not sure where to put it. In the script it is 6 hyphens... Can you illustrate it clearly? Thank you! –  Shi Yuan Feb 4 '13 at 18:28
Shi Yuan, to use the solution you found, you need to replace any instance of ------ in your document with the new command \dmd. –  Kundor Feb 9 '13 at 15:07

This is called a horizontal bar, also known as a quotation dash. It is used to introduce quoted text (sometimes). This is the standard method of printing dialogue in some languages.

There is no support in the standard TeX fonts, but one can use instead as special macro, or just use an em dash.

\newcommand\hemdash{\hbox{---}\kern-.5em---}


You can do this:

\documentclass{article}
\newcommand\hemdash{\hbox{---}\kern-.5em---}
\begin{document}

This one, thanks to the hospitality of the host, had lasted
far into the afternoon. The beautiful October day was fading and
the leaves were falling from the trees in the avenue as I walked
through it. Gate after gate seemed to close with gentle finality
behind me. Innumerable beadles were fitting innumerable keys into
well-oiled locks; the treasure-house was being made secure for another
night. After the avenue one comes out upon a road---I forget its
name---which leads you, if you take the right turning, along to Fernham.
But there was plenty of time. Dinner was not till half-past seven.
One could almost do without dinner after such a luncheon. It is strange
how a scrap of poetry works in the mind and makes the legs move in
time to it along the road. Those words\hemdash

\end{document}

-
Thanks YL, it works brilliantly. However, the LyX will be passed around proof reader, it will be ideal if the manuscript is modified as little as possible. Is there any possible method to be included in the Preamble? I found this post, but couldn't figured out how it works. blog.cleverly.com/permalinks/322.html –  Shi Yuan Feb 4 '13 at 18:24
@ShiYuan I don't use Lyx. Best post a separate question as to how to add custom macro to Lyx. –  Yiannis Lazarides Feb 12 '13 at 8:24

In comments, you asked for a solution which does not involve modifying the content text, but only the preamble. This is indeed possible, if you change the backend for LyX to LuaTeX. I don't use LyX, but their website says that this is an option for versions later than LyX 2.0. Then change the preamble to this:

\usepackage{ebgaramond}
\usepackage{luatextra}
\begin{luacode*}
local function translate(line)
return string.gsub(line, "%-%-%-%-%-%-", "{---\\kern-.1em---}\\penalty\\exhyphenpenalty")
end

Note that you need to remove the \usepackage[T1]{fontenc} line. We have added a Lua function that searches each line of TeX for ------ (each - must be escaped as %- in Lua patterns), and replaces it with the double em-dash command you found. It should look like this:
With Xe- and LuaTeX I’d try something else. EB Garamond contains U+2015 "Horizontal Bar", U+2E3A "Two-em dash" and U+2E3B "Three-em dash". So you can input it directly. Else, in LuaTex use a feature file with a lookup containing something like sub hyphen hyphen hyphen hyphen hyphen hyphen by uni2015; In XeTeX you’d use a mapping file. –  georgd Apr 14 '13 at 7:42