diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-14 16:22:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-14 16:22:32 +0000 |
commit | 8ff57bdca1f2f31861913ebc22961fdb89240cbd (patch) | |
tree | 16bce8182f2d5b16a36d589de033fd2ea5f7e8e2 /Master/texmf-dist/source/latex/computational-complexity/cc.dtx | |
parent | 7580e0584873d1ed5ed97c98b87e3aa32753ea46 (diff) |
computational-complexity 2.24 (18jun12)
git-svn-id: svn://tug.org/texlive/trunk@27047 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/computational-complexity/cc.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/computational-complexity/cc.dtx | 56 |
1 files changed, 43 insertions, 13 deletions
diff --git a/Master/texmf-dist/source/latex/computational-complexity/cc.dtx b/Master/texmf-dist/source/latex/computational-complexity/cc.dtx index 84f2eb8840b..ac68b13ba4d 100644 --- a/Master/texmf-dist/source/latex/computational-complexity/cc.dtx +++ b/Master/texmf-dist/source/latex/computational-complexity/cc.dtx @@ -2833,6 +2833,10 @@ multilingual,english]{cc} % planned to advance to 3.0 soon. Michael N{\"{u}}sken, Bonn} % \changes{v2.23}{2012/05/22}{Increased compatibility with hyperref. % Michael N{\"{u}}sken, Bonn} +% \changes{v2.24}{2012/06/18}{Another bugfix to equation counting. +% Michael N{\"{u}}sken, Bonn} +% \changes{v2.25}{2012/06/21}{Allowing longer theorem comments. +% Michael N{\"{u}}sken, Bonn} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \providecommand\ignorespacesafterend{\@ignoretrue} @@ -2841,7 +2845,7 @@ multilingual,english]{cc} \ifclass\expandafter\ProvidesClass\else\expandafter\ProvidesPackage\fi {\ifclass cc\else cc-cls\fi} [% CC MAIN DATE AND VERSION ON NEXT LINE -2012/05/07 v2.23 +2012/06/21 v2.25 computational complexity \ifclass document class\else package\fi] % \end{macrocode} @@ -5764,14 +5768,17 @@ computational complexity % typeset slanted, the header terminates with a dot. Inside the % optional argument |\cite| is |\shortcite| which avoids double % parentheses. +% \changes{v2.25}{2012/06/21}{Changed \cs{th@cc} and \cs{th@ccnn} so +% that more than single line comments are possible. Michael +% N{\"{u}}sken, Bonn} % \begin{macrocode} \def\th@cc{% \normalfont\slshape \def\@begintheorem##1##2{\item [\hskip\labelsep \theorem@headerfont ##1\ ##2.]}% \def\@opargbegintheorem##1##2##3{\item - [\hskip\labelsep \theorem@headerfont ##1\ ##2\ % - \normalfont({\activate@shortcite{}##3}).]}% + [\hskip\labelsep \theorem@headerfont ##1\ ##2]% + {\normalfont({\activate@shortcite{}##3}).}}% } % \end{macrocode} % @@ -5784,8 +5791,8 @@ computational complexity \def\@begintheorem##1##2{\item [\hskip\labelsep \theorem@headerfont ##1.]}% \def\@opargbegintheorem##1##2##3{\item - [\hskip\labelsep \theorem@headerfont ##1\ % - \normalfont({\activate@shortcite{}##3}).]}% + [\hskip\labelsep \theorem@headerfont ##1]% + {\normalfont({\activate@shortcite{}##3}).}}% } % \end{macrocode} % @@ -5959,9 +5966,19 @@ computational complexity % |\theorembodyfont| as a hook. In the present version of % \Lpackage{theorem}, we access the theorem counter and the theorem % title by the following construction. +% \changes{v2.24}{2012/06/18}{Bugfix: Dirty hacks to ensure correct +% theorem, algorithm and equation counting and +% referencing. MNuesken, Bonn} % \begin{macrocode} +\def\reset@prefixrefstepcounter#1{% + \let\refstepcounter\cc@normal@refstepcounter% Put refstepcounter back to normal + \refstepcounter{#1}% do normal operation + \defprefix{equation}##1{(##1)}% reset equation prefix +} \def\theorempreamblenn\@thm#1#2{% \defprefix{#1}##1{#2}% + \let\cc@normal@refstepcounter\refstepcounter + \let\refstepcounter\reset@prefixrefstepcounter \EnumerationInTheorems{#1}% \pagebreak[3]\relax \the\everytheorem @@ -6110,6 +6127,8 @@ computational complexity % \begin{macrocode} \def\theorempreamble\@thm#1#2{% \defprefix{#1}##1{#2~##1}% + \let\cc@normal@refstepcounter\refstepcounter + \let\refstepcounter\reset@prefixrefstepcounter \EnumerationInTheorems{#1}% \pagebreak[3]\relax \the\everytheorem @@ -6158,12 +6177,13 @@ computational complexity % \lclo{noseparateequationcounting}). % Michael N{\"{u}}sken, Bonn.} % \begin{macrocode} -\newtheorem{namedth@@r@m}{\the\theoremtitle} \if@ccnosepeqncnt %%% \let\c@namedth@@r@m\c@equation %%% \def\thenamedth@@r@m{\theequation} \def\cc@thmcnter{equation} +\newtheorem{namedth@@r@m}[\cc@thmcnter]{\the\theoremtitle} \else +\newtheorem{namedth@@r@m}{\the\theoremtitle} \def\cc@thmcnter{namedth@@r@m} \fi \newenvironment{namedtheorem}[1] @@ -7077,19 +7097,23 @@ computational complexity % used comes from the package \Lpackage{thcc}. We ensure that the % counter used is the same as the one used for equations. % \changes{v2.03}{2002/02/01}{Removed a bug, now -% \cs{thenamed@lg@r@thm} equals \cs{thenamedth@@r@m}.} +% \cs{thenamed@lg@r@thm} equals \cs{thenamedth@@r@m}.} +% \changes{v2.23+}{2012/06/08}{Removed a bug, now named@al@r@thm is +% defined like all other theorems with the v2.23 update in +% mind. Michael N{\"{u}}sken, Bonn.} % \begin{macrocode} \theoremstyle{ccalgo} -\newtheorem{named@lg@r@thm}{\the\algotitle} +\providecommand{\cc@thmcnter}{equation} +\newtheorem{named@lg@r@thm}[\cc@thmcnter]{\the\algotitle} \defprefix{named@lg@r@thm}#1{\the\algotitle~#1} -\ifx\c@namedth@@r@m\@undefined\else -\let\c@named@lg@r@thm\c@namedth@@r@m -\let\thenamed@lg@r@thm\thenamedth@@r@m -\fi +%%% \ifx\c@namedth@@r@m\@undefined\else +%%% \let\c@named@lg@r@thm\c@namedth@@r@m +%%% \let\thenamed@lg@r@thm\thenamedth@@r@m +%%% \fi % \end{macrocode} % % \begin{environment}{namedalgorithm} -% This combines all necessary to typeset an algorithm. +% This combines all necessary stuff to typeset an algorithm. % The environment takes up to four arguments. The first argument % is the \meta{heading}, in the standard |Algorithm|. The second % argument is optional and gives a comma separated list of titles @@ -7101,6 +7125,9 @@ computational complexity % \changes{v2.10}{2010/05/11}{Added extra optional argument to allow % specification of a longest label. But that is of no use at % present since this information is never used.} +% \changes{v2.24}{2012/06/18}{Bugfix: Dirty hacks to ensure correct +% theorem, algorithm and equation counting and +% referencing. MNuesken, Bonn} % \begin{macrocode} \babel\def\babelInput{Input}[german=Eingabe,french=Entr\'ee] \babel\def\babelOutput{Output}[german=Ausgabe,french=Sortie] @@ -7109,11 +7136,13 @@ computational complexity \newtoks\algorithmmasterkey \newenvironment{namedalgorithm}[1]{% \pagebreak[3]% + \defprefix{\cc@thmcnter}##1{\the\algotitle~##1}% \def\algo@theorem{named@lg@r@thm}% \algotitle{#1}% \n@medalgorithm} {\endalgonumerate\csname end\algo@theorem\endcsname} \newenvironment{namedalgorithm*}[1]{% + \defprefix{\cc@thmcnter}##1{\the\algotitle}% \def\algo@theorem{named@lg@r@thm*}% \algotitle{#1}% \n@medalgorithm} @@ -7141,6 +7170,7 @@ computational complexity \ifx\@tempa\@empty\csname\algo@theorem\endcsname \else\csname\algo@theorem\endcsname[#1]\fi% \label{\the\algorithmmasterkey}% + \defprefix{equation}##1{(##1)}% reset equation prefix \algo@keywords \defprefix{algonumerate}{% \Iflabelchanged{\algo@theorem}{\uselabel{\algo@theorem} % |