views:

14751

answers:

6

I am using the acm LaTeX template and I have trouble making my paper double spaced.

My LaTeX document looks like the following:

\documentclass{acm_proc_article-sp}
\usepackage{setspace}
\doublespacing
\begin{document}
...
\end{document}

When I compile the above document using pdflatex, I get the following error message on the line that I use the command \doublespacing:

Missing number, treated as zero \doublespacing
+4  A: 

I believe you want to use \usepackage{doublespace} to double-space your document. To put in a block of singlespacing, surround it with \begin{singlespace} and \end{singlespace}.

Ref: http://web.mit.edu/olh/Latex/ess-latex.html

Mark Rushakoff
this did not work for me on TexShop
celenius
TeX-FAQ advises against using `doublespace`. They say to use `setspace` instead.
Konrad Rudolph
+6  A: 

It looks like the acm_proc_article-sp class does some funky things that confuses the setspace package. In the preamble of your .tex document, add the following lines:

% Redefines \@ptsize to make setspace happy
\makeatletter
\renewcommand{\@ptsize}{0}
\makeatother

% Double-spaces the entire document
\usepackage{setspace}
\doublespacing

I have no idea why the acm_proc_article-sp class redefines \@ptsize to be empty.

godbyk
+1  A: 

The acm_proc_article-sp class seems to redefine \@ptsize to be empty for some reason. I don't know what \@ptsize is used for, so I don't want to mess with it. Using the \show command (see link text for more on this fantastic command), I see that \doublespacing is unpacked into

\setstretch{1.667} \ifcase \@ptsize \relax \setstretch{1.667} \or 
\setstretch{1.618} \or \setstretch{1.655}\fi

In other words, \doublespacing is essentially equivalent to \setstretch{1.667}, with slightly different stretch factors if \@ptsize happens to be 1 or 2. So I think the most unobtrusive solution to your problem is replace \doublespacing by \setstretch{1.667}.

\documentclass{acm_proc_article-sp}
\usepackage{setspace}
\setstretch{1.667}
\begin{document}
...
\end{document}
Anton Geraschenko
`\@ptsize` is used in the LaTeX base classes to determine the normal font size. When you specify `10pt`, `11pt`, or `12pt` as a document class option (e.g., `\documentclass[10pt]{article}`, then `\@ptsize` it set to the last digit (i.e., 0, 1, or 2 for 10pt, 11pt, or 12pt, respectively). So the various line spacings in the case statement are set depending on the base font size.
godbyk
+4  A: 

\linespread{2} should work. Doesn't need any packages, as far as I can tell, and you could change it to 1.9-spacing or 2.1-spacing, if you felt like it...

Seamus
A: 

Don't do it. You need to follow the ACM conference proceedings article submission instructions, which don't want you to double-space the article anyway.

Jeff
Maybe the author wants to temporarily use double spacing so that others can edit or comment on it more easily.
Seth Johnson
A: 

I just tried out this command (in my preamble) for double spacing and it worked fine:

\usepackage{setspace}
\setstretch{2} 
celenius