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.

Despite the easy-sounding task, it appears to be hard to find a suitable package to print line numbers that ignore the automatically generated section/subsection etc. headlines in their counter.

The currently preferred, non-deprecated choice of line-numbering package seems to be lineno, which sadly doesn't have the desired option. My current way of implementing it is calling it using

\usepackage[pagewise, modulo]{lineno}

before the beginning of the document and then calling

\linenumbers

after the table of contents so it doesn't interfere with these.

However, using

\section{Heading}
text longer than 5 lines

results in lineno printing the number 5 next to text line number 4, because it also counts the section heading as a line. Please note that I'd like to refrain from using the linenumbers-environment to manually number every paragraph since my document is quite long.

share|improve this question
    
Welcome to TeX.sx! –  Rico Jan 19 '13 at 15:40

1 Answer 1

up vote 3 down vote accepted

I am the maintainer of lineno – thanks for the idea. What about using \Section rather than \section after

\newcommand*{\Section}[1]{%
    \par\nolinenumbers\section{#1}\linenumbers}

Later, one might "patch" \section accordingly, maybe even dealing with the optional argument.

share|improve this answer
    
Wow, I wouldn't have expected that. Thanks for your concern and for providing a fully working solution. –  Big-Blue Jan 19 '13 at 19:53
    
Welcome to TeX.sx! –  barbara beeton Jan 19 '13 at 21:28

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.