[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug] `org-latex-line-break-safe' breaks the export of verse blocks
From: |
Max Nikulin |
Subject: |
Re: [bug] `org-latex-line-break-safe' breaks the export of verse blocks to LaTeX |
Date: |
Sun, 16 Oct 2022 22:04:48 +0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 |
On 16/10/2022 04:35, Juan Manuel Macías wrote:
To begin with, it is a particular solution
applied in a general way. This can have unexpected consequences, as has
happened in verse blocks.
In my opinion Org has to apply a general solution merely because a table
may be result of evaluation of an org-babel code block. I may be wrong,
but I suspect that some users do not care what is the intermediate
format when they need a PDF file.
And finally, I think that applying a general solution to this problem is
something that should be done(IMHO) in LaTeX and not in Org,
Org has a bit more information concerning context of square brackets.
They may be just text of a table cell or contents of an export snippet.
In a LaTeX file they are just square brackets and there is no way to
distinguish them.
I believe, it is a design flaw in LaTeX that the \\ command does not
have a counterpart with no optional * and [] arguments. For humans \\ is
enough, but it is fragile when LaTeX is used as an intermediate export
format. A part of the problem is that all 3rd party packages should be
adapted for the robust \\ sibling. Likely it may be solved by additional
pass in the exporter code but it will significantly increase its
complexity. I have no idea what is appropriate place to discuss such
issue with LaTeX developers.
The following is irrelevant to the recent changes. I have tried
---- >8 ----
text
#+begin_verse
a b
c d
e f
g h
#+end_verse
---- 8< ----
With the fix Ihor committed today I have got
---- >8 ----
text
\begin{verse}
\vspace*{1em}
a b\\\empty
c d\\\empty
\vspace*{1em}
e f\\\empty
g h\\\empty
\end{verse}
---- 8< ----
My expectation was
---- >8 ----
\begin{verse}
a b\\\empty
c d
e f\\\empty
g h
\end{verse}
---- 8< ----
I am surprised that \vspace is added instead of empty line between
stanzas. Is there a reason to override LaTeX defaults? If such reason
exists would not it better to add
\parskip=1em plus 0.5em minus 0.25em\relax
before first verse line? Is hard coded rigid vertical space acceptable
when high quality output is desired? \vspace before first line looks
like a bug. Frankly speaking, nested calls of `replace-regexp-in-string'
makes the code hard to read.
P.S. I have not found exact citation, but I noticed a mention: Lamport
expected that verse environment would get negative feedback from poets.