Are \onehalfspacing and {spacing}{1.5} Supposed to Yield Different Results

line-spacingoutputscalingsetspacespacing

I am working on a document which requires for a very small portion of the text, that the spacing between the lines be increased. However, and I don't know why, the \begin{onehalfspacing}\end{onehalfspacing} does not work.

Thus, I sought out an alternative approach, and came up with \begin{spacing}{1.5}\end{spacing} which definitely increased the spacing between the lines in the document I am working on.

However, in trying to figure out why the first approach was not working, I discovered that the two approaches yield different results.

Consider the code,

\documentclass{book}
\usepackage{setspace}
\usepackage{lipsum}

\begin{document}
\thispagestyle{empty}

\begin{onehalfspacing}
\lipsum[3] \vspace{20pt}
\end{onehalfspacing}

\begin{spacing}{1.5}
\lipsum[3]
\end{spacing}
\end{document}

which produces the output:

enter image description here

Now, the way I am seeing it, the two results, which I thought should be the same, are different.

QUESTION: What is causing the discrepancy between the two outputs; and which of the two renders a more accurate output of one-and-a-half spacing? Finally, if \spacing{1.5} is not accurate, does anyone know the scaling factor I should use to make it as close to one-and-a-half spacing as possible—as this approach works in my document whereas \onehalfspacing (for some unbeknownst reason) does not.

Thank you.

Best Answer

The environment name is onehalfspace, not onehalfspacing AND, it is (for a 10pt document) equivalent to \begin{spacing}{1.25}.

\documentclass{book}
\usepackage{setspace}
\usepackage{lipsum}

\begin{document}
\thispagestyle{empty}

\begin{onehalfspace}
\lipsum[3] \vspace{20pt}
\end{onehalfspace}

\begin{spacing}{1.25}
\lipsum[3]
\end{spacing}
\end{document}

enter image description here

Here is the relevant code from the style file:

% one and a half spacing is 1.5 x pt size
\newenvironment{onehalfspace}{%
  \begingroup
    \onehalfspacing
}{%
  \restore@spacing
}

where

\newcommand{\onehalfspacing}{%
  \setstretch{1.25}%  default
  \ifcase \@ptsize \relax % 10pt
    \setstretch {1.25}%
  \or % 11pt
    \setstretch {1.213}%
  \or % 12pt
    \setstretch {1.241}%
  \fi
}

and

\newenvironment{spacing}[1]{%
  \par
  \begingroup             % moved from \endspacing by PGBR 29-1-91
    \setstretch {#1}%
}{%
  \restore@spacing
}