# Restricting linespread to an environment

\linespread doesn't seem to be taken in consideration when set in an environment. How can I reduce the space between lines in a specific environment?

-

Inside your environment you can use one of the commands \singlespacing, \onehalfspacing or \doublespacing, or the spacing environment from the setspace package; a little example:

\documentclass{article}
\usepackage{setspace}

\newcommand\TestText{test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test }
\newenvironment{myenv}[1]
{\begin{spacing}{#1}}
{\end{spacing}}

\begin{document}

\TestText
\begin{myenv}{1.6}
\TestText
\end{myenv}
\begin{myenv}{0.6}
\TestText
\end{myenv}

\end{document}


-
Thanks! Just a small comment: When you use \singlespacing you also need to have the spacing package installed. –  Pancho Pino Nov 2 '11 at 1:17
@PanchoPino: Welcome to TeX.sx! I moved your comment here. Note that you shouldn't write answer posts to comment on answers. Note that you can't comment everywhere until getting 50rep. –  Martin Scharrer Nov 2 '11 at 7:04
@PanchoPino: You must be referring to the setspace package, since there is no spacing package. –  Werner Nov 2 '11 at 7:04
Is there also a simple way to define custom factors - not only 0.5 steps? –  Eric Jan 24 '12 at 9:22
@Eric: I am not sure I understand your question. Could you explain in more detail, please? –  Gonzalo Medina Jan 24 '12 at 15:42