[TxMt] Re: My Path Issue (I think) with New Latex Bundle

enas textmate at alxp.gr
Wed Aug 18 07:38:25 UTC 2010


On 6 Aug 2010, at 17:08, Charles Turner wrote:

> Hi all-
> 
> Having trouble running the "new" TextMate bundle with a LaTeX file that worked via the old (or current, stable) bundle and (now) works on the command line. Here's a bit of the log:
> 
>> This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009) (format=pdflatex 2009.11.7)  6 AUG 2010 11:43
>> entering extended mode
>> file:line:error style messages enabled.
>> **"/Users/cturner/Documents/BIZ/Personal/Resume, etc./Resume-2009/resume20090628.tex"
>> (/Users/cturner/Documents/BIZ/Personal/Resume, etc./Resume-2009/resume20090628.tex
>> LaTeX2e <2009/09/24>
>> 
>> [clip...]
>> 
>> Package: ifxetex 2009/01/23 v0.5 Provides ifxetex conditional
>> )
>> /usr/local/texlive/2009/texmf-dist/tex/xelatex/fontspec/fontspec.sty:18: 
>> ********************************************
>> * XeTeX is required to compile this document.
>> * Sorry!
>> ********************************************.
>> \RequireXeTeX ...********************************}
> 
> My document uses XeLaTex and has this as its first line:
> 
>> %!TEX TS-program = xelatex
> 
> So I imagine my problem is that XeLaTeX isn't getting run.

The new LaTeX bundle is a bit rough around the edges. It doesn't support the %!TEX directives as Allan said, but it should though switch to xelatex automatically when it encounters fontspec). The following line of the Typeset & View command should achieve that:

ENV["TM_LATEX"] ||= (`grep -c fontspec #{ENV["TM_FILEPATH"]}`.to_i > 0 ? 'xelatex' : 'pdflatex')

> My default engine in Preferences is "xelatex" so, being a noobie, I'm not sure what else to do to tell the bundle my desires.

The new bundle ignores the Preferences. Instead it makes use of environment variables, which are undocumented. It helps to browse through the code of the command to discover some of them. For example you can set TM_LATEX to specify the engine and TM_LATEX_FLAGS to specify custom flags (which overrides the default ones). As far as I know you can only set environment variables on a per file basis if they're part of a project though.

enas


More information about the textmate mailing list