[OS X TeX] Macintouch report on TeX versus Word

Peter Dyballa Peter_Dyballa at Web.DE
Sat Jan 24 19:14:10 EST 2009

Am 24.01.2009 um 03:26 schrieb Jason Davies:

> Finally -- people have mentioned switching to XeTeX. How easy is  
> that for someone who knows only some fairly basic LaTeX?

It's easy. On MS PCs you need to find a utility that gives you the  
font names, on Linux you need libfontconfig and the command line  
utilities fc-cache/fc-list/fc-match or use another application to  
retrieve font names, and on Mac OS X the Font Book application can  
give you the names. Then you just swap the LaTeX preamble with a  
XeLaTeX preamble (maybe you need to switch from babel to polyglossia,  
which I have not tried yet) and start to write and save in UTF-8. Or  
UTF-16. (Both are *text* encodings. The font encoding is simply named  
Unicode.) Ahh, there is a bug: XeTeX or the xdvipdfmx output driver  
do not follow the settings done with the geometry package,  
particularly in landscape or in non-letter or non-ISO A4 formats –  
or for books. Even Adobe products fall into this pit. There are  
differences in the way the PDF information fields are filled – if  
you want to do it with \special's; the consistent way is \hypersetup 
{}. Ah, before I forget: not all PSTricks work; maybe TikZ/PGF  
(beamer) too only works partly.

Here is the template of a preamble that works both for LaTeX  
(producing PDF or DVI, maybe the latter needs a bit more regard, but  
I gave it up so long ago…) and for XeLaTeX (correct my font choices,  
the usual suspects Times, Helvetica, & Courier can be OK):

%%!TEX TS-program=xelatex	-*- mode: LaTeX; coding: utf-8; -*-
%%!TEX encoding=UTF-8 Unicode
%	Time-stamp: <2009-01-25 01:07:18 pete>
\def\author{Peter Dyballa}
\def\Schlagworte{LaTeX, XeLaTeX, UTF-8, geometry, hyperref}
   \def\title{Wörtér mït Ümläûtèñ}				% Does not translate in  
   \def\Betreff{Ȟÿṗéṛŗèḟ ŧêşẗ ẘïťĥ  
ăčçëńṭṣ}			% Does not translate in pdfTeX!
   \def\title{W\"ort\'er m\"it \"Uml\"a\^ut\`e\~n}
   \def\Betreff{H\"yp\'err\`ef t\^est w\'ith ac\c{c}\"e\'nts}	% OK  
for PDFDocEncoding, but not the next!
%  \def\Betreff{\v{H}\"y\.p\'e\d{r}\c{r}\`ef \b{t}\^e\c{s}\"t \r{w}\'i 
\v{t}\^h \u{a}\v{c}\c{c}\"e\'n\.t\.s}
%U	pdfauthor={\author},pdftitle={\title},pdfsubject= 
      \immediate\write16{==We're with XeTeX==}
%  \setmainfont{Lucida Bright}
   \setromanfont{Lucida Bright}
   \setsansfont{Lucida Sans}
   \setmonofont{Lucida Sans Typewriter}
%  \newfontface\textsl[RawFeature={slant=0.194}]{Lucida Bright}
%    \DeclareGraphicsExtensions{.pdf,.png,.jpeg,.bmp,.eps}		% formats  
with xdvipdfmx
%    \DeclareGraphicsExtensions{.mac,.pict,.psd,.sgi,.tga,.tif,.gif}	 
% additionally with xdv2pdf, less eps!
%    \special{pdf: docinfo <<
%	/Keywords	(\Schlagworte)
%	/Subject	(\Subjekt)
%       /Title		(\Titel)
%        >>}
   \immediate\write16{==We're without XeTeX==}
     \immediate\write16{==\jobname: Bonjour, PDF!==}
%    \DeclareGraphicsExtensions{.pdf,.png,.jpeg}			% in pdfTeX  
allowed graphics formats
%    \usepackage[protrusion=true,expansion=true]{microtype}
     \makeatletter							% following code needs hyperref
          pdfTeX >= 1.30.0 required%
       % empty in case of errors, but don't harm in next comparison
       \ifnum\pdfstrcmp{\@SourceFileDate}{\@CurrentSourceFileDate}>0 %
           Using file `#1'%
     \def\@ParseTime #1#2#3#4#5\@nil{%
       \time=\numexpr #1#2 * 60 + #3#4\relax
%    \pdfinfo
%      {
%	/Title		(An UTF-8 LaTeX Example)
%	/Author		(Peter Dyballa)
%	/Subject	(ISO Latin-1 and ISO Latin-9 characters)
%	/Keywords	(LaTeX, UTF8, ISO, Latin-1, Latin-2, Latin-9, ISO 8859,  
%    }
     \immediate\write16{==¡Hola \jobname: DVI!==}
%    \DeclareGraphicsExtensions{.ps,.eps}				% in dvips allowed  
graphics formats
%  \usepackage[utf8]{inputenc}
%  \usepackage[LUC,T1]{fontenc}
   \usepackage[T1]{fontenc}						% other font encodings: T2A, T2B,  
T2C, X2, LCY, OT2 (LY1, T5)
   \newcommand*\TeX at logo@spacing[6]{%
     \def\xxt at kern@Te{#1}%
     \def\xxt at kern@eX{#2}%
     \def\xxt at lower@e{#3}%
     \def\xxt at kern@La{#4}%
     \def\xxt at kern@aT{#5}%
     \def\xxt at kern@eL{#6}%
   \DeclareRobustCommand\XeTeX{%						make a bit of XeTeX available  
outside ...
       X\lower\xxt at lower@e
       \hbox{\kern\xxt at kern@eX
      }\kern\xxt at kern@Te\TeX}}%
       X\lower\xxt at lower@e
       \hbox{\kern\xxt at kern@eX
     }\kern\xxt at kern@eL\LaTeX}}
   \TeX at logo@spacing{-0.15em}{-0.125em}{0.5ex}{-0.36em}{-0.12em} 

Some example text ...

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:



Government is actually the worst failure of civilized man. There has  
never been a really good one, and even those that are most tolerable  
are arbitrary, cruel, grasping and unintelligent.
				– H. L. Mencken

More information about the MacOSX-TeX mailing list