[latexrefman] jobname

Vincent Belaïche vincent.belaiche at gmail.com
Sun Aug 15 06:52:41 CEST 2021

Concerning your statement « as of 2020, the LaTeX people made a change
so that would happen instead », just for my own information: do you
know what they did to get this behaviour.
I had speculated that there would be something like «
{\toks@\expandafter{\jobname}} » inside the \documentclass in order to
ensure the the job is frozen on texput if nothing else was provided.
That seemed the simplest to do. However, no such thing is done, and I
am wondering what sort of intricate trick they have used.

Le dim. 15 août 2021 à 00:42, Karl Berry <karl at freefriends.org> a écrit :
> In general ... if an \input command is used early enough on the first
> line of input, its argument becomes the \jobname (that's why the job
> name in your case used to be "article").
> If no \input is seen on the first line, or some other command is
> executed that requires the job name before the \input, the jobname is
> set to the default "texput" (as of 2020, the LaTeX people made a change
> so that would happen instead). It has nothing to do with actually
> executing the \jobname primitive.
> You'd have to read tex.web and do many experiments to determine the
> precise behavior.
> However, I don't think any of this should be explained in our manual.
> It's not important, and isn't consistent over time with LaTeX, as you
> discovered, or across engines (I believe luatex has different behavior,
> unfortunately). Seems to me all the manual needs to say is that
> 1) simple invocations like "latex foo" will set \jobname to foo, and
> 2) if no filename is apparent to TeX, it will use "texput" by default, and
> 3) it can be set explicitly with the -jobname option.
> Explaining every detail of every command line option also seems beyond
> the scope of our manual to me. Most of them are not relevant to any
> reasonable LaTeX usage. This is not a manual for TeX programmers. -k

More information about the latexrefman mailing list.