Re: [BUG] exporting links with underscores

2022-12-18 Thread Leo Butler
On Sat, Dec 17 2022, Mike Gauland  wrote:

> On 17/12/22 11:32, Leo Butler wrote:
>> Org version is 9.5.2; emacs version is 27.1.
>>
>> The manual does not indicate that underscores need to be escaped in
>> links (and they can't be, as far as I can tell). The latex and html
>> exporters interpret them as the start of a subscript.
>>
>> Leo
>>
> By default underscore is treated that way--see the "Subscripts and 
> Superscripts" section of the manual 
> (https://orgmode.org/manual/Subscripts-and-Superscripts.html).

Thanks, I was looking at the section on links.

>
> Set the '^' option to 'nil' to get the behaviour you're after:
>
> #+OPTIONS: toc:nil num:nil ^:nil
>
> If you want a subscript anywhere, you can get that by using curly braces 
> (e.g., ex_{ample}).

Thanks for the tip and my apologies for the noise.

Best,
Leo


Re: [BUG] exporting links with underscores

2022-12-17 Thread Ihor Radchenko
Leo Butler  writes:

> The manual does not indicate that underscores need to be escaped in
> links (and they can't be, as far as I can tell). The latex and html
> exporters interpret them as the start of a subscript.
>
> The link =[[mailto:ex_am...@ex.com][ex_ample]]= is expected to export
> to =\href{mailto:ex_am...@ex.com}{ex_ample}= but instead, we get
> [[mailto:ex_am...@ex.com][ex_ample]] exports to (in latex): 
> =\href{mailto:ex\_am...@ex.com}{ex\textsubscript{ample}}=

This is expected. You mixed URL part of the link and the description.
Link description can have same formatting as any other Org text.
So, underscores are indeed treated as markup.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] exporting links with underscores

2022-12-16 Thread Mike Gauland

On 17/12/22 11:32, Leo Butler wrote:

Org version is 9.5.2; emacs version is 27.1.

The manual does not indicate that underscores need to be escaped in
links (and they can't be, as far as I can tell). The latex and html
exporters interpret them as the start of a subscript.

Leo

By default underscore is treated that way--see the "Subscripts and 
Superscripts" section of the manual 
(https://orgmode.org/manual/Subscripts-and-Superscripts.html).


Set the '^' option to 'nil' to get the behaviour you're after:

#+OPTIONS: toc:nil num:nil ^:nil

If you want a subscript anywhere, you can get that by using curly braces 
(e.g., ex_{ample}).





[BUG] exporting links with underscores

2022-12-16 Thread Leo Butler
Org version is 9.5.2; emacs version is 27.1.

The manual does not indicate that underscores need to be escaped in
links (and they can't be, as far as I can tell). The latex and html
exporters interpret them as the start of a subscript.

Leo

#+AUTHOR: Leo Butler
#+TITLE: Bug in processing underscores in links
#+OPTIONS: toc:nil num:nil

* Description

The link =[[mailto:ex_am...@ex.com][ex_ample]]= is expected to export
to =\href{mailto:ex_am...@ex.com}{ex_ample}= but instead, we get
[[mailto:ex_am...@ex.com][ex_ample]] exports to (in latex): =\href{mailto:ex\_am...@ex.com}{ex\textsubscript{ample}}=

Note that a similar issue is seen with the HTML export.

* Reproduction

Export this file: =C-c C-e l p=.