如何刪除 LyX 中經典論文中方程式上方和下方不需要的空格

如何刪除 LyX 中經典論文中方程式上方和下方不需要的空格

我正在使用最新的 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 版本(即文件的最終版本)中方程式上方和後面的空間

方程式 n°(1) 的預期結果

您必須將這些行放在環境之前,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}

您應該使用equationfor 方程式而不是\[and\]

編輯

在 LyX 中,按 Ctrl+L(或插入,然後按 Code TeX)並在空白處貼上

\setlength{\belowdisplayskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
\setlength{\abovedisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}

這是 LyX 的範例LyX 範例

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. 

相關內容