diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/warning |
Initial commit
Diffstat (limited to 'macros/latex/contrib/warning')
-rw-r--r-- | macros/latex/contrib/warning/warning-doc.pdf | bin | 0 -> 254870 bytes | |||
-rw-r--r-- | macros/latex/contrib/warning/warning-doc.tex | 78 | ||||
-rw-r--r-- | macros/latex/contrib/warning/warning.sty | 80 |
3 files changed, 158 insertions, 0 deletions
diff --git a/macros/latex/contrib/warning/warning-doc.pdf b/macros/latex/contrib/warning/warning-doc.pdf Binary files differnew file mode 100644 index 0000000000..8d12e159cf --- /dev/null +++ b/macros/latex/contrib/warning/warning-doc.pdf diff --git a/macros/latex/contrib/warning/warning-doc.tex b/macros/latex/contrib/warning/warning-doc.tex new file mode 100644 index 0000000000..d8b78dbdf6 --- /dev/null +++ b/macros/latex/contrib/warning/warning-doc.tex @@ -0,0 +1,78 @@ +\documentclass[pagesize=auto, parskip=half, fontsize=12pt, DIV=11]{scrartcl} + +\usepackage{fixltx2e} +\usepackage{etex} +\usepackage{lmodern} +\usepackage[T1]{fontenc} +\usepackage{textcomp} +\usepackage[svgnames]{xcolor} +\usepackage{listings} +\usepackage{microtype} +\usepackage{hyperref} + +\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} +\newcommand*{\pkg}[1]{\textsf{#1}} +\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} +\makeatletter +\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} +\makeatother +\newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle} +\newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}} + +\addtokomafont{title}{\rmfamily} +\deffootnote{1em}{1em}{\textsuperscript{\thefootnotemark}} + +\lstset{% + language=[LaTeX]TeX,% + columns=flexible,% + upquote=true,% + numbers=left,% + basicstyle=\ttfamily,% + keywordstyle=\color{Navy},% + commentstyle=\color{DimGray},% + stringstyle=\color{SeaGreen},% + numberstyle=\scriptsize\color{SlateGray}% +} + +\title{The \pkg{warning} package\thanks{This manual corresponds to \pkg{warning.sty}~v0.01, dated~2001/08/17.}} +\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} + + +\begin{document} + +\maketitle + +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 +\verb+\AtEndDocument{\PackageWarningNoLine+\marg{packagename}\marg{warning}\verb+}+ +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 \cmd{\addglobalwarning} as it can be seen in the example below. + +This package could be useful for the warnings generated e.\,g.\ by +the packages \pkg{changebar.sty} or \pkg{longtable.sty}. + +Harald Harders + + +\minisec{Example:} + +\begin{lstlisting} +\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} +\end{lstlisting} + +\end{document} diff --git a/macros/latex/contrib/warning/warning.sty b/macros/latex/contrib/warning/warning.sty new file mode 100644 index 0000000000..67f9746839 --- /dev/null +++ b/macros/latex/contrib/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 |