summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/algorithm2e/doc/algorithm2e_ex07.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/algorithm2e/doc/algorithm2e_ex07.tex')
-rw-r--r--macros/latex/contrib/algorithm2e/doc/algorithm2e_ex07.tex35
1 files changed, 35 insertions, 0 deletions
diff --git a/macros/latex/contrib/algorithm2e/doc/algorithm2e_ex07.tex b/macros/latex/contrib/algorithm2e/doc/algorithm2e_ex07.tex
new file mode 100644
index 0000000000..7aecb14f2d
--- /dev/null
+++ b/macros/latex/contrib/algorithm2e/doc/algorithm2e_ex07.tex
@@ -0,0 +1,35 @@
+Let's have a look at what we can do
+with if-then-else and side comments\;
+\eIf{if-then-else test}{
+ no comment here\;
+ neither in then\;
+}{
+ nor in else\;
+}
+\eIf(\tcc*[f]{then comment}){test}{
+ then with a comment\;
+}(\tcc*[f]{comment in else})
+{
+ here we are in else\;
+}
+\eIf(\tcc*[f]{then comment}){test}{
+ again a comment in then\;
+}{
+ but not in else\;
+}
+\eIf{if-then-else test}{
+ this time, no comment in then\;
+}(\tcc*[f]{else comment})
+{
+ but one comment in else\;
+}
+Let's try with other if possibilities\;
+\lIf(\tcc*[h]{lif comment}){test}{text}
+\uIf(\tcc*[f]{uif comment}){test}{
+ then text\;
+}
+\uElseIf(\tcc*[f]{comment}){test}{
+ elseif text\;
+}
+\lElseIf(\tcc*[h]{comment}){test}{text}
+\lElse(\tcc*[f]{comment}){text}