emacs-orgmode
[Top][All Lists]
Advanced

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

Bug report


From: Topi Mäenpää
Subject: Bug report
Date: Wed, 01 Jun 2022 07:53:21 +0000

* Bug report

I have trouble escaping a dollar sign in org-mode documents. I
tried to enter the following:

#+begin_src
A (14 G$) B (6 G$)
#+end_src

This may look weird to an American viewer, but in Finland we place all
units (including monetary units) after the quantity. Anyhow, org-mode
interprets this as follows:

#+begin_src
A (14 G<math>) B (6 G</math>)
#+end_src

This is the documented behavior: single '$' characters are treated as
math delimiters if

1. the enclosed text contains at most two line breaks (there are none).
2. the enclosed text is directly attached to the '$' characters with
   no whitespace in between (it is).
3. the closing '$' is followed by a whitespace, punctuation or a dash
   (it is).

The standard trick of adding a zero-width space (`<zws>`) after the
first '$' (breaking rule 2 above) doesn't however work as expected:

#+begin_src
A (14 G$<zws>​) B (6 G$)
#+end_src

is rendered as

#+begin_src
A (14 G<math><zws>​) B (6 G$</math>)
#+end_src

Changing the zero-width space to a visible space fixes the
interpretation, but also visually moves the closing parenthesis.

I believe zero-width space is incorrectly interpreted as a
non-whitespace here. It does not seem to be an exporter bug as both
LaTeX and HTML exporters are affected.

Thanks,
Topi




reply via email to

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