Re: Counting in TeX

Uwe Ziegenhagen <[email protected]> Sat, 7 Mar 2026 19:41:25 +0100
Newsgroups gmane.comp.tex.texhax
Message-ID <[email protected]>
--Apple-Mail-1E561412-8A74-477C-B8FF-07A8A1DA929B
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

Have a look at the lineno package. It implements the running counter for the=
 lines somehow.=20

Uwe
Von meinem iPhone gesendet

> Am 07.03.2026 um 19:11 schrieb Walter Burkhard <[email protected]>:
>=20
> =EF=BB=BF
> Hello,
>=20
> I would like to keep a running count of the number of lines as TeX process=
es a list of lines.  Can I do this using the \count register?      I would l=
ike to use the  \advance\count\mycount by 1  command after each line is proc=
essed.
> Is this even possible to do in TeX?
>=20
> Many thanks for any suggeestions.
>=20
> Walt Burkhard

--Apple-Mail-1E561412-8A74-477C-B8FF-07A8A1DA929B
Content-Type: text/html;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html class=3D"apple-mail-supports-explicit-dark-mode"><head><meta http-equi=
v=3D"content-type" content=3D"text/html; charset=3Dutf-8"></head><body dir=3D=
"auto">Have a look at the lineno package. It implements the running counter f=
or the lines somehow.&nbsp;<div><br></div><div>Uwe<br id=3D"lineBreakAtBegin=
ningOfSignature"><div dir=3D"ltr">Von meinem iPhone gesendet</div><div dir=3D=
"ltr"><br><blockquote type=3D"cite">Am 07.03.2026 um 19:11 schrieb Walter Bu=
rkhard &lt;[email protected]&gt;:<br><br></blockquote></div><blockquote typ=
e=3D"cite"><div dir=3D"ltr">=EF=BB=BF<div dir=3D"ltr"><div class=3D"gmail_de=
fault" style=3D"font-family:garamond,times new roman,serif;font-size:large">=
<p style=3D"margin:0px;font-size:18px;line-height:normal;font-family:Menlo;f=
ont-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-v=
ariant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:=
normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style=3D"font-va=
riant-ligatures:no-common-ligatures">Hello,</span></p>
<p style=3D"margin:0px;font-size:18px;line-height:normal;font-family:Menlo;f=
ont-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-v=
ariant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:=
normal;font-feature-settings:normal;color:rgb(0,0,0);min-height:21px"><span s=
tyle=3D"font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style=3D"margin:0px;font-size:18px;line-height:normal;font-family:Menlo;f=
ont-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-v=
ariant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:=
normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style=3D"font-va=
riant-ligatures:no-common-ligatures">I would like to keep a running count of=
 the number of lines as TeX processes a list of lines.<span class=3D"gmail-A=
pple-converted-space">&nbsp; </span>Can I do this using the \count</span>&nb=
sp;register?<span class=3D"gmail-Apple-converted-space">&nbsp; &nbsp; &nbsp;=
 </span>I would like to use the<span class=3D"gmail-Apple-converted-space">&=
nbsp; </span>\advance\count\mycount by 1<span class=3D"gmail-Apple-converted=
-space">&nbsp; </span>command after each line is processed.</p>
<p style=3D"margin:0px;font-size:18px;line-height:normal;font-family:Menlo;f=
ont-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-v=
ariant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:=
normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style=3D"font-va=
riant-ligatures:no-common-ligatures">Is this even possible to do in TeX?</sp=
an></p>
<p style=3D"margin:0px;font-size:18px;line-height:normal;font-family:Menlo;f=
ont-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-v=
ariant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:=
normal;font-feature-settings:normal;color:rgb(0,0,0);min-height:21px"><span s=
tyle=3D"font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style=3D"margin:0px;font-size:18px;line-height:normal;font-family:Menlo;f=
ont-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-v=
ariant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:=
normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style=3D"font-va=
riant-ligatures:no-common-ligatures">Many thanks for any suggeestions.</span=
></p>
<p style=3D"margin:0px;font-size:18px;line-height:normal;font-family:Menlo;f=
ont-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-v=
ariant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:=
normal;font-feature-settings:normal;color:rgb(0,0,0);min-height:21px"><span s=
tyle=3D"font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style=3D"margin:0px;font-size:18px;line-height:normal;font-family:Menlo;f=
ont-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-v=
ariant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:=
normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style=3D"font-va=
riant-ligatures:no-common-ligatures">Walt Burkhard</span></p></div></div>
</div></blockquote></div></body></html>=

--Apple-Mail-1E561412-8A74-477C-B8FF-07A8A1DA929B--