Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

\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?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

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}

enter image description here

share|improve this answer
    
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
1  
@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
show 1 more comment

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.