title: How to reference sections in rmarkdown with pdf output
body: <p>How do I use <code>\label</code> and <code>\ref</code> to link sections in <code>rmarkdown</code> when outputting to pdf please. I have tried various permutations from <a href="https://bookdown.org/yihui/bookdown/cross-references.html" rel="nofollow noreferrer">https://bookdown.org/yihui/bookdown/cross-references.html</a> and <a href="https://bookdown.org/yihui/rmarkdown-cookbook/cross-ref.html" rel="nofollow noreferrer">https://bookdown.org/yihui/rmarkdown-cookbook/cross-ref.html</a> with no success.</p>
  <p>One attempt</p>
  <pre><code>---
  title: &quot;Untitled&quot;
  output: pdf_document
  ---
  See Section \@ref(sec:label).
  
  # Section One  (\#sec:label)
  
  </code></pre>
  <p>which gives</p>
  <p><a href="https://i.stack.imgur.com/skNgP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/skNgP.png" alt="enter image description here" /></a></p>