Customize list of blocks that use "\footnotemark" in `org-latex-footnote-reference'

2024-09-12 Thread 8dcc
Hello,

I am exporting an Org file that contains a large verse block to
LaTeX. This verse block contains footnotes, but they appear in the page
where the LaTeX verse environment ends. I looked at the exported .tex
file and I noticed that it was using "\footnotemark" and
"\footnotetext[N]{...}", instead of "\footnote{...}".

If it's not clear what the issue is, simply add a footnote to the first
lines of a very long verse block (longer than one page), and export it
to PDF.

I searched in ox-latex.el and I found the "problem". Inside
`org-latex-footnote-reference', the 2nd `cond' clause checks if the
reference is within a verse block, among others. It checks this by
calling `org-element-lineage' with a quoted list that contains the
hardcoded "blacklisted" blocks.

I think it would be a good idea to allow the user to customize this
list, since I personally don't think this makes sense with a verse block
(and probably table cell), for example.

Thanks in advance.


signature.asc
Description: PGP signature


Re: [BUG] Can't export variable named "nil" to Texinfo

2024-10-09 Thread 8dcc
Ihor Radchenko  writes:

> It happens to be that :options nil is treated specially by Org
> export. "nil" is not read literally, but is instead interpreted as
> removing the option value - when one needs to combine multiple
> attributes and override previous setting.

I see. I didn't know about "combining attributes", but I guess that
makes sense.

> In theory, we may fix this edge case just for ox-texinfo. But is it
> worth it?

I am not sure if it's worth fixing, specially since I don't know any
possible alternatives apart from using another keyword for specifying
this "attribute combination" (again, not sure how that works). Either
way, modifying existing behavior doesn't sound too good to me, specially
considering the amount of "nil" variables :)

> Do you _really_ have variable name "nil"?

Yes, I was not looking for this error, I didn't even know why it
happened before you told me. I am using Org to write the manual for my
Lisp interpreter, and I am exporting it to Texinfo. I wanted to explain
how `nil' works, and when it's used.


signature.asc
Description: PGP signature


[BUG] Texinfo: Commas in URL text are not escaped

2024-10-09 Thread 8dcc
Hello,

The following Org file:

  [[https://example.com][Foo]]

  [[https://example.com][Foo, Bar]]

When exported to Texinfo using `org-texinfo-export-to-texinfo',
generates the following file:

  ...
  @uref{https://example.com, Foo}

  @uref{https://example.com, Foo, Bar}
  ...

The comma on the text of the second URL is being interpreted by Texinfo
as an argument separator, which in the case of `@uref', only the third
argument is displayed, hiding the second argument and the actual URL
when exporting the file.


Therefore, it should be escaped to `@comma{}', according to the Texinfo
manual[1]:

  ...
  @uref{https://example.com, Foo}

  @uref{https://example.com, Foo@comma{} Bar}
  ...

This produces the expected output.


[1] Section 11.1.3, Inserting `,' with `@comma{}'.

https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Inserting-a-Comma.html


signature.asc
Description: PGP signature


Underscores in "Function:" items

2024-10-22 Thread 8dcc
Hello,

When exporting the following Org file to Texinfo:

- Function: foo_bar arg ::
  Contents.

The part after the underscore is completely skipped:

@defun foo
Contents.
@end defun

And, if I export it to HTML, the `bar' part is shown as a subscript, and
I don't know if it's intended:

Function: foobar arg
Contents.

Another small detail, which might not be important, is that when
exporting to HTML, the description of the function is only wrapped in
 tags if it has more than one paragraph. This kind of makes sense,
but results in inconsistent spacing when multiple functions are close:

Here's a list of functions:
- Function: foo arg ::
  This has multiple paragraphs.

  Another paragraph.
- Function: bar arg ::
  Just one line.
- Function: baz arg ::
  One line, again.
Here's some text after the list.

This is not a huge issue, since the user can just add some CSS (which I
personally use in my blog):

dl.org-dl dd p:nth-child(1) {
margin-top: 0px;
}

dl.org-dl dd p:nth-last-child(1) {
margin-bottom: 0px;
}

Thank you.


signature.asc
Description: PGP signature


[BUG] Can't export variable named "nil" to Texinfo

2024-09-28 Thread 8dcc
Hello,

I can export the following "Variable" to Texinfo with
`org-texinfo-export-to-texinfo':

  - Variable: my-name ::

Content...

Results in the following .texi:

  @defvar my-name
  Content@dots{}
  @end defvar

However, if the variable is named "nil" (without the quotes), the
variable name is not exported, and a warning is generated when
processing the .texi file:

  - Variable: nil ::

Content...

Results in:

  @defvar
  Content@dots{}
  @end defvar

When running `makeinfo --pdf file.texi':

  file.texi:50: warning: missing category for @defvar

I saw the "Variable" to "@defvar" conversion is made with
`org-texinfo--definition-command-alist' in `ox-texinfo.el', which then
gets used in `org-texinfo--match-definition' through the
regexp. However, I was not able to see why a "nil" string isn't
processed.


signature.asc
Description: PGP signature


Text preceding noweb references is duplicated

2024-11-26 Thread 8dcc
Hello,

Using the following Org file:

Paragraph zero...
#+begin_src scheme :tangle org-output.scm :noweb yes
(list <>)
#+end_src
Paragraph one...
#+begin_src scheme :tangle no :noweb-ref my-list-item
(+ 1 2)
#+end_src
Paragraph two...
#+begin_src scheme :tangle no :noweb-ref my-list-item
(+ 3 4)
#+end_src
Paragraph three...
#+begin_src scheme :tangle no :noweb-ref my-list-item
(+ 5 6)
#+end_src

After calling `org-babel-tangle', the contents of 'org-output.scm' are:

(list (+ 1 2)
(list (+ 3 4)
(list (+ 5 6))

Notice how all lines start with '(list', while only the last line
contains the closing parentheses.

However, if I use the following noweb[1] file:

Paragraph zero...
<>=
(list <>)
@
Paragraph one...
<>=
(+ 1 2)
@
Paragraph two...
<>=
(+ 3 4)
@
Paragraph three...
<>=
(+ 5 6)

Which was created using the linked one-page guide[2], I get the
following (expected) output:

(list (+ 1 2)
  (+ 3 4)
  (+ 5 6))

This noweb output was generated using the following command, from
version 2.12:

notangle -Rfile.scm my-noweb-file.nw > noweb-output.scm

Although the current Org behavior can be useful in some situations, I
would like to know if it's intentional before using it, and, in that
case, if it's documented anywhere in the manual.

Thanks in advance.

[1] https://www.cs.tufts.edu/~nr/noweb/
[2] http://literateprogramming.com/nowebpg1.pdf



[BUG] Texinfo: Error when exporting source block with no language

2024-12-21 Thread 8dcc
Hello, when trying to export the following Org file:

#+begin_src
Hello, world.
#+end_src

To texinfo using `org-texinfo-export-to-texinfo', I get the following
error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  org-texinfo-src-block((src-block (:language nil )))
  org-export-data((src-block (:language nil )))

However, if I change contents of the Org file to this, even if it's a
non-existing language, it works:

#+begin_src foobar
Hello, world.
#+end_src

And produces:

<...>
@example
Hello, world.
@end example
<...>

I am using Org mode version 9.6.15 in GNU Emacs 29.4.

Thanks.