Auto incremented document number

Jonathan Fine jfine2358 at gmail.com
Fri Feb 19 20:20:25 CET 2021


Jerry wrote

I work for a municipality. I need to create several documents that need to
> be numbered in consecutive order, i.e., SWI-100, SWI-101, SWI-102,
> etcetera.
>

Let's suppose you need to create files SWI-100.pdf, SWI-101.pdf, etc. This
is a sensible naming convention if you're storing the files, say for
delivery on a website.

So why not create files SWI-100.tex, SWI-102.tex etc such that SWI-100.pdf
is the output of running SWI-100.tex etc.

By the way, you might find \jobname useful, as in

$ tex story
This is TeX, Version 3.14159265 (TeX Live 2019) (preloaded format=tex)
(/usr/local/texlive/2019/texmf-dist/tex/plain/knuth-lib/story.tex [1])
*\immediate\write16{\jobname}
story

best wishes

Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20210219/148c5d97/attachment.html>


More information about the texhax mailing list.