繁体   English   中英

Math kableextra 乳胶

[英]Math kableextra latex

我一直在关注如何在 KableExtra R markdown 中的单元格中包含数学的示例,也许我在做一些非常愚蠢的事情,但我似乎无法让数学符号起作用

遵循此处的示例: 在 R-Markdown 中使用 knitr 和 kableExtra 的表格单元格中的 Latex 公式或符号,但我似乎没有正确理解我的示例,因为它仍然给我在表格末尾丢失的 $ 错误。

output file: test.knit.md

! Missing $ inserted.
<inserted text> 
                $
l.125 \end{tabular}}

我正在尝试创建一个 pdf 文档

---
title: "Untitled"
author: "Willem"
date: "13 March 2019"
output: pdf_document
---
require(knitr)
require(kableExtra)

试试桌子


table <- as.data.frame(matrix(c("LC variable","Small area of significant pixels in the centre","Large area possibly aligning with bushfire affected area.",
"t-test regression model residuals","Slightly lower mean residual ($p\\\\<0.05$) after change (0.5 mm per month)","Lower mean residual ($p\\\\<0.05$) after change (1.5 mm per month)",
"Positive score","0.2\\% of pixels at $p\\\\<0.1$","3.7\\% of pixel at $p\\\\<0.1$",
"Field significance of scores", "Both positive and negative within random distribution", "Positive outside random distribution."
),nrow=4,ncol=3, byrow=T))
kable(table,caption="Summary table of all tests on the two regions ", 'latex',
      booktabs =TRUE, escape=F,col.names = c("Test","Qld" ,"NSW VIC")) %>%
column_spec(2:3, width = "7cm") %>%
  kable_styling(latex_options = "scale_down")#%>%
  #kableExtra::landscape()

谁能发现我的错误?

---
title: "Untitled"
author: "Willem"
date: "13 March 2019"
output: pdf_document
---
require(knitr)
require(kableExtra)

试试桌子


table <- as.data.frame(matrix(c("LC variable","Small area of significant pixels in the centre","Large area possibly aligning with bushfire affected area.",
"t-test regression model residuals","Slightly lower mean residual ($p<0.05$) after change (0.5 mm per month)","Lower mean residual ($p<0.05$) after change (1.5 mm per month)",
"Positive score","0.2\\% of pixels at $p<0.1$","3.7\\% of pixel at $p<0.1$",
"Field significance \\% of scores", "Both positive and negative \\% within random distribution", "Positive \\% outside random distribution."
),nrow=4,ncol=3, byrow=T))
kable(table,caption="Summary table of all tests on the two regions ", 'latex',
      booktabs =TRUE, escape=F,col.names = c("Test","Qld" ,"NSW VIC")) %>%
column_spec(2:3, width = "7cm") %>%
  kable_styling(latex_options = "scale_down")#%>%
  #kableExtra::landscape()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM