4

I'm trying to get a regular apostrophe with XeTeX, like this one:

who

However all I'm getting by typing who's in my .tex is

enter image description here

(notice the diagonal apostrophe)

How can I get the nice first one to get rendered?

  • 2
    Could you add a minimal working example? A quick test file using standard settings for both plain and LaTeX shows a perfectly-normal looking '. – Joseph Wright May 31 '14 at 7:06
  • 1
    What font are you using? – egreg May 31 '14 at 7:52
5

Initial remark: You don't mention in your message how you load families, so I'll assume it's via an instruction such as \setmainfont (provided by the fontspec package). I'm making this assumption because loading font-related packages such as lmodern or libertine will activate the use of "smart" single and double quotes automatically.

To instruct XeLaTeX -- and LuaLaTeX too, for that matter -- to use typographic apostrophes instead of single "typewriter-style" straight quotes, load the fontspec package and use the option Ligatures=TeX when specifying the font family to be used for the document, say via the instruction \setmainfont.

Setting this option will also activate the automatic conversion of -- and --- (double and triple dashes) into typographic en- and em-dashes and the automatic conversion of double back ticks and double single quotes into opening and closing typographic quotes.

enter image description here

% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\setmainfont[Ligatures=TeX]{EB Garamond}
who's I'm that'll. She asked, ``Who's there?''

\setmainfont{EB Garamond} % Note: 'Ligatures=TeX' not specified
who's I'm that'll. She asked, ``Who's there?''
\end{document}
  • 1
    remove all \setmainfont and it will also work. Latin Modern is used by default with Ligatures=TeX – user2478 May 31 '14 at 7:55
  • @Herbert - Judging from the screenshot the OP posted, he/she isn't using Latin Modern. I used Latin Modern in my answer purely to illustrate the use of the Ligatures=TeX option... – Mico May 31 '14 at 8:03
  • I know :-) Using \setmainfont[Ligatures=TeX]{DejaVu Serif} or another font makes more sense here. – user2478 May 31 '14 at 8:13
  • @Herbert - Good suggestion to use a font other than LM in the MWE. I'll modify it accordingly. – Mico May 31 '14 at 8:21
2

That depends to your font setting. With Latin Modern or Libertine it is the default:

\documentclass{article}
\usepackage{fontspec}
\usepackage{libertine}
\begin{document}

\Huge who's

\end{document}

enter image description here

Package libertine sets by default Ligatures=TeX which is needed here. Another setting maybe \setmainfont[Ligatures=TeX]{DejaVu Serif} .

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.