
我正在使用最新的 LyX 版本的 classicthesis 模板。
當我將由單字到乳膠轉換的乳膠程式碼匯入LyX 時,產生的PDF 中每個方程式的上方和下方都有不需要的空格(通常是上面兩行和下面一行),但在LyX 本身中沒有(空格是看不見,看起來很正常)。
如何避免或刪除這些空格?
更新:我在模板中發現了一條評論:“在章節或章節標題中使用數學可能會得到意想不到的結果。考慮 pdfspacing 選項。”
如何在 LyX 中使用“pdfspacing”選項?
更新:原始碼和不需要的 PDF 佈局是
\begin{document}
There are differences in the space above equation.
\[
W = a + b+ c
\]
There are differences in the space below equation.
There are differences in the space above equation.
\begin{equation}
W = a + b+ c
\end{equation}
There are differences in the space below equation.
\end{document}
答案1
您在 LyX 中看到的只是可以更改的預覽。如果您想減少 pdf 版本(即文件的最終版本)中方程式上方和後面的空間
您必須將這些行放在環境之前,equation
如此處所示。
\documentclass[a4paper]{article}
\begin{document}
There are differences in the space above equation.
\[
W = a + b+ c
\]
There are differences in the space below equation.
\setlength{\belowdisplayskip}{0pt} \setlength{\belowdisplayshortskip}{0pt}
\setlength{\abovedisplayskip}{0pt} \setlength{\abovedisplayshortskip}{0pt}
There are differences in the space above equation.
\begin{equation}
W = a + b+ c
\end{equation}
There are differences in the space below equation.
\end{document}
您應該使用equation
for 方程式而不是\[
and\]
編輯
在 LyX 中,按 Ctrl+L(或插入,然後按 Code TeX)並在空白處貼上
\setlength{\belowdisplayskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
\setlength{\abovedisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
LyX產生的LaTeX程式碼是
\setlength{\belowdisplayskip}{0pt} \setlength{\belowdisplayshortskip}{0pt} \setlength{\abovedisplayskip}{0pt} \setlength{\abovedisplayshortskip}{0pt}
There are differences in the space above equation.
\[
W=a+b+c
\]
There are differences in the space below equation.
There are differences in the space above equation.
\begin{equation}
W=a+b+c
\end{equation}
\begin{equation}
T=est
\end{equation}
There are differences in the space below equation.