<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Philip Taylor wrote:<br>
<br>
</div>
<blockquote type="cite"
cite="mid:08374857-e6df-f319-8a80-d5c39093d867@Hellenic-Institute.Uk">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
There was a spurious " sp" in the code as posted at "\seqno =
\seqtmp sp"; this should, of course, have read simply "\seqno =
\seqtmp", as \seqtmp contains a dimension, not an integer. A
better version is currently under development.<br>
</blockquote>
<br>
which version is now released below. Modulo as-yet-unencountered
bugs, I regard this as the final version. Sequence numbers will
start at 0.1, 0.2, ..., 0.65535, and each time that the program is
told that the present run is the final run for the current sequence,
the sequence number will be rounded up to the next integer (so in
the case above, rounded up to 1.0, after which sequence numbers will
be 1.1, 1.2, ..., 1.65535). The mechanism for informing the program
that any given run is the final run for the current sequence is as
before:<br>
<br>
TeX \count 0 = 0 \input <whatever><br>
<br>
The program will use the e-TeX extension "\dimexpr" if present, but
is fully functional in Knuthian TeX.<br>
<br>
<i>Philip Taylor<br>
<br>
--------<br>
<br>
</i><tt>\newread \trackerin<br>
\newwrite \trackerout<br>
<br>
\newcount \major<br>
\newcount \minor<br>
\newcount \pttosp \pttosp = 65536<br>
\newdimen \seqno<br>
<br>
\openin \trackerin = \jobname.seqno<br>
\ifeof \trackerin<br>
\seqno = 0 sp<br>
\else<br>
\read \trackerin to \seqtmp<br>
\seqno = \seqtmp<br>
\fi<br>
\closein \trackerin<br>
<br>
\ifx \dimexpr \undefined<br>
\ifnum \count 0 = 1<br>
\advance \seqno by 1 sp<br>
\else<br>
\divide \seqno by \pttosp<br>
\multiply \seqno by \pttosp<br>
\advance \seqno by 1 pt<br>
\fi<br>
\minor = \seqno<br>
\major = \seqno<br>
\divide \major by \pttosp<br>
\multiply \major by \pttosp<br>
\advance \minor by -\major<br>
\divide \major by \pttosp<br>
\else<br>
\ifnum \count 0 = 1<br>
\advance \seqno by 1 sp<br>
\else<br>
\advance \seqno by 1 pt<br>
\seqno = \dimexpr \seqno / \pttosp * \pttosp \relax<br>
\fi<br>
\minor = \seqno<br>
\major = \dimexpr \seqno / \pttosp \relax<br>
\advance \minor by -\dimexpr \major pt\relax<br>
\fi<br>
<br>
\message {New sequence number = \the \major .\the \minor}<br>
<br>
\immediate \openout \trackerout = \jobname.seqno<br>
\immediate \write \trackerout {\the \seqno}<br>
\immediate \closeout \trackerout<br>
<br>
\end<br>
</tt><i></i>
</body>
</html>