
diff -r c9ff326e3ce5 -r 796c6ea633b3 CookBook/document/root.tex
--- a/CookBook/document/root.tex	Sat Feb 14 00:11:50 2009 +0000
+++ b/CookBook/document/root.tex	Sat Feb 14 00:24:05 2009 +0000
@@ -84,14 +84,16 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % for code that has line numbers
+\newenvironment{linenos}{\resetlinenumber\internallinenumbers}{\nolinenumbers}
+
 \isakeeptag{linenos}
-\renewcommand{\isataglinenos}{\begingroup\resetlinenumber\internallinenumbers}
-\renewcommand{\endisataglinenos}{\par\nolinenumbers\endgroup}
+\renewcommand{\isataglinenos}{\begin{linenos}}
+\renewcommand{\endisataglinenos}{\par\end{linenos}}
 
 % should only be used in ML code
 \isakeeptag{linenosgray}
-\renewcommand{\isataglinenosgray}{\begin{vanishML}\begin{graybox}\resetlinenumber\internallinenumbers}
-\renewcommand{\endisataglinenosgray}{\par\nolinenumbers\end{graybox}\end{vanishML}}
+\renewcommand{\isataglinenosgray}{\begin{vanishML}\begin{graybox}\begin{linenos}}
+\renewcommand{\endisataglinenosgray}{\par\end{linenos}\end{graybox}\end{vanishML}}
 
 \isakeeptag{small}
 \renewcommand{\isatagsmall}{\begingroup\small}




