all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [BUG] Org export fails on $k$-ary
@ 2024-04-04 17:52 Jens Lechtenboerger
  2024-04-04 19:31 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Lechtenboerger @ 2024-04-04 17:52 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

Dear all,

I would expect this to be exported to HTML and LaTeX correctly:
"A $k$-ary function has $k$ arguments"

In 12.5.1 LaTeX fragments, this use of a hyphen is documented:
"To avoid conflicts with currency specifications, single ‘$’
characters are only recognized as math delimiters if the enclosed text
contains at most two line breaks, is directly attached to the ‘$’
characters with no whitespace in between, and if the closing ‘$’ is
followed by whitespace, punctuation or a dash."

However, the HTML export result contains
"A $k$-ary function has \(k\) arguments",
which is not rendered correctly.  The first two dollar signs should
be replaced as well.

The LaTeX result contains "A \$k\$-ary ...", which produces literal
dollar signs, not math mode.

In contrast, "A \(k\)-ary..." works.

This happens with Org mode version 9.6.15 and with
9.7-pre (release_9.6.24-1336-gc8d133 @ ...).

Recipe:
emacs -Q
(add-to-list 'load-path "~/src/org-mode/lisp")
Then export an Org buffer/file with the above line:
C-c C-e h h
C-c C-e l l

Best wishes,
Jens

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 6187 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG] Org export fails on $k$-ary
  2024-04-04 17:52 [BUG] Org export fails on $k$-ary Jens Lechtenboerger
@ 2024-04-04 19:31 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-04-04 19:31 UTC (permalink / raw)
  To: Jens Lechtenboerger; +Cc: emacs-orgmode

Jens Lechtenboerger <lechten@wi.uni-muenster.de> writes:

> I would expect this to be exported to HTML and LaTeX correctly:
> "A $k$-ary function has $k$ arguments"
> 
> In 12.5.1 LaTeX fragments, this use of a hyphen is documented:
> "To avoid conflicts with currency specifications, single ‘$’
> characters are only recognized as math delimiters if the enclosed text
> contains at most two line breaks, is directly attached to the ‘$’
> characters with no whitespace in between, and if the closing ‘$’ is
> followed by whitespace, punctuation or a dash."
>
> However, the HTML export result contains
> "A $k$-ary function has \(k\) arguments",
> which is not rendered correctly.  The first two dollar signs should
> be replaced as well.
>
> The LaTeX result contains "A \$k\$-ary ...", which produces literal
> dollar signs, not math mode.

This is expected. The manual is not accurate here (and has been fixed on
development version of Org mode).
See https://list.orgmode.org/orgmode/f0597d96-a287-2c48-7897-6b8737c95217@posteo.eu/

> In contrast, "A \(k\)-ary..." works.

This is also expected. Note that the latter syntax is preferred. We do
not recommend $k$ because it has edge cases like you encountered.

Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-04 19:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-04 17:52 [BUG] Org export fails on $k$-ary Jens Lechtenboerger
2024-04-04 19:31 ` Ihor Radchenko

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.