Best way to avoid page break just after epigraphAutomatic pagebreak if a text is at the bottom of a...

How to count occurrences of Friday 13th

How would we write a misogynistic character without offending people?

What is the difference between throw e and throw new Exception(e)?

Pure Functions: Does "No Side Effects" Imply "Always Same Output, Given Same Input"?

Non-Italian European mafias in USA?

Skis versus snow shoes - when to choose which for travelling the backcountry?

chrony vs. systemd-timesyncd – What are the differences and use cases as NTP clients?

Can chords be played on the flute?

Find the next monthly expiration date

Make me a metasequence

Is divide-by-zero a security vulnerability?

Second-rate spelling

Hacker Rank: Array left rotation

Where is this triangular-shaped space station from?

Where was Karl Mordo in Infinity War?

If nine coins are tossed, what is the probability that the number of heads is even?

If a druid in Wild Shape swallows a creature whole, then turns back to her normal form, what happens?

The change directory (cd) command is not working with a USB drive

How to avoid being sexist when trying to employ someone to function in a very sexist environment?

How to tighten battery clamp?

Replacement ford fiesta radiator has extra hose

What is this waxed root vegetable?

How to approximate rolls for potions of healing using only d6's?

Contradiction with Banach Fixed Point Theorem



Best way to avoid page break just after epigraph


Automatic pagebreak if a text is at the bottom of a pageAvoiding page breaks after section headings followed by listsStyle individual epigraphs or leave default?Avoid page break in theoremForcing a new section to begin after previous captionsAvoid page break in listingAvoid page break after last line in lstlistingHow to avoid page break in sections?Best way for page break with book tabs tableHow to avoid page break after table?New section on new pageAvoid page break between paragraphs













1















What is the best way to avoid a page break just after a epigraph command from epigraph package? I'm adding epigraphs after section titles.



documentclass{article}
usepackage[nopar]{lipsum}
usepackage{epigraph}

begin{document}

section{Aaaa}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]


section{Bbbb}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]

end{document}


I tried with penalty1000, with nopagebreak, and with clubpenalties without success.



I managed to do that with needspace like in this answer, adding to the preamble:



usepackage{etoolbox}
usepackage{needspace}
pretosection{needspace{7baselineskip}}


Is this a good way? Is there a better one?










share|improve this question























  • I just realized that even in the first page of epigraph package manual, there's a page break just after a section and an epigraph...

    – Ilario Gelmetti
    9 hours ago
















1















What is the best way to avoid a page break just after a epigraph command from epigraph package? I'm adding epigraphs after section titles.



documentclass{article}
usepackage[nopar]{lipsum}
usepackage{epigraph}

begin{document}

section{Aaaa}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]


section{Bbbb}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]

end{document}


I tried with penalty1000, with nopagebreak, and with clubpenalties without success.



I managed to do that with needspace like in this answer, adding to the preamble:



usepackage{etoolbox}
usepackage{needspace}
pretosection{needspace{7baselineskip}}


Is this a good way? Is there a better one?










share|improve this question























  • I just realized that even in the first page of epigraph package manual, there's a page break just after a section and an epigraph...

    – Ilario Gelmetti
    9 hours ago














1












1








1








What is the best way to avoid a page break just after a epigraph command from epigraph package? I'm adding epigraphs after section titles.



documentclass{article}
usepackage[nopar]{lipsum}
usepackage{epigraph}

begin{document}

section{Aaaa}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]


section{Bbbb}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]

end{document}


I tried with penalty1000, with nopagebreak, and with clubpenalties without success.



I managed to do that with needspace like in this answer, adding to the preamble:



usepackage{etoolbox}
usepackage{needspace}
pretosection{needspace{7baselineskip}}


Is this a good way? Is there a better one?










share|improve this question














What is the best way to avoid a page break just after a epigraph command from epigraph package? I'm adding epigraphs after section titles.



documentclass{article}
usepackage[nopar]{lipsum}
usepackage{epigraph}

begin{document}

section{Aaaa}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]


section{Bbbb}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]

end{document}


I tried with penalty1000, with nopagebreak, and with clubpenalties without success.



I managed to do that with needspace like in this answer, adding to the preamble:



usepackage{etoolbox}
usepackage{needspace}
pretosection{needspace{7baselineskip}}


Is this a good way? Is there a better one?







vertical-alignment page-breaking epigraphs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 14 hours ago









Ilario GelmettiIlario Gelmetti

264




264













  • I just realized that even in the first page of epigraph package manual, there's a page break just after a section and an epigraph...

    – Ilario Gelmetti
    9 hours ago



















  • I just realized that even in the first page of epigraph package manual, there's a page break just after a section and an epigraph...

    – Ilario Gelmetti
    9 hours ago

















I just realized that even in the first page of epigraph package manual, there's a page break just after a section and an epigraph...

– Ilario Gelmetti
9 hours ago





I just realized that even in the first page of epigraph package manual, there's a page break just after a section and an epigraph...

– Ilario Gelmetti
9 hours ago










1 Answer
1






active

oldest

votes


















0














From an old answer of mine that is here:



documentclass{article}
usepackage[nopar]{lipsum}
usepackage{epigraph}


newsavebox{mybottombox} % Box to save the text of the command
newlength{mybottomlength} % The length of our text inside the command
newlength{availafter}
% Optional argument is the minimum length after the nobottom text for not pagebreak. Change it to your needs
newcommand{nobottom}[2][60pt]{savebox{mybottombox}{vbox{#2}}setlength{mybottomlength}{htmybottombox}%
setlength{availafter}{dimexprtextheight-mybottomlength-pagetotalrelax}ifdimavailafter<#1%
pagebreaknoindentusebox{mybottombox}%
else%
noindentusebox{mybottombox}%
fi%
}%
begin{document}

section{Aaaa}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]


section{Bbbb}
nobottom{epigraph{$1+2 neq 3$}{Matlab}}

lipsum[1-4]

nobottom[90pt]{section{Cccc}}
epigraph{$1+2 neq 3$}{Matlab}

lipsum[1-4]

nobottom[90pt]{section{Dddd}
epigraph{$1+2 neq 3$}{Matlab}}

lipsum[1-4]

end{document}


I gave a second example of usage that included the section command inside my nobottom in case you wish to use it like this (preferable for me), but added a third example to with both section and epigraph commands inside my command.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477674%2fbest-way-to-avoid-page-break-just-after-epigraph%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    From an old answer of mine that is here:



    documentclass{article}
    usepackage[nopar]{lipsum}
    usepackage{epigraph}


    newsavebox{mybottombox} % Box to save the text of the command
    newlength{mybottomlength} % The length of our text inside the command
    newlength{availafter}
    % Optional argument is the minimum length after the nobottom text for not pagebreak. Change it to your needs
    newcommand{nobottom}[2][60pt]{savebox{mybottombox}{vbox{#2}}setlength{mybottomlength}{htmybottombox}%
    setlength{availafter}{dimexprtextheight-mybottomlength-pagetotalrelax}ifdimavailafter<#1%
    pagebreaknoindentusebox{mybottombox}%
    else%
    noindentusebox{mybottombox}%
    fi%
    }%
    begin{document}

    section{Aaaa}
    epigraph{$1+2 neq 3$}{Matlab}

    lipsum[1-4]


    section{Bbbb}
    nobottom{epigraph{$1+2 neq 3$}{Matlab}}

    lipsum[1-4]

    nobottom[90pt]{section{Cccc}}
    epigraph{$1+2 neq 3$}{Matlab}

    lipsum[1-4]

    nobottom[90pt]{section{Dddd}
    epigraph{$1+2 neq 3$}{Matlab}}

    lipsum[1-4]

    end{document}


    I gave a second example of usage that included the section command inside my nobottom in case you wish to use it like this (preferable for me), but added a third example to with both section and epigraph commands inside my command.






    share|improve this answer




























      0














      From an old answer of mine that is here:



      documentclass{article}
      usepackage[nopar]{lipsum}
      usepackage{epigraph}


      newsavebox{mybottombox} % Box to save the text of the command
      newlength{mybottomlength} % The length of our text inside the command
      newlength{availafter}
      % Optional argument is the minimum length after the nobottom text for not pagebreak. Change it to your needs
      newcommand{nobottom}[2][60pt]{savebox{mybottombox}{vbox{#2}}setlength{mybottomlength}{htmybottombox}%
      setlength{availafter}{dimexprtextheight-mybottomlength-pagetotalrelax}ifdimavailafter<#1%
      pagebreaknoindentusebox{mybottombox}%
      else%
      noindentusebox{mybottombox}%
      fi%
      }%
      begin{document}

      section{Aaaa}
      epigraph{$1+2 neq 3$}{Matlab}

      lipsum[1-4]


      section{Bbbb}
      nobottom{epigraph{$1+2 neq 3$}{Matlab}}

      lipsum[1-4]

      nobottom[90pt]{section{Cccc}}
      epigraph{$1+2 neq 3$}{Matlab}

      lipsum[1-4]

      nobottom[90pt]{section{Dddd}
      epigraph{$1+2 neq 3$}{Matlab}}

      lipsum[1-4]

      end{document}


      I gave a second example of usage that included the section command inside my nobottom in case you wish to use it like this (preferable for me), but added a third example to with both section and epigraph commands inside my command.






      share|improve this answer


























        0












        0








        0







        From an old answer of mine that is here:



        documentclass{article}
        usepackage[nopar]{lipsum}
        usepackage{epigraph}


        newsavebox{mybottombox} % Box to save the text of the command
        newlength{mybottomlength} % The length of our text inside the command
        newlength{availafter}
        % Optional argument is the minimum length after the nobottom text for not pagebreak. Change it to your needs
        newcommand{nobottom}[2][60pt]{savebox{mybottombox}{vbox{#2}}setlength{mybottomlength}{htmybottombox}%
        setlength{availafter}{dimexprtextheight-mybottomlength-pagetotalrelax}ifdimavailafter<#1%
        pagebreaknoindentusebox{mybottombox}%
        else%
        noindentusebox{mybottombox}%
        fi%
        }%
        begin{document}

        section{Aaaa}
        epigraph{$1+2 neq 3$}{Matlab}

        lipsum[1-4]


        section{Bbbb}
        nobottom{epigraph{$1+2 neq 3$}{Matlab}}

        lipsum[1-4]

        nobottom[90pt]{section{Cccc}}
        epigraph{$1+2 neq 3$}{Matlab}

        lipsum[1-4]

        nobottom[90pt]{section{Dddd}
        epigraph{$1+2 neq 3$}{Matlab}}

        lipsum[1-4]

        end{document}


        I gave a second example of usage that included the section command inside my nobottom in case you wish to use it like this (preferable for me), but added a third example to with both section and epigraph commands inside my command.






        share|improve this answer













        From an old answer of mine that is here:



        documentclass{article}
        usepackage[nopar]{lipsum}
        usepackage{epigraph}


        newsavebox{mybottombox} % Box to save the text of the command
        newlength{mybottomlength} % The length of our text inside the command
        newlength{availafter}
        % Optional argument is the minimum length after the nobottom text for not pagebreak. Change it to your needs
        newcommand{nobottom}[2][60pt]{savebox{mybottombox}{vbox{#2}}setlength{mybottomlength}{htmybottombox}%
        setlength{availafter}{dimexprtextheight-mybottomlength-pagetotalrelax}ifdimavailafter<#1%
        pagebreaknoindentusebox{mybottombox}%
        else%
        noindentusebox{mybottombox}%
        fi%
        }%
        begin{document}

        section{Aaaa}
        epigraph{$1+2 neq 3$}{Matlab}

        lipsum[1-4]


        section{Bbbb}
        nobottom{epigraph{$1+2 neq 3$}{Matlab}}

        lipsum[1-4]

        nobottom[90pt]{section{Cccc}}
        epigraph{$1+2 neq 3$}{Matlab}

        lipsum[1-4]

        nobottom[90pt]{section{Dddd}
        epigraph{$1+2 neq 3$}{Matlab}}

        lipsum[1-4]

        end{document}


        I gave a second example of usage that included the section command inside my nobottom in case you wish to use it like this (preferable for me), but added a third example to with both section and epigraph commands inside my command.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 13 hours ago









        koleygrkoleygr

        11.7k11038




        11.7k11038






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477674%2fbest-way-to-avoid-page-break-just-after-epigraph%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

            How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

            Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...