On 22/10/2022 12:15, Ihor Radchenko wrote:
as long as the next line does not match
"^[ \t]*\\["

Verse package defines \\! and \\>.

The only precaution that search pattern should ignore \\\[0pt]\] that is a display equation "0pt]"

I propose the following:
1. Merge my patch with \\[0pt] safe page breaks
2. Modify org-latex-template to replace unnecessary occurrences of
    "\\[0pt]" in CONTENTS when org-latex-compact-latex (you may propose
    other defcustom names) is non-nil.

I believe, it is better to introduce a list of filter functions that may perform such optimizing.

The only problem that I see with such approach is that if defined as defcustom then users changed its value will not see default filters added in new Org version. If an alist mapping hook name to enabled/disabled state is used then I am unsure how to determine order of hooks during mixing of standard and user defined functions. I raised a similar question during discussion of org-file-apps.

I do not have a better proposal.



Reply via email to