0

Whenever I enter a QUOTATION MARK (U+0022), like in this MWE:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Arial}
\begin{document}
This is "in quotes"
\end{document}

I end up with:

That wrong symbol there is a RIGHT DOUBLE QUOTATION MARK (U+201D).

This is XeTeX, Version 3.14159265-2.6-0.99998 (MiKTeX 2.9.6350 64-bit) (preloaded format=xelatex 2017.10.13)

4
  • Try with `` instead of "
    – BambOo
    Aug 12 '18 at 9:38
  • That yields “ (U+201C LEFT DOUBLE QUOTATION MARK), but it's kind of tangential to my question. Also, I don't mind this behavior because I usually don't use `` in text and also it's one of the "classic" workarounds before we had XeTeX.
    – AndreKR
    Aug 12 '18 at 9:42
  • Do you need other TeX ligatures to work, like ``, '', --, ---, etc.? Aug 12 '18 at 10:28
  • Oh just saw your comment! Aug 12 '18 at 10:29
4

You can avoid this mapping like this. But this will also disable the other "tex" mappings like -- to endash:

\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures[\rmfamily,\sffamily]{}
\setmainfont{Arial}
\begin{document}
This is "in quotes" -- ---
\end{document}

enter image description here

An alternative is to use \textquotedbl.

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Arial}
\begin{document}
This is \textquotedbl in quotes\textquotedbl\  -- ---

This is in "quotes".
\end{document}

enter image description here

3
  • 1
    Would it be better to explicitly use Mapping= instead of an empty feature set to make clear what specifically makes this work?
    – AndreKR
    Aug 12 '18 at 10:17
  • Mapping wouldn't work with lualatex. I personally wouldn't need to reset the quote style at all like this, I never use quote signs directly but use \enquote of csquotes. Aug 12 '18 at 10:35
  • In hindsight this mapping probably should have been left out of the tex-text mapping / tlig feature... oh well :) Aug 12 '18 at 12:26

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.