Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

section followed by pagebreak #82

Open
ilippert opened this issue Apr 23, 2019 · 4 comments
Open

section followed by pagebreak #82

ilippert opened this issue Apr 23, 2019 · 4 comments

Comments

@ilippert
Copy link

I often experience that moderncv allows for a pagebreak between a \section or \subsection command and something like \tlcventry. It would be great if the package could automatically increase the penalty for this kind of behaviour.

@inpowell
Copy link

inpowell commented Sep 5, 2019

Seconded.

I reproduced a minimal example based on the template.tex example by inflating the first \cventry under vocational experience with many lines -- see attached archive complete with code and output.
overflow.tar.gz

Perhaps a temporary workaround is to manually break the page before the section header. A more ideal solution, I believe, would be to allow for pagebreaks within \cventry items.

@inpowell
Copy link

inpowell commented Sep 5, 2019

An even better hack: one can simulate a line break (which allows for a page break) in \cventry by ending it early, and following it with a \cvitem with empty first argument. Note that if an environment like itemize is used, then it will need to be manually ended and restarted.

If using a massive list, then careful placing of the break is needed. If using paragraphs, then \cvitems can be placed quite naturally! See attached archive with code and output:
overflow-hack.tar.gz

@ilippert
Copy link
Author

ilippert commented Sep 5, 2019

I am using manual breaks. Interestingly, using \pagebreak[1-3] basically never gets me a break, and [4] always does.

@ilippert
Copy link
Author

ilippert commented Jan 4, 2020

I just found https://texfaq.org/FAQ-nopagebrk and can sort out my needs well with the package needspace.
Just insert
\needspace{4\baselineskip}
before the section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants