From c014be04b37537bc6c6498f794ac1e95282b5fb2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 26 Aug 2009 23:46:11 +0000 Subject: algorithms 0.1 (25aug09) git-svn-id: svn://tug.org/texlive/trunk@14871 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/algorithms/algorithm.sty | 66 +++++++------ .../tex/latex/algorithms/algorithmic.sty | 108 ++++++++++++++------- 2 files changed, 109 insertions(+), 65 deletions(-) (limited to 'Master/texmf-dist/tex/latex/algorithms') diff --git a/Master/texmf-dist/tex/latex/algorithms/algorithm.sty b/Master/texmf-dist/tex/latex/algorithms/algorithm.sty index 34e1f1fd028..85585654b1b 100644 --- a/Master/texmf-dist/tex/latex/algorithms/algorithm.sty +++ b/Master/texmf-dist/tex/latex/algorithms/algorithm.sty @@ -1,28 +1,33 @@ -% ALGORITHM STYLE -- Released 8 April 1996 -% for LaTeX-2e -% Copyright -- 1994 Peter Williams -% -% E-mail pwil3058@bigpond.net.au -% -% This style file is free software; you can redistribute it and/or -% modify it under the terms of the GNU Lesser General Public -% License as published by the Free Software Foundation; either -% version 2 of the License, or (at your option) any later version. -% -% This style file is distributed in the hope that it will be useful, -% but WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -% Lesser General Public License for more details. -% -% You should have received a copy of the GNU Lesser General Public -% License along with this style file; if not, write to the -% Free Software Foundation, Inc., 59 Temple Place - Suite 330, -% Boston, MA 02111-1307, USA. -% -\NeedsTeXFormat{LaTeX2e} +%% +%% This is file `algorithm.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% algorithms.dtx (with options: `algorithm') +%% This is a generated file. +%% +%% Copyright (C) 1994-2004 Peter Williams +%% Copyright (C) 2005-2009 Rogério Brito +%% +%% This document file is free software; you can redistribute it and/or +%% modify it under the terms of the GNU Lesser General Public License as +%% published by the Free Software Foundation; either version 2 of the +%% License, or (at your option) any later version. +%% +%% This document file is distributed in the hope that it will be useful, but +%% WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +%% General Public License for more details. +%% +%% You should have received a copy of the GNU Lesser General Public License +%% along with this document file; if not, write to the Free Software +%% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +%% USA. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{algorithm} -\typeout{Document Style `algorithm' - floating environment} - + [2009/08/24 v0.1 Document Style `algorithm' - floating environment] \RequirePackage{float} \RequirePackage{ifthen} \newcommand{\ALG@within}{nothing} @@ -31,9 +36,8 @@ \newcommand{\ALG@floatstyle}{ruled} \newcommand{\ALG@name}{Algorithm} \newcommand{\listalgorithmname}{List of \ALG@name s} - -% Declare Options -% first appearance +% Declare Options: +% * first: appearance \DeclareOption{plain}{ \renewcommand{\ALG@floatstyle}{plain} } @@ -43,7 +47,7 @@ \DeclareOption{boxed}{ \renewcommand{\ALG@floatstyle}{boxed} } -% then numbering convention +% * then: numbering convention \DeclareOption{part}{ \renewcommand{\ALG@within}{part} \setboolean{ALG@within}{true} @@ -69,7 +73,6 @@ \setboolean{ALG@within}{true} } \DeclareOption*{\edef\ALG@name{\CurrentOption}} - % ALGORITHM % \ProcessOptions @@ -91,6 +94,7 @@ \newfloat{algorithm}{htbp}{loa} } \floatname{algorithm}{\ALG@name} - \newcommand{\listofalgorithms}{\listof{algorithm}{\listalgorithmname}} - +\endinput +%% +%% End of file `algorithm.sty'. diff --git a/Master/texmf-dist/tex/latex/algorithms/algorithmic.sty b/Master/texmf-dist/tex/latex/algorithms/algorithmic.sty index a8ea2546bc7..f8bd40b873a 100644 --- a/Master/texmf-dist/tex/latex/algorithms/algorithmic.sty +++ b/Master/texmf-dist/tex/latex/algorithms/algorithmic.sty @@ -1,31 +1,42 @@ -% ALGORITHMIC STYLE for LaTeX version 2e -% -% This style file is free software; you can redistribute it and/or -% modify it under the terms of the GNU Lesser General Public -% License as published by the Free Software Foundation; either -% version 2 of the License, or (at your option) any later version. -% -% This style file is distributed in the hope that it will be useful, -% but WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -% Lesser General Public License for more details. -% -% You should have received a copy of the GNU Lesser General Public -% License along with this style file; if not, write to the -% Free Software Foundation, Inc., 59 Temple Place - Suite 330, -% Boston, MA 02111-1307, USA. -% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{algorithmic}[2006/06/02] -\typeout{Document Style `algorithmic' - environment} -% +%% +%% This is file `algorithmic.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% algorithms.dtx (with options: `algorithmic') +%% This is a generated file. +%% +%% Copyright (C) 1994-2004 Peter Williams +%% Copyright (C) 2005-2009 Rogério Brito +%% +%% This document file is free software; you can redistribute it and/or +%% modify it under the terms of the GNU Lesser General Public License as +%% published by the Free Software Foundation; either version 2 of the +%% License, or (at your option) any later version. +%% +%% This document file is distributed in the hope that it will be useful, but +%% WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +%% General Public License for more details. +%% +%% You should have received a copy of the GNU Lesser General Public License +%% along with this document file; if not, write to the Free Software +%% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +%% USA. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{algorithmic} + [2009/08/24 v0.1 Document Style `algorithmic'] +% The algorithmic.sty package: \RequirePackage{ifthen} -\RequirePackage{calc} \RequirePackage{keyval} \newboolean{ALC@noend} \setboolean{ALC@noend}{false} -\newcounter{ALC@line} -\newcounter{ALC@rem} +\newcounter{ALC@unique} % new counter to make lines numbers be internally +\setcounter{ALC@unique}{0} % different in different algorithms +\newcounter{ALC@line} % counter for current line +\newcounter{ALC@rem} % counter for lines not printed \newcounter{ALC@depth} \newlength{\ALC@tlm} % @@ -46,12 +57,10 @@ % For line numbers' delimiters \newcommand{\ALC@linenodelimiter}{:} \define@key{ALG}{linenodelimiter}{\renewcommand{\ALC@linenodelimiter}{#1}} - % % For line numbers' size \newcommand{\ALC@linenosize}{\footnotesize} \define@key{ALG}{linenosize}{\renewcommand{\ALC@linenosize}{#1}} - % % ALGORITHMIC \newcommand{\algorithmicrequire}{\textbf{Require:}} @@ -75,11 +84,17 @@ \newcommand{\algorithmicuntil}{\textbf{until}} \newcommand{\algorithmicprint}{\textbf{print}} \newcommand{\algorithmicreturn}{\textbf{return}} +\newcommand{\algorithmicand}{\textbf{and}} +\newcommand{\algorithmicor}{\textbf{or}} +\newcommand{\algorithmicxor}{\textbf{xor}} +\newcommand{\algorithmicnot}{\textbf{not}} +\newcommand{\algorithmicto}{\textbf{to}} +\newcommand{\algorithmicinputs}{\textbf{inputs}} +\newcommand{\algorithmicoutputs}{\textbf{outputs}} +\newcommand{\algorithmicglobals}{\textbf{globals}} +\newcommand{\algorithmicbody}{\textbf{do}} \newcommand{\algorithmictrue}{\textbf{true}} \newcommand{\algorithmicfalse}{\textbf{false}} -\def\ALC@setref{% - \def\@currentlabel{\theALC@line}% -} \def\ALC@item[#1]{% \if@noparitem \@donoparitem \else \if@inlabel \indent \par \fi @@ -121,31 +136,53 @@ \let\@listvii\@listi \newenvironment{ALC@g}{ \begin{list}{\ALC@lno}{ \itemsep\z@ \itemindent\z@ - \listparindent\z@ \rightmargin\z@ + \listparindent\z@ \rightmargin\z@ \topsep\z@ \partopsep\z@ \parskip\z@\parsep\z@ \leftmargin \algorithmicindent%1em \addtolength{\ALC@tlm}{\leftmargin} } } {\end{list}} - \newcommand{\ALC@it}{\refstepcounter{ALC@rem}\refstepcounter{ALC@line}\ifthenelse{\equal{\arabic{ALC@rem}}{#1}}{\setcounter{ALC@rem}{0}}{}\item\ALC@setref} + \newcommand{\ALC@it}{% + \stepcounter{ALC@rem}% + \ifthenelse{\equal{\arabic{ALC@rem}}{#1}}{\setcounter{ALC@rem}{0}}{}% + \stepcounter{ALC@line}% + \refstepcounter{ALC@unique}% + \item\def\@currentlabel{\theALC@line}% + } \newcommand{\ALC@com}[1]{\ifthenelse{\equal{##1}{default}}% {}{\ \algorithmiccomment{##1}}} \newcommand{\REQUIRE}{\item[\algorithmicrequire]} \newcommand{\ENSURE}{\item[\algorithmicensure]} - \newcommand{\PRINT}{\ALC@it\algorithmicprint{}\ \ } - \newcommand{\RETURN}{\ALC@it\algorithmicreturn{}\ \ } + \newcommand{\PRINT}{\ALC@it\algorithmicprint{} \ } + \newcommand{\RETURN}{\ALC@it\algorithmicreturn{} \ } \newcommand{\TRUE}{\algorithmictrue{}} \newcommand{\FALSE}{\algorithmicfalse{}} + \newcommand{\AND}{\algorithmicand{} } + \newcommand{\OR}{\algorithmicor{} } + \newcommand{\XOR}{\algorithmicxor{} } + \newcommand{\NOT}{\algorithmicnot{} } + \newcommand{\TO}{\algorithmicto{} } \newcommand{\STATE}{\ALC@it} \newcommand{\STMT}{\ALC@it} \newcommand{\COMMENT}[1]{\algorithmiccomment{##1}} + \newenvironment{ALC@inputs}{\begin{ALC@g}}{\end{ALC@g}} + \newenvironment{ALC@outputs}{\begin{ALC@g}}{\end{ALC@g}} + \newenvironment{ALC@globals}{\begin{ALC@g}}{\end{ALC@g}} + \newenvironment{ALC@body}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@if}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@for}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@whl}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@loop}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@rpt}{\begin{ALC@g}}{\end{ALC@g}} \renewcommand{\\}{\@centercr} + \newcommand{\INPUTS}[1][default]{\ALC@it\algorithmicinputs\ \ALC@com{##1}\begin{ALC@inputs}} + \newcommand{\ENDINPUTS}{\end{ALC@inputs}} + \newcommand{\OUTPUTS}[1][default]{\ALC@it\algorithmicoutputs\ \ALC@com{##1}\begin{ALC@outputs}} + \newcommand{\ENDOUTPUTS}{\end{ALC@outputs}} + \newcommand{\GLOBALS}{\ALC@it\algorithmicglobals\ } + \newcommand{\BODY}[1][default]{\ALC@it\algorithmicbody\ \ALC@com{##1}\begin{ALC@body}} + \newcommand{\ENDBODY}{\end{ALC@body}} \newcommand{\IF}[2][default]{\ALC@it\algorithmicif\ ##2\ \algorithmicthen% \ALC@com{##1}\begin{ALC@if}} \newcommand{\ELSE}[1][default]{\end{ALC@if}\ALC@it\algorithmicelse% @@ -176,7 +213,7 @@ \newcommand{\ENDFOR}{\end{ALC@for}\ALC@it\algorithmicendfor} \newcommand{\ENDWHILE}{\end{ALC@whl}\ALC@it\algorithmicendwhile} \newcommand{\ENDLOOP}{\end{ALC@loop}\ALC@it\algorithmicendloop} - } + } \renewcommand{\@toodeep}{} \begin{list}{\ALC@lno}{\setcounter{ALC@rem}{0}\setcounter{ALC@line}{0}% \itemsep\z@ \itemindent\z@ \listparindent\z@% @@ -190,3 +227,6 @@ } } {\end{list}} +\endinput +%% +%% End of file `algorithmic.sty'. -- cgit v1.2.3