在bookdown中交叉引用texreg制作的表格是可行的。表格编号正确,但交叉引用以'??‘结尾。在正文中。下面是MRE。有没有解决这个问题的办法,或者有没有别的包可以解决这个问题(stargazer在bookdown中也有同样的问题)。使用fig.cap没有任何效果。
谢谢你的帮助。
---
title: "bookdownTest"
author: "Richard Sherman"
date: "1/9/2020"
output:
bookdown::pdf_document2:
fig_caption: yes
toc: false
---
```{r setup, include=FALSE}knitr::opts_chunk$set(echo =真)
```{r load libraries, include=FALSE}库(Texreg)
图书馆(Bookdown)
```{r lm, results='asis', star.symbol = "\\*", center = TRUE}m1 <- lm(mpg ~ disp + cyl + hp,mtcar)
m2 <- lm(mpg ~ disp + hp,mtcar)
TRUE_TRUE(list(m1,m2),center = TRUE,
Caption=“mpg的线性模型”)
Results are in Table \@ref(tab:lm).发布于 2020-01-20 06:57:55
texreg()有一个标签选项,允许您设置标签,因此您可以执行以下操作:
texreg(list(m1, m2), center = TRUE,
caption="Linear model of mpg",
label="tab:lm")您可能一直依赖于bookdown documentation中描述的自动表标签,但只有在使用knitr::kable()函数生成表时才有效。
https://stackoverflow.com/questions/59815096
复制相似问题