Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using the lineno package to print line numbers (each page starts with number one) in the draft of my document:

\usepackage[switch*, pagewise]{lineno}

Is there a way to read out the number of lines in the whole document (or even per chapter) from one of the aux files?

I do only want to count the "real" text lines, not the headers and footers, so a sum of all the linenumbers would be quite useful. (Even if also floats are counted as one line each.)

share|improve this question

1 Answer 1

up vote 14 down vote accepted

The last annotation in the .aux file made by lineno is of the form

\@LN{251}{5}

where 251 is the global number of counted lines and 5 is the last page number. Of course this will depend on the document.

If you say

\AtEndDocument{\typeout{Total number of lines: \thelinenumber}}

in your preamble, you'll see a message such as

Total number of lines: 251

in the log file (and on the terminal window).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.