Thanks to this answer I have been able to avoid unpleasant jumps in my content, but, as you can see in the image, the bottom margin is not being respected.

What I would like is that:

  • the content in red does not remain only on one page (that it always remains together with the next paragraph that has the command ccebody (I say this because sometimes the next paragraph could be one with the command ccesection and in that case I want to group the three paragraphs jumping to a new page).

  • however, I want subsequent ccebody paragraphs to respect the bottom margin (it could be starting the whole paragraph on the next page or at least respecting the bottom margin).

This is my actual code:

\newfontfamily\headerfont{Libertinus Sans}
\usepackage[showframe, pass]{geometry}

%--------------------------------------------------------------------- CCE styles
%Títulos en negrita del propio CCE
    \par% Start a new paragraph
    \addvspace{\baselineskip}% Space above

    \par% Start a new paragraph
            \bfseries% Weight
            \color{red}% Colour
            \large \cceA\\\cceB

    % \begin{cr}{#1}
    \alterfont% Font
    \ccetheme{La Alianza con Noé} {CEC 56-58, 71}
        \n{56} \lipsum[1-29] 
    \ccetheme{Test} {CEC NNNN}
        \n{57} \lipsum[1-3] 
        \n{58} \lipsum[5] 
        \n{59} \lipsum[6-8] 
    \ccetheme{Test} {CEC MMMM}
        \ccesection{This is title on bold}
        \n{59} \lipsum[1-29] 
        \n{60} \lipsum[5] 

This is the output:

enter image description here

My idea is that the paragraph Quisque ullamcorper ... goes to the next page because it is overflowing the bottom margin.

  • You defined ccebody using a minipage environment which itself can not break across pages.
    – leandriis
    Feb 4, 2021 at 10:30
  • @leandriis actually I did that in the answer, because the spec as written was to keep the heading with the entire following ccebody. I think the new spec you just want a standard latex heading that keeps the heading with the first line of following text (so never breaks immediately after the heading) but does not affect the layout of following paragraphs. Feb 4, 2021 at 10:32
  • @DavidCarlisle It is right. I'm sorry I didn't explain myself well in the previous question.
    – A. Cedano
    Feb 4, 2021 at 10:35
  • no problem that's how it goes:-) Feb 4, 2021 at 10:45
  • @DavidCarlisle i'm new in LaTeX. How I can achieve this?
    – A. Cedano
    Feb 4, 2021 at 10:49


You must log in to answer this question.

Browse other questions tagged .