On Aug 18, 2010, at 3:38 AM, enas wrote:
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.
All of Enas' information in this older post is very good, but my problem turned out to be much simpler: the LaTeX2 bundle doesn't like spaces in the TM_FILEPATH.
HTH, Charles