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 writing a dtx file containing several source files. Is there a way to reset the line counter when commenting the code of a different file?

My dtx file looks something like this:

....
%\iffalse
%<file1>
%\fi
% .... comments and code of file 1
%\iffalse
%</file1>
%<file2>
%\fi
% .... comments and code of file 2 ... etc.

and I would like the line numbers of the code of file2 to start with 1 again.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

The doc package uses the CodelineNo counter so \setcounter{CodelineNo}{0} probably does what you need.

share|improve this answer
    
perfect, thank you! –  Jonathan Mar 22 '12 at 11:33
add comment

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.