标签: cross-reference

如何在适用于pdf和html输出的书本文档的表格标题中插入引用

我使用bookdown生成html和pdf格式的文档。如何在表格标题中插入对文档部分的引用?

使用\\ref{sec:FirstSection}pdf_book可以正常工作(但gitbook不能):

---
title: "Test"
output: bookdown::pdf_book
---

# A section {#sec:FirstSection}
The dataset in Table \@ref(tab:aTable) contains some data.

# Another section
```{r, aTable, echo = FALSE}
knitr::kable(
  cars[1:5, ],
  caption  = "See Section \\ref{sec:FirstSection}."
)
```
Run Code Online (Sandbox Code Playgroud)

同时使用\\@ref(sec:FirstSection)gitbook可以正常工作(但pdf_book不能)

---
title: "Test"
output: bookdown::gitbook
---

# A section {#sec:FirstSection}
The dataset in Table \@ref(tab:aTable) contains some data.

# Another section
```{r, aTable, echo = FALSE}
knitr::kable(
  cars[1:5, ],
  caption  = "See Section \\@ref(sec:FirstSection)."
)
    ```
Run Code Online (Sandbox Code Playgroud)

caption cross-reference r-markdown bookdown

2
推荐指数
1
解决办法
675
查看次数

内核函数定义

我在哪里可以找到以下函数的完整实现/主体,在Linux内核中的"include/linux/pci.h"中定义为函数原型.

int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val);
int pci_bus_write_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 val);
Run Code Online (Sandbox Code Playgroud)

我通常使用自由电子的交叉引用来查找内核中函数的定义.我也使用cscope来查找这些函数的定义,但两种情况都没有运气.

cross-reference linux-kernel

1
推荐指数
1
解决办法
289
查看次数

linq 中的多个交叉引用表联接

这一直困扰着我一段时间,因为我试图提出一种优化的查询方式。

因此,假设我有 3 个交叉引用表,它们共享一个公共列,该公共列将在包含更多信息的主表上进行最终连接。

例如:

假设我有以下内容:

 Customers //properties: ID, Name, Address
 IEnumberable<CustomerSports> //properties: CustomerID, SportsID
 IEnumberable<CustomerLocation> //properties: CustomerID, LocationID
 IEnumberable<CustomerPets> //properties: CustomerID, PetsID
Run Code Online (Sandbox Code Playgroud)

所以我可以进行查询,例如:

给我一份在纽约 (CustomerLocation) 玩长曲棍球、足球、足球 (CustomerSports)... 以及养狗和猫 (CustomerPets) 的客户列表。查找表可以为空,因此客户可以参加体育运动,但没有宠物。

然后,当我获得客户列表时,我将加入客户表中的公共列 (CustomerID) 以检索 ID、姓名和地址。

我正在考虑在每次查找时加入客户表,然后进行联合以获取客户列表,但我不知道这是否是正确的做法。

c# linq cross-reference

1
推荐指数
1
解决办法
1226
查看次数

交叉引用 bookdown::html_document2 不起作用

我正在 Rmarkdown 中写一篇论文,并使用它bookdown::html_document2来编织输出。交叉引用图形和表格使用常见的 Bookdown 语法,例如\@ref(tab:example_table)。但是,交叉引用章节/标题不起作用:\@ref(introduction)不起作用。我最终会发现??这很奇怪,因为链接指向正确的标签:/example_path/example_filename.html#introduction。我正在处理一个文档。

我检查了源代码,章节标题的标签 ID 也正确。当我使用 Pandoc 的本机语法引用章节部分/标题时,它确实有效:[introduction]works。但是,这将打印介绍部分/标题的标签,而不是标题本身,因此“介绍”而不是带有大写“I”的“介绍”。一个明显的解决方法是使用[Introduction][introduction],但这在我的例子中违背了交叉引用的目的。我还尝试给我的章节部分/标题自定义标签,但这也行不通。它也不适用于bookdown::pdf_document2.

根据“使用 R Markdown 创作书籍”的这一部分,我使用的语法应该有效,那么我在这里缺少什么?

我正在使用 Pandoc 版本2.7.3

编辑

删除了会话信息,因为它与问题无关。

编辑

@RalfStubner 请求了一个 mre(我应该首先提供 - 感谢 Ralf 的建议!):

---
title: "Document Title"
author: "Jono3030"
date: "Last updated: `r Sys.time()`"
output:
  bookdown::html_document2:
    number_sections: no
  bookdown::pdf_document2:
    keep_tex: no
    number_sections: no
  bookdown::word_document2: default
---

# Introduction

This is the introduction

# Chapter_one …
Run Code Online (Sandbox Code Playgroud)

r cross-reference pandoc r-markdown bookdown

1
推荐指数
1
解决办法
2071
查看次数

Bookdown:另一个文件中的交叉参考图

我已经冒险尝试并准备使用 bookdown 完全在 RStudio 中出版的手稿。在正文中,我想在单独的支持信息 .Rmd 文件中交叉引用数字。

假设这是我的主要文本文件,名为main.Rmd

---
title: "Main text"
output:
  bookdown::pdf_book:
    toc: no
---
Here is the main text file. I would like to refer to \@ref(fig:supporting-figure).
Run Code Online (Sandbox Code Playgroud)

这是名为 的支持文本supporting.Rmd和要参考的图,保存在同一文件夹中:

---
title: "Supporting info"
output:
  bookdown::pdf_book:
    toc: no
---

Here is the supporting text.

```{r supporting-figure}
plot(cars)
```
Run Code Online (Sandbox Code Playgroud)

如何supporting-figure在正文中交叉引用?

我已经检查了 Yihui's bookdown manual 中有关交叉引用的部分,但我看不出如何将其扩展到文件之间的交叉引用。

我还发现了这个问题: Cross-reference figure in a separate Rmarkdown (PDF) file 但接受的答案对我不起作用(也许是因为我使用的是 bookdown 而不是 base Rmarkdown?)

r literate-programming cross-reference r-markdown bookdown

0
推荐指数
1
解决办法
842
查看次数