Tilde over n when when converting from markdown to latex with pandoc
<p>I have a markdown document that I convert to PDF via pandoc's latex engine. I'm trying to render an n with a tilde over it, as in "niño", with markdown like the following:</p>

<pre><code>ni\~{n}o
</code></pre>

<p>...but this just gets rendered in the PDF as "ni~no" -- i.e. the tilde gets interpreted literally. I've also tried escaping the backslash (<code>ni\\~{n}o</code>), surrounding everything in brackets (<code>ni{\~{n}}o</code>), and basically what I think is every possible combination of escaping characters in this sequence, but nothing works. It also fails even when the sequence is on its own (i.e. <code>\~{n}</code>).</p>

<p>But, other similar sequences that are based on letters rather than symbols  work just fine (e.g. <code>Otter\r{a}</code> gets rendered correctly to "Otterå"). Pandoc is specifically failing to handle the tilde (or maybe more generally non-letter-based latex character sequences -- I haven't tested others).</p>

<p>The command I'm using to build the pdf is <code>pandoc file.md -o file.pdf</code>. I've also tried specifying <code>-f markdown+raw_tex</code>, but it still fails (nor should I need to, since the <code>\r{a}</code> works without it, and I think <code>raw_tex</code> is enabled by default anyway).</p>

<p>Any thoughts? I know I can use xetex to just enter these characters directly, but that's not really a satisfying solution...</p>