diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/bezos/checkend.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/bezos/checkend.sty | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/bezos/checkend.sty b/Master/texmf-dist/tex/latex/bezos/checkend.sty new file mode 100644 index 00000000000..87b71517555 --- /dev/null +++ b/Master/texmf-dist/tex/latex/bezos/checkend.sty @@ -0,0 +1,55 @@ +% +--------------------------------------------------+ +% | Documentation in clear text follows | +% +--------------------------------------------------+ +% +% (c) 2002 Javier Bezos. All Rights Reserved. +% +% This file can be redistributed and/or modified under the terms +% of the LaTeX Project Public License Distributed from CTAN +% archives in directory macros/latex/base/lppl.txt; either +% version 1 of the License, or any later version. +% +% +% Usage +% ~~~~~ +% When an environment is left open, LaTeX gives an error at the +% end of the document. However it only informs about the first +% of them, while the rest are shown with meaningless errors: +% +% (\end occurred inside a group at level N) +% +% This package replaces them with more useful messages +% which show which environments (in reverse order) were +% not closed. +% +% That's all. There are no user macros. Just use the package. +% +% Code +% ~~~~ + +\def\fileversion{1.0} +\def\filedate{2002/04/20} + +\ProvidesPackage{checkend}[2002/04/20 v1.0 Environment checking] + +\def\chkend@checkend{% + \def\@tempa{document}% + \ifx\@currenvir\@tempa + \else + \count@\errorcontextlines + \errorcontextlines\z@ + \PackageError{checkend}{% + \@currenvir \@currenvline \space open at + \string\end{document}}% + {The package has detected an open environment at the + end\MessageBreak + of the document}% + \errorcontextlines\count@ + \csname end\@currenvir\endcsname + \endgroup + \chkend@checkend + \fi} + +\AtEndDocument{\chkend@checkend} + +\endinput
\ No newline at end of file |