]> AND Private Git Repository - UIC2013.git/blob - algorithm.sty
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
34e1f1fd02828b103f716f623c83f5399bc1ce75
[UIC2013.git] / algorithm.sty
1 % ALGORITHM STYLE -- Released 8 April 1996
2 %    for LaTeX-2e
3 % Copyright -- 1994 Peter Williams
4 %
5 % E-mail pwil3058@bigpond.net.au
6 %
7 % This style file is free software; you can redistribute it and/or
8 % modify it under the terms of the GNU Lesser General Public
9 % License as published by the Free Software Foundation; either
10 % version 2 of the License, or (at your option) any later version.
11 %
12 % This style file is distributed in the hope that it will be useful,
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 % Lesser General Public License for more details.
16 %
17 % You should have received a copy of the GNU Lesser General Public
18 % License along with this style file; if not, write to the
19 % Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 % Boston, MA  02111-1307, USA.
21 %
22 \NeedsTeXFormat{LaTeX2e}
23 \ProvidesPackage{algorithm}
24 \typeout{Document Style `algorithm' - floating environment}
25
26 \RequirePackage{float}
27 \RequirePackage{ifthen}
28 \newcommand{\ALG@within}{nothing}
29 \newboolean{ALG@within}
30 \setboolean{ALG@within}{false}
31 \newcommand{\ALG@floatstyle}{ruled}
32 \newcommand{\ALG@name}{Algorithm}
33 \newcommand{\listalgorithmname}{List of \ALG@name s}
34
35 % Declare Options
36 % first appearance
37 \DeclareOption{plain}{
38   \renewcommand{\ALG@floatstyle}{plain}
39 }
40 \DeclareOption{ruled}{
41   \renewcommand{\ALG@floatstyle}{ruled}
42 }
43 \DeclareOption{boxed}{
44   \renewcommand{\ALG@floatstyle}{boxed}
45 }
46 % then numbering convention
47 \DeclareOption{part}{
48   \renewcommand{\ALG@within}{part}
49   \setboolean{ALG@within}{true}
50 }
51 \DeclareOption{chapter}{
52   \renewcommand{\ALG@within}{chapter}
53   \setboolean{ALG@within}{true}
54 }
55 \DeclareOption{section}{
56   \renewcommand{\ALG@within}{section}
57   \setboolean{ALG@within}{true}
58 }
59 \DeclareOption{subsection}{
60   \renewcommand{\ALG@within}{subsection}
61   \setboolean{ALG@within}{true}
62 }
63 \DeclareOption{subsubsection}{
64   \renewcommand{\ALG@within}{subsubsection}
65   \setboolean{ALG@within}{true}
66 }
67 \DeclareOption{nothing}{
68   \renewcommand{\ALG@within}{nothing}
69   \setboolean{ALG@within}{true}
70 }
71 \DeclareOption*{\edef\ALG@name{\CurrentOption}}
72
73 % ALGORITHM
74 %
75 \ProcessOptions
76 \floatstyle{\ALG@floatstyle}
77 \ifthenelse{\boolean{ALG@within}}{
78   \ifthenelse{\equal{\ALG@within}{part}}
79      {\newfloat{algorithm}{htbp}{loa}[part]}{}
80   \ifthenelse{\equal{\ALG@within}{chapter}}
81      {\newfloat{algorithm}{htbp}{loa}[chapter]}{}
82   \ifthenelse{\equal{\ALG@within}{section}}
83      {\newfloat{algorithm}{htbp}{loa}[section]}{}
84   \ifthenelse{\equal{\ALG@within}{subsection}}
85      {\newfloat{algorithm}{htbp}{loa}[subsection]}{}
86   \ifthenelse{\equal{\ALG@within}{subsubsection}}
87      {\newfloat{algorithm}{htbp}{loa}[subsubsection]}{}
88   \ifthenelse{\equal{\ALG@within}{nothing}}
89      {\newfloat{algorithm}{htbp}{loa}}{}
90 }{
91   \newfloat{algorithm}{htbp}{loa}
92 }
93 \floatname{algorithm}{\ALG@name}
94
95 \newcommand{\listofalgorithms}{\listof{algorithm}{\listalgorithmname}}
96