summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/computational-complexity
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-05-14 18:21:27 +0000
committerKarl Berry <karl@freefriends.org>2010-05-14 18:21:27 +0000
commit5149405bc761d8518999021fd0019b463bee1fd0 (patch)
tree0619a25bb5299d52477ffc861561338a76b178c9 /Master/texmf-dist/doc/latex/computational-complexity
parent91ea5ca6c438abff6a9ed0c13431ac5d4265f067 (diff)
computational-complexity 2.11 (13may10)
git-svn-id: svn://tug.org/texlive/trunk@18244 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/computational-complexity')
-rw-r--r--Master/texmf-dist/doc/latex/computational-complexity/cc-cls-inline.tex169
-rw-r--r--Master/texmf-dist/doc/latex/computational-complexity/cc.pdfbin752835 -> 752553 bytes
2 files changed, 124 insertions, 45 deletions
diff --git a/Master/texmf-dist/doc/latex/computational-complexity/cc-cls-inline.tex b/Master/texmf-dist/doc/latex/computational-complexity/cc-cls-inline.tex
index 51ea6b00645..f3fc6c834fa 100644
--- a/Master/texmf-dist/doc/latex/computational-complexity/cc-cls-inline.tex
+++ b/Master/texmf-dist/doc/latex/computational-complexity/cc-cls-inline.tex
@@ -39,7 +39,7 @@
\ifclass\expandafter\ProvidesClass\else\expandafter\ProvidesPackage\fi
{\ifclass cc\else cc-cls\fi}
[% CC MAIN DATE AND VERSION ON NEXT LINE
-2010/01/25 v2.10
+2010/01/25 v2.11
computational complexity
\ifclass document class\else package\fi]
\RequirePackage{ccaux}
@@ -1051,7 +1051,6 @@ computational complexity
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{ccalgo}[2005/08/27 v2.05
algorithm environment for cc. Michael Nuesken, Bonn.]
-\RequirePackage{ccaux}
\let\namedalgorithm\@undefined
\let\endnamedalgorithm\@undefined
\let\algorithm\@undefined
@@ -1123,6 +1122,7 @@ computational complexity
Command \protect\@item\space has changed.\MessageBreak
Check if current package is valid}
\fi}
+\RequirePackage{ccaux}
\RequirePackage{theorem}
\RequirePackage{thcc}
\RequirePackage{relabel}
@@ -1164,69 +1164,127 @@ computational complexity
\newcommand{\labelalgonumerate}{%
\count@\value{algonumerate}%
\ifnum\count@<\z@
- \algonumfield:%
+ \algonumfield%
\else
- \makealgolabel{\thealgonumerate}\fi
+ \makealgolabel{\thealgonumerate}%
+ \fi
}%
\newdimen\algo@labelsep
\newdimen\steplabelwidth
\newtoks\AtNextItem
\newif\if@requireditemscomplete
+\newif\if@noitemargcopy
+\let\orig@item\item
+\def\item{\@ifnextchar[{\@noitemargcopyfalse\orig@item}{\@noitemargcopytrue\orig@item}}
+\newcount\last@algolabeltype
+\newcount\this@algolabeltype
\newcommand{\algonumerate@label}[1]{%
- \def\@tempa{#1}\def\@tempc{\@itemlabel}%
- %%\show\@tempa\show\@tempc
- \ifx\@tempa\@tempc\global\@speciallabelfalse
- \else\global\@speciallabeltrue\fi
- \expandafter\ifnum\value{algonumerate}<\z@
- #1\hskip\algo@labelsep%
- \else
- \ifx\@tempa\@empty
- \hskip\steplabelwidth\hskip\algo@labelsep
+ \expandafter\count@\value{algonumerate}%
+ \if@noitemargcopy
+ \ifnum\count@<\z@
+ \let\next\algonumerate@labelautomatic
+ \global\last@algolabeltype\this@algolabeltype
+ \global\this@algolabeltype\m@ne
+ \else
+ \let\next\algonumerate@labelnumber
+ \global\last@algolabeltype\this@algolabeltype
+ \global\this@algolabeltype\@ne
+ \fi
\else
+ \def\@tempa{#1}%
+ \ifx\@tempa\@empty
+ \let\next\algonumerate@labelempty
+ \global\last@algolabeltype\this@algolabeltype
+ \global\this@algolabeltype\tw@
+ \else
+ \global\last@algolabeltype\this@algolabeltype
+ \global\this@algolabeltype\z@
+ \let\next\algonumerate@labelexplicit
+ \fi
+ \fi\next{#1}}
+\newcommand{\algonumerate@makelabelexplicit}[1]{%
+ #1:\hskip\algo@labelsep%
+}
+\newcommand{\algonumerate@makelabelempty}[1]{%
+ \hskip\steplabelwidth\hskip\algo@labelsep%
+}
+\newcommand{\algonumerate@makelabelautomatic}[1]{%
+ #1:\hskip\algo@labelsep%
+}
+\newcommand{\algonumerate@makelabelnumber}[1]{%
\hb@xt@\steplabelwidth{\hss
- \hb@xt@\steplabelwidth{\hfill
- \if@speciallabel
- \makeoptalgolabel{#1}%
- \else
+ %\hb@xt@\steplabelwidth{\hfill
#1%
- \fi
- }}\hskip\algo@labelsep%
- \fi\fi
- \global\let\algonumerate@global\global
- \gdef\global{\algonumerate@global\let\global\algonumerate@global
+ %}
+ }\hskip\algo@labelsep%
+}
+\newcommand{\algonumerate@postprocess}[1]{%
\expandafter\count@\value{algonumerate}%
%%{\tracingall\nonstopmode\showbox\@tempboxa}%
- \ifnum\count@=\m@ne
- \stepcounter{algonumerate}%
- \fi
- \ifnum\count@=\z@
- \if@requireditemscomplete\else
- \global\@requireditemscompletetrue
- \ifnum\algonumerate@items>\z@\medskip\fi
- \fi
- \fi
- \ifnum\count@=\@ne
- \if@requireditemscomplete\else
- \global\@requireditemscompletetrue
- \ifnum\algonumerate@items>\z@\medskip\fi
- \fi
+ \ifnum\last@algolabeltype<\@ne
+ \ifnum\this@algolabeltype=\@ne
+ \medskip
\fi
- \if@speciallabel
- \protected@edef\@currentlabel{\csname p@\@listctr\endcsname
- {\makeoptalgocurrentlabel{#1}}}%
- \protected@edef\@bare@currentlabel{#1}%
\fi
+ #1%
\global\let\latest@item@currentlabel\@currentlabel
\global\let\latest@item@bare@currentlabel\@bare@currentlabel
+ \ifnum\count@=\m@ne
+ \stepcounter{algonumerate}%
+ \fi
\global\@speciallabeltrue
\the\AtNextItem \global\AtNextItem{}%
\reinit@list@label
+}
+\newcommand{\algonumerate@labelexplicit}[1]{% For algorithm i/o
+ \typeout{item explicit [#1]}%
+ \algonumerate@makelabelexplicit{#1}%
+ \global\let\algonumerate@global\global
+ \gdef\global{\algonumerate@global\let\global\algonumerate@global
+ \algonumerate@postprocess{%
+ \protected@edef\@currentlabel{\csname p@\@listctr\endcsname
+ {\makeoptalgocurrentlabel{#1}}}%
+ \protected@edef\@bare@currentlabel{#1}%
+ }%
\global}%
- }
+}
+\newcommand{\algonumerate@labelempty}[1]{% For algorithm i/o
+ \typeout{item empty [#1]}%
+ \algonumerate@makelabelempty{}%
+ \global\let\algonumerate@global\global
+ \gdef\global{\algonumerate@global\let\global\algonumerate@global
+ \algonumerate@postprocess{}%
+ \global}%
+}
+\newcommand{\algonumerate@labelautomatic}[1]{% For algorithm steps
+ \typeout{item automatic [#1]}%
+ \algonumerate@makelabelautomatic{#1}%
+ \global\let\algonumerate@global\global
+ \gdef\global{\algonumerate@global\let\global\algonumerate@global
+ \algonumerate@postprocess{%
+ \protected@edef\@currentlabel{\csname p@\@listctr\endcsname
+ {\makeoptalgocurrentlabel{#1}}}%
+ \protected@edef\@bare@currentlabel{#1}%
+ }%
+ \global}%
+}
+\newcommand{\algonumerate@labelnumber}[1]{% For algorithm steps
+ \typeout{item numbered [#1]}%
+ \algonumerate@makelabelnumber{#1}%
+ \global\let\algonumerate@global\global
+ \gdef\global{\algonumerate@global\let\global\algonumerate@global
+ \algonumerate@postprocess{}%
+ \global}%
+}
+%%%
\newdimen\algonumerate@maxindent
+\newdimen\@algolongestlabel
\AtBeginDocument{\ifdim\algonumerate@maxindent=\z@
\algonumerate@maxindent.2\textwidth\fi}
\def\algonumerateinit#1{%
+ \setcounter{algonumerate}{-1}%
+ \this@algolabeltype=\@M
+ \@algolongestlabel\z@
\def\@algonumfield{}%
\let\ccorg@or\or\let\or\relax
\algonumerate@items\z@
@@ -1235,6 +1293,9 @@ computational complexity
\@temptokena\expandafter{\@tempa}%
\toks@\expandafter{\@algonumfield}%
\edef\@algonumfield{\the\@temptokena\or\the\toks@}%
+ \setbox\@tempboxa\hbox{\algonumerate@makelabelautomatic{\the\toks@}}%
+ \ifdim\wd\@tempboxa>\@algolongestlabel\relax
+ \@algolongestlabel\wd\@tempboxa\fi
}%
\let\or\ccorg@or
\toks@\expandafter{\@algonumfield}%
@@ -1278,6 +1339,7 @@ computational complexity
\let\endbody\endalgo@block
\let\meta\algo@meta
\let\endmeta\endalgo@meta
+ \def\skipremainingspecialitems{\setcounter{algonumerate}{0}}%
}{%
\endlist\vskip\topskip}
\newdimen\blockindent \blockindent\parindent
@@ -1407,8 +1469,10 @@ computational complexity
\theoremstyle{ccalgo}
\newtheorem{named@lg@r@thm}{\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
\babel\def\babelInput{Input}[german=Eingabe,french=Entr\'ee]
\babel\def\babelOutput{Output}[german=Ausgabe,french=Sortie]
\babel\def\babelstep{step}[german=Schritt,french=pas]%% ??? pas?
@@ -1425,12 +1489,24 @@ computational complexity
\algotitle{#1}%
\n@medalgorithm}
{\endalgonumerate\csname end\algo@theorem\endcsname}
-\newcommand{\n@medalgorithm}[2][\babelInput,\protect\babelOutput]{%
+\newcommand{\n@medalgorithm}[1][\babelInput,\protect\babelOutput]{%
\algonumerateinit{#1}%
- \algorithmmasterkey{#2}%
+ \n@m@d@lgorithmgetlongestlabel}
+\newcommand{\n@m@d@lgorithmgetlongestlabel}[1][]{%
+ \def\@tempa{#1}%
+ \ifx\@tempa\@empty\else
+ \setbox\@tempboxa\hbox{\algonumerate@makelabel{#1}}%
+ \ifdim\wd\@tempboxa>\@algolongestlabel\relax
+ \@algolongestlabel\wd\@tempboxa\fi
+ \fi
+ \n@m@d@lgorithmgetmasterkey
+}
+\newcommand{\n@m@d@lgorithmgetmasterkey}[1]{%
+ \algorithmmasterkey{#1}%
\edef\@tempa{\the\algorithmmasterkey}\ifx\@tempa\@empty
\PackageError{ccalgo}{Empty key for algorithm like environment}{}\fi%
- \n@m@d@lgorithm}
+ \n@m@d@lgorithm
+}
\newcommand{\n@m@d@lgorithm}[1][]{%
\def\@tempa{#1}%
\ifx\@tempa\@empty\csname\algo@theorem\endcsname
@@ -1478,7 +1554,8 @@ computational complexity
\babel\def\endIF{}[]%
\babel\def\CALL{\keyword{Call}}[german=\keyword{Rufe}]%
\babel\def\RETURN{\keyword{Return}}[german=\keyword{Antworte}]%
- \expandafter\selectlanguage\expandafter{\languagename}
+ \def\@tempa{nohyphenation}\ifx\languagename\@tempa\else%
+ \expandafter\selectlanguage\expandafter{\languagename}\fi%
\def\COMMENT##1{$\{$ ##1 $\}$}%
}
\newcommand{\optitem}[1]{%
@@ -3259,6 +3336,8 @@ computational complexity
%%
%% End of file `ccthm.sty'.
\end{filecontents*}
+\begin{filecontents*}{develop.sty}
+\end{filecontents*}
\begin{filecontents*}{relabel.sty}
%%
%% This is file `relabel.sty',
diff --git a/Master/texmf-dist/doc/latex/computational-complexity/cc.pdf b/Master/texmf-dist/doc/latex/computational-complexity/cc.pdf
index e0577a7edce..617d332b87b 100644
--- a/Master/texmf-dist/doc/latex/computational-complexity/cc.pdf
+++ b/Master/texmf-dist/doc/latex/computational-complexity/cc.pdf
Binary files differ