On 05/09/2025 02:53, David Masterson wrote:
Max Nikulin writes:
What you observed may be related to penalty
that LaTeX adds after \section and similar commands to prevent page
breaks between headings and their text bodies. So just sectioning
commands without any text in between leads to trouble.
Hmm. Which is a problem with exporting with Visibility On and the
document is *not* in a SHOWALL state, correct?
See another message, changing visibility is not required to face the issue.
Could ox-latex add an
invisible (or slightly visible?) something after a heading with no text
body to get around this?
The challenge is to recruit a volunteer closely familiar with low level
code of standard and non-standard LaTeX classes who may suggest a safe
command. Earlier \\ \empty workaround for table cells with square
brackets broke a LaTeX3 table package and another variant with \\[0pt]
caused enough user complains. LaTeX is designed to be convenient for
humans who may quickly fix specific corner cases. For markup generators
it may be tricky to avoid pitfalls.
Anyway LaTeX adds visible vertical space before section. You may try to
file bugs against various LaTeX packages to allow page breaks if there
is no contents between section commands. Perhaps they will be rejected
as changing earlier created documents.
LaTeX has been created to generate properly formatted documents.
Breaking it in specific places to accept poorly typed documents may be a
non-trivial task.
The use-case here is having written a large
document, you want to produce a high-level outline of it to (say)
introduce the document to your class professor. I suppose this is also
a problem for someone writing a large document that who has only mostly
outlined it so far and wanting to show that to the professor (IOW,
visibility is off here).
I think, the professor will be more pleased to read table of contents
(that is formatted better), but you decided to suppress TOC and to
create a worse substitute in another way.
Adding some "TODO" text placeholders to outlined draft (semi-manually or
perhaps even using an AI assistant) may be easier than trying to find
code that works for any LaTeX package, even for custom ones. Writing
actual text requires significantly more time than adding "TODO" stubs.