0

When using the font Lucida Calligraphy with XeLaTeX the dashes do not work correctly: -- gives two small dashes instead of a longer one. How can I repair that?

MWE:

\documentclass[12pt]{scrartcl}
\usepackage{titlesec}
\usepackage{xltxtra}
\newfontfamily\headingfont{Lucida Calligraphy}
\titleformat{\section}{\LARGE\headingfont\filcenter}
\renewcommand{\maketitlehooka}{\headingfont}
\begin{document}
\section*{Hello-World}
\section*{Hello--World}
\section*{Hello---World}
\end{document}
2
  • 1
    unrelated but don't use xltxtra these days, just use fontspec directly. Apr 14 at 12:33
  • 1
    titlesec is not compatible with scrartcl.
    – egreg
    Apr 14 at 14:00

1 Answer 1

1

The Ligatures=TeX feature is only added by default to fonts declared with \setmainfont, \setsansfont. TeX ligatures aren't enabled with fonts declared with \newfontfamily unless you add them.

You can use the characters directly:

Or can explicitly specify that the TeX ligatures should apply via [Ligatures=TeX]

enter image description here

\documentclass[12pt]{scrartcl}
\usepackage{titlesec}
\usepackage{fontspec}
\newfontfamily\headingfont[Ligatures=TeX]{Lucida Calligraphy}
\titleformat{\section}{\LARGE\headingfont\filcenter}
\renewcommand{\maketitlehooka}{\headingfont}
\begin{document}
\section*{Hello-World}
\section*{Hello--World}
\section*{Hello---World}
\section*{Hello–World}
\section*{Hello—World}


\end{document}
6
  • Did you try \newfontfamily\headingfont{Lucida Calligraphy}[Ligatures=TeX]?
    – egreg
    Apr 14 at 14:13
  • @egreg well mostly I was wondering why the default tex ligature didn't apply, but I'll add a note Apr 14 at 14:19
  • 1
    oh is it just setmainfont and friends that default tex ligatures,... Apr 14 at 14:22
  • @egreg yes that's even documented:-) Apr 14 at 14:23
  • 1
    @rallg yes certainly I thought of mentioning with the funky W you need to adjust the space, but I thought I'd keep to the issue at hand, Apr 14 at 18:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .