[tex-live] Effect of, and restrictions on, %& pragmat

Reinhard Kotucha reinhard.kotucha at web.de
Tue Mar 20 21:19:55 CET 2012


On 2012-03-20 at 16:50:13 +0000, Philip TAYLOR wrote:

 > With the announcement yesterday of a Unicode-based implementation
 > of WinEDT, I am now trying to migrate back from TeXworks to WinEDT,
 > which was for years my TeX editor of choice.
 > 
 > But it is now so long since I last used WinEDT that I no longer
 > remember the full and gory details of the "%&" pragmat that can
 > be used in the first line of a TeX file to specify how it is
 > to be processed.  May I therefore ask (in the context of TeX Live 2011),
 > whether :
 > 
 > 1) %& processing is enabled by default;
 > 2) if not, how to enable it;
 > 3) its limitations : can it indicate only a format,
 > 	or can it also indicate an engine ?  In
 > 	other words, can I write :
 > 
 > 		%& XeTeX
 > 
 > 	then launch TeX on the resulting file yet still
 > 	have it processed by XeTeX ?
 > 4) where such things are documented ?

Hi Phil,
I fear that you have to read the WinEDT documentation.

The %& directives tell the engine which format file to load.
That was fine when there was only one engine.  Since the directives
are evaluated by the engine, you can only select format files which
work on this engine.  Furthermore, an already running engine cannot
replace itself by another one.

If you want to select engines this way, then your TeX IDE has to
evaluate the %& line.  Note that different IDEs use a slightly
different syntax.

Here is an excerpt of texmf/web2c/texmf.cnf:

  % Allow TeX, and MF to parse the first line of an input file for
  % the %&format construct.
  parse_first_line = t

  % But don't parse the first line if invoked as "tex", since we want that
  % to remain Knuth-compatible.  The src_specials and
  % file_line_error_style settings, as well as the options -enctex,
  % -mltex, -8bit, etc., also affect this, but they are all off by default.
  parse_first_line.tex = f
  parse_first_line.initex = f

These (and other) settings can be overridden by command line switches.
The --help option of the programs describes them briefly.

The official documentation is the Web2c manual, AFAIK.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------


More information about the tex-live mailing list