On 05/09/2025 03:04, David Masterson wrote:
Max Nikulin writes:
Perhaps Org still should gracefully handle a case of early draft of long
document with outline and nothing more. I consider the attached diff as
a dirty hack. Unfortunately I can not figure out if it has undesired
consequences and if there is a better way to suppress penalties added by
sections. Just \break instead of \leavevmode causes excessive page breaks.
[...]
+++ b/lisp/ox-latex.el
@@ -2428,7 +2428,7 @@ (defun org-latex-headline (headline contents info)
;; Maybe end local TOC (see `org-latex-keyword').
(contents
(concat
- contents
+ (or contents "\\leavevmode")
(let ((case-fold-search t)
Hmm. It's interesting that, in my document, the excessive page break
only happens in one location (after H4.3.1.2).
It is the only possible break point before unbreakable block of text.
That suggests that there is a more specific trigger.
Perhaps I have missed something, but I have not noticed other issues
besides penalties after section titles.
However, the excessive page break can be (sort of) acceptable,
I am in doubts if you will be happy with "\\break" in the diff above.
but the
inability to view the whole document that is produced (IOW, you can only
view up to approx. H15.1 instead of H28) is not acceptable. Is that
also a page break issue?
Yes, of course.
Are you realizing that outline view and visibility is just a specific
case of document with contiguous block of headings without text?