]> mj.ucw.cz Git - ucwmac.git/blobdiff - ucw-algo.tex
ucw-algo: Comments
[ucwmac.git] / ucw-algo.tex
index cb65f042bdcf0b74d74f59e210d4dbc168277705..e356ef4f6f3f47ac42f697b1a89a916f36bfd82f 100644 (file)
@@ -7,7 +7,7 @@
 %      \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
@@ -59,6 +59,7 @@
        \inititemize
        \let\:=\algoitem
        \def\={\leftarrow}
+       \let\cmt=\algcmt
        \itemcount=0
 }
 
@@ -88,3 +89,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}}