Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

en-dash and em-dash in luatex

399 views
Skip to first unread message

Marcus Harnisch

unread,
Feb 28, 2011, 5:42:55 AM2/28/11
to
After switching to luatex and fontspec recently, I noticed that hyphens
in the source code are differently from what I was used
to. Traditionally in TeX, sequences of two or three hyphen (or dash)
characters will be typeset as en-dash and em-dash respectively.

After changing to a different default font with the help of fontspec,
this doesn't seem work any longer. Please have a look at the minimal
example below.

\documentclass{minimal}
\usepackage{fontspec}

%without the command below, things work
\setmainfont{Times New Roman}

\begin{document}
-- ---
\end{document}


LuaTeX, Version beta-0.60.2-2010071421 (Web2C 2010) (rev 3736) (format=lualatex 2011.2.22)
fontspec 2010/11/17 v2.1e


Any idea how to fix this? The input is generated automatically, so I
can't change the -- to anything else. I mean I could, but I'd rather
avoid it.

Thanks
Marcus

Juergen Spitzmueller

unread,
Feb 28, 2011, 5:50:18 AM2/28/11
to
Marcus Harnisch wrote:
> After switching to luatex and fontspec recently, I noticed that hyphens
> in the source code are differently from what I was used
> to. Traditionally in TeX, sequences of two or three hyphen (or dash)
> characters will be typeset as en-dash and em-dash respectively.
>
> After changing to a different default font with the help of fontspec,
> this doesn't seem work any longer. Please have a look at the minimal
> example below.
>
> \documentclass{minimal}
> \usepackage{fontspec}
>
> %without the command below, things work
> \setmainfont{Times New Roman}

\setmainfont[Ligatures=TeX]{Times New Roman}

refer to the fontspec manual for details.

Jürgen

Ulrike Fischer

unread,
Feb 28, 2011, 6:02:00 AM2/28/11
to


This certainly worked at some time. But with the newest versions of
fontspec and luaotfload the default mode of the renderer has change
to node mode. TeX-ligatures seems to work only with base mode, so
you must set the renderer too:

\listfiles
\documentclass{article}
\usepackage{fontspec}

\setmainfont[Renderer=Basic,Ligatures=TeX]{Times New Roman}

\begin{document}
-- ---
\end{document}

--
Ulrike Fischer

Juergen Spitzmueller

unread,
Feb 28, 2011, 6:27:52 AM2/28/11
to
Ulrike Fischer wrote:
>> \setmainfont[Ligatures=TeX]{Times New Roman}
>
>
> This certainly worked at some time. But with the newest versions of
> fontspec and luaotfload the default mode of the renderer has change
> to node mode. TeX-ligatures seems to work only with base mode, so
> you must set the renderer too:

Still works for me, with most recently updates TeXLive 2010 (fontspec.sty
2011/02/26 v2.1f) on Linux.

Jürgen

Ulrike Fischer

unread,
Feb 28, 2011, 6:52:33 AM2/28/11
to

The version of luaotfload is (I think) what matters:

luaotfload.sty 2011/02/16 v1.24 OpenType layout system


--
Ulrike Fischer

Juergen Spitzmueller

unread,
Feb 28, 2011, 6:57:33 AM2/28/11
to
Ulrike Fischer wrote:

> luaotfload.sty 2011/02/16 v1.24 OpenType layout system

Same here.

Jürgen

Juergen Spitzmueller

unread,
Feb 28, 2011, 7:19:33 AM2/28/11
to
Juergen Spitzmueller wrote:
>> luaotfload.sty 2011/02/16 v1.24 OpenType layout system
>
> Same here.

It seems to be dependent on the actual font. Some fonts work, some don't.
Strikes me like a bug somewhere in lua*land.

Jürgen

Ulrike Fischer

unread,
Feb 28, 2011, 7:56:12 AM2/28/11
to

Currently it looks as if otf-open-type and true-type fonts works but
ttf-open-type fails. But my data basis is quite small.


--
Ulrike Fischer

Marcus Harnisch

unread,
Feb 28, 2011, 8:15:29 AM2/28/11
to
Thanks to both of you for the quick response.

Juergen Spitzmueller <j.spitz...@gmx.de> writes:

> It seems to be dependent on the actual font. Some fonts work, some don't.

Indeed. Arial/Times/Courier fonts seem to require the "Renderer"
option. DejaVu Sans doesn't. And, sadly, Frutiger LT 55 Roman doesn't
work with either combination (with/without Renderer).

\newfontface\Frutiger[Renderer=Basic,Ligatures=TeX]{Frutiger LT 55 Roman}

--
Marcus

Philipp Stephani

unread,
Feb 28, 2011, 8:50:25 AM2/28/11
to
Marcus Harnisch <marcus....@gmx.net> writes:

> Thanks to both of you for the quick response.
>
> Juergen Spitzmueller <j.spitz...@gmx.de> writes:
>
>> It seems to be dependent on the actual font. Some fonts work, some don't.
>
> Indeed. Arial/Times/Courier fonts seem to require the "Renderer"
> option. DejaVu Sans doesn't. And, sadly, Frutiger LT 55 Roman doesn't
> work with either combination (with/without Renderer).

Could somebody please document that option? Neither the fontspec nor
the luaotfload manuals explain what Renderer=Basic etc. mean.

--
Change “LookInSig” to “tcalveu” to answer by mail.

Ulrike Fischer

unread,
Mar 11, 2011, 9:23:57 AM3/11/11
to
Am Mon, 28 Feb 2011 14:15:29 +0100 schrieb Marcus Harnisch:


>> It seems to be dependent on the actual font. Some fonts work, some don't.

> Indeed. Arial/Times/Courier fonts seem to require the "Renderer"
> option. DejaVu Sans doesn't. And, sadly, Frutiger LT 55 Roman doesn't
> work with either combination (with/without Renderer).

> \newfontface\Frutiger[Renderer=Basic,Ligatures=TeX]{Frutiger LT 55 Roman}

I asked on the context list. The answer from Hans Hagen:

"this is a side effect of there being two hyphens, think of:

\char 45\char 45
\char173\char173
\char173\char 45
\char 45\char173
\char 45\char 45\char 45
\char173\char173\char173
\char173\char 45\char 45
\char 45\char173\char173

fixed in next beta"

The last line means that it will be fixed in context. The fix will
(hopefully) then find its way in luaotfload (and so fontspec) when
it updates the underlying files which originate from context.


--
Ulrike Fischer

0 new messages