如何使用pdf输出引用rmarkdown中的节

如何使用pdf输出引用rmarkdown中的节,r,latex,r-markdown,R,Latex,R Markdown,当输出到pdf时,我如何使用\label和\ref链接rmarkdown中的部分。我尝试过各种排列,但都没有成功 一次尝试 --- title: "Untitled" output: pdf_document --- See Section \@ref(sec:label). # Section One (\#sec:label) 给 您可以按如下方式修改文档: --- title: "Untitled 1" date: "28 de j

当输出到pdf时,我如何使用
\label
\ref
链接
rmarkdown
中的部分。我尝试过各种排列,但都没有成功

一次尝试

---
title: "Untitled"
output: pdf_document
---
See Section \@ref(sec:label).

# Section One  (\#sec:label)


您可以按如下方式修改文档:

---
title: "Untitled 1"
date: "28 de junio de 2020"
link-citations: yes
output:
  pdf_document:
    includes:
      keep_tex: yes
    number_sections: yes
    toc_depth: 2
---

\section{This is the first section} \label{section1}

You will be some in \ref{section1}


然后您可以看到数字是如何显示的,只需将
\label{}
添加到您的部分,并使用
\ref{}
调用。另外,我建议使用
\section{}
,并根据我的介绍修改
YAML
。希望这能有所帮助。

您可以按如下方式修改文档:

---
title: "Untitled 1"
date: "28 de junio de 2020"
link-citations: yes
output:
  pdf_document:
    includes:
      keep_tex: yes
    number_sections: yes
    toc_depth: 2
---

\section{This is the first section} \label{section1}

You will be some in \ref{section1}


然后您可以看到数字是如何显示的,只需将
\label{}
添加到您的部分,并使用
\ref{}
调用。另外,我建议使用
\section{}
,并根据我的介绍修改
YAML
。希望这能有所帮助。

非常感谢。因此,似乎是选项
number\u sections:yes
发挥了神奇的作用,允许标准latex引用工作非常感谢。因此,似乎是选项
number\u sections:yes
发挥了允许标准latex引用工作的魔力