[OS X TeX] Conditional typesetting engine selection

Paul Vickers paul.vickers at unn.ac.uk
Fri Nov 25 07:01:46 EST 2005


I am writing a document which I am typesetting in XeLaTeX using TeXshop 
2.03 on OS X Tiger 10.4.3. However, as the XeLaTeX engine is much slower 
on my PowerBook than LaTeX, for small updates I use the LaTeX engine for 
proofing purposes. I've set up a variable 'xetex':


Which, if true causes various XeLaTeX feaures to be enabled, otherwise 
the document reverts to vanilla LaTeX:
  \usepackage{myxetexfonts}% My default XeLaTeX font settings
  \newfontinstance\tabfont[Numbers=Monospaced,Scale=0.90]{Skia Regular}
\newcommand{\applelogo}{\logo apple}


now, I notice with TeXShop 2.03 I can add

     %!TEX TS-program = xelatex
     %!TEX encoding = UTF-8 Unicode
     %!TEX root = ./Main.tex

to the head of the document which will automatically select the XeLaTeX 
engine when I press the Typeset button. Being extraordinarily lazy, I 
would like to have the engine selected depending on the value of the 
variable 'xetex'. I have tried the following at the top of the document


    %!TEX TS-program = xelatex
    %!TEX TS-program = pdflatex
%!TEX encoding = UTF-8 Unicode
%!TEX root = ./Main.tex

However, this does not work. Is there any way to selectively set %!TEX 
TS-program from within a document?


Dr P. Vickers BSc PhD CEng MIEE ILTM
Reader in Human-Computer Interaction &
Visiting Research Fellow of Loughborough University

School of Computing, Engineering, & Information Sciences
Northumbria University
Pandon Building, Camden Street

Tel +44 (0)191 243-7614
Fax +44 (0)870 133-9127
e-mail: paul.vickers at northumbria.ac.uk
web: www.paulvickers.com/northumbria

Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of
Northumbria University.


This e-mail is intended solely for the addressee. It may contain private
and confidential information. If you are not the intended addressee,
please take no action based on it nor show a copy to anyone. Please
reply to this e-mail to highlight the error. You should also be aware
that all electronic mail from, to, or within Northumbria University may
be the subject of a request under the Freedom of Information Act 2000
and related legislation, and therefore may be required to be disclosed
to third parties.

This e-mail and attachments have been scanned for viruses prior to
leaving Northumbria University. Northumbria University will not be
liable for any losses as a result of any viruses being passed on.
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

More information about the MacOSX-TeX mailing list