TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to set the line space among my thesis double. So I use the following commands at preamble

\setlength{\parindent}{1em}
\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.8}

However, the line space at the following items should be untouched and regular:

  • Captions
  • Footnotes
  • Bibliography entries of more than one line

What commands should I add?

share|improve this question
    
\usepackage{setspace}\doublespacing. – cfr Feb 21 at 19:40
    
@cfr - Depending on the main document font size, \doublespacing is equivalent to \setstretch with a factor somewhere between 1.618 and 1.667. Since the OP appears to be interested in a factor of 1.8, I'd use \setstretch{1.8}. – Mico Feb 21 at 19:43
    
@Mico Maybe. But then that's more than double-spaced. So it depends if it is double-spacing or something else that's wanted. @ OP You can use \begin{singlespace}... \end{singlespace} or you can say \singlespacing to switch indefinitely, although the \...ing versions are intended primarily for preamble use. – cfr Feb 21 at 19:56
    
@cfr - Unfortunately, the term "double-spacing" isn't defined uniformly and consistently. E.g., whereas setspace uses a stretch factor somewhere between 1.618 and 1.667, MS Word, I believe, uses a stretch factor of 2.0 (yikes!). – Mico Feb 21 at 20:04
1  
Why don't you say \setstretch{1.8} in the preamble and then put \begin{singlespace}... \end{singlespace} around the bibliography? Will that work? – cfr Feb 21 at 20:43
up vote 3 down vote accepted

setspace provides 4 commands intended for use in the preamble:

  • \singlespacing
  • \doublespacing
  • \onehalfspacing
  • \setstretch{<factor>}

Alternatively, the package options singlespacing, onehalfspacing or doublespacing may be used in place of the first three. singlespacing is default.

In addition, a further option nodisplayskipstretch may be set to prevent extra spacing around display environments.

For use in the body of the document, the package provides 4 environments:

  • \begin{singlespace}...\end{singlespace}
  • \begin{singlespace*}...\end{singlespace*}
  • \begin{onehalfspace}...\end{onehalfspace}
  • \begin{doublespace}...\end{doublespace}
  • \begin{spacing}{<factor>}...\end{spacing}

Although the preamble commands will work in the document body, they are not designed for use there and will result in sub-optimal spacing in many cases. This is because the environments do more than simply switch the stretch using the \...ing commands.

For example, here's the definition of singlespace:

\newenvironment{singlespace}{% from setspace.sty
  \vskip \baselineskip
  \setstretch {\setspace@singlespace}%
  \vskip -\baselineskip
}{%
  \par
}

In contrast, here's the definition of \singlespacing:

\newcommand{\singlespacing}{% from setspace.sty
  \setstretch {\setspace@singlespace}%  normally 1
  \vskip \baselineskip  % Correction for coming into singlespace
}

While \setstretch {\setspace@singlespace} is the same in both definitions, the adjustments differ in other ways because the environment makes adjustments specifically required in the case of line spacing changes within a document.

The difference between singlespace and singlespace* is in the specific adjustments made. Here's singlespace*:

\newenvironment{singlespace*}{% from setspace.sty
  \setstretch {\setspace@singlespace}%
  \vskip -\baselineskip
}{%
  \vskip -0.5\baselineskip
}

As can be seen, the vertical spacing changes differ between the two environments and between both environments and \singlespacing.

Similar differences exist for the other preamble command/corresponding environment pairs.

In general, therefore, it is best to use the environments intended for use within the body within the body. In some cases, the differences will not change the output because, for example, there's a page break at the start and end of the changed line-spacing anyway. But the differences will matter in other cases so it is best to use the environments as a routine within the document body unless there is some special reason to do otherwise.

\documentclass...
...
\usepackage{setspace}
\setstretch{1.8}
...
\begin{document}
...
\begin{singlespace}
<bibliography commands go here>
\end{singlespace}
...
\end{document}
share|improve this answer

Don't modify the low-level parameter \baselinestretch directly. Instead, insert the following instructions in the preamble:

\usepackage{setspace}
\setstretch{1.8}

Or, use a spacing environment with an argument of 1.8, in the body of the document:

\begin{spacing}{1.8}
 ...
\end{spacing}

Just let the spacing environment end before the start of the bibliography.

An MWE:

\documentclass{article}
\usepackage{lipsum} % filler text
\usepackage{setspace}
\begin{document}
\begin{spacing}{1.8}
\lipsum*[1]\footnote{\lipsum*[2]}  % automatic single-spacing in footnotes

\end{spacing}

\begin{thebibliography}{9}

\bibitem{z} xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 

\end{thebibliography}
\end{document}
share|improve this answer
    
When I add the command \setstrech{1.8} I get the error \setstretch ...ef \baselinestretch {#1}\@currsize. I resolve this issue by adding the few commands \makeatletter \let\@currsize\normalsize \makeatother and then add \setstrech{1.8}. However, the space line in references is larger than regular. – Admia Feb 21 at 19:46
1  
@Mahdi - Do issue the instruction \setstretch{1.0} -- or, equivalently, \singlespacing -- before the start of the bibliography. – Mico Feb 21 at 20:15
1  
@Mahdi - Are you really using the minimal document class? You should have mentioned this rather important fact up-front. About the macro \singlespacing: Why do you believe that it can only be used in the preamble? – Mico Feb 21 at 20:29
1  
@Mahdi It works in the body, too, but it isn't intended for use there. In your case, I don't think it will make any difference because you have a new page, probably, at the start and end of the stretch of single-spaced references. But in other cases, you will lose the spacing adjustments the package makes when using singlespace but not when saying \singlespacing. So it is better to use singlespace within the body as routine. – cfr Feb 21 at 20:49
1  
@Mahdi - I don't have access to a copy of the University_Template.cls file, but I'd say that it's exceedingly unlikely that the class file is based on the minimal class. Thus, I wouldn't worry about a discussion that's applicable to users of the minimal document class only. – Mico Feb 21 at 20:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.