交叉引用由texreg
in bookdown 中途制作的表格。该表已正确编号,但交叉引用以“??”结尾 在文本中。下面是一个 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 = TRUE)
```
```{r load libraries, include=FALSE}
library(texreg)
library(bookdown)
```
```{r lm, results='asis', star.symbol = "\\*", center = TRUE}
m1 <- lm(mpg ~ disp + cyl + hp, mtcars)
m2 <- lm(mpg ~ disp + hp, mtcars)
texreg(list(m1, m2), center = TRUE,
caption="Linear model of mpg")
```
Results are in Table \@ref(tab:lm).