2

I have an environment and I'd like to increase the \parskip between the first and second paragraphs in the environment, but only the first and second paragraphs.

I can achieve the effect manually with

\begin{myenv}
  First par

  \medskip
  Second par

  Third par
\end{myenv}

Is there a way to do this automatically?

2

Two choices, I won't tell which one I prefer. 😉

\documentclass{article}

\makeatletter
\newenvironment{jason}
 {\par\def\par{\@@par\medskip\let\par\@@par}}
 {\par}
\makeatother

\newenvironment{egreg}[1]
 {\par#1\par\medskip}
 {\par}

\begin{document}

\section{Jason}

This is Jason's idea:

\begin{jason}
First line

Second line

Third line
\end{jason}

\section{Egreg}

This is Egreg's idea:

\begin{egreg}{First line}
Second line

Third line
\end{egreg}

\end{document}

enter image description here

In the first realization, \par is redefined to end the paragraph (because \@@par is the primitive \par), issue a \medskip and then redefine itself to the primitive meaning.

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.