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

Number Every Single Line??

43 views
Skip to first unread message

Lones Smith

unread,
Feb 19, 2000, 3:00:00 AM2/19/00
to
My coauthor and I frequently remotely edit the same paper,
and I would like to call objections to edits made at various
points of the paper. Ideally, it would be great to have
EVERY single line in the paper numbered in the margin,
so we could say "Take a look at line 5039" rather than
"see the fifth line above the bottom display eqn on page 45".
Is there a .sty (or whatever is the 2e sequel) file for this?

TIA. - Lones
.-. .-. .-. .-. .-. .-. econ-t...@earthling.net
/ L \ O / N \ E / S \ / S \ M / I \ T / H \ or: lo...@umich.edu
`-' `-' `-' `-' `-' `
335A Lorch, Economics Dept, Univ. of Michigan, Ann Arbor MI 48109-1220
http://www.umich.edu/~lones 734-764-2357 [764primes] FAX: -2769 [-army]

David Kastrup

unread,
Feb 19, 2000, 3:00:00 AM2/19/00
to
Lones Smith <lo...@umich.edu> writes:

> My coauthor and I frequently remotely edit the same paper,
> and I would like to call objections to edits made at various
> points of the paper. Ideally, it would be great to have
> EVERY single line in the paper numbered in the margin,
> so we could say "Take a look at line 5039" rather than
> "see the fifth line above the bottom display eqn on page 45".
> Is there a .sty (or whatever is the 2e sequel) file for this?

Several. Consult the Catalogue at CTAN.


--
David Kastrup Phone: +49-234-32-25570
Email: d...@neuroinformatik.ruhr-uni-bochum.de Fax: +49-234-32-14209
Institut für Neuroinformatik, Universitätsstr. 150, 44780 Bochum, Germany

Lones Smith

unread,
Feb 19, 2000, 3:00:00 AM2/19/00
to
David Kastrup wrote:
>
> Lones Smith <lo...@umich.edu> writes:
>
> > My coauthor and I frequently remotely edit the same paper,
> > and I would like to call objections to edits made at various
> > points of the paper. Ideally, it would be great to have
> > EVERY single line in the paper numbered in the margin,
> > so we could say "Take a look at line 5039" rather than
> > "see the fifth line above the bottom display eqn on page 45".
> > Is there a .sty (or whatever is the 2e sequel) file for this?
>
> Several. Consult the Catalogue at CTAN.

Can you suggest a name? I searched CTAN catalogue below,
with the keywords "number lines", and got the following not
useful files listed, having nothing to do with line numbering.

number lines

Date Size Link to Source
=======================================
/anfs/ctan/tex-archive/FILES.byname:1992/09/27 | 623 |
digests/texline/no8/backnumber.tex

/anfs/ctan/tex-archive/FILES.byname:1992/09/02 | 17980 |
fonts/pandora/number.mf

/anfs/ctan/tex-archive/FILES.byname:1989/12/22 | 322 |
macros/latex209/contrib/misc/nopagenumbers.sty

/anfs/ctan/tex-archive/FILES.byname:1992/05/27 | 1796 |
macros/latex209/contrib/misc/nosecnumbers.sty

/anfs/ctan/tex-archive/FILES.byname:1992/06/16 | 1040 |
macros/text1/cms_help_files/1number.helpsubh

/anfs/ctan/tex-archive/FILES.byname:1992/06/16 | 1040 |
macros/text1/cms_help_files/anumber.helpsubh

/anfs/ctan/tex-archive/FILES.byname:1998/10/23 | 3486 |
nonfree/systems/mac/support/alpha/contrib/number.tcl

/anfs/ctan/tex-archive/FILES.byname:1999/12/05 | 2331 |
support/ppower4/pjnumber.patch

/anfs/ctan/tex-archive/FILES.byname:1993/09/16 | 7526 |
support/vortex/vortex/source/donumberp.c

Thanks. - Lones

Robin Fairbairns

