]> mj.ucw.cz Git - ucwmac.git/blobdiff - ucw-algo.tex
Released version 1.99 (a preview of 2.0)
[ucwmac.git] / ucw-algo.tex
index cb65f042bdcf0b74d74f59e210d4dbc168277705..32f3c30053d53f722af99cd67ce114d79538b097 100644 (file)
@@ -7,17 +7,17 @@
 %      \algo{name of the algorithm}\algalias{a longer name}
 %      \algin input description
 %      \:step
-%      \:step
+%      \:step  \cmt{comment}
 %      \::[identifier]nested step
 %      \:::yet more nested step
 %      \algout output description
 %      \endalgo
 
 % Localized strings
-\localedef{en}{alg:alg}{Algorithm}
-\localedef{en}{alg:proc}{Procedure}
-\localedef{en}{alg:in}{Input}
-\localedef{en}{alg:out}{Output}
+\localedef{0}{alg:alg}{Algorithm}
+\localedef{0}{alg:proc}{Procedure}
+\localedef{0}{alg:in}{Input}
+\localedef{0}{alg:out}{Output}
 
 % Item indent
 \newdimen\algoindent
 \def\algostep#1{\hbox to \algolabelwidth{\hss #1~~}}
 
 \def\algoinit{
-       \goodbreak
        \begingroup
        \algospacing
        \inititemize
        \let\:=\algoitem
        \def\={\leftarrow}
+       \let\cmt=\algcmt
        \itemcount=0
 }
 
@@ -67,7 +67,7 @@
 \def\proc#1{\typedalgo{\localestr{alg:proc}}{#1}}
 \def\headlessalgo{\algoinit}
 
-\def\endalgo{\goodbreak\endlist\endgroup}
+\def\endalgo{\endlist\endgroup}
 \let\endproc=\endalgo
 
 \def\algoitem{%
@@ -88,3 +88,7 @@
 
 % Algorithm name in text or in a formula
 \protected\def\alg#1{\leavevmode\hbox{\csc #1}}
+
+% Comments
+\def\algcmt#1{\unskip~~\hfill\fullcmt{#1}\ignorespaces}
+\def\fullcmt#1{{$\triangleleft$\hskip0.5em\it #1}}