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 know the conversion of --- to an em-dash is an on-going problem with lualatex. But I don't understand why using Greek in one font should (afterwards) break conversion of 3 hyphens to an em-dash in another.

Here is my code:

%!TEX encoding = UTF-8 Unicode

\setmainfont[Ligatures=TeX]{Linux Libertine O}
\setsansfont[Ligatures=TeX,Scale=MatchLowercase]{TeX Gyre Heros}
%\newfontfamily\myGk[Script=Greek,Scale=MatchUppercase,Ligatures=TeX]{Linux Libertine O}



This is a test---to see if dashes are being converted to emdashes.

\textgreek{Ἐν ἀρχῇ ἦν ὁ λόγος}

This is a test---to see if dashes are being converted to emdashes.


For me, if I run the above code as is, the second "This is a test..." comes out with dashes instead of an em-dash. If I use the Linux Libertine O font for the Greek, I don't have the problem.

Can anyone tell me how I can use the Cambria Greek (which I prefer) without breaking em-dashes in the main font? I am using TeXLive 2012 with Mac TeXShop.

share|improve this question
The problem with Cambria not rendering the --- correctly is due to a bug in luaotfload. – topskip Aug 21 '12 at 20:34
up vote 7 down vote accepted

hold the definition local:

%  {{...}}
share|improve this answer

I think the solution is pretty clear as it is a little bit my fault. (Sorry!)

When I first posted my answer to your previous question here, I made a little mistake, which I corrected later. You, however, did not use the updated version of my answer. This mistakes seems to cause your present problem.

You need to use this:


You see, the fontcommands for the greek font are now enclosed by bgroup ... egroup. Without this, the Greek font is used for the rest of the document and not just for the few Greek words.

Since the em-dash is not part of your Greek font, it does not typeset it. I am currently not able to check my assumption, but I am pretty sure, this is it.

In effect, this is very similar to Herbert's solution, but -- imho -- more elegant and perhaps in some extreme cases even more secure to use.

share|improve this answer
Cambria has the em-dash, but with luaotfload's render=node, it is broken (at the moment). With render=basic the em-dash in Cambria works fine. – topskip Aug 21 '12 at 21:13
The answer is not similar it is the same, \bgroup ... \egroup is not different to {...} – Herbert Aug 22 '12 at 14:20

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.