emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Line breaks and brackets in LaTeX export


From: Max Nikulin
Subject: Re: Line breaks and brackets in LaTeX export
Date: Tue, 1 Nov 2022 23:07:04 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

On 01/11/2022 08:51, Ihor Radchenko wrote:
Max Nikulin writes:

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]"

Can you please elaborate?

LaTeX verse package require "\\!" as stanza separator to get proper line count, so square bracket on the next line is not the only character that may change meaning of "\\". So "[*!>" (depending on context) should be handled.

Search pattern should not match odd number of backslashes. It is a common mistake to not care what character precedes the pattern. Accordingly to Org syntax \\ line break may appear at the end of line only, but a user may add for some reason @@latex:...@.

Another corner case when "\\[0pt]\n" should not be blindly replaced to "\\\n" (I do not escape "\"). Imagine that you are going to describe this optimizing filter

---- >8 ----
Optimizing filter will replace
#+begin_example
First\\[0pt]
Second
#+end_example
with
#+begin_example
First\\
Second
#+end_example
---- 8< -----

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.

I don't think so. Users can already define filters. What we discuss here
is a built-in filter. It should be separate from user customization and
only expose on/off options.

If a separate defcustom is used for each built-in filter then it will be inconvenient to review which filters are active from easy customization UI.

It might be better to use single defcustom of list type allowing to disable particular built-in filters and to add user filters and to define their order in respect to built-in ones. I am unsure concerning convenient enough UI.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]