<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Le 10/10/2010 17:26, Gareth Hughes a écrit :
<blockquote cite="mid:4CB1DB24.5030705@gmail.com" type="cite">
<pre wrap="">Paul Isambert wrote:
</pre>
<blockquote type="cite">
<pre wrap="">That one is harder. Line number are no simple matter with traditional TeX.
Question: does bidipoem starts a new paragraph with every line? Then
something might be doable with \everypar.
Just try this in the poem environment: \everypar{test}. If ``test''
appears at the beginning of every line, then I might try to find a
solution.
</pre>
</blockquote>
<pre wrap="">
Hmm. Within the environment \everypar has no effect, but given outside
the traditional poem, but within the font changing environment, it
prints on each line including the the 'zeroth' line. I'm not sure if
this is the right way to do this, how might this work?
</pre>
</blockquote>
<br>
Ok, the following works on your file, but I don't know how robust it
is:<br>
<br>
%%%<br>
<br>
\newcount\LineNumber \newcount\templinenumber<br>
\newdimen\linenumberskip \linenumberskip=6em<br>
\chardef\linestep=2<br>
\def\poemlinenumber{%<br>
\advance\LineNumber1<br>
\templinenumber=\LineNumber<br>
\computelinenumber<br>
}<br>
\def\computelinenumber{%<br>
\ifnum\templinenumber>\linestep<br>
\advance\templinenumber-\linestep<br>
\expandafter\computelinenumber<br>
\else<br>
\ifnum\templinenumber=\linestep<br>
\leavevmode\rlap{\kern\linenumberskip\the\LineNumber}%<br>
\fi<br>
\fi<br>
}<br>
\newenvironment{numberedpoem}<br>
{\everypar{\everypar{\poemlinenumber}}%<br>
\begin{traditionalpoem}}<br>
{\end{traditionalpoem}}<br>
<br>
%%%<br>
<br>
You poem should now be enclosed in the "numberedpoem" environment.<br>
You can change \linestep (on line 3) to any value; if it is set <i>n</i>,
every <i>n</i>th line number is printed.<br>
You can change \linenumberskip (on line 2), which sets the distance
of the line number to the margin.<br>
This is not thoroughly tested! Sorry for the syntax, it's not
LaTeX-like (but you made me -- although you didn't ask! -- download
so many packages so your file can work than I need a little revenge
:) ).<br>
<br>
Best,<br>
Paul<br>
<br>
<br>
</body>
</html>