【发布时间】:2017-12-26 17:07:11
【问题描述】:
align 和 gather 这样的环境显然是为在一段 LaTeX 文本中使用而设计的,因为文档文本和数学环境开始之间的两个换行符会插入一个惊人的两段的垂直空白.但是,Markdown 总是在其上方文本下方两行开始任何 LaTeX 环境,即使您在 Markdown 代码/文本的同一行开始环境,即使您在它之前放置 2 个空格以添加单行中断。由于 Markdown 没有原生的多行数学显示,这造成了两难。
在环境补偿足够好之前运行\vspace{-\baselineskip},但当然最好告诉markdown不要首先插入换行符。那可能吗?如果没有,那么在每个 align(和/或 align*、gather、gather* 等)环境开始之前自动运行 \vspace{-\baselineskip} 的最简单方法是什么?
MWE:
---
output:
pdf_document:
keep_tex: 1
---
The following environment will get marked up with an extra two lines between it and
this text, putting it on a new paragraph and creating a lot of whitespace above it,
whether or not there's any line breaks in the markdown code:
\begin{gather*}
A \\ B
\end{gather*}
This can of course be hackily corrected by subtracting vertical space:
\vspace{-\baselineskip} \begin{gather*}
A \\ B
\end{gather*}
【问题讨论】:
标签: latex r-markdown multiline