emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Conflict between org-emphasis and org-latex
@ 2021-09-26 12:24 Léo Ackermann
  2021-09-26 12:57 ` Juan Manuel Macías
  0 siblings, 1 reply; 8+ messages in thread
From: Léo Ackermann @ 2021-09-26 12:24 UTC (permalink / raw)
  To: Org Mode List

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

Hi!
I noticed that in org@888aaa97c0ce331097787333d0d712dd6e4d078f, the
following happens:
When writing `Consider $a^{*}$ and $b^{*}$` in an org-mode buffer, the two
stars match together, causing "and" to appear in bold case.

Any idea to fix this unwanted behavior ?

Thanks for making org-mode better every day!
Leo

[-- Attachment #2: Type: text/html, Size: 1241 bytes --]

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

* Re: [BUG] Conflict between org-emphasis and org-latex
  2021-09-26 12:24 [BUG] Conflict between org-emphasis and org-latex Léo Ackermann
@ 2021-09-26 12:57 ` Juan Manuel Macías
  2021-09-26 16:57   ` Léo Ackermann
  0 siblings, 1 reply; 8+ messages in thread
From: Juan Manuel Macías @ 2021-09-26 12:57 UTC (permalink / raw)
  To: Léo Ackermann; +Cc: orgmode

Hi Léo,

Léo Ackermann writes:

> Hi!
> I noticed that in org@888aaa97c0ce331097787333d0d712dd6e4d078f, the
> following happens:
> When writing `Consider $a^{*}$ and $b^{*}$` in an org-mode buffer, the
> two stars match together, causing "and" to appear in bold case. 
>
> Any idea to fix this unwanted behavior ?

You can insert a zero width space character (U+200B), to prevent that
segment is fontified as emphasis [see the Manual in the section `Escape
Character']. It is enough with insert the character after one of the
asterisks: M-x insert-char RET 200b RET. I also recommend that you look
at this section on Timothy's blog `This Month in Org':
https://blog.tecosaur.com/tmio/2021-05-31-async.html#easy-zero-width

Best regards,

Juan Manuel 


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

* Re: [BUG] Conflict between org-emphasis and org-latex
  2021-09-26 12:57 ` Juan Manuel Macías
@ 2021-09-26 16:57   ` Léo Ackermann
  2021-09-26 17:01     ` Timothy
  2021-09-26 18:29     ` Juan Manuel Macías
  0 siblings, 2 replies; 8+ messages in thread
From: Léo Ackermann @ 2021-09-26 16:57 UTC (permalink / raw)
  To: Juan Manuel Macías; +Cc: orgmode

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

Hi Juan Manuel,

I agree that some tricks exist in order to prevent this behavior.
Nevertheless, I think that this bug has been introduced recently (I never
noticed it before) and has to be corrected properly (as this is a really
basic use of org-mode).
Unfortunately, I can barely understand elisp... so writing a patch is far
away from what I can do :/

Best,
Leo

Le dim. 26 sept. 2021 à 14:57, Juan Manuel Macías <maciaschain@posteo.net>
a écrit :

> Hi Léo,
>
> Léo Ackermann writes:
>
> > Hi!
> > I noticed that in org@888aaa97c0ce331097787333d0d712dd6e4d078f, the
> > following happens:
> > When writing `Consider $a^{*}$ and $b^{*}$` in an org-mode buffer, the
> > two stars match together, causing "and" to appear in bold case.
> >
> > Any idea to fix this unwanted behavior ?
>
> You can insert a zero width space character (U+200B), to prevent that
> segment is fontified as emphasis [see the Manual in the section `Escape
> Character']. It is enough with insert the character after one of the
> asterisks: M-x insert-char RET 200b RET. I also recommend that you look
> at this section on Timothy's blog `This Month in Org':
> https://blog.tecosaur.com/tmio/2021-05-31-async.html#easy-zero-width
>
> Best regards,
>
> Juan Manuel
>

[-- Attachment #2: Type: text/html, Size: 1816 bytes --]

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

* Re: [BUG] Conflict between org-emphasis and org-latex
  2021-09-26 16:57   ` Léo Ackermann
@ 2021-09-26 17:01     ` Timothy
  2021-09-26 17:05       ` Léo Ackermann
  2021-09-26 18:29     ` Juan Manuel Macías
  1 sibling, 1 reply; 8+ messages in thread
From: Timothy @ 2021-09-26 17:01 UTC (permalink / raw)
  To: Léo Ackermann; +Cc: Juan Manuel Macías, emacs-orgmode


Hi Léo,

You write:
> Nevertheless, I think that this bug has been introduced recently (I never noticed it before) and has to be corrected properly (as this is a really basic use of
> org-mode).
> Unfortunately, I can barely understand elisp... so writing a patch is far away from what I can do :/

Do you think you might be able to identify a "good" commit and bisect
the bug? That would be a tremendous help for solving it, and shouldn't
require any elisp.

--
Timothy


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

* Re: [BUG] Conflict between org-emphasis and org-latex
  2021-09-26 17:01     ` Timothy
@ 2021-09-26 17:05       ` Léo Ackermann
  2021-09-26 17:07         ` Timothy
  2021-09-30 14:48         ` Max Nikulin
  0 siblings, 2 replies; 8+ messages in thread
From: Léo Ackermann @ 2021-09-26 17:05 UTC (permalink / raw)
  To: Timothy; +Cc: Juan Manuel Macías, emacs-orgmode

Hi,
I’ll try to do so ;) 

Let you know,
Leo

> Le 26 sept. 2021 à 19:01, Timothy <tecosaur@gmail.com> a écrit :
> 
> 
> Hi Léo,
> 
> You write:
>> Nevertheless, I think that this bug has been introduced recently (I never noticed it before) and has to be corrected properly (as this is a really basic use of
>> org-mode).
>> Unfortunately, I can barely understand elisp... so writing a patch is far away from what I can do :/
> 
> Do you think you might be able to identify a "good" commit and bisect
> the bug? That would be a tremendous help for solving it, and shouldn't
> require any elisp.
> 
> --
> Timothy


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

* Re: [BUG] Conflict between org-emphasis and org-latex
  2021-09-26 17:05       ` Léo Ackermann
@ 2021-09-26 17:07         ` Timothy
  2021-09-30 14:48         ` Max Nikulin
  1 sibling, 0 replies; 8+ messages in thread
From: Timothy @ 2021-09-26 17:07 UTC (permalink / raw)
  To: Léo Ackermann; +Cc: Juan Manuel Macías, emacs-orgmode

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

Hi  Léo,

> I’ll try to do so ;)
> Let you know,

That’s great to hear. Thanks in advance, even if it doesn’t work out the effort
is appreciated 🙂.

All the best,
Timothy

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

* Re: [BUG] Conflict between org-emphasis and org-latex
  2021-09-26 16:57   ` Léo Ackermann
  2021-09-26 17:01     ` Timothy
@ 2021-09-26 18:29     ` Juan Manuel Macías
  1 sibling, 0 replies; 8+ messages in thread
From: Juan Manuel Macías @ 2021-09-26 18:29 UTC (permalink / raw)
  To: Léo Ackermann, Timothy; +Cc: orgmode

Hi Léo and Timothy,

Léo Ackermann writes:

> [...]
> I think that this bug has been introduced recently (I
> never noticed it before)

I don't know if I'm pointing in the right direction, or I am missing
something, but I would say that this is a problem (or consequence) of
`org-emphasis-regexp-components'. According to the docstring, it is a list
with five parts:

("-[:space:]('\"{"
"-[:space:].,:!?;'\")}\\["
"[:space:]"
"."  ;; <<====
15)

where part 4, body-regexp, is: "A regexp like "." to match a body
character. Don’t use non-shy groups here, and don’t allow
newline here".

Therefore, the segment "} and {" is fontized here as emphasis

For a LaTeX fragment I think you can do:

(setq org-highlight-latex-and-related 'script)

According to the docstrip:

Non-nil means highlight LaTeX related syntax in the buffer.
When non-nil, the value should be a list containing any of the
following symbols:
  ‘native’   Highlight LaTeX snippets and environments natively.
  ‘latex’    Highlight LaTeX snippets and environments.
  ‘script’   Highlight subscript and superscript.
  ‘entities’ Highlight entities.

Best regards,

Juan Manuel


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

* Re: [BUG] Conflict between org-emphasis and org-latex
  2021-09-26 17:05       ` Léo Ackermann
  2021-09-26 17:07         ` Timothy
@ 2021-09-30 14:48         ` Max Nikulin
  1 sibling, 0 replies; 8+ messages in thread
From: Max Nikulin @ 2021-09-30 14:48 UTC (permalink / raw)
  To: Léo Ackermann; +Cc: emacs-orgmode

On 27/09/2021 00:05, Léo Ackermann wrote:
>> Le 26 sept. 2021 à 19:01, Timothy a écrit :
>> You write:
>>> Nevertheless, I think that this bug has been introduced recently (I never noticed it before) and has to be corrected properly (as this is a really basic use of
>>> org-mode).
>>> Unfortunately, I can barely understand elisp... so writing a patch is far away from what I can do :/
>>
>> Do you think you might be able to identify a "good" commit and bisect
>> the bug? That would be a tremendous help for solving it, and shouldn't
>> require any elisp.

It is not bisect, though results for "emacs -Q" or "emacs -q" are 
identical for the following Org versions:

- Org mode version 9.5 (release_9.5-6-g59cb39 ...) - current main
- Org mode version 9.3.1 (9.3.1-dist ...) - elpa-org package from 
Ubuntu-20.04
- Org mode version 9.1.9 (release_9.1.9-65-g5e4542 ...) - bundled with 
emacs-26.3 Ubuntu-20.04 package

- "and" is bold in the buffer (wrong)
- Export to LaTeX (correct): "Consider \(a^{*}\) and \(b^{*}\)"

I do not think that some problem has been introduced recently.



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

end of thread, other threads:[~2021-09-30 14:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26 12:24 [BUG] Conflict between org-emphasis and org-latex Léo Ackermann
2021-09-26 12:57 ` Juan Manuel Macías
2021-09-26 16:57   ` Léo Ackermann
2021-09-26 17:01     ` Timothy
2021-09-26 17:05       ` Léo Ackermann
2021-09-26 17:07         ` Timothy
2021-09-30 14:48         ` Max Nikulin
2021-09-26 18:29     ` Juan Manuel Macías

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).