summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/warning
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-03-19 03:01:21 +0000
committerNorbert Preining <norbert@preining.info>2023-03-19 03:01:21 +0000
commit41b65de3ca404c665b94ea7716f036ce4f024619 (patch)
tree79b818f56264510a85b019c02e6d7b26238d9cfb /macros/latex/contrib/warning
parentb0cfbb3bcaeafdcb4da817c21937f10ce07f5dca (diff)
CTAN sync 202303190301
Diffstat (limited to 'macros/latex/contrib/warning')
-rw-r--r--macros/latex/contrib/warning/README77
-rw-r--r--macros/latex/contrib/warning/warning-doc.pdfbin254870 -> 288383 bytes
-rw-r--r--macros/latex/contrib/warning/warning-doc.tex31
-rw-r--r--macros/latex/contrib/warning/warning.sty118
4 files changed, 153 insertions, 73 deletions
diff --git a/macros/latex/contrib/warning/README b/macros/latex/contrib/warning/README
new file mode 100644
index 0000000000..b80a18f268
--- /dev/null
+++ b/macros/latex/contrib/warning/README
@@ -0,0 +1,77 @@
+README for warning package, 2023-03-18, v0.10
+
+
+TABLE OF CONTENTS
+=================
+
+1 Introduction
+2 Download
+3 Installation
+
+
+1 INTRODUCTION
+==============
+
+Note 1: This package is obsolete. For LaTeX-format 2020-10-01 and newer:
+Instead of \addglobalwarning{ something } use
+\AddToHook{enddocument/info}{ something } and do not load the warning package.
+
+Note 2: The package author, Harald Harders, is inactive.
+
+
+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 material is published under the LPPL 1.3c: This work may be
+distributed and/or modified under the conditions of the LaTeX Project
+Public License, either version 1.3c of this license or (at your option)
+any later version. This version of this license is in
+https://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+https://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of
+LaTeX version 2005-12-01 or later.
+
+
+2 DOWNLOAD
+==========
+
+"warning" is available on CTAN:
+https://ctan.org/pkg/warning
+
+Also a ZIP file is provided that contains the files:
+the manual (warning-doc.tex and warning-doc.pdf,
+including examples),
+the style file (warning.sty),
+and this README:
+https://mirrors.ctan.org/macros/latex/contrib/warning.zip
+
+
+3 INSTALLATION
+==============
+
+a) Download the warning files from CTAN.
+ If necessary, unpack them.
+b) Install the file "warning.sty" in your TDS tree:
+ cp warning.sty TDS:tex/latex/warning/
+ Replace "TDS:" by the prefix of your TDS tree
+ (texmf directory).
+c) Create the documentation, if necessary, e.g.
+ pdflatex warning.tex
+ pdflatex warning.tex
+d) Update the databases if necessary, e.g. for TeX Live
+ texhash or mktexlsr.
+e) Create the warning-example.pdf, if necessary,
+ by copying the example code from the documentation
+ into (a) separate .tex file(s) and compiling that (those).
+f) Copy the documentation files to
+ "TDS:doc/latex/warning/":
+ README, warning.pdf, warning.tex,
+ and the example(s), if you created any. \ No newline at end of file
diff --git a/macros/latex/contrib/warning/warning-doc.pdf b/macros/latex/contrib/warning/warning-doc.pdf
index 8d12e159cf..b3c6f60b2d 100644
--- a/macros/latex/contrib/warning/warning-doc.pdf
+++ b/macros/latex/contrib/warning/warning-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/warning/warning-doc.tex b/macros/latex/contrib/warning/warning-doc.tex
index d8b78dbdf6..82a93be17e 100644
--- a/macros/latex/contrib/warning/warning-doc.tex
+++ b/macros/latex/contrib/warning/warning-doc.tex
@@ -1,10 +1,6 @@
-\documentclass[pagesize=auto, parskip=half, fontsize=12pt, DIV=11]{scrartcl}
-
-\usepackage{fixltx2e}
-\usepackage{etex}
+\documentclass[parskip=half,fontsize=12pt,DIV=11]{scrartcl}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
-\usepackage{textcomp}
\usepackage[svgnames]{xcolor}
\usepackage{listings}
\usepackage{microtype}
@@ -34,16 +30,19 @@
numberstyle=\scriptsize\color{SlateGray}%
}
-\title{The \pkg{warning} package\thanks{This manual corresponds to \pkg{warning.sty}~v0.01, dated~2001/08/17.}}
+\title{The \pkg{warning} package\thanks{This manual corresponds to \pkg{warning.sty}~v0.10, dated~2023-03-18.}}
\subtitle{Global warnings at the end of the screen output\\and the logfile}
-\author{Harald Harders\thanks{\mail{h.harders@tu-bs.de}}}
-\date{2001/08/17}
-
+\author{Harald Harders\thanks{\mail{harald.harders@gmx.de}}\hspace{0.7em}(inactive)}
+\date{2023-03-18}% (2023-03-18 update done by H.-Martin Münch, <Martin dot Muench at Uni-Bonn dot de>)
\begin{document}
-
\maketitle
+{\large\color{red}
+\textbf{Note: This package is obsolete. For \LaTeX-format \hbox{2020-10-01} and newer:
+Instead of }\verb|\addglobalwarning{ something }|\textbf{ use }
+\verb|\AddToHook{enddocument/info}{ something }|\textbf{ and do not load the warning package.}}
+
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
@@ -60,6 +59,7 @@ the packages \pkg{changebar.sty} or \pkg{longtable.sty}.
Harald Harders
+\newpage
\minisec{Example:}
@@ -75,4 +75,15 @@ Hello
\end{document}
\end{lstlisting}
+For \LaTeX-format 2020-10-01 and newer use:
+\begin{lstlisting}
+\documentclass{article}
+\AddToHook{enddocument/info}{%
+ \ClassWarningNoLine{testclass}{This is a global warning}}
+\AddToHook{enddocument/info}{%
+ \PackageWarningNoLine{testpackage}{This is another global warning}}
+\begin{document}
+Hello
\end{document}
+\end{lstlisting}
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/warning/warning.sty b/macros/latex/contrib/warning/warning.sty
index 67f9746839..0a8e3e5b7d 100644
--- a/macros/latex/contrib/warning/warning.sty
+++ b/macros/latex/contrib/warning/warning.sty
@@ -1,80 +1,72 @@
%%
-%% warning.sty
+%% Project: warning
+%% Version: 2023-03-18 v0.10
+%% Info: Global warnings at the end of the screen output and the logfile
%%
-%% Global warnings at the end of the screen output and the logfile
+%% Copyright © 2001, 2023 Harald Harders (harald.harders@gmx.de; inactive)
+%% (2023-03-18 update done by H.-Martin Münch, <Martin dot Muench at Uni-Bonn dot de>)
%%
-%% Copyright 2001 Harald Harders (h.harders@tu-bs.de)
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of
+%% LaTeX version 2005-12-01 or later.
%%
-%% License: LPPL
+%% Note: This package is obsolete. For LaTeX-format 2020-10-01 and newer:
+%% Instead of \addglobalwarning{ something } use
+%% \AddToHook{enddocument/info}{ something }
+%% and do not load the warning package.
%%
-%% 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]
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{warning}[2023/03/18 v0.10 Global warnings at end of logfile]
+
+\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
+\IfFormatAtLeastTF{2020/10/01}{
+ \NewDocumentCommand\addglobalwarning{m}{\AddToHook{enddocument/info}{#1}}
+ \addglobalwarning{%
+ \PackageWarningNoLine{warning}{Package warning is obsolete.\MessageBreak%
+ Instead of \string\addglobalwarning{ something } use \MessageBreak%
+ \string\AddToHook{enddocument/info}{ something }\MessageBreak%
+ and do not load the warning package}
+ }
+ \def\wrn@warning{\endinput}
+ }{\let\wrn@warning\relax
+ \AtBeginDocument{\addglobalwarning{\PackageWarningNoLine{warning}{%
+ Used LaTeX-format: \fmtversion, more recent LaTeX-format is available}}}
+ }
+
+\wrn@warning% is \endinput for LaTeX since 2020-10-01 and \relax for older LaTeX.
% 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
+ {\toks@\expandafter{\wrn@warning#1}%
+ \xdef\wrn@warning{\the\toks@}}%
}
-% 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
+ \let\wrn@dofilelist\@dofilelist%
\def\@dofilelist{\wrn@dofilelist\wrn@warning}%
}
-
-\let\wrn@warning\relax
-
\endinput
+% This works with or without \listfiles because \listfile has to be
+% used in the preamble and therefor is executed before this definition.
+%
+% 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}}
+%
%% EOF \ No newline at end of file