title: Latex algorithm. Can't get it to work
body: <p>Im trying to write an algorithm using the <code>algorithm</code> package, but when I use any keyword (if, while, state, etc) it won't compile</p>
  
  <p>Here's what I type in (snippet)</p>
  
  <pre><code>\documentclass[9pt]{article}
  \usepackage{algorithm}
  \begin{document}
  
  \begin{algorithm}
  \caption{Calculate $A_{nxn}$}
  \label{Algorithm 1}
  
  \IF{$n&lt;0$}
  \STATE $x \leftarrow X$
  \ENDIF
  
  
  \end{algorithm}
  
  \end{document}
  </code></pre>
  
  <blockquote>
    <p><em>geometry auto-detecting driver</em>
    <em>geometry detected driver: pdftex</em> (/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&lt;0$} ? q</p>
  </blockquote>
  
  <h1>update</h1>
  
  <p>These are all the packages i'm using.</p>
  
  <pre><code>\usepackage[utf8]{inputenc}
  \usepackage{geometry}
  \usepackage{url}
  \usepackage{amsmath}
  \usepackage{graphicx}
  \usepackage{listings}
  \usepackage{algorithm}
  
  \usepackage{multicol}
  \usepackage{algorithmic}
  
  \usepackage{fancyhdr}
  </code></pre>
  
  <p>Any thoughts? I'm kind of lost.</p>
  
  <p>Thanks in advance.</p>