Quantcast
Channel: How to create a paragraph that show the number of line it contains? - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

How to create a paragraph that show the number of line it contains?

$
0
0

Trying being brief...

How can I create a paragraph that shows meta information, e.g., mentioning the number of lines or words it contains, using TeX primitives only? It's very important that such information could appear at any place in the paragraph (at the start, middle or end... anywhere in the paragraph)

For example:

This paragraph has 4 lines. Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá-Blá

(I'm not sure if the paragraph above will be coherent. That is the point in this question!)

I've thought about create a \vbox, do some calculations and unbox it after updates. But a meta data could occupying a lot of lines. I have no idea how to preview where TeX system will break a line o use hyphenation, so, how many lines will be add after the insertion of a some characters at a given point.

Thanks in advance.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images