\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?
1 Answer
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. Nov 2, 2011 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. Nov 2, 2011 at 7:04
-
1@PanchoPino: You must be referring to the
setspace
package, since there is nospacing
package.– Werner ♦Nov 2, 2011 at 7:04 -
Is there also a simple way to define custom factors - not only 0.5 steps?– EricJan 24, 2012 at 9:22
-
@Eric: I am not sure I understand your question. Could you explain in more detail, please? Jan 24, 2012 at 15:42