summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-07-08 22:44:22 +0000
committerKarl Berry <karl@freefriends.org>2006-07-08 22:44:22 +0000
commitc59e8e72c1dd6b8a00e742faa6f752cbc03feebc (patch)
treedddd51491e30f2d8da50ac1efbb7af2fbee7568e /Master/texmf-dist/doc/latex
parent13e3bf66eaa5551c7d9839efad868587e36dc584 (diff)
nag 0.5
git-svn-id: svn://tug.org/texlive/trunk@1785 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex')
-rw-r--r--Master/texmf-dist/doc/latex/nag/nag-abort.cfg37
-rw-r--r--Master/texmf-dist/doc/latex/nag/nag-l2tabu.cfg110
-rw-r--r--Master/texmf-dist/doc/latex/nag/nag-orthodox.cfg45
-rw-r--r--Master/texmf-dist/doc/latex/nag/nag.pdfbin68025 -> 141119 bytes
-rw-r--r--Master/texmf-dist/doc/latex/nag/nag.sty254
-rw-r--r--Master/texmf-dist/doc/latex/nag/nagdemo.pdfbin28954 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/nag/nagdemo.tex25
7 files changed, 466 insertions, 5 deletions
diff --git a/Master/texmf-dist/doc/latex/nag/nag-abort.cfg b/Master/texmf-dist/doc/latex/nag/nag-abort.cfg
new file mode 100644
index 00000000000..5102e831b4f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/nag/nag-abort.cfg
@@ -0,0 +1,37 @@
+%%
+%% This is file `nag-abort.cfg',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% nag.dtx (with options: `abortnag')
+%% This is a generated file.
+%%
+%% This file is part of the `nag' package.
+%% The `nag' package has the LPPL maintenance status: maintained.
+%% Current Maintainer is Ulrich M. Schwarz, ulmi@users.sarovar.org
+%%
+%% Copyright (C) 2005, 2006 by Ulrich M. Schwarz.
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3a of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%% http://www.latex-project.org/lppl.txt
+%%
+\ProvidesFile{nag-abort.cfg}
+ [2005/05/08 v0.1 treat complaints as errors (ulmi)]
+\renewcommand\nag@warn[1]{%
+ \addtocounter{nag@sins}{1}%
+ \PackageError{nag}{#1}{#1}%
+}
+\renewcommand\nag@warnNoLine[1]{%
+ \addtocounter{nag@sins}{1}%
+ \PackageError{nag}{#1}{#1}%
+}
+%%X Local Variables:
+%%X mode: latex
+%%X End:
+\endinput
+%%
+%% End of file `nag-abort.cfg'.
diff --git a/Master/texmf-dist/doc/latex/nag/nag-l2tabu.cfg b/Master/texmf-dist/doc/latex/nag/nag-l2tabu.cfg
new file mode 100644
index 00000000000..bde36c3aae8
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/nag/nag-l2tabu.cfg
@@ -0,0 +1,110 @@
+%%
+%% This is file `nag-l2tabu.cfg',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% nag.dtx (with options: `l2tabunag')
+%% This is a generated file.
+%%
+%% This file is part of the `nag' package.
+%% The `nag' package has the LPPL maintenance status: maintained.
+%% Current Maintainer is Ulrich M. Schwarz, ulmi@users.sarovar.org
+%%
+%% Copyright (C) 2005, 2006 by Ulrich M. Schwarz.
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3a of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%% http://www.latex-project.org/lppl.txt
+%%
+\ProvidesFile{nag-l2tabu.cfg}
+ [2006/04/19 v1.8 l2tabu rules for nag.sty (ulmi)]
+%%
+%% The sins.
+%%
+%% Section numbers refer to l2tabuen 1.7 revised/enlarged dated 2004OCT24
+%% \S 1.1
+\ObsoletePackage{a4wide}{the \lq a4paper\rq\space class option}
+\ObsoletePackage{a4}{the \lq a4paper\rq\space class option}
+%% \S 1.2--1.5 cannot reasonably be checked programmatically
+%% \S 1.6 is handled by H.Harders' onlyamsmath package
+%% \S 1.7 cannot reasonably be checked programmatically
+%% \S 1.8 \sloppy is called by parbox, among others, and would
+%% give many spurious warnings.
+%% \S 2.1.1
+\ObsoleteCS[an old LaTeX 2.09 command]{bf}
+ {\protect\bfseries\space or \protect\textbf}
+\ObsoleteCS[an old LaTeX 2.09 command]{it}
+ {\protect\itshape\space or \protect\textit}
+\ObsoleteCS[an old LaTeX 2.09 command]{rm}
+ {\protect\rmfamily\space or \protect\textrm}
+\ObsoleteCS[an old LaTeX 2.09 command]{sc}
+ {\protect\scshape\space or \protect\textsc}
+\ObsoleteCS[an old LaTeX 2.09 command]{sf}
+ {\protect\sffamily\space or \protect\textsf}
+\ObsoleteCS[an old LaTeX 2.09 command]{sl}
+ {\protect\slshape\space or \protect\textsl}
+\ObsoleteCS[an old LaTeX 2.09 command]{tt}
+ {\protect\ttfamily\space or \protect\texttt}
+\ObsoleteCS[an old LaTeX 2.09 command]{cal}
+ {\protect\mathcal}% Hmm, this is not in l2tabu?
+%% \S 2.1.2
+%% Gone with 1.8 because this never worked for the kernel \frac anyway.
+%% \ObsoleteCS[TeX]{over}{\protect\frac}
+%% \ObsoleteCS[TeX]{choose}{\protect\frac\space or amsmath's \protect\binom}
+%% \S 2.1.3
+\ObsoleteCS[TeX]{centerline}{\protect\centering\space or center environment}
+%% \S 2.2.1
+\ObsoleteClass{scrlettr}{the scrlttr2 package}
+%% \S 2.2.2
+\ObsoletePackage{epsf}{the graphicx package}
+\ObsoletePackage{psfig}{the graphicx package}
+\ObsoletePackage[deprecated]{epsfig}{the graphicx package directly}
+%% \S 2.2.3
+\ObsoletePackage{doublespace}{the setspace package}
+%% \S 2.2.4
+\ObsoletePackage{fancyheadings}{the fancyhdr or scrpage2 packages}
+\ObsoletePackage{scrpage}{the scrpage2 package}
+%% \S 2.2.5
+\ObsoletePackage{isolatin}{the inputenc package with option latin1}
+\ObsoletePackage{umlaut}{the inputenc package with suitable option
+ (latin1, utf8 ...)}
+\ObsoletePackage{isolatin1}{the inputenc package with option latin1}
+%% \S 2.2.6
+\ObsoletePackage{t1enc}{the fontenc package with option T1}
+%% \S 2.2.7 we don't check for bst yet.
+%% (This is in l2tabu 1.8)
+\ObsoletePackage{caption2}{the caption package v3.0 or later}
+%% \S 2.3.1-3
+\ObsoletePackage{times}
+ {the mathptmx, helvet (option scaled=.9), courier packages}
+\ObsoletePackage{pslatex}
+ {the mathptmx, helvet (option scaled=.9), courier packages}
+\ObsoletePackage{mathptm}
+ {the mathptmx package}
+%% \S 2.3.4-5
+\ObsoletePackage{palatino}
+ {the mathpazo, helvet (option scaled=.95), courier packages}
+\ObsoletePackage{mathpple}{the mathpazo package}
+%% \S 2.3.6 can't be checked
+%% \S 2.3.7
+\ObsoletePackage{euler}{the eulervm package}
+\ObsoletePackage{utopia}{the fourier package}
+%% \S 3.1
+\g@addto@macro\nag@floats{,figure,table}%
+%% \S 3.2
+\NotAnEnvironment{appendix}%
+%% In the same vein:
+\@for\sectioning:=frontmatter,mainmatter,backmatter\do{%
+ \expandafter\NotAnEnvironment\expandafter{\sectioning}%
+}
+%% \S 3.3 handled by onlyamsmath.
+%% \S 3.4 -- nothing to be done --
+%%X Local Variables:
+%%X mode: latex
+%%X End:
+\endinput
+%%
+%% End of file `nag-l2tabu.cfg'.
diff --git a/Master/texmf-dist/doc/latex/nag/nag-orthodox.cfg b/Master/texmf-dist/doc/latex/nag/nag-orthodox.cfg
new file mode 100644
index 00000000000..5552c9b0b67
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/nag/nag-orthodox.cfg
@@ -0,0 +1,45 @@
+%%
+%% This is file `nag-orthodox.cfg',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% nag.dtx (with options: `orthodoxnag')
+%% This is a generated file.
+%%
+%% This file is part of the `nag' package.
+%% The `nag' package has the LPPL maintenance status: maintained.
+%% Current Maintainer is Ulrich M. Schwarz, ulmi@users.sarovar.org
+%%
+%% Copyright (C) 2005, 2006 by Ulrich M. Schwarz.
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3a of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%% http://www.latex-project.org/lppl.txt
+%%
+\ProvidesFile{nag-orthodox.cfg}
+ [2006/04/19 v1.8 strict rules for nag.sty (ulmi)]
+\@for\fontcmd:=tiny,small,footnotesize,normalsize,large,Large,%
+ LARGE,huge,Huge\do{%
+ \expandafter\NotAnEnvironment\expandafter{\fontcmd}%
+}%
+\@for\fontcmd:=sffamily,rmfamily,ttfamily,%
+ bfseries,mdseries,scshape,%
+ itshape,upshape\do{%
+ \expandafter\NotAnEnvironment\expandafter{\fontcmd}%
+}%
+\@for\justsw:=centering,raggedleft,raggedright,%
+ RaggedLeft,RaggedRight\do{%
+ \expandafter\NotAnEnvironment\expandafter{\justsw}%
+}
+\@for\justenv:=center,flushleft,flushright\do{%
+ \expandafter\NotASwitch\expandafter{\justenv}%
+}
+%%X Local Variables:
+%%X mode: latex
+%%X End:
+\endinput
+%%
+%% End of file `nag-orthodox.cfg'.
diff --git a/Master/texmf-dist/doc/latex/nag/nag.pdf b/Master/texmf-dist/doc/latex/nag/nag.pdf
index 156b95a71d5..e735cbd0f28 100644
--- a/Master/texmf-dist/doc/latex/nag/nag.pdf
+++ b/Master/texmf-dist/doc/latex/nag/nag.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/nag/nag.sty b/Master/texmf-dist/doc/latex/nag/nag.sty
new file mode 100644
index 00000000000..2bbcd9721b5
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/nag/nag.sty
@@ -0,0 +1,254 @@
+%%
+%% This is file `nag.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% nag.dtx (with options: `nag')
+%% This is a generated file.
+%%
+%% This file is part of the `nag' package.
+%% The `nag' package has the LPPL maintenance status: maintained.
+%% Current Maintainer is Ulrich M. Schwarz, ulmi@users.sarovar.org
+%%
+%% Copyright (C) 2005, 2006 by Ulrich M. Schwarz.
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3a of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%% http://www.latex-project.org/lppl.txt
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{nag}[2006/07/08 0.5 warning about old commands (ulmi)]
+\let\@xa\expandafter
+\let\@nx\noexpand
+\newcounter{nag@c}
+\newcounter{nag@sins}
+ \newcommand\nag@prepend[2]{%
+ \@xa\let
+ \csname nag@@#1@\thenag@c\@xa\endcsname
+ \csname #1\endcsname
+ \@xa\nag@pr@p@nd\csname #1\@xa\endcsname
+ \csname nag@@#1@\thenag@c\endcsname{#2}%
+ \stepcounter{nag@c}%
+}
+\newcommand\nag@pr@p@nd[3]{%
+ \def#1{#3#2}%
+}
+\newcommand\nag@warn{%
+ \addtocounter{nag@sins}{1}%
+ \PackageWarning{nag}%
+}
+\newcommand\nag@warnNoLine{%
+ \addtocounter{nag@sins}{1}%
+ \PackageWarningNoLine{nag}%
+}
+\newcommand\ObsoleteCS[3][obsolete]{%
+ \AtBeginDocument{%
+ \nag@prepend{#2}{%
+ \nag@warn{%
+Command \@backslashchar#2 is #1.
+\MessageBreak
+Use #3 instead}%
+ }%
+ }%
+}
+\newcommand\nag@ifcsname[3]{%
+ \begingroup\@ifundefined{#1}{#3}{#2}\endgroup
+}
+\nag@ifcsname{ifcsname}{%
+ \renewcommand*\nag@ifcsname[3]{%
+ \begingroup
+ \ifcsname #1\endcsname
+ % It still might be relax from some other test. Thanks to J\"org
+ % Sommer for finding this bug.
+ \@ifundefined{#1}{#3}{#2}%
+ \else #3\fi
+ \endgroup
+ }%
+ \global\let\nag@ifcsname\nag@ifcsname
+}{}
+\newcommand\ObsoletePackage[3][obsolete]{%
+ \AtEndDocument{%
+ \nag@ifcsname{ver@#2.sty}{%
+ \nag@warnNoLine{%
+ Package #2 is #1.\MessageBreak
+ Use #3 instead}%
+ }{}%
+ }%
+}
+\newcommand\ObsoleteClass[3][obsolete]{%
+ \AtEndDocument{%
+ \nag@ifcsname{ver@#2.cls}{%
+ \nag@warnNoLine{%
+ Class #2 is #1.\MessageBreak
+ Use #3 instead}%
+ }{}%
+ }%
+}
+\newif\ifnag@haslabel
+\newif\ifnag@hascaption
+\newcommand\nag@hackfloat[1]{%
+ \nag@prepend{#1}{%
+ \nag@prepend{endcenter}{%
+ \nag@warn%
+ {\lq center\rq\space environment in #1.\MessageBreak
+ Maybe you want \protect\centering\space instead}
+ }%
+ }
+ \nag@prepend{#1}{%
+ \@for\labelprovider:=\nag@labels\do{%
+ \nag@prepend{\labelprovider}%
+ {\nag@captioncheck\nag@haslabeltrue}
+ }%
+ \@for\captionprovider:=\nag@captions\do{%
+ \nag@prepend{\captionprovider}{\global\nag@hascaptiontrue}%
+ }%
+ \global\nag@haslabelfalse\global\nag@hascaptionfalse
+ }%
+ \nag@prepend{end#1}{%
+ \ifnag@hascaption\relax\else
+ \nag@warn%
+{#1 with no \protect\caption}%
+ \fi
+ }%
+}
+\newcommand\nag@captioncheck{%
+ \ifnag@hascaption\else
+ \nag@warn{\protect\label\space in float, but not after
+ \protect\caption}%
+ \fi
+}
+\def\nag@floats{nag@dummy}
+\def\nag@labels{label}
+%% The latter two are used by KOMA-Script.
+\def\nag@captions{caption,captionabove,captionbelow}
+\newcommand\nag@floatsetup{%
+ \@for\flo:=\nag@floats\do{%
+ \@xa\nag@hackfloat\@xa{\flo}%
+ }%
+}
+\AtBeginDocument{%
+ \nag@floatsetup
+}
+\AtBeginDocument{%
+ \AtEndDocument{%
+ \ifnum\value{nag@sins}>0%
+ \PackageWarningNoLine{nag}{\arabic{nag@sins} complaints
+ in total}%
+ \else
+ \typeout{No complaints by nag.}%
+ \fi
+ }%
+}
+\newcommand\nag@ifCurrentEnvironment[3]{%
+ \bgroup
+ \def\tmp@a{#1}%
+ \ifx\@currenvir\tmp@a
+ #2%
+ \else
+ #3%
+ \fi
+ \egroup
+}
+\newcommand\NotAnEnvironment[1]{%
+ \AtBeginDocument{%
+ \nag@prepend{#1}{%
+ \nag@ifCurrentEnvironment{#1}{%
+ \nag@warn{%
+ There is no environment ``#1''.\MessageBreak
+ Maybe you want a grouped \@backslashchar#1
+ }%
+ }{% OK case.
+ }%
+ }%
+ }%
+}
+\newcommand\nag@envstack{\relax}
+
+\newcommand\nag@beginenv[1]{%
+ % push a begin-entry onto the stack. Form is
+ % |{\foo{lineno}}| for environment foo.
+ \xdef\nag@envstack{%
+ \@nx{%
+ \@xa\@nx\csname #1\endcsname
+ \@nx{\the\inputlineno\@nx}%
+ \@nx}%
+ \@xa\@nx\nag@envstack
+ }%
+}
+\newcommand\nag@endenv[1]{%
+ % extract the first entry.
+ \@xa\nag@end@nv\nag@envstack\@nil #1\@nil
+}
+
+\def\nag@end@nv#1#2\@nil #3\@nil{%
+ \def\tmp@a{#1}%
+ \def\tmp@b{\relax}%
+ \ifx\tmp@a\tmp@b
+ % This was the end-of-stack flag.
+ \nag@warn{``\@backslashchar end#3'' without matching
+ ``\@backslashchar #3''}
+ \else
+ % We may assume this is a proper entry. See if the begin-token on
+ % the stack matches what |\nag@endenv| was passed.
+ \@xa\ifx\csname #3\@xa\endcsname\@firstoftwo #1%
+ %OK case, just pop the entry.
+ \gdef\nag@envstack{#2}%
+ \else
+ % error case
+ \nag@warn{%
+ You cannot close ``\@xa\string\@firstoftwo #1'' on line
+ \@secondoftwo #1 with ``\@backslashchar end#3''%
+ }%
+ % leave it on the stack. Some case of misnesting will always cause
+ % horrible amounts of follow-up errors. Also, scare them!
+ \fi
+ \fi
+}
+\AtEndDocument{%
+ \@xa\@tfor\@xa\looseends\@xa:\@xa=\nag@envstack\do{%
+ \@xa\ifx\looseends\relax\else
+ \nag@warnNoLine{Unmatched
+ ``\@xa\@xa\@xa\string\@xa\@firstoftwo\looseends''
+ command on line
+ \@xa\@xa\@xa\string\@xa\@secondoftwo\looseends%
+ }%
+ \fi
+ }%
+}
+\newcommand\NotASwitch[1]{%
+ \AtBeginDocument{%
+ \nag@prepend{#1}{%
+ \nag@beginenv{#1}%
+ }%
+ \nag@prepend{end#1}{%
+ \nag@endenv{#1}%
+ }%
+ }%
+}
+\DeclareOption*{%
+ \InputIfFileExists{nag-\CurrentOption.cfg}{%
+ \PackageInfo{nag}{%
+ Loaded nag-\CurrentOption.cfg
+ }
+ }{%
+ \InputIfFileExists{\CurrentOption.nag}{%
+ \PackageWarningNoLine{nag}{%
+ Loaded old-style config file \CurrentOption.nag.\MessageBreak
+ Consider renaming the file to nag-\CurrentOption.cfg
+ }%
+ }{%
+ \PackageWarningNoLine{nag}{Required ruleset
+ \CurrentOption, and it wasn't there}
+ }%
+ }
+}
+\ProcessOptions*
+%%X Local Variables:
+%%X mode: latex
+%%X End:
+\endinput
+%%
+%% End of file `nag.sty'.
diff --git a/Master/texmf-dist/doc/latex/nag/nagdemo.pdf b/Master/texmf-dist/doc/latex/nag/nagdemo.pdf
deleted file mode 100644
index 6209f67c652..00000000000
--- a/Master/texmf-dist/doc/latex/nag/nagdemo.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/nag/nagdemo.tex b/Master/texmf-dist/doc/latex/nag/nagdemo.tex
index ce616dc58b0..afb54fca744 100644
--- a/Master/texmf-dist/doc/latex/nag/nagdemo.tex
+++ b/Master/texmf-dist/doc/latex/nag/nagdemo.tex
@@ -11,7 +11,7 @@
%% The `nag' package has the LPPL maintenance status: maintained.
%% Current Maintainer is Ulrich M. Schwarz, ulmi@users.sarovar.org
%%
-%% Copyright (C) 2005 by Ulrich M. Schwarz.
+%% Copyright (C) 2005, 2006 by Ulrich M. Schwarz.
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -21,7 +21,7 @@
%%
%% Test document: finding and complaining about obsolete macros.
%%
-\RequirePackage[l2tabu]{nag}
+\RequirePackage[l2tabu, orthodox]{nag}
\documentclass{article}
%% some usual culprits
\usepackage{times, a4wide, epsfig, palatino}
@@ -29,6 +29,13 @@
\typeout{Next: it and bf complaints}
{\it f{\bf oo}f}highter
+\typeout{Next: not-an-env complaints}
+\begin{Large}
+ \begin{sffamily}
+ Foo!
+ \end{sffamily}
+\end{Large}
+
\typeout{Next: center in float complaint}
\begin{figure}
\begin{center}
@@ -55,15 +62,23 @@
Foo.
\end{figure}
+\typeout{Next: appendix complaints}
\begin{appendix}
\begin{center}
Foo.
\end{center}
-\typeout{Next: over complaint, centerline complaint}
+\typeout{Next: no over complaint, centerline complaint, no frac complaint}
\centerline{Ferner gilt $4\over 2=2$.}
-\typeout{Next: appendix complaints}
+ $\frac 42$
\end{appendix}
-\typeout{You should get 13 warnings.}
+\typeout{Next: unmatched endflushright}
+\endflushright
+\typeout{Next: unclosed center}
+{\center Smack in the middle!}
+\typeout{Next: mismatched endflushright}
+\endflushright
+
+\typeout{You should get 17 warnings.}
\end{document}
%%X Local Variables:
%%X mode: latex