[XeTeX] Smart quotes in Leopard

Ross Moore ross at ics.mq.edu.au
Sun Nov 11 04:39:18 CET 2007

Hi Will, and Andrew,

On 11/11/2007, at 1:26 PM, Will Robertson wrote:

> On 11/11/2007, at 7:54 , Andrew Arana wrote:
>> \setromanfont{Hoefler Text}
> Use [Mapping=tex-text] as an option.
>> Plato was a philosopher with lots of "friends''—you do believe me,
>> don't you?
> Using " as opening double curly quotes is Bad News. In regular TeX  
> " gives you a closing double quote. You're better off using ``  
> instead.
> Like I said before, the automatic curlies is a feature of the font  
> and the change in behaviour could either be a change in the font in  
> Leopard, or a change in Leopard, or a bug in XeTeX in Leopard. But  
> if you change your font, you won't get the output you expect.

Exactly right.
I tested the provided source under Tiger.
It works as described using Hoefler Text, but not when using Lucida  

As for Leopard, I haven't gone there yet so cannot say anything  
Maybe the Hoefler Text font has changed a bit, or the system no longer
recognises that particular feature anymore.

> In any case, your method is not very good because your output is this:
>   “friends’’
> Notice that you've got two *single* closing quotes there and one  
> double opening quote.
> XeTeX's tex-text mapping transforms `` and '' into “ and ”  
> respectively.

All true.
But there is another possibility that allows Alan to retain his past  

I'm assuming Alan is using TeXshop.
Simply put a filter into the XeLaTeX engine.
    (Better to rename it if you do this!)

A 1-line  perl ,  awk  or  sed  script could be used to rewrite and save
the input source before  xelatex  is called; e.g. using a regular  
match and replacement, such as:

There is a small industry, of possible such pre-processing scripts, just
waiting to be developed. This can allow authors to be much sloppier  
more laid-back) about what they type for input, yet still have TeX  
it in the way that was intended.

Of course there'll be difficulties when you really want to have  "A...
in your input, for a specific reason --- e.g. in an Xy-pic diagram.
That's why I say there is an industry here, developing regular  
that will accurately match what is required in specific circumstances.

> Will



Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114

More information about the XeTeX mailing list