File:Latex-algorithmic-if-else.png
Summary
| Description |
English: Image of the example code from wikibooks:en:LaTeX/Algorithms_and_Pseudocode#Typesetting_using_the_algorithmic_package |
| Source | Own work |
| Author | Nemti |
Produced by the following:
$ cat algorithm.tex
\documentclass[12pt]{article}
\usepackage{algorithmic}
\usepackage[right=8cm]{geometry}
\usepackage[active,pdftex,tightpage]{preview}
\PreviewEnvironment[]{algorithmic}
\begin{document}
\begin{algorithmic}
\IF {$i\geq maxval$}
\STATE $i\gets 0$
\ELSE
\IF {$i+k\leq maxval$}
\STATE $i\gets i+k$
\ENDIF
\ENDIF
\end{algorithmic}
\end{document}
$ pdflatex algorithm.tex
...
$ pdftoppm -r 600 algorithm.pdf algorithm
$ convert algorithm-1.ppm latex-algorithmic-if-else.png
Licensing
| I, the copyright holder of this work, release this work into the public domain. This applies worldwide. In some countries this may not be legally possible; if so: I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |