emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Topi Mäenpää" <topi.maenpaa@protonmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Bug report
Date: Wed, 01 Jun 2022 07:53:21 +0000	[thread overview]
Message-ID: <icEsGOcGni6qhFgjvChMB6qVwr3XpnZv2tcVWApPXwOWkntHtLmKOBeQKB4LPTqeXcMHTeIkyHv9JurAqJzTgjLm4s-HTODJ6h6p4QDMydU=@protonmail.com> (raw)

* 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	other threads:[~2022-06-01 15:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01  7:53 Topi Mäenpää [this message]
2022-06-01 15:37 ` Bug report Eric S Fraga
2022-06-01 16:24   ` Max Nikulin
2022-06-01 16:49     ` Eric S Fraga
2022-06-02 15:30   ` Topi Mäenpää
  -- strict thread matches above, loose matches on Subject: below --
2016-06-01  7:02 Dan
2016-06-01 17:45 ` Nicolas Goaziou
2009-10-06  9:12 Otto Pichlhoefer
2009-10-07  6:17 ` Carsten Dominik

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='icEsGOcGni6qhFgjvChMB6qVwr3XpnZv2tcVWApPXwOWkntHtLmKOBeQKB4LPTqeXcMHTeIkyHv9JurAqJzTgjLm4s-HTODJ6h6p4QDMydU=@protonmail.com' \
    --to=topi.maenpaa@protonmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).