summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-12-03 23:36:43 +0000
committerKarl Berry <karl@freefriends.org>2011-12-03 23:36:43 +0000
commit588d746c4db3a95ed8ec234bf392c8ca7061fc3e (patch)
treedd0f18d1e6f381bf37290dc41c7012e88f13bf1e /Master
parentf884cf55d378c5815215caa25f5fb7ff1d8f83cd (diff)
nag (3dec11)
git-svn-id: svn://tug.org/texlive/trunk@24741 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/nag/nag.pdfbin458889 -> 437781 bytes
-rw-r--r--Master/texmf-dist/source/latex/nag/nag.dtx151
-rw-r--r--Master/texmf-dist/tex/latex/nag/nag-experimental.cfg50
-rw-r--r--Master/texmf-dist/tex/latex/nag/nag.sty61
4 files changed, 259 insertions, 3 deletions
diff --git a/Master/texmf-dist/doc/latex/nag/nag.pdf b/Master/texmf-dist/doc/latex/nag/nag.pdf
index 1dae746e83f..128487367d5 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/source/latex/nag/nag.dtx b/Master/texmf-dist/source/latex/nag/nag.dtx
index fe1e71cf510..0c677a254ec 100644
--- a/Master/texmf-dist/source/latex/nag/nag.dtx
+++ b/Master/texmf-dist/source/latex/nag/nag.dtx
@@ -238,13 +238,17 @@ unsuited for closing the center command above.
% adds more compatibility with the caption package.}
%\changes{0.621}{2010/04/05}{Bugfix concerning unknown command in math mode}
%\changes{0.622}{2010/05/17}{Bugfix: math in captions catcode issue}
+%\changes{0.623}{2010/08/15}{Tracing code in experimental: nofiles}
+%\changes{0.623}{2010/08/15}{Tracing code in experimental: changing labels}
+%\changes{0.623}{2010/08/15}{New error message: no room for a ... and eTeX}
+%\changes{0.7}{2011/11/25}{IncompatiblePackages,RecommendPackage,BadFileLoadOrder}
%
%\GetFileInfo{nag.sty}
%\newcommand\pkg[1]{\textsf{#1}}
%\title{The \pkg{nag} package\ignorespaces%
% \thanks{This document corresponds to \pkg{nag}~\fileversion,
% dated~\filedate. Other versions can be found at http://absatzen.de/}}
-% \author{Ulrich Michael Schwarz\ignorespaces%
+% \author{Dr. Ulrich Michael Schwarz\ignorespaces%
% \thanks{\texttt{ulmi@absatzen.de}}}
%
% \maketitle
@@ -614,6 +618,75 @@ unsuited for closing the center command above.
\ProvidesFile{nag-experimental.cfg}
[2009/07/04 v0.62alpha2 experimental additions to nag (ulmi)]
% \end{macrocode}
+%
+% Patch handling of nofiles: suppressed lines give an
+% Info-level message in the logfile now. The message
+% doesn't quite give the original line, but a sanitized
+% version. Reason: otherwise, we might need to execute
+% the setup code \#2.
+%
+% \begin{macrocode}
+\long\def\nag@protected@dontwrite#1#2#3%
+ {\write\m@ne{}%
+ \def\nag@line{#3}%
+ \@onelevel@sanitize\nag@line
+ \PackageInfo{nag}{%
+ \string\nofiles\space in effect.
+ Did not write line \MessageBreak
+ `\nag@line'
+ }%
+ \if@nobreak\ifvmode\nobreak\fi\fi}%
+
+\if@filesw
+ \def\nofiles{%
+ \@fileswfalse
+ \typeout{No auxiliary output files.^^J}%
+ \global\let\protected@write=\nag@protected@dontwrite
+ \let\makeindex\relax
+ \let\makeglossary\relax}
+\else
+ % already \nofiles.
+ \global\let\protected@write=\nag@protected@dontwrite
+\fi
+% \end{macrocode}
+%
+% Amend ``no space for a new foo'' message to point out
+% e\TeX\ alleviates some problems in that area.
+% \begin{macrocode}
+\gdef\ch@ck#1#2#3{%
+ \ifnum\count1#1<#2\else
+ \errhelp{%
+ eTeX has more counters, dimens, etc., maybe
+ that will help.
+ }
+ \errmessage{No room for a new #3}%
+\fi}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@testdef #1#2#3{%
+ \def\reserved@a{#3}%
+ \expandafter \ifx \csname #1@#2\endcsname\reserved@a
+ \else
+ \@tempswatrue
+ \begingroup
+ \@onelevel@sanitize\reserved@a
+ \expandafter\let\expandafter\nag@tmpb\csname #1@#2\endcsname
+ \ifx\nag@tmpb\relax
+ \let\nag@tmpb\@empty
+ \else
+ \@onelevel@sanitize\nag@tmpb
+ \fi
+ \PackageInfo{nag}{%
+ Label `#2' appears to have changed from\MessageBreak
+ `\nag@tmpb'\MessageBreak
+ to `\reserved@a'
+ }%
+ \endgroup
+ \fi}
+% \end{macrocode}
+%
+%
% Check if a float that may be positioned b is actually small
% enough for bottomfraction etc.
% \changes{0.62alpha1}{2008/03/19}{Bigger warning if all float positions fail}
@@ -728,7 +801,7 @@ unsuited for closing the center command above.
% Identify ourselves.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{nag}[2010/05/17 0.622 warning about old commands (ulmi)]
+\ProvidesPackage{nag}[2011/11/25 0.7 warning about old commands (ulmi)]
\let\@xa\expandafter
\let\@nx\noexpand
% \end{macrocode}
@@ -830,6 +903,12 @@ unsuited for closing the center command above.
\addtocounter{nag@sins}{1}%
\PackageWarningNoLine{nag}%
}
+\providecommand\PackageInfoNoLine[2]{%
+ \PackageInfo{#1}{#2\@gobble}%
+}
+\DeclareRobustCommand\nag@suggestNoLine[1]{%
+ \PackageInfoNoLine{nag}{#1}%
+}
% \end{macrocode}
% \end{macro}
%
@@ -942,6 +1021,37 @@ unsuited for closing the center command above.
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\SuggestedPackage}
+% Usage: |\SuggestedPackage|\oarg{reason}\marg{package}
+% \begin{macrocode}
+\newcommand\SuggestedPackage[2][might be useful to you]{%
+ \AtEndDocument{%
+ \nag@ifcsname{ver@#2.sty}{%
+ % Attaboy!
+ }{%
+ \nag@suggestNoLine{%
+ Not loaded: Package #2 #1}%
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IncompatiblePackages}
+% Usage: |\IncompatiblePackages|\oarg{reason}\marg{package}\marg{package}\marg{hint}
+% \begin{macrocode}
+\newcommand\IncompatiblePackages[4][are incompatible]{%
+ \AtEndDocument{%
+ \nag@ifcsname{ver@#2.sty}{%
+ \nag@ifcsname{ver@#3.sty}{%
+ \nag@warnNoLine{%
+ Packages #2 and #3 #1.\MessageBreak
+ #4}%
+ }{}%
+ }{}
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\ObsoleteClass}
% Usage: |\ObsoleteClass|\oarg{reason}\marg{class}\marg{%
@@ -965,6 +1075,43 @@ unsuited for closing the center command above.
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\BadFileLoadOrder}
+% \begin{macrocode}
+\def\nag@quark{\nag@quark}
+\ifx\@listfiles\@undefined
+ % emulate a silent listfiles
+ \def\@listfiles#1\@@{}%
+\fi
+\newcommand\BadFileLoadOrder[3][This might cause problems]{%
+ \AtEndDocument{%
+ \nag@ifLoadOrder{#2}{#3}{%
+ \nag@warnNoLine{%
+ `#3' loaded after `#2'.\MessageBreak
+ #1}%
+ }%
+ }%
+}
+\def\nag@ifLoadOrder#1#2{%
+ \def\nag@tmporder@a ##1#1##2\relax{%
+ \ifx\nag@quark##2\nag@quark
+ \noexpand\@gobble
+ \else
+ \nag@tmporder@b ##2,#2\relax
+ \fi
+ }%
+ \def\nag@tmporder@b ##1#2##2\relax{%
+ \ifx\nag@quark##2\nag@quark
+ \noexpand\@gobble
+ \else
+ \noexpand\@firstofone
+ \fi
+ }%
+ \@xa\protected@edef\@xa\nag@tmporder\@xa{\@xa\nag@tmporder@a\@filelist,,#1\relax}%
+ \nag@tmporder
+}
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Common float errors and no-nos.}
%
% We do the following:
diff --git a/Master/texmf-dist/tex/latex/nag/nag-experimental.cfg b/Master/texmf-dist/tex/latex/nag/nag-experimental.cfg
index 330b792be6b..e65c4800cd6 100644
--- a/Master/texmf-dist/tex/latex/nag/nag-experimental.cfg
+++ b/Master/texmf-dist/tex/latex/nag/nag-experimental.cfg
@@ -21,6 +21,56 @@
%%
\ProvidesFile{nag-experimental.cfg}
[2009/07/04 v0.62alpha2 experimental additions to nag (ulmi)]
+\long\def\nag@protected@dontwrite#1#2#3%
+ {\write\m@ne{}%
+ \def\nag@line{#3}%
+ \@onelevel@sanitize\nag@line
+ \PackageInfo{nag}{%
+ \string\nofiles\space in effect.
+ Did not write line \MessageBreak
+ `\nag@line'
+ }%
+ \if@nobreak\ifvmode\nobreak\fi\fi}%
+
+\if@filesw
+ \def\nofiles{%
+ \@fileswfalse
+ \typeout{No auxiliary output files.^^J}%
+ \global\let\protected@write=\nag@protected@dontwrite
+ \let\makeindex\relax
+ \let\makeglossary\relax}
+\else
+ % already \nofiles.
+ \global\let\protected@write=\nag@protected@dontwrite
+\fi
+\gdef\ch@ck#1#2#3{%
+ \ifnum\count1#1<#2\else
+ \errhelp{%
+ eTeX has more counters, dimens, etc., maybe
+ that will help.
+ }
+ \errmessage{No room for a new #3}%
+\fi}
+\def\@testdef #1#2#3{%
+ \def\reserved@a{#3}%
+ \expandafter \ifx \csname #1@#2\endcsname\reserved@a
+ \else
+ \@tempswatrue
+ \begingroup
+ \@onelevel@sanitize\reserved@a
+ \expandafter\let\expandafter\nag@tmpb\csname #1@#2\endcsname
+ \ifx\nag@tmpb\relax
+ \let\nag@tmpb\@empty
+ \else
+ \@onelevel@sanitize\nag@tmpb
+ \fi
+ \PackageInfo{nag}{%
+ Label `#2' appears to have changed from\MessageBreak
+ `\nag@tmpb'\MessageBreak
+ to `\reserved@a'
+ }%
+ \endgroup
+ \fi}
\let\@xa\expandafter
\newif\ifnag@dofloatsizecheck
\newif\ifnag@allfloatpositionsfailed
diff --git a/Master/texmf-dist/tex/latex/nag/nag.sty b/Master/texmf-dist/tex/latex/nag/nag.sty
index a627c9b0292..188f57cb964 100644
--- a/Master/texmf-dist/tex/latex/nag/nag.sty
+++ b/Master/texmf-dist/tex/latex/nag/nag.sty
@@ -20,7 +20,7 @@
%% http://www.latex-project.org/lppl.txt
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{nag}[2010/05/17 0.622 warning about old commands (ulmi)]
+\ProvidesPackage{nag}[2011/11/25 0.7 warning about old commands (ulmi)]
\let\@xa\expandafter
\let\@nx\noexpand
\newcounter{nag@c}
@@ -73,6 +73,12 @@
\addtocounter{nag@sins}{1}%
\PackageWarningNoLine{nag}%
}
+\providecommand\PackageInfoNoLine[2]{%
+ \PackageInfo{#1}{#2\@gobble}%
+}
+\DeclareRobustCommand\nag@suggestNoLine[1]{%
+ \PackageInfoNoLine{nag}{#1}%
+}
\newcommand\ObsoleteCS[3][obsolete]{%
\AtBeginDocument{%
\nag@prepend{#2}{%
@@ -124,6 +130,27 @@ Use #3 instead}%
}{}%
}%
}
+\newcommand\SuggestedPackage[2][might be useful to you]{%
+ \AtEndDocument{%
+ \nag@ifcsname{ver@#2.sty}{%
+ % Attaboy!
+ }{%
+ \nag@suggestNoLine{%
+ Not loaded: Package #2 #1}%
+ }%
+ }%
+}%
+\newcommand\IncompatiblePackages[4][are incompatible]{%
+ \AtEndDocument{%
+ \nag@ifcsname{ver@#2.sty}{%
+ \nag@ifcsname{ver@#3.sty}{%
+ \nag@warnNoLine{%
+ Packages #2 and #3 #1.\MessageBreak
+ #4}%
+ }{}%
+ }{}
+ }%
+}%
\newcommand\ObsoleteClass[3][obsolete]{%
\AtEndDocument{%
\nag@ifcsname{ver@#2.cls}{%
@@ -133,6 +160,38 @@ Use #3 instead}%
}{}%
}%
}
+\def\nag@quark{\nag@quark}
+\ifx\@listfiles\@undefined
+ % emulate a silent listfiles
+ \def\@listfiles#1\@@{}%
+\fi
+\newcommand\BadFileLoadOrder[3][This might cause problems]{%
+ \AtEndDocument{%
+ \nag@ifLoadOrder{#2}{#3}{%
+ \nag@warnNoLine{%
+ `#3' loaded after `#2'.\MessageBreak
+ #1}%
+ }%
+ }%
+}
+\def\nag@ifLoadOrder#1#2{%
+ \def\nag@tmporder@a ##1#1##2\relax{%
+ \ifx\nag@quark##2\nag@quark
+ \noexpand\@gobble
+ \else
+ \nag@tmporder@b ##2,#2\relax
+ \fi
+ }%
+ \def\nag@tmporder@b ##1#2##2\relax{%
+ \ifx\nag@quark##2\nag@quark
+ \noexpand\@gobble
+ \else
+ \noexpand\@firstofone
+ \fi
+ }%
+ \@xa\protected@edef\@xa\nag@tmporder\@xa{\@xa\nag@tmporder@a\@filelist,,#1\relax}%
+ \nag@tmporder
+}
\newif\ifnag@haslabel
\newif\ifnag@hascaption\nag@hascaptiontrue
\newcommand\nag@hackfloat[1]{%