summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/checkend
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/checkend
Initial commit
Diffstat (limited to 'macros/latex/contrib/checkend')
-rw-r--r--macros/latex/contrib/checkend/README.md24
-rw-r--r--macros/latex/contrib/checkend/checkend.sty71
2 files changed, 95 insertions, 0 deletions
diff --git a/macros/latex/contrib/checkend/README.md b/macros/latex/contrib/checkend/README.md
new file mode 100644
index 0000000000..f5d9b708ae
--- /dev/null
+++ b/macros/latex/contrib/checkend/README.md
@@ -0,0 +1,24 @@
+
+More useful error messages when there are open environments
+at \end{document}.
+
+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.
+
+License: MIT
+________
+Javier Bezos --- http://www.texnia.com
+
+
+
+
+
diff --git a/macros/latex/contrib/checkend/checkend.sty b/macros/latex/contrib/checkend/checkend.sty
new file mode 100644
index 0000000000..347949ae11
--- /dev/null
+++ b/macros/latex/contrib/checkend/checkend.sty
@@ -0,0 +1,71 @@
+%
+% Copyright (C) 2002-2019 Javier Bezos http://www.texnia.com
+%
+% This file may be distributed and/or modified under the conditions of
+% the MIT License. A version can be found at the end of this file.
+%
+% 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.1}
+\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
+
+MIT License
+-----------
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file