Skip to content

lilypond-book: Fix combination of `verbatim` and `quote` for LaTeX mode

Werner Lemberg requested to merge dev/wl/quote-verbatim into master

If both verbatim and quote options are used for a LilyPond environment, the created LaTeX code starts with

\begin{quote}
\noindent
\begin{verbatim}

LaTeX's quote environment contains special code to signal the next nested environment that it already has inserted some vertical space. However, \noindent hides this marker. As a consequence, the verbatim environment inserts vertical space again, causing a far too large vertical gap.

This commit fixes this by not inserting \noindent before \begin{verbatim}. It has a minor side effect, though: If option verbatim is used (without option quote) the vertical space to the previous paragraph slightly increases. Reason is that for code like

foo
\begin{verbatim}

LaTeX's verbatim environment inserts \topsep as the vertical amount of space, while

foo

\begin{verbatim}

causes \partopsep to be inserted, which is a slightly larger vertical space.

Merge request reports