From 4b5487398103e93799625c57c03caac2318b1398 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 13 Jan 2006 00:11:15 +0000 Subject: warning git-svn-id: svn://tug.org/texlive/trunk@1447 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/warning/warning.sty | 80 +++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/warning/warning.sty (limited to 'Master/texmf-dist/tex/latex/warning') 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 -- cgit v1.2.3