
私は classicthesis テンプレートの最新の LyX バージョンを使用しています。
word-to-latex で変換した LaTeX コードを LyX にインポートすると、生成された PDF では各方程式の上下に不要なスペース (通常は上に 2 行、下に 1 行) がありますが、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
の代わりに方程式にを使う必要があります\[
\]
編集
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.