3

My document needs a line spacing of 1.5, if I set this line spacing using the setspace's \onehalfspacing command, or using \linespread{1.5}, the equation environment is also affected. The effect of this line spacing can be viewed when a array-like element is disposed inside the equation, as follows:

enter image description here

Moreover, the effect of the line spacing is increased if I use double spacing, that's awful! Basically I need equation environments with single spacing.

Following the solution to Equations and Double Spacing by Gonzalo Medina matrices looks good!, but I've noticed that when the equation environment follows a text paragraph (no line between them on plain text) the solution also affects such preceding text by changing its line spacing to single, as follows:

![enter image description here

Note that the third paragraph is not affected because it's after the equation. Also note the spaces between text and equations are changed and they are incorrect.

Why do this happen? How can I fix it?

Code

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{setspace}
%\onehalfspacing
\linespread{1.5}
\usepackage{etoolbox}
\BeforeBeginEnvironment{equation}{\begin{singlespacing}}
\AfterEndEnvironment{equation}{\end{singlespacing}\noindent\ignorespaces}

\begin{document}
Remote sensing is the acquisition of information about an object or phenomenon without making physical contact with the object and thus in contrast to on site observation. Remote sensing is a sub-field of geography.
    \begin{equation}
        \begin{bmatrix}
            X & Y & Z \\
            \vdots & \vdots & \vdots\\
            W & Q & V
        \end{bmatrix}
    \end{equation}

In modern usage, the term generally refers to the use of aerial sensor technologies to detect and classify objects on Earth (both on the surface, and in the atmosphere and oceans) by means of propagated signals (e.g. electromagnetic radiation).
\begin{equation}
    \left[
    \begin{array}{ccc}
    1 & 2 & 3\\
    4 & 5 & 6\\
    \end{array}\right]
\end{equation}

Remote sensing is a sub-field of geography. In modern usage, the term generally refers to the use of aerial sensor technologies to detect and classify objects on Earth (both on the surface, and in the atmosphere and oceans) by means of propagated signals (e.g. electromagnetic radiation).
\end{document}

1 Answer 1

5

I slighly modified your code. The trick was to add a \leavevmode. Note there is no singlespacing environment, but only a singlespace one.

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{setspace}
%\onehalfspacing
\linespread{1.5}
\usepackage{etoolbox}
\AtBeginEnvironment{equation}{\leavevmode\singlespace}
\AfterEndEnvironment{equation}{\endsinglespace\vskip0.5\baselineskip\noindent\ignorespaces}

\begin{document}

Remote sensing is the acquisition of information about an object or phenomenon without making physical contact with the object and thus in contrast to on site observation. Remote sensing is a sub-field of geography.
\begin{equation}
  \begin{bmatrix}
    X & Y & Z \\
    \vdots & \vdots & \vdots \\
    W & Q & V
  \end{bmatrix}
\end{equation}
In modern usage, the term generally refers to the use of aerial sensor technologies to detect and classify objects on Earth (both on the surface, and in the atmosphere and oceans) by means of propagated signals (e.g. electromagnetic radiation).
\begin{equation}
  \left[
    \begin{array}{ccc}
      1 & 2 & 3 \\
      4 & 5 & 6 
  \end{array}\right] 
\end{equation}
Remote sensing is a sub-field of geography. In modern usage, the term generally refers to the use of aerial sensor technologies to detect and classify objects on Earth (both on the surface, and in the atmosphere and oceans) by means of propagated signals (e.g. electromagnetic radiation).

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .