Auto incremented document number

Mike Marchywka marchywka at
Sat Feb 20 13:06:54 CET 2021

On Sat, Feb 20, 2021 at 10:50:23AM +0000, Philip Taylor wrote:
>    I still do not understand why anything more than "TeX out of the box" is required.  I have shewn in a previous message how

It is helpful to learn the capabilities of Tex and if you need or want
to do that in Tex great but AFAICT the OP was more interested
in a larger system. 
Even if you just write for home use, there must be some way to track
what you do. Again, though, most email systems are nice for
that and if you want to keep all your publications and correspondences
indexed adding capability there may be good. If the pdf has human and
machine readable citation info, some include DOI in the extended
info but most people or organizations don't get a DOI for letters they write ,
things get a lot easier. So, again, I like my approach even if the
bash script is rather awful. I'm starting to clean this up now
in a utility I call "toobib." 

>    a simple text file, in conjunction with TeX, can be used to generate a monotonic increasing sequence of integers, and if
>    each document requires its own sequence then the following trivial modification is all that is required —
>      \newread \trackerin
>      \newwrite \trackerout
>      \newcount \seqno
>      \openin \trackerin = \jobname.seqno
>      \ifeof \trackerin
>          \seqno = 0
>      \else
>          \read \trackerin to \seqtmp
>          \seqno = \seqtmp
>      \fi
>      \closein \trackerin
>      \advance \seqno by 1
>      \message {New sequence number = \number \seqno}
>      \immediate \openout \trackerout = \jobname.seqno
>      \immediate \write \trackerout {\number \seqno}
>      \immediate \closeout \trackerout
>      \end
>    --
>    Philip Taylor


mike marchywka
306 charles cox
canton GA 30115
USA, Earth 
marchywka at
ORCID: 0000-0001-9237-455X

More information about the texhax mailing list.