25

My latex logs begin with

 %&-line parsing enabled

What does it mean?

  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – jub0bs Apr 22 '14 at 12:10
  • 1
    What do you find missing? A minimal working example? (any attempt generates this log message) Or perhaps my question is just too short? – Bach Apr 22 '14 at 12:15
  • 1
    Don't be alarmed. Your question is fine. That message is just our way of welcoming a new user (see this). – jub0bs Apr 22 '14 at 12:17
  • 13
    @Jubobs although the fact that you need to explain that implies that it's an unnecessarily negative opening comment I think. The text block ought to be changed (if it is going to be used). – David Carlisle Apr 22 '14 at 12:37
24

Some TeX engines (e.g. based on Web2C) have the feature that the format file can also be specified in the first line of the document, e.g.:

%&pdflatex
\documentclass{article}
\begin{document}
Hello World
\end{document}

This specifies the format pdflatex.fmt for the engine pdftex. The engine still needs to be specified, e.g. pdftex, pdflatex, latex, but the format is taken from the first line of the document. Thus the document above can also be compiled with

pdftex test

or

latex test

In both cases the LaTeX format is used and PDF is generated.

From the manual page of TeX:

-parse-first-line
If the first line of the main input file begins with %& parse it to look for a dump name or a -translate-file option.

-no-parse-first-line
Disable parsing of the first line of the main input file.

8

%& parsing is an option which allows one to indicate which TeX variant a particular file requires, e.g., %& eplain

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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