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 am writing a document class where I want to set the default line spacing to be 1.5. How can I use the setspace package to achieve this? More particularly, where in my .cls file should I mention \onehalfspacing?
I have tried modifying \baselinestretch, but it does not work when I add \RequirePackage{setspace} in the .cls file.

share|improve this question
Wouldn't \RequirePackage[onehalfspacing]{setspace} be sufficient? – egreg Jan 16 '12 at 12:08
@egreg: When trying to compile with \RequirePackage[onehalfspacing]{setspace}, I am getting the error: Package: `setspace' 6.7 <2000/12/01> ) ! Undefined control sequence. \setstretch ...ef \baselinestretch {#1}\@currsize – user1145885 Jan 16 '12 at 12:17
up vote 4 down vote accepted

The error in your comment says, that \@currsize is undefined. It is set by \@setfontsize, which is called by LaTeX font size commands such as \Large, \small etc.

So you could fix it by defining \@currsize yourself, such as by


but I recommend to define a font size in your class before you load setspace, which fixes it. Here's an example from bk10.clo, loaded by the book class:

   \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
   \belowdisplayskip \abovedisplayskip
share|improve this answer
The command \RequirePackage[onehalfspacing]{setspace} must go after a \LoadClass command (if used). – egreg Jan 16 '12 at 13:13
@Stefan: Thanks for the solution. – user1145885 Jan 16 '12 at 14:00

The new documentclass is baz.cls



share|improve this answer

Your Answer


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.