📚 The CoCalc Library - books, templates and other resources
License: OTHER
% ALGORITHM STYLE -- Released 8 April 19961% for LaTeX-2e2% Copyright -- 1994 Peter Williams3% E-mail [email protected]4\NeedsTeXFormat{LaTeX2e}5\ProvidesPackage{algorithm}6\typeout{Document Style `algorithm' - floating environment}78\RequirePackage{float}9\RequirePackage{ifthen}10\newcommand{\ALG@within}{nothing}11\newboolean{ALG@within}12\setboolean{ALG@within}{false}13\newcommand{\ALG@floatstyle}{ruled}14\newcommand{\ALG@name}{Algorithm}15\newcommand{\listalgorithmname}{List of \ALG@name s}1617% Declare Options18% first appearance19\DeclareOption{plain}{20\renewcommand{\ALG@floatstyle}{plain}21}22\DeclareOption{ruled}{23\renewcommand{\ALG@floatstyle}{ruled}24}25\DeclareOption{boxed}{26\renewcommand{\ALG@floatstyle}{boxed}27}28% then numbering convention29\DeclareOption{part}{30\renewcommand{\ALG@within}{part}31\setboolean{ALG@within}{true}32}33\DeclareOption{chapter}{34\renewcommand{\ALG@within}{chapter}35\setboolean{ALG@within}{true}36}37\DeclareOption{section}{38\renewcommand{\ALG@within}{section}39\setboolean{ALG@within}{true}40}41\DeclareOption{subsection}{42\renewcommand{\ALG@within}{subsection}43\setboolean{ALG@within}{true}44}45\DeclareOption{subsubsection}{46\renewcommand{\ALG@within}{subsubsection}47\setboolean{ALG@within}{true}48}49\DeclareOption{nothing}{50\renewcommand{\ALG@within}{nothing}51\setboolean{ALG@within}{true}52}53\DeclareOption*{\edef\ALG@name{\CurrentOption}}5455% ALGORITHM56%57\ProcessOptions58\floatstyle{\ALG@floatstyle}59\ifthenelse{\boolean{ALG@within}}{60\ifthenelse{\equal{\ALG@within}{part}}61{\newfloat{algorithm}{htbp}{loa}[part]}{}62\ifthenelse{\equal{\ALG@within}{chapter}}63{\newfloat{algorithm}{htbp}{loa}[chapter]}{}64\ifthenelse{\equal{\ALG@within}{section}}65{\newfloat{algorithm}{htbp}{loa}[section]}{}66\ifthenelse{\equal{\ALG@within}{subsection}}67{\newfloat{algorithm}{htbp}{loa}[subsection]}{}68\ifthenelse{\equal{\ALG@within}{subsubsection}}69{\newfloat{algorithm}{htbp}{loa}[subsubsection]}{}70\ifthenelse{\equal{\ALG@within}{nothing}}71{\newfloat{algorithm}{htbp}{loa}}{}72}{73\newfloat{algorithm}{htbp}{loa}74}75\floatname{algorithm}{\ALG@name}7677\newcommand{\listofalgorithms}{\listof{algorithm}{\listalgorithmname}}78798081