Prevent IEEEeqnarray ignoring baselineskip

line-spacing

I have been running into this problem when using \IEEEeqnarray. I have set the default line spacing of my document to be \baselineskip=18pt plus1pt, however for any paragraphs before an equation array this command is seemingly ignored, but all paragraphs after are fine.

Here is my code:

\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}

This is what the result looks like.

Is there any way to resolve this? I would like to be able to use \IEEEeqnarray since it is very useful but this makes my document look really ugly.

Thanks in advance for any help.

Best Answer

The problem is that IEEEeqnarray sets \baselineskip to \normalbaselineskip, which you don't set.

\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}

enter image description here

On the other hand, using flexible baseline skip is not the best idea. It's much better if you ensure an integer number of lines, which is easy to do with the geometry package and with \linespread{1.5}.