0

I've got the following problem:

The content of a page overflows the footnote area. So far it has only happened when the last thing on the page is a blockquote. Here is a screenshot of what I am experiencing:

enter image description here

You can see a paragraph above the blockquote.

In my template I have the following code, which I suspect causes this problem:

\definecolor{quotecolor}{HTML}{686868}
\newfontfamily\quotefont[Color=quotecolor]{Ubuntu}
\AtBeginEnvironment{quote}{\quotefont\small\it\color{quotecolor}}
\AtBeginEnvironment{quote}{\vspace{-0.7\baselineskip}}% Stuff before {quote}
\AtEndEnvironment{quote}{\vspace{-0.7\baselineskip}}% Stuff after {quote}

However, without this code blockquotes seem to take way too much space vertically.

What can I do to fix this?

So far I only have the following two ideas:

  • somehow increase the punishment for content overflowing into the footnote area
  • using a different method for reducing the vertical white space around blockquotes

I'll try to come up with a MWE, although it could be very difficult to find a way to trick Latex into making the same mistake. I cannot share the complete document.

My build process is a bit complicated, but in the end everything is Latex code before being compiled to PDF, so I think this is a valid question for this platform:

  1. reStructuredText is parsed and partially replaced with latex code, to enable document internal links and citations
  2. the partly converted code is then converted completely to latex by Pandoc (using the template)
  3. the resulting latex code is then compiled to pdf using latexmk

I am able to get the last stage latex code file, but as I said, cannot share the complete file, nor significant portions and if such a thing is needed will need to come up with an MWE.

3
  • I doubt that anything much can be said without an example. Just take your generated latex, remove any text before or after the bad page still checking the problem occurs and then replace every word by foobar if you don't want to reveal text. Jan 31, 2017 at 17:10
  • 1
    explicitly applying negative \vspace to the environment makes latex think the block is smaller than it really is. a better way to approach this is to reset the default spacing at the top and bottom of the list structure, on which quote is built. this question explains how the various spacing elements work: \topsep, \itemsep, \partopsep and \parsep - what does each of them mean (and what about the bottom)? Jan 31, 2017 at 18:46
  • @barbarabeeton Can you make an answer from your comment? Setting \topsep instead and then at the end of the quoting environment setting it to the old value again solved the problem and it seems a better practice than what I had before. Feb 1, 2017 at 12:12

1 Answer 1

2

without an example to use for illustration, this is only a description of a solution (recognized by the op in a comment).

applying an explicit negative \vspace at the top and bottom of a list (which is what the quote environment is based on) is guaranteed to make latex think that the block is smaller vertically than it really is, leading to such results as overprinting what is above and below, as reported.

the space at the top of the environment is governed by \topsep, which defaults to 8.0pt plus 2.0pt minus 4.0pt (as reported by \showthe\topsep for the article class). if this is reset to something smaller at the beginning of the environment, that should take care of the problem.

since quote is a "confined" environment, the original values of \topsep and similar settings are restored on exiting the environment, so there's no need to reset it manually, as demonstrated by this simple test:

\documentclass{article}
\begin{document}
\begin{quote}
\showthe\topsep
\topsep=0pt
xxx
\end{quote}
\showthe\topsep
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .