2

How can I make the paragraphs in the quote environment appear on the same page?

In this example I would like the paragraph Nula malesuada... to start on the next page:

enter image description here

EMV:

% !TeX program = lualatex
\documentclass[ebook,11pt,twoside,openright]{memoir}
\usepackage[no-math]{fontspec}
\usepackage{polyglossia}
\usepackage{csquotes} 
\usepackage{lipsum} 
\setdefaultlanguage{spanish}

\begin{document} \lipsum[1-2] \begin{quote}
\lipsum[3] \end{quote}
\end{document}

A. Cedano
  • 453

1 Answers1

3

The latex command \samepage will set \interlinepenalty and related penalties to 10000 to prevent page breaking within paragraphs (it may still break between paragraphs)

\documentclass[ebook,11pt,twoside,openright]{memoir}
\usepackage[no-math]{fontspec}
\usepackage{polyglossia}
\usepackage{csquotes} 
\usepackage{lipsum} 
\setdefaultlanguage{spanish}
\AddToHook{env/quote/begin}{\samepage }

\begin{document} \lipsum[1-2] \begin{quote}
\lipsum[3] \end{quote}
\end{document}

For older LaTeX releases without the hook system you could add \samepage to quote for example by

 \let\oldquote\quote \renewcommand\quote{\oldquote\samepage} 
David Carlisle
  • 757,742