unread,
Feb 20, 2000, 3:00:00 AM2/20/00
to
Lones Smith <lo...@umich.edu> wrote:
>David Kastrup wrote:
>> Lones Smith <lo...@umich.edu> writes:
>> > Ideally, it would be great to have
>> > EVERY single line in the paper numbered in the margin,
>> > so we could say "Take a look at line 5039" [...]

>>
>> Several. Consult the Catalogue at CTAN.
>
>Can you suggest a name? I searched CTAN catalogue below,
>with the keywords "number lines", and got the following not
>useful files listed, having nothing to do with line numbering.

you didn't consult the catalogue, you *grepped files.byname (for some
value of *).

http://www.tex.ac.uk/CTANfind.html, given "line number" in its
catalogue search field, gave me `play' (which only incidentally
numbers lines) and lineno. lineno gave me a link to numline.

i commend it to this house ;-)
--
Robin Fairbairns, Cambridge

Donald Arseneau

unread,
Feb 20, 2000, 3:00:00 AM2/20/00
to
r...@betsy.cl.cam.ac.uk (Robin Fairbairns) writes:

> Lones Smith <lo...@umich.edu> wrote:
> >Can you suggest a name? I searched CTAN catalogue below,
> >with the keywords "number lines", and got the following not
>

> you didn't consult the catalogue, you *grepped files.byname (for some
> value of *).

I realized that too.

> http://www.tex.ac.uk/CTANfind.html, given "line number" in its
> catalogue search field,

But when I tried the catalog, using either "line number" or
"number lines", the only hit I got was "morevrb". It did not
commend itself to me.

Donald Arseneau as...@triumf.ca

Lones Smith

unread,
Feb 21, 2000, 3:00:00 AM2/21/00
to
I earlier asked about a sty file for automatic marginal
line numbering of a LeTeX file. I was directed to two files:
numline.sty (which so mangled my file as to be useless),
and lineno.sty. The latter comes with a family of files
to deal with various complications. But one complication
evades it: When there is display math in the text, great
gops of text (including the paragraph preceding the display
math) is not numbered. Some excuses were included for this
omission, and the only solution is to globally adjust the
commands for the displaymath!!

Bottom line: I find it absolutely Alice-in-Wonderland
amazing that it is apparently pure rocket science to figure
out when LaTeX has gone onto a new line, and then to place
a number in the margin.

Am I missing something? This seems like a useful piece of
software to create a sty file that numbers EVERY line in
a file in the margin. I chellenge the TeX-literati to
make such a basic style file.

We put a safely man on the moon 31 years ago.
Can't we safely put a number in every margin now?

Thanks! - Lones Smith (University of Michigan)
http://www.umich.edu/~lones/


Sent via Deja.com http://www.deja.com/
Before you buy.

David Kastrup

unread,
Feb 21, 2000, 3:00:00 AM2/21/00
to
Lones Smith <econ-t...@earthling.net> writes:

> I earlier asked about a sty file for automatic marginal
> line numbering of a LeTeX file. I was directed to two files:
> numline.sty (which so mangled my file as to be useless),
> and lineno.sty. The latter comes with a family of files
> to deal with various complications. But one complication
> evades it: When there is display math in the text, great
> gops of text (including the paragraph preceding the display
> math) is not numbered. Some excuses were included for this
> omission, and the only solution is to globally adjust the
> commands for the displaymath!!
>
> Bottom line: I find it absolutely Alice-in-Wonderland
> amazing that it is apparently pure rocket science to figure
> out when LaTeX has gone onto a new line, and then to place
> a number in the margin.
>
> Am I missing something? This seems like a useful piece of
> software to create a sty file that numbers EVERY line in
> a file in the margin. I chellenge the TeX-literati to
> make such a basic style file.

And you set what prize for this achievement? $10000 or so?

> We put a safely man on the moon 31 years ago.
> Can't we safely put a number in every margin now?

It might be a good idea to know what you are talking about before
spewing out grand words, great demands and hand-waving.

TeX, the Program, is not designed for interference with single lines
after the line break mechanism has done its work.

If you want to get a man to the moon, pay up to have a rocket designed
instead of demanding people to drive a car to the moon just the way
you want it.

It is purely marvelous that those packages work at all, considering
that they have to disassemble the whole page by hand after TeX has put
it together.

James Kilfiger

unread,
Feb 21, 2000, 3:00:00 AM2/21/00
to
Donald Arseneau wrote:
>But when I tried the catalog, using either "line number" or
>"number lines", the only hit I got was "morevrb". It did not
>commend itself to me.

"line number" should work. These searches are just do egrep, but there
is no easy way to do "(line) AND (number)" with egrep, which would be a
good feature. Agrep uses `;' for AND but for searching the xml
catalogue perhaps sgrep would be a good idea. The search page should
probably insulate users from the grep syntax (maybe making it availible
as a `power search').
James

Andreas zum Winkel

unread,
Feb 21, 2000, 3:00:00 AM2/21/00
to
Hi!

Here's a QUADS (= QUick And Dirty Solution) for your problem. I suggest to
you and your coauthor to exchange just the LaTeX-source code. Instead of
flying to the moon ;-), creating a DVI with line numbers and so on, you may
look at the source code with an appropiate editor, e.g. with the fabulous
WinEdt2K. EVERY line of the source code will be numbered!

What about this?


--
Have nice docs
Andreas zum Winkel
Email: Andreas.H....@math.uni-giessen.de

Lones Smith <econ-t...@earthling.net> schrieb in im Newsbeitrag:
88qq23$ju6$1...@nnrp1.deja.com...


> I earlier asked about a sty file for automatic marginal
> line numbering of a LeTeX file. I was directed to two files:
> numline.sty (which so mangled my file as to be useless),
> and lineno.sty. The latter comes with a family of files
> to deal with various complications. But one complication
> evades it: When there is display math in the text, great
> gops of text (including the paragraph preceding the display
> math) is not numbered. Some excuses were included for this
> omission, and the only solution is to globally adjust the
> commands for the displaymath!!
>
> Bottom line: I find it absolutely Alice-in-Wonderland
> amazing that it is apparently pure rocket science to figure
> out when LaTeX has gone onto a new line, and then to place
> a number in the margin.
>
> Am I missing something? This seems like a useful piece of
> software to create a sty file that numbers EVERY line in
> a file in the margin. I chellenge the TeX-literati to
> make such a basic style file.
>

> We put a safely man on the moon 31 years ago.
> Can't we safely put a number in every margin now?
>

Stephan Boettcher

unread,
Feb 21, 2000, 3:00:00 AM2/21/00
to

Lones Smith <econ-t...@earthling.net> writes:

> Bottom line: I find it absolutely Alice-in-Wonderland
> amazing that it is apparently pure rocket science to figure
> out when LaTeX has gone onto a new line, and then to place
> a number in the margin.

Well, you don't need to be a rocket scientist to do rocket science,
but it does take a little bit of TeX wizardry to put in those pesky
line numbers. It took me the second half of 1993 to convince myself
that it could be done at all. The latest version*) may even have a
remote chance not to screw up footnotes :-)

Stephan

*) not yet submitted to CTAN.
http://www.nevis.columbia.edu/~stephan/tex/lineno/lineno.sty

--
Stephan Boettcher FAX: +1-914-591-4540
Columbia University, Nevis Labs Tel: +1-914-591-2863
P.O. Box 137, 136 South Broadway mailto:ste...@nevis.columbia.edu
Irvington, NY 10533, USA http://www.nevis.columbia.edu/~stephan

Victor Eijkhout

unread,
Feb 22, 2000, 3:00:00 AM2/22/00
to
David Kastrup <d...@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:

> TeX, the Program, is not designed for interference with single lines
> after the line break mechanism has done its work.

You can intercept the page box before shipout, and unbox, unskip,
unpenalty your way up through it. This would be the solution, if it
weren't fr the fact that you can not unwhatsis...

--
Victor Eijkhout
"the time comes for everyone to do deliberately what
he used to do by mistake" [Quentin Crisp]

David Kastrup

unread,
Feb 22, 2000, 3:00:00 AM2/22/00
to
vic...@eijkhout.net (Victor Eijkhout) writes:

> David Kastrup <d...@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:
>
> > TeX, the Program, is not designed for interference with single lines
> > after the line break mechanism has done its work.
>
> You can intercept the page box before shipout, and unbox, unskip,
> unpenalty your way up through it. This would be the solution, if it
> weren't fr the fact that you can not unwhatsis...

Which is what existing line numbering packages actually do. But it is
hardly what TeX has been designed for, and the results, as the poster
noted, are not always satisfactory.

Stephan Boettcher

unread,
Feb 22, 2000, 3:00:00 AM2/22/00
to
David Kastrup <d...@mailhost.neuroinformatik.ruhr-uni-bochum.de> writes:

> vic...@eijkhout.net (Victor Eijkhout) writes:
> > You can intercept the page box before shipout, and unbox, unskip,
> > unpenalty your way up through it. This would be the solution, if it
> > weren't fr the fact that you can not unwhatsis...
>
> Which is what existing line numbering packages actually do.

Yes. IIRC numline.sty does it that way.
No. lineno.sty does it differently.

lineno does \interlinepenalty=-100000, and thus gets control in the
\output routine after each line that goes out.

Stephan

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

unread,
Feb 22, 2000, 3:00:00 AM2/22/00
to
There are two packages you can use to number lines. linenum.sty, and the EDMAC
format.

John Burt


In article <yfiwvnz...@triumf.ca>, Donald Arseneau <as...@triumf.ca> writes:
>r...@betsy.cl.cam.ac.uk (Robin Fairbairns) writes:
>
>> Lones Smith <lo...@umich.edu> wrote:
>> >Can you suggest a name? I searched CTAN catalogue below,
>> >with the keywords "number lines", and got the following not
>>
>> you didn't consult the catalogue, you *grepped files.byname (for some
>> value of *).
>
>I realized that too.
>
>> http://www.tex.ac.uk/CTANfind.html, given "line number" in its
>> catalogue search field,
>

>But when I tried the catalog, using either "line number" or
>"number lines", the only hit I got was "morevrb". It did not
>commend itself to me.
>

>Donald Arseneau as...@triumf.ca

Michael J Downes

unread,
Feb 22, 2000, 3:00:00 AM2/22/00
to
Lones Smith <econ-t...@earthling.net> writes:

> Bottom line: I find it absolutely Alice-in-Wonderland
> amazing that it is apparently pure rocket science to figure
> out when LaTeX has gone onto a new line, and then to place
> a number in the margin.

TeX's internal model is based on simple boxes and glue, there is not
sufficient information to distinguish a line box from some other kind of
box. And it is quite possible to have extra boxes in the vertical list
that are not line boxes, or conversely to have multiple lines hidden
inside a containing box. For example a three-line table typically
appears to be only a single "line" when viewed at the outermost
page-column level.

> Am I missing something? This seems like a useful piece of
> software to create a sty file that numbers EVERY line in
> a file in the margin.

Yes, you are missing something I think: It is better to stop thinking of
the TeX page in terms of an overly simplistic line-oriented model. TeX
is rather more sophisticated than a typewriter. For example, the order
in which the text is processed is not necessarily the same order in
which it appears in the printed document (e.g., split footnotes or
floating tables or figures). But line numbers are necessarily generated
in processing order, so it will be difficult to keep them in synch with
the printed pages.

To avoid such sequencing problems, and other problems, just consider the
page as a coordinate space and when you want to specify a particular
spot on the page use Cartesian coordinates. Making an overlay on the
page to facilitate getting the numbers for a particular spot is a
relatively straightforward application of the LaTeX picture environment
and the fancyhdr package (put a picture in the running head that
overlaps downward and contains a grid).

Then you can specify any spot in your document to any desired degree of
precision with three coordinates, one of them being the page number.

Or, number your sentences like the verses of the Bible by defining \s
suitably and starting each sentence with \s. This would seem to be one
of the most well-tested methods of identifying specific locations in
running text :-) It also has the advantage of being more resistant to
breaking down when slight changes are made that affect line breaks.

Regards, Michael Downes

Victor Eijkhout

unread,
Feb 22, 2000, 3:00:00 AM2/22/00
to
David Kastrup <d...@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:

> > You can intercept the page box before shipout, and unbox, unskip,
> > unpenalty your way up through it. This would be the solution, if it
> > weren't fr the fact that you can not unwhatsis...
>
> Which is what existing line numbering packages actually do.

That's not very clever. It's probably better to catch each paragraph and
display equation before they go on the vertical list. Mind you,
redefining \par is fraught with danger. But at least you'll lose those
marks generated by headings.

Donald Arseneau

unread,
Feb 22, 2000, 3:00:00 AM2/22/00
to
vic...@eijkhout.net (Victor Eijkhout) writes:

> David Kastrup <d...@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:
>
> > > You can intercept the page box before shipout, and unbox, unskip,
> > > unpenalty your way up through it. This would be the solution, if it
> > > weren't fr the fact that you can not unwhatsis...
> >
> > Which is what existing line numbering packages actually do.
>
> That's not very clever. It's probably better to catch each paragraph and
> display equation before they go on the vertical list.

No. Because there are many more whatzits on the vertical list before
the page bulder washes them.

In addition to whatzits, there are rules and shifted boxes. Rules
can't be grabbed, and the shifts are lost from shifted boxes.

I would like to see a TeX format, preferably LaTeX, whose internals
put nothing on the vertical list that couldn't be grabbed when sifting
backwards. This means:

o \write (label etc), if given in vmode, would be performed in the next
box, or in an additional box stuck to the previous box (\prevdepth etc...)

o Lists and section titles use \leftskip and \rightskip instead of
\parshape and \hangindent. (That's easy; \parshape in particular
is major overkill.)

o Displayed equations aren't displaymath ($$).

There was a proposal for the next version of etex to be able to sift
through everything. That would be good.

Donald Arseneau as...@triumf.ca

Lones Smith

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to
In article <88ruk8$d...@c4.hrz.uni-giessen.de>,

"Andreas zum Winkel" <Andreas.H....@math.uni-giessen.de> wrote:

> Here's a QUADS (= QUick And Dirty Solution) for your problem.
> I suggest to you and your coauthor to exchange just the
> LaTeX-source code.

Sigh. I lost him to the Dark Side of Scientific Workplace,
the Microsoft of the TeX world (whose code BTW is horrible;
SW is also deserving of a long string of horrible epithets not
appropriate for a child-friendly newsgroup like this).

Lones Smith

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to
In article <rdaekuk...@nevis1.nevis.columbia.edu>,

Stephan Boettcher <ste...@nevis1.columbia.edu> wrote:
>
> Lones Smith <econ-t...@earthling.net> writes:
>
> > Bottom line: I find it absolutely Alice-in-Wonderland
> > amazing that it is apparently pure rocket science to figure
> > out when LaTeX has gone onto a new line, and then to place
> > a number in the margin.
>
> Well, you don't need to be a rocket scientist to do rocket science,
> but it does take a little bit of TeX wizardry to put in those pesky
> line numbers. It took me the second half of 1993 to convince myself
> that it could be done at all. The latest version*) may even have a
> remote chance not to screw up footnotes :-)
>
> Stephan
>
> *) not yet submitted to CTAN.
> http://www.nevis.columbia.edu/~stephan/tex/lineno/lineno.sty

Righto! This file is the only one that seems to work at all.
The revision doesn't mangle (or number) the footnote lines,
but still cannot handle the display math or text preceding
it in a paragraph. For my papers, this sadly keeps half of all
lines from being numbered. I am hoping for a technological
break through or flash of insight in some TeXspert in finding
a way around this, without changing my displaymath code.

Joseph Hertzlinger

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to
On Thu, 24 Feb 2000 06:25:42 GMT, Lones Smith <econ-t...@earthling.net>
wrote:

>Righto! This file is the only one that seems to work at all.
>The revision doesn't mangle (or number) the footnote lines,
>but still cannot handle the display math or text preceding
>it in a paragraph. For my papers, this sadly keeps half of all
>lines from being numbered. I am hoping for a technological
>break through or flash of insight in some TeXspert in finding
>a way around this, without changing my displaymath code.

It might make sense to devise a post-processor for dvi files that
can insert line numbers.

Rupert Levene

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to

MikTeX already does something similar, inserting line number specials
every paragraph. Presumably it would not be hard to change this
behaviour, given the sources?

Rupert

Dominik Wujastyk

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to
I haven't been paying close attention to what you want to do, but have
you looked at EDMAC? This is a plain format which does the paragraph
disassembly-reassembly job which was mentioned in this thread,
attaching line numbers in various flexible ways.

Dominik


On Thu, 24 Feb 2000 06:25:42 GMT, Lones Smith
<econ-t...@earthling.net> wrote:

ja...@uci.edu

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to
d.wuj...@ucl.ac.uk (Dominik Wujastyk) writes:

> I haven't been paying close attention to what you want to do, but have
> you looked at EDMAC?

Doesn't EDMAC work only with plain TeX?

Jason

Joseph Hertzlinger

unread,
Feb 25, 2000, 3:00:00 AM2/25/00
to
On 24 Feb 2000 17:24:43 +0100, Stefan Ulrich <ulr...@cis.uni-muenchen.de>
wrote:

>Postprocessing the .dvi or .ps file might indeed be the easier thing
>to do; either the hard way, by scanning the glyph setting commands and
>trying to figure out the line numbers from these (this will probably
>face some quite tricky problems, e.g. when you have side-by-side
>tables that are not in `register' and will clobber your numbering), or
>something along the lines of the `cartesian coordinates' also
>mentioned by Michael: overprinting the page margin with some fixed
>`ruler'. This ought to be a 5-minute hack for someone familiar with
>Postscript ... any volunteers?

Now that I've taken another look at this, putting the following in
the preamble if dvips is used will number each line and will not
number superscripts and subscripts. (It will number each line of a matrix
in an equation and will sometimes number the numerator and denominator of
a fraction separately.)

\special{!userdict begin
/start-hook{/lineno 0 def} def
/bop-hook{/lenpage Resolution 14 mul def /lines lenpage array def
/Flines {/Times-Roman findfont
[Resolution 6 div 0 0 Resolution 6 div neg 0 0]
makefont setfont} def
/eop{userdict /eop-hook known{eop-hook}if lineno SI restore
/lineno exch def showpage}def
0 1 lenpage 1 sub{lines exch 0 put}for
/p{lines currentpoint 0.5 add cvi exch pop 1 put show}def}def
/eop-hook{Flines /last Resolution neg def
0 1 lenpage 1 sub{dup dup lines exch get 0 gt{
dup dup last Resolution 10 div add gt{
/lineno lineno 1 add def lineno 5 string cvs exch Resolution 2 div neg
exch moveto show
}{pop} ifelse /last exch def
}{pop}ifelse
lines exch 0 put}for}def
end}

There's probably some way of improving it by inserting specials into
\everymath, \everydisplay, etc.

Dominik Wujastyk

unread,
Mar 2, 2000, 3:00:00 AM3/2/00
to
EDMAC is a plain format, yes. It is cleanly coded, so it can, in
fact, be used with LaTeX2e to a certain extent. But since EDMAC uses
its own output routine, one sacrifices some LaTeX functionality
(floats, etc.). However, EDMAC is really designed for use with plain.
Users tend to do critical editions with EDMAC, and set other parts of
the book with LaTeX if desired.

Dominik

0 new messages