- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在写带有方程式的rmarkdown pdf文档(使用mac,knitr,pdf-latex)。我的问题是rmarkdown会自动在前面的文本和公式之间创建2-3行的大空白间隙。我如何摆脱这种差距?
下面的示例rmarkdown文档。
---
title: "No More Gaps"
author: "Llew Mills"
date: "16th of September 2016"
output: pdf_document
header-includes:
- \setlength{\mathindent}{0pt}
linestretch: 1.3
toc: yes
classoption: fleqn
---
Some text to illustrate the gap. I still want there to be a decent line spacing between lines of text, but I would like a much smaller gap between the equations and the preceding text.
\begingroup\Large
\begin{align*}
Y_{ij} &= \pi_{0i} + \pi_{1i}TIME_{ij} + \pi_{2i}(0) + \varepsilon_{ij}\\
&= \pi_{0i} + \pi_{1i}TIME_{ij} + \varepsilon_{ij}
\end{align*}
\endgroup
Can anyone help with this problem?
最佳答案
这里有两个选择。正如我在评论中指出的,的第一个仅用于使用\vspace
。 第二个是使用\abovedisplayskip
。有关此(以及同级命令)如何工作的详细信息,我可以向您推荐Remove vertical space around align。
---
title: "Spacing"
output: pdf_document
header-includes:
- \usepackage{amsmath}
- \usepackage{lipsum}
---
\setlength{\abovedisplayskip}{-15pt}
\setlength{\belowdisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
\lipsum*[3]
\begin{align*}
A\cap B & = \{b,d,e\} \cap \{a,b,f,g\} \\
& = \{b\}
\end{align*}
\lipsum[3]
关于latex - 减少RMarkdown中对齐环境和文本内容之间的垂直空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39522390/
我正在尝试使用此示例将 3 个文件编织在一起:http://rmarkdown.rstudio.com/rmarkdown_websites.html 我的文件都共享同一个目录,该目录已在 RStud
我正在将 Rmarkdown 与 python 一起使用。相当于R python的内联代码? 例如,在 https://rmarkdown.rstudio.com/lesson-4.html我可以 `
我正在用 Rmarkdown 编写一系列相互补充的报告。我想将上一份报告的结果包含在我目前正在处理的报告中。我看到其他问题建议使用 purl 从 Rmarkdown 文档中提取 R 代码然后运行它,所
我想演示如何编写 RMarkdown,其中所说的 RMarkdown 演示嵌入在用于创建类(class) Material 的 RMarkdown 文档中。在这个围栏代码块中,我不希望 knitr 执
我在 Amazon AWS EC-2(Amazon Linux AMI 2015.09.1 (HVM),SSD Volume Type - ami-60b6c60a)上安装了一个 Shiny 的服务器
我刚刚开始使用 rmarkdown、pandoc 和 knitr。我在尝试让 pandoc 获取比 rmarkdown 文档高一级的图像时遇到了很多困难。例如,考虑我们的项目目录是 ~/test,下面
我希望将 Bootstrap 导航栏(如此处所示:https://getbootstrap.com/docs/4.0/components/navbar/)添加到我正在创建的 R Markdown 模
我正在尝试通过 Rmarkdown 并排打印两个表格,输出为 PDF。 我可以很好地打印这些表格,但它们最终靠得很近,我找不到在它们之间创造更多空间的方法。我在其他帖子中找到的解决方案返回奇怪的输出或
我报告了一个问题 https://github.com/rstudio/rmarkdown/issues/967我想知道是否有解决方法(如何使其工作)? 下面的可重现示例(改变 n 和 nGroup
我正在将 Rmarkdown PDF 文档与以下 YAML 设置放在一起: --- output: pdf_document: fig_caption: true fig_crop
我有类似于以下的代码,它是动态生成并存储在变量中的: --- title: "test" author: "me" date: "3 June 2019" output: html_document
我经常编写可供技术人员和高管阅读的 Markdown 文档。 从这个意义上说,我想知道是否可以在 HTML 中创建一个按钮来隐藏或显示最终输出中的代码块? 目前,我正在创建两个单独的文件,我认为这是一
我正在使用 rmarkdown 在 RStudio 中进行投影仪演示。我想在演示文稿的顶部获得幻灯片代码。德累斯顿主题应该支持那些股票 Dresden 那么是否有可能通过使用 rmarkdown 来获
我有一个简单的问题。我如何使用 Rmarkdown/knitr 创建词汇表。我与 RStudio 合作。 我尝试这个但没有成功 \usepackage{glossaries} 在 header.tex
我有R包,它的功能之一-产生报告。在inst/markdown中,我有一个模板rep.rmd。在包函数ProduceReport()中,我有以下代码: render.file <-"rep.Rmd
嗨,我想在我的 Rmarkdown 文件的一侧添加一个页面导航。如果它看起来像侧边栏就好了 on this page . --- title: "My Title" author: "My Name"
当我为学生准备教程时,我需要一种方法来隐藏可折叠面板中的内容,这些面板可以通过单击按钮来显示。我已经使用下面的代码让它工作了。 RMarkdown 文件如下所示: --- title: Collaps
我最近开始使用 r-markdown使用来自 rticles 的便捷模板准备期刊文章.但是,我们最终使用 Word 而不是 LaTex 提交。合作者更喜欢 Word,目前,并非所有期刊都接受 LaTe
我有两个 RMarkdown 文件。 main.Rmd这是渲染的主文件 example.Rmd它包含更长的示例并在其他地方使用(因此它存在于自己的文档中)。 我想包括example.Rmd在 main
在我的 R 文件中,我有: library(rmarkdown) rmarkdown::render("C://Users//me//Desktop//test_param.Rmd",
我是一名优秀的程序员,十分优秀!