title: How do I make a reference to a figure in markdown using pandoc?
body: <p>I'm currently writing a document in markdown and I'd like to make a reference to an image from my text.</p>
  
  <pre><code>this is my text, I want a reference to my image1 [here]. blablabla
  
  ![image1](img/image1.png)
  </code></pre>
  
  <p>I want to do that reference because after converting my markdown to pdf, images get placed in one or two pages after and the document doesn't make any sense.</p>
  
  <p>UPDATE:</p>
  
  <p>I've tried <a href="http://groups.google.com/group/pandoc-discuss/msg/4a42442657a96414">Ryan's answer</a> in <a href="http://groups.google.com/group/pandoc-discuss/browse_thread/thread/33118abe7348d3c7/4a42442657a96414?#4a42442657a96414">that post</a> and I can't make it working.
  Apparently the code :</p>
  
  <pre><code>[image]: image.png "Image Title" 
  ![Alt text][image] 
  A reference to the [image](#image).
  </code></pre>
  
  <p>should produce:</p>
  
  <pre><code>\begin{figure}[htbp] 
  \centering 
  \includegraphics[keepaspectratio,width=\textwidth,height=0.75\textheight]{i mage.png} 
  \caption{Alt text} 
  \label{image} 
  \end{figure} 
  
  A reference to the image (\autoref{image}).
  </code></pre>
  
  <p>instead, I obtain:</p>
  
  <pre><code>\begin{figure}[htbp]
  \centering
  \includegraphics{image.png}
  \caption{Alt text}
  \end{figure}
  
  A reference to the \href{\#image}{image}.
  </code></pre>
  
  <p>I've noticed two problems :</p>
  
  <ul>
  <li><code>\label{image}</code> doesn't appear : no reference is created.</li>
  <li><code>(\autoref{image})</code> becomes <code>\href{\#image}{image}</code> : no cross reference is detected.</li>
  </ul>
  
  <p>And then, when I convert that to pdf it obviously doesn't link to the image. There's a link, but it doesn't link to anything.</p>
  
  <p>Any help would be much appreciated!!</p>