[XeTeX] A small tip

Will Robertson will at guerilla.net.au
Wed Nov 16 14:04:20 CET 2005


Don't know how I've used XeTeX for so long without realising the  
Since LaTeX can now handle UTF-8 with the inputenc package, it's  
possible to create a smart em-dash (OPT SHIFT -) that looks good in  
the source document, only has thin spaces surrounding it, and will  
allow line breaks after but not before it:


\expandafter\ifx\csname XeTeXversion\endcsname\relax
   % if pdfLaTeX:
   % if XeLaTeX:
   \catcode`\^^^^2014=\active  % or just \catcode`\—=\active
   \let^^^^2014\dash           % or just \let—\dash

meow — meow

Yay. I should do something similar for real unicode curly quotes and  
Philipp Lehman's great csquotes package...


More information about the XeTeX mailing list