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.

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

With pdfLaTeX, I can print two hyphens using -{}-. This does not seem to work in LuaLaTeX.

Indeed, the following snippet

    en dash -- two dashes -{}-


en dash — two dashes --

when compiled with pdflatex, but

en dash — two dashes —

when compiled with lualatex.

How do I print -- in LuaLaTeX without disabling ligatures completely?

share|improve this question
up vote 9 down vote accepted

I suppose you don't want to introduce break points at the double hyphen. Here's a way.

%\usepackage{fontspec} % works also with fontspec

\newcommand{\texthyphen}{} % ensure \texthyphen is not defined

en dash -- two dashes \texthyphen\texthyphen

\textit{en dash -- two dashes \texthyphen\texthyphen}

\textbf{en dash -- two dashes \texthyphen\texthyphen}

\strut \vrule-\vrule\ \textit{\vrule-\vrule} \textbf{\vrule-\vrule}

The \protected is just to avoid the command being expanded when in moving arguments, but it's not really necessary.

I add a graphic analysis of the hyphen's placement with respect to its bounding box.

enter image description here

share|improve this answer
Just to clarify: The methods that rely on using an italics correction, -\/-, or an explicit zero-width kern, -\kern0pt- don't allow line breaks either between the two dashes. – Mico Nov 24 '13 at 18:51
@Mico This is true for LuaLaTeX, but not for pdflatex or XeLaTeX – egreg Nov 24 '13 at 19:22

Indeed, the method of breaking up ligatures by inserting an empty TeX group, {}, does not work in LuaTeX and LuaLaTeX. To prevent the creation of an en-dash, then, you could insert a "zero-width kern", i.e.,


or an explicit "italic correction", i.e.,


With either method, LuaTeX will not insert a line break between the two dashes.

If you have many instances of such double-dashes, you may want to create a dedicated macro called, say, \dbldash, to streamline your typesetting:


Here's an illustration of the result of using \dbldash:

enter image description here

\setmainfont[Ligatures=TeX]{Latin Modern Roman}
\newcommand\dbldash{-\kern0pt-\ }
dash - endash -- double-dash \dbldash

Aside: At least if the Computer Modern (and Latin Modern) font family is in use, employing either the -\kern0pt- or the -\/- method while in italics mode will result in slightly more whitespace being inserted between the two dashes; this amount is the same irrespective of which of the two methods is in use. The cause of this increased space between the dashes would appear to be the fact that the "side-bearing" (the glyph-associated white-space) in front of (but not the one behind) the dash-character is slightly more generous in the italic font shape than they are in the upright font shape.

Addendum: @egreg's parallel answer shows explicitly that there's a non-zero side-bearing in front of but not behind the dash character when it occurs in italic mode, at least for the Computer Modern font family. In contrast, there's a somewhat smaller non-zero side-bearing after, but not before, the dash character in the plain-upright and bold-upright font shapes. These differences in side-bearings cause the differences in whitespace between the plain-upright and italic font shapes.

share|improve this answer
Thanks for the detailed explanations! I wonder why {} doesn't work anymore though. – Clément Nov 24 '13 at 16:48
@Clément - I guess you'd have to ask the authors of LuaTeX... I suppose they did so because various house-keeping chores are simplified if empty text-mode TeX groups (or anything that evaluates to an empty TeX group) are removed prior to commencing the paragraph-building process. – Mico Nov 24 '13 at 17:00

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.