Hi,
Im trying to write an algorithm using the algorithm
package, but when I use any keyword (if, while, state, etc) it won't compile
Here's what I type in (snippet)
\documentclass[9pt]{article}
\usepackage{algorithm}
\begin{document}
\begin{algorithm}
\caption{Calculate $A_{nxn}$}
\label{Algorithm 1}
\IF{$n<0$}
\STATE $x \leftarrow X$
\ENDIF
\end{algorithm}
\end{document}
geometry auto-detecting driver *geometry detected driver: pdftex* (/usr/share/texmf/tex/context/base/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] ! Undefined control sequence. l.94 \IF {$n<0$} ? q
update
These are all the packages i'm using.
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{url}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{algorithm}
\usepackage{multicol}
\usepackage{algorithmic}
\usepackage{fancyhdr}
Any thoughts? I'm kind of lost.
Thanks in advance.