/[cvs]/bcast-kanada/algpseudocode.sty
ViewVC logotype

Annotation of /bcast-kanada/algpseudocode.sty

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations)
Fri Jan 27 22:10:44 2006 UTC (12 years, 11 months ago) by riso
Branch: MAIN
CVS Tags: paper-v1, sirocco06-submitted, sirocco06-cameraready, HEAD
Changes since 1.1: +40 -58 lines
1. verzia clanku od Steva

1 riso 1.2 % PSEUDOCODE ALGORITHMIC STYLE -- Released 27 APR 2005
2 riso 1.1 % for LaTeX version 2e
3     %
4     % Copyright Szasz Janos
5     % E-mail szaszjanos@users.sourceforge.net
6     % Based on Peter Williams's algorithmic.sty
7     %
8     \NeedsTeXFormat{LaTeX2e}%
9     \ProvidesPackage{algpseudocode}%
10     \RequirePackage{ifthen}%
11     \RequirePackage{algorithmicx}%
12     \typeout{Document Style - pseudocode environments for use with the `algorithmicx' style}%
13     %
14 riso 1.2 \def\ALG@noend{f}%
15 riso 1.1 \newboolean{ALG@compatible}%
16     \setboolean{ALG@compatible}{false}%
17     %
18 riso 1.2 \DeclareOption{noend}{\def\ALG@noend{t}}%
19     \DeclareOption{end}{\def\ALG@noend{f}}%
20     \DeclareOption{compatible}{\typeout{For compatibility mode use algcompatible.sty!!!}\setboolean{ALG@compatible}{true}}%
21 riso 1.1 \DeclareOption{noncompatible}{\setboolean{ALG@noncompatible}{false}}%
22     \ProcessOptions%
23     %
24     % *** DECLARATIONS ***
25     %
26 riso 1.2 \algnewlanguage{pseudocode}%
27     \alglanguage{pseudocode}%
28 riso 1.1 %
29     % *** KEYWORDS ***
30     %
31 riso 1.2 \algnewcommand\algorithmicend{\textbf{end}}
32     \algnewcommand\algorithmicdo{\textbf{do}}
33     \algnewcommand\algorithmicwhile{\textbf{while}}
34     \algnewcommand\algorithmicfor{\textbf{for}}
35     \algnewcommand\algorithmicforall{\textbf{for all}}
36     \algnewcommand\algorithmicloop{\textbf{loop}}
37     \algnewcommand\algorithmicrepeat{\textbf{repeat}}
38     \algnewcommand\algorithmicuntil{\textbf{until}}
39     \algnewcommand\algorithmicprocedure{\textbf{procedure}}
40     \algnewcommand\algorithmicfunction{\textbf{function}}
41     \algnewcommand\algorithmicif{\textbf{if}}
42     \algnewcommand\algorithmicthen{\textbf{then}}
43     \algnewcommand\algorithmicelse{\textbf{else}}
44     \algnewcommand\algorithmicrequire{\textbf{Require:}}
45     \algnewcommand\algorithmicensure{\textbf{Ensure:}}
46     \algnewcommand\algorithmicreturn{\textbf{return}}
47     \algnewcommand\textproc{\textsc}
48 riso 1.1 %
49     % *** DECLARED LOOPS ***
50     %
51 riso 1.2 \algdef{SE}[WHILE]{While}{EndWhile}[1]{\algorithmicwhile\ #1\ \algorithmicdo}{\algorithmicend\ \algorithmicwhile}%
52     \algdef{SE}[FOR]{For}{EndFor}[1]{\algorithmicfor\ #1\ \algorithmicdo}{\algorithmicend\ \algorithmicfor}%
53     \algdef{S}[FOR]{ForAll}[1]{\algorithmicforall\ #1\ \algorithmicdo}%
54 riso 1.1 \algdef{SE}[LOOP]{Loop}{EndLoop}{\algorithmicloop}{\algorithmicend\ \algorithmicloop}%
55 riso 1.2 \algdef{SE}[REPEAT]{Repeat}{Until}{\algorithmicrepeat}[1]{\algorithmicuntil\ #1}%
56     \algdef{SE}[IF]{If}{EndIf}[1]{\algorithmicif\ #1\ \algorithmicthen}{\algorithmicend\ \algorithmicif}%
57     \algdef{C}[IF]{IF}{ElsIf}[1]{\algorithmicelse\ \algorithmicif\ #1\ \algorithmicthen}%
58 riso 1.1 \algdef{Ce}[ELSE]{IF}{Else}{EndIf}{\algorithmicelse}%
59     \algdef{SE}[PROCEDURE]{Procedure}{EndProcedure}%
60 riso 1.2 [2]{\algorithmicprocedure\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}%
61 riso 1.1 {\algorithmicend\ \algorithmicprocedure}%
62     \algdef{SE}[FUNCTION]{Function}{EndFunction}%
63 riso 1.2 [2]{\algorithmicfunction\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}%
64 riso 1.1 {\algorithmicend\ \algorithmicfunction}%
65     %
66 riso 1.2 \ifthenelse{\equal{\ALG@noend}{t}}%
67 riso 1.1 {%
68     \algtext*{EndWhile}%
69     \algtext*{EndFor}%
70     \algtext*{EndLoop}%
71     \algtext*{EndIf}%
72     \algtext*{EndProcedure}%
73     \algtext*{EndFunction}%
74     }{}%
75     %
76     % *** OTHER DECLARATIONS ***
77     %
78 riso 1.2 \algnewcommand\Require{\item[\algorithmicrequire]}%
79     \algnewcommand\Ensure{\item[\algorithmicensure]}%
80     \algnewcommand\Return{\algorithmicreturn{} }%
81     \algnewcommand\Call[2]{\textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}%
82 riso 1.1 %
83     %
84     %
85     \ifthenelse{\boolean{ALG@compatible}}%
86     {%
87 riso 1.2 \ifthenelse{\equal{\ALG@noend}{t}}%
88     {\RequirePackage[noend]{algcompatible}}%
89     {\RequirePackage{algcompatible}}%
90 riso 1.1 }%
91     {}%
92     %

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.26