[OS X TeX] Conditional typesetting engine selection

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


Jonathan

Thanks. Tried:

\ifx\XeTeXversion\undefined % We're not runningXeTeXversion}{%
   \usepackage[sc,osf]{mymathpazo}
    \usepackage[scaled]{helvet}
    \newcommand{\tabfontbf}{\bf}
    \newcommand{\tabfont}{}
    \newcommand{\applelogo}{}
\else %XeTeX is running
    \usepackage{myxetexfonts}
 
\newfontinstance\tabfontbf[Numbers=Monospaced,Weight=2,Scale=0.95]{Skia 
Regular}
  \newfontinstance\tabfont[Numbers=Monospaced,Scale=0.90]{Skia Regular}
  \newfontinstance\logo[Ligatures={Rare,Logos,Rebus,Diphthong}]{Palatino}
   \newcommand{\applelogo}{\logo apple}
\fi

And met with success. hurrah!

Paul

Jonathan Kew wrote:
> On 25 Nov 2005, at 12:01 pm, Paul Vickers wrote:
> 
>> Hi
>>
>> 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':
>> <....snip....>
>>  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
>>
>> \newif\ifxetex
>> \xetexfalse
>> %\xetextrue
>>
>> \ifxetex
>>    %!TEX TS-program = xelatex
>> \else
>>    %!TEX TS-program = pdflatex
>> \fi
>> %!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?
> 
> I don't see how this would work, as \ifxetex here is a TeX macro, which 
> has to be processed/evaluated by the TeX engine ... by which time the 
> choice of which engine you're using has (necessarily) already been made.
> 
> However, why not take the opposite approach: make the decision by 
> choosing an engine from TeXShop's pop-up menu, and let that choice 
> influence the conditional sections in the document? Your document can 
> detect whether it's being processed by xetex (for example by testing 
> whether the primitive \XeTeXversion is defined) and behave accordingly.
> 
> So you'd have "encoding" and "root" lines as before, but *no* 
> "TS-program" in the source document; choose the engine you want to use 
> via the TeXShop interface, and replace your existing use of \ifxetex 
> with \ifx\XeTeXversion\undefined or some such construction.
> 
> HTH,
> 
> JK
> 
> ------------------------- 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/
> 
> 
> --This message has been scanned for viruses and dangerous
> content by the NorMAN MailScanner Service and is believed
> to be clean.
> 
> The NorMAN MailScanner Service is operated by Information
> Systems and Services, University of Newcastle upon Tyne.

-- 
____________________________________
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
Newcastle-upon-Tyne
NE2 1XE

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