[XeTeX] How to write a header for XeTeX, pdfTeX, and dvips/dvipdfm

Peter Dyballa Peter_Dyballa at Web.DE
Sun Nov 25 12:09:53 CET 2007


The body of a LaTeX document can be assumed to be independent of the  
"machine" that actually converts the mixture of text and graphics  
with commands/macros to some output. But how would one set up the  
part before \begin{document}, where the use of fonts is declared or  
logos are defined (\XeTeX and \XeLaTeX should also work outside  
XeTeX) or micro-typography is arranged or hyper-references are set  
up? Such a construct would be perfect for testing whether XeLaTeX and  
LaTeX produce different results with different "machines." This  
example seems to be a good start:

	     \immediate\write16{==In XeTeX==}
	  \setromanfont{Lucida Bright}
	  \setsansfont{Lucida Sans}
	  \setmonofont{Lucida Sans Typewriter}
	     \immediate\write16{==No XeTeX==}
	       \immediate\write16{\jobname: Bonjour, PDF!}
	%    \usepackage[protrusion=true,expansion=true]{microtype}
	       \immediate\write16{¡Hola \jobname: DVI!}
	%    \DeclareGraphicsExtensions{.ps,.eps,.png,.gif,.jpeg}
	%  space for \XeTeX, \XeLaTeX ... definitions

Anything better?



"No man was ever taken to hell by a woman unless he already had a  
ticket in his pocket, or at least had been fooling around with  
                                        -- Archie Goodwin

More information about the XeTeX mailing list