How to produce white space for all text lines of an environment?
Perhaps you might be interested in using a combination of \obeylines
(so you don't have to manually break the line) and \doublespacing
(provided by setspace
):
\documentclass{article}
\usepackage{lipsum,setspace}% http://ctan.org/pkg/{lipsum,setspace}
\newenvironment{myenv}
{\par\hrulefill\doublespacing\obeylines}
{\hrulefill\par\ignorespacesafterend}
\begin{document}
\lipsum[6]
\begin{myenv}
hello
world
\end{myenv}
\lipsum[6]
\end{document}
The \hrulefill
is only to show the start/end of the environment myenv
and most likely not needed in your application.
Although the proposed solution does not show the typewriter font, you can issue \ttfamily
to achieve this (not \texttt
).
Depending on the application a minor problem of Werner's solution is that if a line is longer than the texwith the continuation is not indented. Here is an alternative solution (and comparison with Werner's solution).
\documentclass{article}
\usepackage{lipsum}
\newenvironment{myenv}
{\begin{list}{}{
\setlength{\topsep}{3mm}
\setlength{\leftmargin}{0.5cm}
\small\ttfamily}
\item[]\hrulefill\\}
{\hrulefill\end{list}}
\newenvironment{myenvW}
{\par\hrulefill\obeylines\small\ttfamily}
{\hrulefill\par\ignorespacesafterend}
\begin{document}
\lipsum[6]
\begin{myenv}
test\\
\lipsum[6]
\end{myenv}
\lipsum[6]
\begin{myenvW}
test
\lipsum[6]
\end{myenvW}
\end{document}