emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [patch] ox-latex.el: fix blank lines behavior in verse block


From: Juan Manuel Macías
Subject: Re: [patch] ox-latex.el: fix blank lines behavior in verse block
Date: Thu, 10 Aug 2023 10:39:45 +0000

Ihor Radchenko writes:

> Well. Technically, we already warn users that the blank lines are
> preserved in the verse blocks:
>
>     12.1 Paragraphs
>     ===============
>     
>     Paragraphs are separated by at least one empty line.  If you need to
>     enforce a line break within a paragraph, use ‘\\’ at the end of a line.
>     
>        To preserve the line breaks, indentation and blank lines in a region,
>     but otherwise use normal formatting, you can use this construct, which
>     can also be used to format poetry.
>     
>
>          #+BEGIN_VERSE
>           Great clouds overhead
>           Tiny black birds rise and fall
>           Snow covers Emacs
>     
>              ---AlexSchroeder
>          #+END_VERSE
>
> So, I now think that while extra cleanups might be OK for ox-latex, we
> may not want to ignore empty lines universally in all the verse blocks.

hmm, I don't know if phrased like that (as read in the documentation)
it's clear enough that the empty lines before and after the content are
also preserved. I would understand not, but it could also be a habit that
I inherited from LaTeX: I usually leave a blank line between the
#+begin/#+end directives and the content because it makes it easier for
me to read. I don't know if it is a widespread habit among other
users...

Anyway, I don't mind leaving things as they are in the other backends,
but in the case of LaTeX, with my patch modifications, it would be
necessary to remove the blank lines before and after the content.
Otherwise it would produce something like:

\begin{verse}
\\[0pt]
\\[0pt]
\\[0pt]
\\[0pt]
\\[0pt]
  lorem ipsum dolor
\end{verse}

which would return the error "There's no line here to end".

Also, the LaTeX 'verse' environment has its own syntax for vertical
spaces. It is not necessary to put an explicit \vspace just to separate
stanzas.

... In any case, the fact that the verse block can also be used to
literally export line breaks and horizontal/vertical spaces is
interesting. Something occurred to me that I don't know if it's a bit
foolhardy: how about a LaTeX attribute ':literal t'? If used, it would
not export to a verse environment (specialized in poetry) but to normal
text, without environment, but with line breaks and horizontal and
vertical spacing preserved... wdyt?


-- 
Juan Manuel Macías

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com



reply via email to

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