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

2023-08-18 Thread Ihor Radchenko
Juan Manuel Macías writes: > Subject: [PATCH] lisp/ox-latex.el: Add the `:literal' attribute to verse > block. Thanks! Applied, onto main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2eb4fd890 -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode a

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

2023-08-17 Thread Juan Manuel Macías
Ihor Radchenko writes: > Thanks! > >> * (org-latex-verse-block): now the treatment of blank lines is >> consistent with the syntax of the LaTeX `verse' environment, and the >> one provided by the `verse' package. If the `:literal' attribute is >> used, all blank lines are preserved and exported as

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

2023-08-17 Thread Ihor Radchenko
Juan Manuel Macías writes: > Here is the modified patch. Thanks! > * (org-latex-verse-block): now the treatment of blank lines is > consistent with the syntax of the LaTeX `verse' environment, and the > one provided by the `verse' package. If the `:literal' attribute is > used, all blank lines

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

2023-08-16 Thread Juan Manuel Macías
Ihor Radchenko writes: > Juan Manuel Macías writes: > >> I think the best thing is to rethink the :literal attribute, as I >> commented at the end of my other email: >> >> - without :literal --> verse environment with a more "canonical" syntax. >> >> - with :literal --> verse environment seen in

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

2023-08-16 Thread Ihor Radchenko
Juan Manuel Macías writes: > I think the best thing is to rethink the :literal attribute, as I > commented at the end of my other email: > > - without :literal --> verse environment with a more "canonical" syntax. > > - with :literal --> verse environment seen in the "old (org) style", > preser

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

2023-08-15 Thread Juan Manuel Macías
Ihor Radchenko writes: > Sure, but look at the pdf. The generated pdfs are not different for some > reason. Ah, sorry. It was a foolish oversight of mine. The point is that a \vspace after a line break in normal text has no effect. This does work: lorem ipsum\\ \vspace*{10ex}\\ dolor but it's a

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

2023-08-15 Thread Ihor Radchenko
Juan Manuel Macías writes: >> The output is not different, which it should be, AFAIU. Am I missing >> something? > > I have tried your examples and I think both give the expected result. > Look at this screenshot: > > https://i.imgur.com/ofl8Z9f.png Sure, but look at the pdf. The generated pdfs

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

2023-08-15 Thread Juan Manuel Macías
Ihor Radchenko writes: > Thanks! > I tested the patch with > > #+attr_latex: :literal t > > #+begin_verse > > This is just a test. > ASF. > > #+end_verse > > > and then with > > #+attr_latex: :literal t > > #+begin_verse > > This is just a test. > > ASF. >

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

2023-08-15 Thread Ihor Radchenko
Juan Manuel Macías writes: > Ihor Radchenko writes: > >> Looks reasonable in general. Of course, we will also need to document >> the new attribute. > > Here is the modified patch (with your suggestions, including the `rx' code) > and the documentation of the new attribute. Thanks! I tested the

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

2023-08-14 Thread Juan Manuel Macías
Ihor Radchenko writes: > Looks reasonable in general. Of course, we will also need to document > the new attribute. Here is the modified patch (with your suggestions, including the `rx' code) and the documentation of the new attribute. -- Juan Manuel Macías https://juanmanuelmacias.com https:

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

2023-08-13 Thread Ihor Radchenko
Juan Manuel Macías writes: >>> + (concat "\\(" >>> + (regexp-quote org-latex-line-break-safe) >>> + "\n\\)" >>> + "\\(^[ \t]*" >>> + (regexp-quote org-latex-line-break-safe) >>> +

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

2023-08-12 Thread Juan Manuel Macías
Ihor Radchenko writes: > Juan Manuel Macías writes: >> + (vwidth (if (not lit) >> + (if versewidth (format "\\settowidth{\\versewidth}{%s}\n" >> versewidth) "") >> + "")) > > Can just do (if (and versewidth (not lit)) (format ...) "") > >> + (linres

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

2023-08-12 Thread Ihor Radchenko
Juan Manuel Macías writes: > How about this (pre-)patch? With the `:literal' attr., the content of the > block is exported "as is", with all manual formatting preserved. Looks reasonable in general. Of course, we will also need to document the new attribute. > I have made some modifications in

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

2023-08-11 Thread Juan Manuel Macías
Ihor Radchenko writes: > Juan Manuel Macías writes: > >> ... 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 at

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

2023-08-11 Thread Ihor Radchenko
Juan Manuel Macías writes: > ... 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,

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

2023-08-10 Thread Juan Manuel Macías
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,

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

2023-08-10 Thread Ihor Radchenko
Juan Manuel Macías writes: >> Do you mean that people use extra leading/trailing spaces just to get >> extra vertical space before/after the verse block in _latex_ export? > > No, I don't think people use it for that purpose. I meant that if > someone puts a space before or after the content (whi

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

2023-08-09 Thread Juan Manuel Macías
Ihor Radchenko writes: >>> I see nothing that would prevent merging this patch. >>> However, I believe that removing blank lines before/after content is >>> something we may want to do in other built-in backends as well. WDYT? >> >> I think you're right. My impression is that the blank lines befor

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

2023-08-09 Thread Ihor Radchenko
Juan Manuel Macías writes: >> I see nothing that would prevent merging this patch. >> However, I believe that removing blank lines before/after content is >> something we may want to do in other built-in backends as well. WDYT? > > I think you're right. My impression is that the blank lines befor

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

2023-08-07 Thread Juan Manuel Macías
Ihor Radchenko writes: >> Rationale for this patch: the treatment of blank lines in >> `org-latex-verse-block' is inconsistent with the syntax of the `verse' >> environment, both the one that includes LaTeX and the one provided by >> the `verse' package as a replacement for the former. >> ... >> S

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

2023-08-07 Thread Ihor Radchenko
Juan Manuel Macías writes: > Rationale for this patch: the treatment of blank lines in > `org-latex-verse-block' is inconsistent with the syntax of the `verse' > environment, both the one that includes LaTeX and the one provided by > the `verse' package as a replacement for the former. > ... > So

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

2023-08-06 Thread Juan Manuel Macías
Rationale for this patch: the treatment of blank lines in `org-latex-verse-block' is inconsistent with the syntax of the `verse' environment, both the one that includes LaTeX and the one provided by the `verse' package as a replacement for the former. Currently, each blank line is exported to LaTe