[TxMt] [Latex] Compiler selection logic

Charilaos Skiadas skiadas at hanover.edu
Sun Apr 15 19:42:25 UTC 2007

Hi Robin,

	thanks for working on this.
On Apr 13, 2007, at 6:51 AM, Robin Houston wrote:

> As we've discussed before, the current compiler selection logic (in  
> the Typeset & View command) is a bit of a mess. Below is a  
> suggestion for how it might be rationalised. Once we've agreed on a  
> plan, I'm happy to implement it.
> One complication is that it's sometimes useful to have compilation  
> under the control of a custom script – either one that you've  
> written for your specific project, or a generic compilation tool  
> such as latexmk. The way that TeXShop deals with this is to have  
> special program-designators "mytex" and "mylatex", which signify  
> that a user-specified compilation script should be used. I propose  
> that we adopt this mechanism.
> The first task is to decide on the compilation route to use. This  
> will be one of: tex, latex, pdftex, pdflatex, xetex, xelatex,  
> mytex, mylatex. I propose trying the following things, in order:

Not sure we should really distinguish between mytex and mylatex. Any  
use cases where both are needed as options?

Also, what exactly do we mean when we say "compilation route is  
'latex' "? latex would produce a dvi file. Do we then convert it to  
pdf, and if so how?

Also, should the user have a way of specifying that they want dvi  
output instead of pdf output? Or do we somehow sniff that out of the  

> 1. Use the %!TEX TS-program specification in the source file.
> 2. Use the %!TEX TS-program specification in the master file.

Actually those 1,2 are really one, using the options.sh/options.rb  
script/library. There might be other files between the source file  
and the master file, and those should be looked at as well. Also keep  
in mind that there are multiple ways to define what the master file  
is (I think options.sh/rb takes care of that).

> 3. Use the value of the $TM_LATEX_PROGRAM variable.
> 4. Sniff for \usepackage commands that suggest (DVI)latex/xelatex  
> should be used.
> 5. Default to pdflatex.
> If the resulting value is mytex/mylatex, then:
> 1. Use the script specified in the variable $TM_LATEX_MYTEX or  

Consequently, I would think only one variable should be sufficient,  

> 2. Use the script specified in the TeXShop configuration, if any:
> defaults read TeXShop TexScriptCommand
> defaults read TeXShop LatexScriptCommand
> 3. Give up, explaining why.
> So, the variables $TM_LATEX_COMPILER and $TEX_PSTRICKS would no  
> longer be used. For backwards compatibility, we could continue to  
> allow the value of $TM_LATEX_COMPILER to trump all other  
> considerations (perhaps with a warning in the compilation window to  
> the effect that this variable is deprecated, and explaining the new  
> way to do it).
This sounds reasonable. I would definitely want backwards compatibility.

> Any thoughts?

Looks good overall.

> Robin

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

More information about the textmate mailing list