5

I want to define an environment to detach text from the document. I would like to have one blank line before and after my quote. I defined the following environment:

\newenvironment{myenv}{
\bigskip\noindent\newline
}{\par\bigskip}

But it happens that I need to put two of theses environments, and I get a double blank line. Is there a way to put a definite distance to the last paragraph and not a number of lines?

  • Welcome to the site. Please provide a minimum working example (MWE) that compiles and demonstrates the problem, starting with \documentclass. – Steven B. Segletes Apr 9 '14 at 17:29
5

\addvspace only inserts vertical space up to some maximum:

enter image description here

\documentclass{article}
\usepackage{lipsum}

\newenvironment{myenv}
  {\par\addvspace{\baselineskip}}% \begin{myenv}
  {\par\addvspace{\baselineskip}}% \end{myenv}

\begin{document}

\lipsum[4]
\begin{myenv}
\lipsum[4]
\end{myenv}
\begin{myenv}
\lipsum[4]
\end{myenv}
\lipsum[4]

\end{document}

You can add your own formatting of the environment contents in terms of the font shape, say.

| improve this answer | |
5

I'd suggest you to use a \list (as many of the standard LaTeX2e environments do):

\documentclass{article}
\usepackage{lipsum}% just to generate text for the example

\newenvironment{myenv}
  {\list{}{\leftmargin=0pt}\item\relax}{\endlist}

\begin{document}

\lipsum[4]
\begin{myenv}
\lipsum[4]
\end{myenv}
\begin{myenv}
\lipsum[4]
\end{myenv}
\lipsum[4]

\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.