summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ntheorem
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-02-18 00:17:44 +0000
committerKarl Berry <karl@freefriends.org>2011-02-18 00:17:44 +0000
commitdfd632c523a341604c836463c70224b297208fe6 (patch)
tree09185943d210d0ba972d4eac2112272f1f3032cd /Master/texmf-dist/tex/latex/ntheorem
parent7111ff10fd573d433de26c290c4b0b557f82d822 (diff)
ntheorem (17feb11)
git-svn-id: svn://tug.org/texlive/trunk@21446 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ntheorem')
-rw-r--r--Master/texmf-dist/tex/latex/ntheorem/ntheorem.std6
-rw-r--r--Master/texmf-dist/tex/latex/ntheorem/ntheorem.sty198
2 files changed, 118 insertions, 86 deletions
diff --git a/Master/texmf-dist/tex/latex/ntheorem/ntheorem.std b/Master/texmf-dist/tex/latex/ntheorem/ntheorem.std
index 41826472fe1..43da68568db 100644
--- a/Master/texmf-dist/tex/latex/ntheorem/ntheorem.std
+++ b/Master/texmf-dist/tex/latex/ntheorem/ntheorem.std
@@ -20,9 +20,9 @@
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
-\def\filedate{2009/07/01}
-\def\docdate{2009/07/01}
-\def\fileversion{1.28}
+\def\filedate{2011/02/16}
+\def\docdate{2011/02/16}
+\def\fileversion{1.31}
\def\basename{ntheorem}
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
diff --git a/Master/texmf-dist/tex/latex/ntheorem/ntheorem.sty b/Master/texmf-dist/tex/latex/ntheorem/ntheorem.sty
index 94624fae86a..4f60c1f3320 100644
--- a/Master/texmf-dist/tex/latex/ntheorem/ntheorem.sty
+++ b/Master/texmf-dist/tex/latex/ntheorem/ntheorem.sty
@@ -20,9 +20,9 @@
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
-\def\filedate{2009/07/01}
-\def\docdate{2009/07/01}
-\def\fileversion{1.28}
+\def\filedate{2011/02/16}
+\def\docdate{2011/02/16}
+\def\fileversion{1.31}
\def\basename{ntheorem}
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
@@ -48,6 +48,7 @@
%% Right brace \} Tilde \~}
\typeout{Style `\basename', Version \fileversion\space <\filedate>}
\ProvidesPackage{ntheorem}[\filedate \space\fileversion]
+\RequirePackage{ifthen}%
\newif\if@thmmarks\@thmmarksfalse
\newif\if@thref\@threffalse
\newif\ifthm@tempif
@@ -276,20 +277,21 @@
\def\set@label@type#1#2[#3]{%
\global\@namedef{#1@#2@type}{#3}}
-\newcommand\org@testdef{}
-\let\org@testdef\@testdef
-\def\@testdef#1#2#3{%
- \org@testdef{#1}{#2}{#3}%
- \@ifnextchar[{\@gobbleopt}{}%
-}
-\newcommand\@gobbleopt{}
-\long\def\@gobbleopt[#1]{}
\def\thref#1{%
\expandafter\ifx\csname r@#1@type\endcsname\None
\PackageWarning{\basename}{thref: Reference Type of `#1' on page
\thepage \space undefined}\G@refundefinedtrue
\else\csname r@#1@type\endcsname~\fi%
\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}}
+
+\newcommand\org@testdef{}
+\let\org@testdef\@testdef
+\def\@testdef#1#2#3{%
+ \org@testdef{#1}{#2}{#3}%
+ \@ifnextchar[{\thm@gobbleopt}{}%
+}
+\newcommand\thm@gobbleopt{}
+\long\def\thm@gobbleopt[#1]{}
}% end of option thref ************************************************
\DeclareOption{amsmath}{% ***************************************************
\if@thref
@@ -315,7 +317,7 @@
\if@fleqn \@xp\endmathdisplay@fleqn
\else \ifx\df@tag\@empty \else \veqno \alt@tag \df@tag \fi
\ifx\df@label\@empty \else
- \ifx\thm@df@label@optarg\@empty \@xp\ltx@label\@xp{\df@label}
+ \ifx\thm@df@label@optarg\@empty \@xp\ltx@label\@xp{\df@label}%
\else \@xp\ltx@label\@xp{\df@label}[\thm@df@label@optarg]\fi
\fi
\fi
@@ -337,7 +339,7 @@
\ifmeasuring@
\else
\ifx\df@label\@empty\else
- \ifx\thm@df@label@optarg\@empty \@xp\ltx@label\@xp{\df@label}
+ \ifx\thm@df@label@optarg\@empty \@xp\ltx@label\@xp{\df@label}%
\else \@xp\ltx@label\@xp{\df@label}[\thm@df@label@optarg]\fi
\global\let\df@label\@empty
\fi
@@ -349,7 +351,7 @@
\ifx\@empty\df@tag
\else
\setbox4\hbox{\df@tag
- \ifx\thm@df@label@optarg\@empty \@xp\ltx@label\@xp{\df@label}
+ \ifx\thm@df@label@optarg\@empty \@xp\ltx@label\@xp{\df@label}%
\else \@xp\ltx@label\@xp{\df@label}[\thm@df@label@optarg]\fi
}%
\fi
@@ -390,6 +392,9 @@
\gdef\maketag@@@##1{\hbox{\m@th\normalfont##1%
\llap{\hss\PotEndMark{\raisebox{-1.3em}}}}}%
\fi}
+\let\ams@@maketag@@@\maketag@@@
+\gdef\tagform@#1{%
+ \ams@@maketag@@@{(\ignorespaces#1\unskip\@@italiccorr)}}
\gdef\RestoreTags{%
\global\let\maketag@@@=\Old@maketag@@@
\global\let\df@tag=\Old@df@tag}
@@ -567,8 +572,12 @@
\global\theoremnumbering{arabic}
\newskip\theorempreskipamount
\newskip\theorempostskipamount
+\newskip\theoremframepreskipamount
+\newskip\theoremframepostskipamount
\global\theorempreskipamount\topsep
\global\theorempostskipamount\topsep
+\global\theoremframepreskipamount0pt
+\global\theoremframepostskipamount0pt
\newdimen\theoremindent
\global\theoremindent0cm
\newdimen\theorem@indent
@@ -827,20 +836,21 @@
\theoremframecommand%
\fi
\theoremprework{%
- \def\FrameCommand{\csname#1@framecommand\endcsname}\framed}%
- \theorempostwork{\endframed}%
+ \def\FrameCommand{\csname#1@framecommand\endcsname}%
+ \vskip\theoremframepreskipamount\framed}%
+ \theorempostwork{\endframed\vskip\theoremframepostskipamount}%
\newtheorem@i{#1}%
}
\def\newframedtheorem#1{%
- \theoremprework{\framed}%
- \theorempostwork{\endframed}%
+ \theoremprework{\vskip\theoremframepreskipamount\framed}%
+ \theorempostwork{\endframed\vskip\theoremframepostskipamount}%
\newtheorem@i{#1}%
}
}% end of option framed **********************************************
\def\thm@thmcaption#1#2{\thm@@thmcaption{#1}#2}
\def\thm@@thmcaption#1#2#3#4{%
\thm@parseforwriting{#2}%
- \let\thm@tmpii\thm@tmp%
+ \let\thm@tmpii\thm@tmp
\thm@parseforwriting{#4}%
\edef\thm@t{{\thm@tmpii}{#3}{\thm@tmp}}%
\addcontentsline{thm}{#1}{\thm@t}}
@@ -853,7 +863,8 @@
{#1 \protect\numberline{#2}#3}%
{#4}}
\def\thm@thmline#1#2{\thm@@thmline#1{#2}}
-\long\def\thm@lgobble#1#2{\ignorespaces}
+\long\def\thm@lgobble@entry#1#2{\ignorespaces}
+\long\def\thm@lgobble@freetext#1#2{\ignorespaces}
\def\theoremlistall{%
\let\thm@@thmlstart=\relax
\let\thm@@thmlend=\relax
@@ -878,60 +889,6 @@
\else%
\thm@@thmline@name{##1}{##2}{##3}{##4}%
\fi}}
-\DeclareOption{hyperref}{% **********************************************
- \def\thm@@thmline@noname#1#2#3#4#5{%
- \ifx\\#5\\%
- \@dottedtocline{-2}{0em}{2.3em}%
- {\protect\numberline{#2}#3}%
- {#4}%
- \else
- \ifHy@linktocpage\relax\relax
- \@dottedtocline{-2}{0em}{2.3em}%
- {\protect\numberline{#2}#3}%
- {\hyper@linkstart{link}{#5}{#4}\hyper@linkend}
- \else
- \@dottedtocline{-2}{0em}{2.3em}%
- {\hyper@linkstart{link}{#5}{\protect\numberline{#2}#3}%
- \hyper@linkend}%
- {#4}%
- \fi
- \fi}%
- \def\thm@@thmline@name#1#2#3#4#5{%
- \ifx\\#5\\%
- \@dottedtocline{-2}{0em}{2.3em}%
- {#1 \protect\numberline{#2}#3}%
- {#4}
- \else
- \ifHy@linktocpage\relax\relax
- \@dottedtocline{-2}{0em}{2.3em}%
- {#1 \protect\numberline{#2}#3}%
- {\hyper@linkstart{link}{#5}{#4}\hyper@linkend}%
- \else
- \@dottedtocline{-2}{0em}{2.3em}%
- {\hyper@linkstart{link}{#5}%
- {#1 \protect\numberline{#2}#3}\hyper@linkend}%
- {#4}%
- \fi
- \fi}
- \def\thm@thmline#1#2#3{\thm@@thmline#1{#2}{#3}}
- \long\def\thm@lgobble#1#2#3{\ignorespaces}
- \def\theoremlistoptional{%
- \let\thm@@thmlstart=\relax
- \let\thm@@thmlend=\relax
- \def\thm@@thmline##1##2##3##4##5{%
- \ifx\empty ##3%
- \else%
- \thm@@thmline@noname{##1}{##2}{##3}{##4}{##5}%
- \fi}}
- \def\theoremlistoptname{%
- \let\thm@@thmlstart=\relax
- \let\thm@@thmlend=\relax
- \def\thm@@thmline##1##2##3##4##5{%
- \ifx\empty ##3%
- \else%
- \thm@@thmline@name{##1}{##2}{##3}{##4}{##5}%
- \fi}}
-}% end of option hyperref *********************************************
\def\theoremlisttype#1{%
\@ifundefined{thm@thml@#1}%
{\PackageError{\basename}{Listtype #1 not defined}\@eha}%
@@ -953,8 +910,8 @@
\expandafter\let\csname thm@thml@#1\endcsname\relax
\newtheoremlisttype{#1}{#2}{#3}{#4}}
\def\thm@definelthm#1{%
- \expandafter\gdef\csname l@#1\endcsname{\thm@lgobble}%
- \expandafter\gdef\csname thm@listdo#1\endcsname{\thm@lgobble}}
+ \expandafter\gdef\csname l@#1\endcsname{\thm@lgobble@entry}%
+ \expandafter\gdef\csname thm@listdo#1\endcsname{\thm@lgobble@freetext}}
\long\def\thm@inlistdo#1#2{#2}%
\def\listtheorems#1{\begingroup
\c@tocdepth=-2%
@@ -964,22 +921,27 @@
\begingroup
\typeout{** Generating table of \thm@list}%
\def\contentsline##1{%
- \expandafter\@ifundefined{l@##1}{\thm@lgobble}{\csname l@##1\endcsname}}%
+ \expandafter\@ifundefined{l@##1}%
+ {\thm@lgobble@entry}{\csname l@##1\endcsname}}%
\thm@@thmlstart
- \@for\thm@currentlist:=\thm@list\do{%
+ \@for\thm@currentlist:=\thm@list
+ \do{%
\ifx\thm@currentlist\@empty\else
\expandafter\gdef\csname l@\thm@currentlist\endcsname{\thm@thmline}%
\expandafter\gdef\csname thm@listdo\thm@currentlist\endcsname{\thm@inlistdo}%
\fi
- }%
+ }%
\@input{\jobname .thm}%
\thm@@thmlend
- \@for\thm@currentlist:=\thm@list\do{%
+ \@for\thm@currentlist:=\thm@list
+ \do{%
\ifx\thm@currentlist\@empty\else
- \expandafter\gdef\csname l@\thm@currentlist\endcsname{\thm@lgobble}%
- \expandafter\gdef\csname thm@listdo\thm@currentlist\endcsname{\thm@lgobble}%
+ \expandafter\gdef\csname l@\thm@currentlist\endcsname
+ {\thm@lgobble@entry}%
+ \expandafter\gdef\csname thm@listdo\thm@currentlist\endcsname
+ {\thm@lgobble@freetext}%
\fi
- }%
+ }%
\endgroup}
\def\thm@enablelistoftheorems{%
\begingroup
@@ -1014,6 +976,76 @@
\long\def\theoremlistdo#1#2{\expandafter\@ifundefined{thm@listdo#1}%
\relax{\csname thm@listdo#1\endcsname{#1}{#2}}}
\AtEndDocument{\thm@enablelistoftheorems}
+\DeclareOption{hyperref}{% **********************************************
+ \def\thm@@thmline@noname#1#2#3#4#5{%
+ \ifx\\#5\\%
+ \@dottedtocline{-2}{0em}{2.3em}%
+ {\protect\numberline{#2}#3}%
+ {#4}%
+ \else
+ \ifHy@linktocpage\relax\relax
+ \@dottedtocline{-2}{0em}{2.3em}%
+ {\protect\numberline{#2}#3}%
+ {\hyper@linkstart{link}{#5}{#4}\hyper@linkend}
+ \else
+ \@dottedtocline{-2}{0em}{2.3em}%
+ {\hyper@linkstart{link}{#5}{\protect\numberline{#2}#3}%
+ \hyper@linkend}%
+ {#4}%
+ \fi
+ \fi}%
+ \def\thm@@thmline@name#1#2#3#4#5{%
+ \ifx\\#5\\%
+ \@dottedtocline{-2}{0em}{2.3em}%
+ {#1 \protect\numberline{#2}#3}%
+ {#4}
+ \else
+ \ifHy@linktocpage\relax\relax
+ \@dottedtocline{-2}{0em}{2.3em}%
+ {#1 \protect\numberline{#2}#3}%
+ {\hyper@linkstart{link}{#5}{#4}\hyper@linkend}%
+ \else
+ \@dottedtocline{-2}{0em}{2.3em}%
+ {\hyper@linkstart{link}{#5}%
+ {#1 \protect\numberline{#2}#3}\hyper@linkend}%
+ {#4}%
+ \fi
+ \fi}
+ \def\thm@thmline#1#2#3{\thm@@thmline#1{#2}{#3}}
+ \long\def\thm@lgobble@entry#1#2#3{\ignorespaces}
+ \def\theoremlistoptional{%
+ \let\thm@@thmlstart=\relax
+ \let\thm@@thmlend=\relax
+ \def\thm@@thmline##1##2##3##4##5{%
+ \ifx\empty ##3%
+ \else%
+ \thm@@thmline@noname{##1}{##2}{##3}{##4}{##5}%
+ \fi}}
+ \def\theoremlistoptname{%
+ \let\thm@@thmlstart=\relax
+ \let\thm@@thmlend=\relax
+ \def\thm@@thmline##1##2##3##4##5{%
+ \ifx\empty ##3%
+ \else%
+ \thm@@thmline@name{##1}{##2}{##3}{##4}{##5}%
+ \fi}}
+\if@thref
+\def\@firstofthree#1#2#3{#1}%
+\def\getKeywordOf#1{%
+ \let\thm@oldcontentsline\contentsline
+ \def\contentsline##1##2##3##4{%
+ \ifthenelse{\equal{#1}{##4}}{\@firstofthree##2}{}%
+ \ignorespaces}%
+ \@input{\jobname .thm}%
+ \let\contentsline\thm@oldcontentsline
+}
+\def\thm@fmt@hyplabel@i#1#2#3#4#5{%
+ \getKeywordOf{#4}~\thm@fmt@hyplabel@ii#4}
+\def\thm@fmt@hyplabel@ii#1.#2{#2}%
+\def\thref#1{%
+ \expandafter\@setref\csname r@#1\endcsname\thm@fmt@hyplabel@i{#1}}%
+\fi % end of \if@thref
+}% end of option hyperref *********************************************
\def\thm@meaning#1->#2\relax{#2}% remove "macro: ->"
\long\def\thm@parseforwriting#1{%
\def\thm@tmp{#1}%