3

The following code...

\documentclass{article}

\usepackage{lipsum}
\usepackage[a4paper, margin = 0.4in]{geometry}
\usepackage{fontspec}

\begin{document}

    \fontspec[Scale=3]{URW Bookman L Light}

    ``These quotes are not curly!'' \\ \\ \par

    Examples: ` `` '' '

\end{document}

...produces the following disheartening output when run through XƎLatex.

Screenshot of rendered TeX code

As soon as I remove the \fontspec instruction, everything works perfectly using TeX's default font.

How do I specify my own (TTF, system) font, and use curly quotes?

(Note: I'm using TeX to typeset some emails so they print with precise formatting; I've never used it before, and I only have about 7 hours’ experience using it. If there's anything braindead you see in the code above please don't hesitate to mention it.)

  • Does tex.stackexchange.com/q/23004/15925 help? – Andrew Swann Dec 14 '14 at 19:25
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Do you mean curly quotation marks rather than curly braces? My answer below assumes that 'braces' is a typo. Please explain the problem with braces if I am mistaken in this assumption! – cfr Dec 14 '14 at 19:26
5

Just add Mapping=tex-text or Ligatures=TeX to the \fontspec options (see §11.1 of the docs).

3

You need to tell fontspec to emulate traditional TeX typesetting features, such as turning backticks and straight quotation marks into curly quotation marks. You can do this using Mapping but the recommended syntax is Ligatures=TeX:

\documentclass{article}

\usepackage[a4paper, margin = 0.4in]{geometry}
\usepackage{fontspec}

\begin{document}

    \fontspec[Scale=3, Ligatures=TeX]{URW Bookman L Light}

    ``These quotes are not curly!'' \\ \\ \par

    Examples: ` `` '' '

\end{document}

curly quotes

I recommend taking a look at csquotes which helps manage quotation mark-up in a flexible and consistent way.

  • It would be better to suggest \setmainfont rather than \fontspec in the document body. – egreg Dec 14 '14 at 19:54
  • @egreg I wasn't sure that the OP wanted to set it as the main font. But it might be better to set up a different font family, at least. – cfr Dec 14 '14 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.