【问题标题】:R Markdown - Reference Section Numbers in PDFR Markdown - 参考 PDF 中的章节编号
【发布时间】:2020-09-17 17:44:47
【问题描述】:

我在 R Studio 中使用 R Markdown 并且有许多部分。我正在尝试使用此处记录的自定义部分引用标签来引用部分编号:https://ulyngs.github.io/oxforddown/cites-and-refs.html 但它似乎不起作用。

这里是一些示例代码:

Some paragraph text here

## Obtain Projected {#Projections}

Another paragraph with a reference to Section Number \@ref(Projections).

我希望将第二段呈现为:

“引用第 3.1 节的另一段。”例如。

我的相关 YAML 标头是:

header-includes: |
  \usepackage{indentfirst}
  \usepackage{hyperref}
  \usepackage[utf8]{inputenc}
  \def\tightlist{}
  \setlength\parindent{24pt}
output: rticles::tf_article

有人知道我怎样才能让它工作吗?

【问题讨论】:

    标签: r latex r-markdown


    【解决方案1】:

    我在发布后不久就想通了,很抱歉发布我自己的答案。我只需将 bookdown 添加到我的 YAML 部分:

    ---
    header-includes: |
      \usepackage{indentfirst}
      \usepackage{hyperref}
      \usepackage[utf8]{inputenc}
      \def\tightlist{}
      \setlength\parindent{24pt}
    output: 
      bookdown::pdf_book:
        base_format: rticles::tf_article
    ---
    

    然后这工作了:

    这里有一些段落文本

    ## Obtain Projected {#Projections}

    Another paragraph with a reference to Section Number \@ref(Projections).

    【讨论】:

      猜你喜欢
      • 2022-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-20
      • 1970-01-01
      • 2021-05-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多