I would like to typeset something like a "quote plus attribution", e.g. at the beginning of a book chapter. It should look like this:
CHAPTER TITLE
This is an introductory quote.
It's stylistically questionable,
but it's a fun LaTeX exercise.
-- said by me
Now starts the main body text, which is not rele-
vant to this question. It just goes on and on and
on and on.
It just looks like ordinary text. You do not
have to keep reading.
For this purpose, I have an environment and a command, used like this:
\section{Chapter Title}
\begin{fooquote}
This is an introductory quote % etc. etc.
\quoteattribution{-- said by me}
\end{fooquote}
Question: How can I guarantee that there is no page break between the attribution and the body of the quote? I don't mind if there's a page break within the quote, but there shouldn't be one between the quote and the attribution.
I'm happy to change my entire setup if that's necessary. In my case, it's like this:
\newenvironment{fooquote}%
{ \bgroup
\let\oldend=\end
\def\end##1{\oldend{##1}\csname @afterindentfalse\endcsname
\csname @afterheading\endcsname}
\begin{quote}%
\itshape%
}{%
\end{quote}
\egroup
}
\newcommand{\quoteattrib}[1]{\normalfont\flushright#1}
foo
environment is defined. Note also that\bar
is the name of an existing macro. Be careful not to overwrite it if you need it in your document.fooquote
is a bit lengthy because I want to suppress indentation after the quote.needspace
package, and on the last line of the quote, issue a\needspace
for the anticipated gap+attribution. space If it can't reserve it in advance, the page will break, with the end of the quote being bumped to the next page.\baselineskip
's to be a non-precise measure. Try increasing the number above 3, and experiment with how it works.