问题描述
我正在使用一些 Latex 处理以下代码(在 R 笔记本中制作可重现的报告文档,但由于某种原因,我的表格放在了我的文本和方程式上方。我该如何解决这个问题?enter image description here>
title: "Empirical Research in Finance"
subtitle: "**Hypothesis tests and simulation**"
author: Faes E.
fontsize: 12pt
date: '*January 25,2021*'
output:
pdf_document: default
html_document:
df_print: paged
header-includes:
- \usepackage{amsmath} \usepackage{color}
- \usepackage{titling}
- \pretitle{\begin{center}
\includegraphics[width=4in,height=4in]{AMSLOGO.jpg}\LARGE\\}
- \posttitle{\end{center}}
\thispagestyle{empty}
# copy the R logo to the current directory
file.copy(file.path(R.home("doc"),"html","AMSLOGO.jpg"),'.')
\newpage
\newpage
表 1 中对样本偏度的一阶和二阶矩进行了检查。可以看出,对于较大的样本,均值趋于零。对于方差,正在达到渐近方差。我们知道它应该呈现以下值(等式 2),因为我们知道偏度是渐近分布的,均值为 0,方差为 6/n(在这种情况下,n 是样本大小)。
\begin{equation}
\tag{2}
skewness \stackrel{a}{\sim}N(0,\dfrac{6}{n})
\end{equation}
```{r echo=FALSE}
kable(des(mom=S),digits= 3,caption = "Statistics for skewness") %>%
kable_classic(full_width = F) %>%
footnote(number = c("n is the sample size","std is the standard deviation"))
```
解决方法
就像 user2554330 回答正确并且对我有用:
您可以使用 kable(...,format = "latex",position = "h!")
给出一个非常强烈的建议,将其保留在原处。如果 LaTeX 认为这是一个坏主意,它仍然不会这样做。