diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/nag/nag-l2tabu.cfg')
-rw-r--r-- | Master/texmf-dist/tex/latex/nag/nag-l2tabu.cfg | 75 |
1 files changed, 70 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/nag/nag-l2tabu.cfg b/Master/texmf-dist/tex/latex/nag/nag-l2tabu.cfg index 48ae1474d6e..3ca2e7a0878 100644 --- a/Master/texmf-dist/tex/latex/nag/nag-l2tabu.cfg +++ b/Master/texmf-dist/tex/latex/nag/nag-l2tabu.cfg @@ -9,9 +9,9 @@ %% %% 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 +%% Current Maintainer is Ulrich M. Schwarz, ulmi@absatzen.de %% -%% Copyright (C) 2005, 2006 by Ulrich M. Schwarz. +%% Copyright (C) 2005-7 by Ulrich M. Schwarz. %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -20,7 +20,7 @@ %% http://www.latex-project.org/lppl.txt %% \ProvidesFile{nag-l2tabu.cfg} - [2007/03/21 v1.8b l2tabu rules for nag.sty (ulmi)] + [2007/06/10 v2.0 l2tabu rules for nag.sty (ulmi)] %% %% The sins. %% @@ -29,7 +29,63 @@ \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.6 +\def\nag@doubledollar{$$}%$$ +\def\nag@singledollar{$}%$ +\def\nag@expanding@voodoo#1#2#3{\relax\relax\nag@singledollar} + +\def\nag@maybedispmath{% + \texorpdfstring{% + %% in TeX context, do tricky stuff. + \ifinner\expandafter\@firstoftwo + \else\expandafter\@secondoftwo\fi + {%% in inner mode, $$ is an empty formula, so no testing wanted. + \nag@singledollar}% + {%% + \ifx\protect\@typeset@protect\expandafter\@firstoftwo + \else\expandafter\@secondoftwo\fi + {%% normal case: looks like typesetting + %% protect against strictly expanding context + %% like TeX' \message: the first expanding voodoo will expand, + %% removing the rest, inserting \relax\relax$ instead. This is + %% not totally transparent, but \let\relax\relax is as close + %% to a no-op as we can get. + \let\nag@expanding@voodoo\nag@expanding@voodoo + \protect\nag@maybe@dispmath}% + {%% some other case, hide ourselves + \nag@singledollar}% + }% + }{% + %% in pdf context, just be a math shift. This creates the "math + %% shift not allowed" warnings we all love. + \nag@singledollar + }% +} +\AtBeginDocument{\providecommand\texorpdfstring{\@firstoftwo}} +\AtBeginDocument{\catcode`$\active}%$ +\bgroup + \catcode`$\active%$ + \gdef\nag@maybe@dispmath{% + \bgroup + \let\@sptoken\nag@quark% prevent skipping of spaces + \@ifnextchar${%$% + \ifmmode + % we already warned upon entering. + \else + \nag@warn{% + \nag@doubledollar...\nag@doubledollar\space is obsolete.\MessageBreak + Use \string\[...\string\] et al. instead}% + \fi + \egroup\expandafter\nag@doubledollar\@gobble + }{% + \egroup\nag@singledollar + }% + } + % we do the assignment here, which means any package that redefines + % \$ as well will silently disable us. This is a feature. + \global\let$\nag@maybedispmath%$ +\egroup + %% \S 1.7 cannot reasonably be checked programmatically %% \S 1.8 \sloppy is called by parbox, among others, and would %% give many spurious warnings. @@ -95,6 +151,12 @@ %% \S 3.1 \NagDeclareFloat{figure}\NagDeclareFloat{table}% \g@addto@macro\nag@labels{,label}% +\nag@prepend{endcenter}{% + \ifx\@captype\@undefined\else + \nag@warn{\lq center\rq\space environment in \@captype.\MessageBreak + Maybe you want \protect\centering\space instead}% + \fi +}% %% The latter two are used by KOMA-Script, the last by hypcap. \g@addto@macro\nag@captions{,caption,captionabove,captionbelow,hc@caption,topcaption}% @@ -104,7 +166,10 @@ \@for\sectioning:=frontmatter,mainmatter,backmatter\do{% \expandafter\NotAnEnvironment\expandafter{\sectioning}% } -%% \S 3.3 handled by onlyamsmath. +%% \S 3.3 +%% It's more trouble than it's worth to have another warning for +%% align*, since it passes through align. +\ObsoleteEnv{eqnarray}{amsmath's align} %% \S 3.4 -- nothing to be done -- %%X Local Variables: %%X mode: latex |