title: How to prevent escape of a ~ (tilde) character in LaTeX document using R markdown and pandoc?
body: <p>I am preapring a scientific article manuscript using R Markdown. My R Markdown file is first converted to Markdown by knitr and then to LaTeX code by pandoc.</p>
  
  <p>In LaTeX, the <code>~</code> character is used to indicate a non-breaking space. <a href="https://tex.stackexchange.com/questions/15547/when-should-i-use-non-breaking-space">It is considered good style</a> by some journals to use the <code>~</code> character in front of <code>\ref</code> or <code>\cite</code>. For instance, LaTeX code like <code>Section~\ref{...}</code> and <code>Figure~\ref{...}</code> or rather <code>Sect.~\ref{...}</code> and <code>Fig.~\ref{...}</code> is expected by my journal.</p>
  
  <p>Trying to use R Markdown to generate LaTeX code as close as possible to the journal's guidelines, I try to use <code>Sect.~\ref{...}</code>, but this is converted to <code>Sect.\textasciitilde{}\ref{...}</code> by pandoc.</p>
  
  <p>How can I prevent pandoc escaping the <code>~</code> character to <code>\textasciitilde{}</code> to obtain the valid LaTeX?</p>