【问题标题】:Bookdown table references when not using Kable不使用 Kable 时的 Bookdown 表参考
【发布时间】:2017-09-11 17:38:04
【问题描述】:

Yihui Xie 的 Bookdown 书https://bookdown.org/yihui/bookdown/tables.html 很清楚,交叉引用系统需要对非 kable 表进行适配。本节的最后一段很关键,但(在我的外行看来)是难以理解的,我希望能举一两个例子。

为了让事情稍微复杂一些,我的项目使用了 Rchunks,这可能会使任务更加复杂。

但是,有没有人有他们将共享的 bookdown 交叉引用代码示例(可能包括 Rchunks、Rmd 调用那些 Rchunks 或 \@ref(tab:...)),哪些不调用 kable?

【问题讨论】:

    标签: r knitr cross-reference bookdown kable


    【解决方案1】:

    不完全确定您在问什么,但这里有一个手动键入的表格示例,可与 bookdown 一起使用:

    R includes a lot of advanced mathematical functions. Table \@ref(tab:mathfunctions) shows a list of the most common functions.
    
    Table: (\#tab:mathfunctions) Common mathematical functions in R.
    
    | Function | Explanation | Example|
    |----------|------------|-------------|
    |   `abs(x)`  | Absolute value| `abs(-3) = 3`|
    |   `sqrt(x)` | Square root | `sqrt(9) = 3` |
    |   `log(x)`  | Natural logarithm | `log(10) = 2.303` |
    |   `log10(x)`  | Base 10 logarithm | `log10(10) = 1` |
    |   `log(x, base=2)`  | Base 2 logarithm | `log(10, base=2) = 3.322` |
    |   `exp(x)`  | Exponential function | `exp(1) = 2.718` |
    
    
    R also allows you to yada yada yada.
    

    【讨论】:

    • 我发现我必须删除最初的“表格:”并将我的标题包含在一个 html 标记中才能正常工作: (\#tab:label) 我的标题
    猜你喜欢
    • 2019-08-14
    • 1970-01-01
    • 1970-01-01
    • 2016-10-11
    • 1970-01-01
    • 1970-01-01
    • 2020-08-29
    • 1970-01-01
    • 2021-04-09
    相关资源
    最近更新 更多