Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I couldn't find any information in either MikTeX nor TeXlive docs. AFAIR, the parsing of the first line (with --translate-file etc.) is disabled by default in modern TeX distros; am I right?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

As far as I know it's enabled except for "Knuth TeX".

If I try latex on this example input file

%& pdflatex --translate-file=cp1250t1.tcx
\typeout{\the\pdfoutput}

I get on the terminal

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
 restricted \write18 enabled.
 (/usr/local/texlive/2012/texmf/web2c/cp1250t1.tcx)
entering extended mode
(./firstline.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, 
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
 polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, 
welsh, loaded.
1
)

showing that the .tcx file is loaded and PDF output is enabled even though the call was latex.

However, if I omit the format, then the option is not loaded.

In my main texmf.cnf file the setting is

% 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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.