防止 IEEEeqnarray 忽略 baselineskip

防止 IEEEeqnarray 忽略 baselineskip

我在使用时遇到了这个问题\IEEEeqnarray。我已将文档的默认行距设置为\baselineskip=18pt plus1pt,但是对于方程数组之前的任何段落,此命令似乎被忽略,但之后的所有段落都正常。

这是我的代码:

\documentclass{article}
\usepackage{IEEEtrantools}
\usepackage[utf8]{inputenc}

\begin{document}
\baselineskip=18pt plus1pt

Here is some text. This text is normal and spaced how I would like for it to be spaced. I am going to add a few more words to make it really clear what the spacing is meant to look like. Notice how the lines are relatively further apart compare to the following paragraph.

Here is some text. It is spaced too narrowly. This text is not spaced correctly since immediately after I am going to use the command \verb=\IEEEeqnarray=. For some reason I cannot understand it overrides the spacing I set up earlier.
\begin{IEEEeqnarray}{rCl}
    (a + b) + c & =  & a + b + c \\
    & = & a + (b + c)
\end{IEEEeqnarray}

This text after is also formatted correctly. The purpose of this text is to show that the affected text is only for paragraphs directly before the \verb=\IEEEeqnarray= environment.

\end{document}

结果如下所示。

有什么办法可以解决这个问题吗?我希望能够使用它,\IEEEeqnarray因为它非常有用,但这会使我的文档看起来非常丑陋。

在此先感谢您的帮助。

答案1

问题是IEEEeqnarray设置\baselineskip\normalbaselineskip,而您没有设置。

\documentclass{article}
\usepackage{IEEEtrantools}

\AtBeginDocument{%
  \baselineskip=18pt plus1pt
  \normalbaselineskip=18pt plus1pt
  \selectfont
}

\begin{document}

Here is some text. This text is normal and spaced how I would like for
it to be spaced. I am going to add a few more words to make it really
clear what the spacing is meant to look like. Notice how the lines
are relatively further apart compare to the following paragraph.

Here is some text. It is spaced too narrowly. This text is not spaced
correctly since immediately after I am going to use the command
\verb=\IEEEeqnarray=. For some reason I cannot understand it overrides
the spacing I set up earlier.
\begin{IEEEeqnarray}{rCl}
    (a + b) + c & =  & a + b + c \\
    & = & a + (b + c)
\end{IEEEeqnarray}

This text after is also formatted correctly. The purpose of this
text is to show that the affected text is only for paragraphs
directly before the \verb=\IEEEeqnarray= environment.

\end{document}

在此处输入图片描述

另一方面,使用灵活的基线跳过并不是最好的主意。如果能确保行数为整数,效果会更好,使用geometry和 包很容易做到这一点\linespread{1.5}

相关内容