2

我正在使用 bookdown 同时生成 html 和 pdf。我想在 html 版本中使用动态表(DT),但在 pdf 文件中使用普通表。有没有办法在降价中做到这一点,而不必将文件作为输入分开并使用 yml 文件。就像是

if (output = html) {
    DT...
}
if (output = "pdf"){
    xlatex ...
}

谢谢伦格

4

1 回答 1

4

编辑感谢一辉的评论:

if( knitr:::is_latex_output() ) {
    xlatex ...
} else {
    DT...
}
于 2017-01-19T15:36:12.843 回答