General\everyline command similar to \everypar

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
maieul
Posts: 8
Joined: Sun Jan 16, 2011 12:23 am

\everyline command similar to \everypar

Post by maieul »

Hello,

I would like to have a command like \everypar, but for every line.

A command wich execute something an every line.

Do you have any idea ?

Thank a lot
Please forgive me for English : I'm french.
http://geekographie.maieul.net

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: everyline

Post by Stefan Kottwitz »

Hi,

you could use \everycr.

Stefan
LaTeX.org admin
maieul
Posts: 8
Joined: Sun Jan 16, 2011 12:23 am

\everyline command similar to \everypar

Post by maieul »

Thank for you reply, but it seems don't work.

A test (it's not what I want to have, it's just an trying)

Code: Select all

\newcounter{toto}
\everycr{\addtocounter{toto}{1}}

Demain, dès l'aube, à l'heure où blanchit la campagne,
Je partirai. Vois-tu, je sais que tu m'attends.
J'irai par la forêt, j'irai par la montagne.
Je ne puis demeurer loin de toi plus longtemps.

Je marcherai les yeux fixés sur mes pensées,
Sans rien voir au dehors, sans entendre aucun bruit,
Seul, inconnu, le dos courbé, les mains croisées,
Triste, et le jour pour moi sera comme la nuit.

Je ne regarderai ni l'or du soir qui tombe,
Ni les voiles au loin descendant vers Harfleur,
Un bouquet de houx vert et de bruyère en fleur. Un bouquet de houx vert et de bruyère en fleur. Et, quand j'arriverai, je mettrai sur ta tombe
Un bouquet de houx vert et de bruyère en fleur.

\thetoto
But \thetoto is at 0. A contrario, when I write

Code: Select all

\newcounter{toto}
\everypar{\addtocounter{toto}{1}}

Demain, dès l'aube, à l'heure où blanchit la campagne,
Je partirai. Vois-tu, je sais que tu m'attends.
J'irai par la forêt, j'irai par la montagne.
Je ne puis demeurer loin de toi plus longtemps.

Je marcherai les yeux fixés sur mes pensées,
Sans rien voir au dehors, sans entendre aucun bruit,
Seul, inconnu, le dos courbé, les mains croisées,
Triste, et le jour pour moi sera comme la nuit.

Je ne regarderai ni l'or du soir qui tombe,
Ni les voiles au loin descendant vers Harfleur,
Un bouquet de houx vert et de bruyère en fleur. Un bouquet de houx vert et de bruyère en fleur. Et, quand j'arriverai, je mettrai sur ta tombe
Un bouquet de houx vert et de bruyère en fleur.

\thetoto
\thetoto is at 3
Please forgive me for English : I'm french.
http://geekographie.maieul.net
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: everyline

Post by Stefan Kottwitz »

You did not end the lines by \\ or \newline, you just ended the line in the source code. Line breaks in the source code are like white space, they don't mean line breaks in the output. It's like continuous writing.

Stefan
LaTeX.org admin
maieul
Posts: 8
Joined: Sun Jan 16, 2011 12:23 am

Re: everyline

Post by maieul »

Ok,

I think I misspoken.

I want to count each ligne of the output. Each line that latex make.
Please forgive me for English : I'm french.
http://geekographie.maieul.net
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

\everyline command similar to \everypar

Post by Stefan Kottwitz »

You could use the lineno package.

Stefan
LaTeX.org admin
maieul
Posts: 8
Joined: Sun Jan 16, 2011 12:23 am

Re: everyline

Post by maieul »

The problem is not that a want to numerote lines ;-).

In fact, I want to make each line (made by LaTeX) start by a personal character. So I thougth there was a commands like everyline. But it' seem not.

I looked on the code of lineno, but I did'nt understand how he do to know when a line start.
Please forgive me for English : I'm french.
http://geekographie.maieul.net
maieul
Posts: 8
Joined: Sun Jan 16, 2011 12:23 am

Re: everyline

Post by maieul »

A found a solution. The problem was for integrate a function on the ledmac/ledpar package.

As this package work with hbox, I used \everyhbox and some counter to be sure to insert this character on the right hbox.

See for the upade : http://groups.google.com/group/comp.tex ... 7efe94cdf8#
Please forgive me for English : I'm french.
http://geekographie.maieul.net
Post Reply