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
>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
: >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
>: >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
% : 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
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 !!++++++++++++++++
>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
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