[latexrefman] jobname

Karl Berry karl at freefriends.org
Wed Aug 18 23:36:23 CEST 2021


As far as I can see, it's impossible to reasonably specify the exact way
in which \jobname gets defined.  As I said before, you have to read
tex.web. I do not know all the rules myself.

The first \input (or use of \jobname) is not relevant. What counts is
when the log file is opened:

    tex.web line 10236:
    @ Initially |job_name=0|; it becomes nonzero as soon as the true name is known.
    We have |job_name=0| if and only if the `\.{log}' file has not been opened,
    except of course for a short time just after |job_name| has become nonzero.

There are quite a variety of possible scenarios involving code on the
command line, none of which have anything to do with LaTeX, as such.

This is why I suggested what I did: describe the normal case and point
to other, more deeply TeXnical (not LaTeXnical) manuals for the rest. If
you insist on doing something different, well, good luck. -k

P.S. If you use \tracingall instead of \loggingall, the expansion of
\documentclass appears on the terminal, but not in the .log file.
I ran this command, redirecting the (voluminous) terminal output:
$ pdflatex '\tracingall\documentclass{article}\input' body </dev/null >&/tmp/l

I believe this is precisely the issue at hand: TeX delays defining the
log file name, exactly so that \jobname does not have to get defined
"prematurely" (in Knuth's view).


More information about the latexrefman mailing list.