Debian Codegraph @

texmf-dist/doc/latex/warning/warning-doc.tex

raw
1 \documentclass[parskip=half,fontsize=12pt,DIV=11]{scrartcl}
2 \usepackage{lmodern}
3 \usepackage[T1]{fontenc}
4 \usepackage[svgnames]{xcolor}
5 \usepackage{listings}
6 \usepackage{microtype}
7 \usepackage{hyperref}
8
9 \newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
10 \newcommand*{\pkg}[1]{\textsf{#1}}
11 \newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
12 \makeatletter
13 \newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}}
14 \makeatother
15 \newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle}
16 \newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}}
17
18 \addtokomafont{title}{\rmfamily}
19 \deffootnote{1em}{1em}{\textsuperscript{\thefootnotemark}}
20
21 \lstset{%
22 language=[LaTeX]TeX,%
23 columns=flexible,%
24 upquote=true,%
25 numbers=left,%
26 basicstyle=\ttfamily,%
27 keywordstyle=\color{Navy},%
28 commentstyle=\color{DimGray},%
29 stringstyle=\color{SeaGreen},%
30 numberstyle=\scriptsize\color{SlateGray}%
31 }
32
33 \title{The \pkg{warning} package\thanks{This manual corresponds to \pkg{warning.sty}~v0.11, dated~2025-01-01.}}
34 \subtitle{Global warnings at the end of the screen output\\and the logfile}
35 \author{Harald Harders\thanks{\mail{[email protected]}}\hspace{0.7em}(inactive)}
36 \date{2025-01-01}% (2025-01-01 update done by H.-Martin Münch, <Martin dot Muench at Uni-Bonn dot de>)
37
38 \begin{document}
39 \maketitle
40
41 {\large\color{red}
42 \textbf{Note: This package is obsolete. For \LaTeX-format \hbox{2020-10-01} and newer:
43 Instead of }\verb|\addglobalwarning{ something }|\textbf{ use }
44 \verb|\AddToHook{enddocument/info}{ something }|\textbf{ and do not load the warning package.}}
45
46 Sometimes a class or package has to make a global warning such as
47 ``Rerun for this or that reason'' or ``This is draft, change this
48 before the final run''. If you are generating them with
49 \verb+\AtEndDocument{\PackageWarningNoLine+\marg{packagename}\marg{warning}\verb+}+
50 the warning appears very early before the filelist. Then the
51 warning can easily be overseen. This package provides a command
52 that surely puts the warning at the end near to the global
53 warnings generated by \LaTeX\ itself.
54 You can add a warning to a list of user defined warnings using the
55 command \cmd{\addglobalwarning} as it can be seen in the example below.
56
57 This package could be useful for the warnings generated e.\,g.\ by
58 the packages \pkg{changebar.sty} or \pkg{longtable.sty}.
59
60 Harald Harders
61
62 \newpage
63
64 \minisec{Example:}
65
66 \begin{lstlisting}
67 \documentclass{article}
68 \usepackage{warning}
69 \addglobalwarning{%
70 \ClassWarningNoLine{testclass}{This is a global warning}}
71 \addglobalwarning{%
72 \PackageWarningNoLine{testpackage}{This is another global warning}}
73 \begin{document}
74 Hello
75 \end{document}
76 \end{lstlisting}
77
78 For \LaTeX-format 2020-10-01 and newer use:
79 \begin{lstlisting}
80 \documentclass{article}
81 \AddToHook{enddocument/info}{%
82 \ClassWarningNoLine{testclass}{This is a global warning}}
83 \AddToHook{enddocument/info}{%
84 \PackageWarningNoLine{testpackage}{This is another global warning}}
85 \begin{document}
86 Hello
87 \end{document}
88 \end{lstlisting}
89 \end{document}