5

I want to reduce globally in a document the vertical space before and after a verse environment. The MWE shows the problem, with output: Imgur

I would like not to use other packages, because I want to learn some low-level commands. I know that verse is based on a list environment. A related answer (How to eliminate vertical space before and after verse environment?) seems overly complex, and uses the verse package (not the built-in version). Surely there is a way to

\setlength{\versesep}{0pt}

or something like it?

Or (since I am using xpatch package anyway), could I do something like

\xpatchcmd\verse{\...

But I don't know how to find the original code for the verse environment, and so I don't know which line to modify.

\documentclass[12pt,oneside]{article}

\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}

\begin{document}

This is a paragraph.

This is another paragraph.  Separated nicely.

\begin{verse}
This is some\\
lovely verse,\\
that has too much space\\
on top and below.
\end{verse}

I would really like not as much space above and below.  Just one parskip would be sufficient.

But other paragraphs should be spaced with parskip.

\end{document}
Tim
  • 1,539
  • Remove \setlength{\parskip}{1em} (that doesn't make much sense anyway). – egreg Dec 22 '15 at 10:46
  • This will affect the normal paragraphs, which I don't want to do. I just edited the question to clarify this. – Tim Dec 22 '15 at 10:54

2 Answers2

3

Remove the added \parskip by reducing \topsep:

\documentclass[12pt,oneside]{article}
\usepackage{xpatch}

\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}
\xpatchcmd{\verse}{\itemsep}{\advance\topsep-\parskip\itemsep}{}{}

\begin{document}

This is a paragraph.

\begin{verse}
This is some\\
lovely verse,\\
that has too much space\\
on top and below.
\end{verse}

I would really like not as much space above and below.  Just one parskip would be sufficient

I would really like not as much space above and below.  Just one parskip would be sufficient

\end{document}

enter image description here

egreg
  • 1,121,712
  • I compiled your solution inside my real document (two columned, landscape) and the vertical space still looked too big, until I added 'ragged bottom', which fixed things. Can you add to your answer please how to limit the stretchiness inside the \verse command so that I do not need the \raggedbottom? – Tim Dec 22 '15 at 12:21
  • @Tim Two column and raggedbottom don't go along; in this case you are responsible of setting the spacing parameters so that columns are filled up correctly. Possibly adding a bit of stretching or shrinking to such a gigantic \parskip can help. – egreg Dec 22 '15 at 12:52
2

Without other packages, maybe something like this:

\documentclass[12pt,oneside]{article}

\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}

\let\oldverse\verse
\renewenvironment{verse}{%
    \vspace{-\parskip}
    \oldverse
}

\begin{document}

This is a paragraph.

This is another paragraph.  Separated nicely.

\begin{verse}
This is some\\
lovely verse,\\
that has too much space\\
on top and below.
\end{verse}

I would really like not as much space above and below.  Just one parskip would be sufficient.

But other paragraphs should be spaced with parskip.

\end{document}

enter image description here

alwaysask
  • 2,248
  • 13
  • 16