Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Line numbering in LaTeX

34 views
Skip to first unread message

Peter Albrecht

unread,
Jul 31, 1995, 3:00:00 AM7/31/95
to
Hi,

does anybody know if it is possible to number the lines in a LaTeX-processed
output? I need to number every fifth line on the left side of the text.
Thanks a lot.

Peter


Tijn Coosen

unread,
Aug 2, 1995, 3:00:00 AM8/2/95
to
albr...@olymp.uni-sw.gwdg.de (Peter Albrecht) wrote:

>Hi,

I have a simular question/problem:

To remind myself of things that need yet to be taken of in a document that's
under construction, I sometimes place dangling refrences, or write to a file
or display or things like that. One thing is always missing: the line number.
I really would like TeX to tell me on what line in my source I placed a
certain command, but how? Where does TeX store it's (input line) counter?
Ofcourse it has one, because it's displayed at every error, or is it
maintained only internally and not like the \folio?

Anybody?

Tijn Coosen
jmco...@cs.ruu.nl


Michal Jaegermann

unread,
Aug 3, 1995, 3:00:00 AM8/3/95
to
Tijn Coosen (jmco...@cs.ruu.nl) wrote:
: albr...@olymp.uni-sw.gwdg.de (Peter Albrecht) wrote:

: >Hi,

: >does anybody know if it is possible to number the lines in a LaTeX-processed
: >output? I need to number every fifth line on the left side of the text.
: >Thanks a lot.

: I really would like TeX to tell me on what line in my source I placed a


: certain command, but how? Where does TeX store it's (input line) counter?
: Ofcourse it has one, because it's displayed at every error,

But it does not store such information for output; it formats paragraph
by paragraph and breaks output into pages taking into account what
happens on other pages. Wordprocessors which format on "line-by-line"
basis obviously have no problems with numbering output lines for a cost
of an inferior formatting. Excluding special cases (verbatim input)
input and output lines do not correspond to each other. When they do
then supplying line numbers is rather trivial.

It is unfortunate that TeX misses primitives to split into "line" boxes
and put back every page. Sometimes it is doable. For LaTeX you may
want to look at 'numline.sty' from CTAN. It may require rewrite of your
input before it will work. It also messes with LaTeX output routine
so YMMV depending on a version which you happen to be you using. You
have been warned! :-)

EDMAC macros also include line numbering, but this is not LaTeX.

Michal

Tijn Coosen

unread,
Aug 3, 1995, 3:00:00 AM8/3/95
to
mic...@gortel.phys.ualberta.ca (Michal Jaegermann) wrote:

>: >Hi,

> Michal

You've probably misunderstood me, 'cause Donald Arseneau and Ole Michael
Selberg helped me out: I was looking for \inputlineno this tells the input
linenumer currently read and can help connect a macro to the line numer of the
source...

Tijn

Tijn Coosen
jmco...@cs.ruu.nl


Patrick TJ McPhee

unread,
Aug 4, 1995, 3:00:00 AM8/4/95
to
In article <3vqr0q$13...@rover.ucs.ualberta.ca>,
Michal Jaegermann <mic...@gortel.phys.ualberta.ca> wrote:
% Tijn Coosen (jmco...@cs.ruu.nl) wrote:
% : albr...@olymp.uni-sw.gwdg.de (Peter Albrecht) wrote:
%
% : >Hi,
%
% : >does anybody know if it is possible to number the lines in a LaTeX-processed
% : >output?
It is, but the solutions depend on even line numbering. I can't recommend
a style file, but they do exist.

% : I really would like TeX to tell me on what line in my source I placed a
% : certain command, but how? Where does TeX store it's (input line) counter?
%
% But it does not store such information for output;
Since v3.0, there's been \inputlineno, which gives precisely this
information. You won't find this in the \TeX book, but it's in the
article where Knuth introduced v3.0, and I think that's on CTAN somewhere.

--

Patrick TJ McPhee
Toronto Canada
pt...@io.org

Sergei Naumov

unread,
Aug 5, 1995, 3:00:00 AM8/5/95
to
Once at a time Tijn Coosen (jmco...@cs.ruu.nl) wrote:
> >does anybody know if it is possible to number the lines in a LaTeX-processed
> >output? I need to number every fifth line on the left side of the text.
> >Thanks a lot.
> I have a simular question/problem:

Get numlines.sty from CTAN. Does what you want.

--
++++++++++++ http://sunsite.oit.unc.edu/sergei/Me/Serge.html ++++++++++
+ Sergei O. Naoumov se...@envy.astro.unc.edu tel: (919)962-3998 +
+Department of Physics & Astronomy, UNC-CH, Chapel Hill, NC 27599, USA+
++++++++++++++++++ !! 8 bit (Cyrillic) mail accepted !!++++++++++++++++

Timothy Murphy

unread,
Aug 5, 1995, 3:00:00 AM8/5/95
to
se...@envy.astro.unc.edu (Sergei Naumov) writes:

>Get numlines.sty from CTAN. Does what you want.

Actually numline.sty. [Just got it.]

--
Timothy Murphy
e-mail: t...@maths.tcd.ie
tel: +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

bu...@binah.cc.brandeis.edu

unread,
Aug 7, 1995, 3:00:00 AM8/7/95
to
For line-numbering prose text, try EDMAC, which is available on
CTAN at pip.shsu.edu.
John Burt
(bu...@binah.cc.brandeis.edu)

Michal Jaegermann

unread,
Aug 8, 1995, 3:00:00 AM8/8/95
to
Due to a sudden burst of activity in the subject :-) I left a copy
of a new version (1.3) of numline.sty in tex-archive/Incoming on ftp.shsu.edu.
I hope that it find its way to a more permanent location.

There are no differences in TeX code but included sample input and new
comments show how you may deal with problems like displayed math,
sectioning, labels in a text you want to mistreat by putting number
lines. I also checked that the code works the same with LaTeX2e as
with 2.09.

Making this code work with plain is simple but you may want to look
at EDMAC macros for such purposes.

Michal

0 new messages