emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: [patch] ox-latex.el: fix blank lines behavior in verse block
Date: Thu, 10 Aug 2023 10:39:45 +0000	[thread overview]
Message-ID: <871qgbb2q6.fsf@posteo.net> (raw)
In-Reply-To: <87il9nb62q.fsf@localhost> (Ihor Radchenko's message of "Thu, 10 Aug 2023 09:27:25 +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	other threads:[~2023-08-10 10:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-06 12:03 [patch] ox-latex.el: fix blank lines behavior in verse block Juan Manuel Macías
2023-08-07 11:40 ` Ihor Radchenko
2023-08-07 17:23   ` Juan Manuel Macías
2023-08-09  7:57     ` Ihor Radchenko
2023-08-09  8:41       ` Juan Manuel Macías
2023-08-10  9:27         ` Ihor Radchenko
2023-08-10 10:39           ` Juan Manuel Macías [this message]
2023-08-11 10:00             ` Ihor Radchenko
2023-08-11 18:52               ` Juan Manuel Macías
2023-08-12  7:56                 ` Ihor Radchenko
2023-08-12 11:28                   ` Juan Manuel Macías
2023-08-13  8:06                     ` Ihor Radchenko
2023-08-14 20:10                   ` Juan Manuel Macías
2023-08-15 10:08                     ` Ihor Radchenko
2023-08-15 11:50                       ` Juan Manuel Macías
2023-08-15 11:53                         ` Ihor Radchenko
2023-08-15 14:25                           ` Juan Manuel Macías
2023-08-16  8:10                             ` Ihor Radchenko
2023-08-16 14:10                               ` Juan Manuel Macías
2023-08-17 10:35                                 ` Ihor Radchenko
2023-08-17 20:17                                   ` Juan Manuel Macías
2023-08-18  8:44                                     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qgbb2q6.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).