summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-13 00:11:15 +0000
committerKarl Berry <karl@freefriends.org>2006-01-13 00:11:15 +0000
commit4b5487398103e93799625c57c03caac2318b1398 (patch)
tree8d4ea226f0411c731a62d593683d5c2c81327fa7 /Master/texmf-dist/tex
parent23e7162338e0006320660626575dc9f19c0f4059 (diff)
warning
git-svn-id: svn://tug.org/texlive/trunk@1447 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/warning/warning.sty80
1 files changed, 80 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/warning/warning.sty b/Master/texmf-dist/tex/latex/warning/warning.sty
new file mode 100644
index 00000000000..67f97468396
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/warning/warning.sty
@@ -0,0 +1,80 @@
+%%
+%% warning.sty
+%%
+%% Global warnings at the end of the screen output and the logfile
+%%
+%% Copyright 2001 Harald Harders (h.harders@tu-bs.de)
+%%
+%% License: LPPL
+%%
+%% Sometimes a class or package has to make a global warning such as
+%% ``Rerun for this or that reason'' or ``This is draft, change this
+%% before the final run''. If you are generating them with
+%% \AtEndDocument{\PackageWarningNoLine{packagename}{warning}}
+%% the warning appears very early before the filelist. Then the
+%% warning can easily be overseen. This package provides a command
+%% that surely puts the warning at the end near to the global
+%% warnings generated by LaTeX itself.
+%% You can add a warning to a list of user defined warnings using the
+%% command \addglobalwarning as it can be seen in the example below.
+%%
+%% This package could be useful for the warnings generated e.g. by
+%% the packages changebar.sty or longtable.sty.
+%%
+%% Harald Harders
+%%
+%%
+%% Example:
+%%
+%% \documentclass{article}
+%% \usepackage{warning}
+%% \addglobalwarning{%
+%% \ClassWarningNoLine{testclass}{This is a global warning}}
+%% \addglobalwarning{%
+%% \PackageWarningNoLine{testpackage}{This is another global warning}}
+%% \begin{document}
+%% Hello
+%% \end{document}
+%%
+%%
+\ProvidesPackage{warning}[2001/08/17 v0.01 Global warnings at end of logfile]
+
+% Define a command that adds new warnings to the list of warnings.
+% Modification of the \addto command provided by babel.def.
+\def\addglobalwarning#1{%
+ \ifx\wrn@warning\@undefined
+ \def\wrn@warning{#1}%
+ \else
+ \ifx\wrn@warning\relax
+ \def\wrn@warning{#1}%
+ \else
+ {\toks@\expandafter{\wrn@warning#1}%
+ \xdef\wrn@warning{\the\toks@}}%
+ \fi
+ \fi
+}
+
+% Expand \@@end command. I have the feeling that is not too stable.
+% Thus not used.
+%\let\wrn@end\@@end
+%\def\@@end{\wrn@warning\wrn@end}
+
+% Expand \@refundefined command. This does not work if undefined
+% references appear after the execution of \AtEndDocument which can happen.
+% Thus not used.
+%\AtEndDocument{%
+% \let\wrn@refundefined=\@refundefined
+% \def\@refundefined{\wrn@refundefined\wrn@warning}}
+
+% Expand \@dofilelist
+% This works with or without \listfiles because \listfile has to be
+% used in the preamble and therefor is executed before this definition.
+\AtBeginDocument{%
+ \let\wrn@dofilelist\@dofilelist
+ \def\@dofilelist{\wrn@dofilelist\wrn@warning}%
+}
+
+\let\wrn@warning\relax
+
+\endinput
+%% EOF \ No newline at end of file