emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* prevent underscores to be translates in subscript when exporting to latex
@ 2022-10-08 13:58 Luca Ferrari
  2022-10-08 14:13 ` Ihor Radchenko
  2022-10-08 14:43 ` Mark Barton
  0 siblings, 2 replies; 5+ messages in thread
From: Luca Ferrari @ 2022-10-08 13:58 UTC (permalink / raw)
  To: emacs-org list

Hi all,
I've a link like
[[https://foo.com/bar_baz.html][https://foo.com/bar_baz.html]] that,
once rendered in LaTeX, is converted to a subscript like
bar\textsubscript{baz}.
Is there a way to prevent this?

Thanks,
Luca


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

* Re: prevent underscores to be translates in subscript when exporting to latex
  2022-10-08 13:58 prevent underscores to be translates in subscript when exporting to latex Luca Ferrari
@ 2022-10-08 14:13 ` Ihor Radchenko
  2022-10-08 14:32   ` Luca Ferrari
  2022-10-08 14:43 ` Mark Barton
  1 sibling, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2022-10-08 14:13 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: emacs-org list

Luca Ferrari <fluca1978@gmail.com> writes:

> Hi all,
> I've a link like
> [[https://foo.com/bar_baz.html][https://foo.com/bar_baz.html]] that,
> once rendered in LaTeX, is converted to a subscript like
> bar\textsubscript{baz}.
> Is there a way to prevent this?

Description part of the link can contain markup, including underscore.
Just as if you write bar_baz in paragraph, =_= is interpreted as
subscript.
As usual, to prevent Org markup from being interpreted, you can use
verbatim environment:

[[https://foo.com/bar_baz.html][=https://foo.com/bar_baz.html=]]

or entity

[[https://foo.com/bar_baz.html][https://foo.com/bar\under{}baz.html]]

or you can drop the description part of the link altogether:

[[https://foo.com/bar_baz.html]]


-- 
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] 5+ messages in thread

* Re: prevent underscores to be translates in subscript when exporting to latex
  2022-10-08 14:13 ` Ihor Radchenko
@ 2022-10-08 14:32   ` Luca Ferrari
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Ferrari @ 2022-10-08 14:32 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-org list

On Sat, Oct 8, 2022 at 4:12 PM Ihor Radchenko <yantar92@gmail.com> wrote:
> [[https://foo.com/bar_baz.html][=https://foo.com/bar_baz.html=]]
>

This has, however, the effect of changing the font type to \textt. The
same happens when using ~ in place of =.

> or you can drop the description part of the link altogether:
>
> [[https://foo.com/bar_baz.html]]

This is the simplest way, according to me, and keeps the same font as
the surrounding text.

Thanks.


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

* Re: prevent underscores to be translates in subscript when exporting to latex
  2022-10-08 13:58 prevent underscores to be translates in subscript when exporting to latex Luca Ferrari
  2022-10-08 14:13 ` Ihor Radchenko
@ 2022-10-08 14:43 ` Mark Barton
  2022-10-12 12:22   ` Luca Ferrari
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Barton @ 2022-10-08 14:43 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: emacs-org list

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



> On Oct 8, 2022, at 6:58 AM, Luca Ferrari <fluca1978@gmail.com> wrote:
> 
> Hi all,
> I've a link like
> [[https://foo.com/bar_baz.html][https://foo.com/bar_baz.html] <https://foo.com/bar_baz.html][https://foo.com/bar_baz.html]>] that,
> once rendered in LaTeX, is converted to a subscript like
> bar\textsubscript{baz}.
> Is there a way to prevent this?

I settled on adding an OPTION line to my org file to disable this behavior, since the documents I'm working on rarely need subscripts and I can use the LaTeX form when I do need to specify them.

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

The last part forces the export to recognize just the LaTeX form of specifying subscripts.

[[info:org#Export Settings][org#Export Settings]]
‘^’
     Toggle TeX-like syntax for sub- and superscripts.  If you write
     ‘^:{}’, ‘a_{b}’ is interpreted, but the simple ‘a_b’ is left as it
     is (‘org-export-with-sub-superscripts’).

Mark

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

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

* Re: prevent underscores to be translates in subscript when exporting to latex
  2022-10-08 14:43 ` Mark Barton
@ 2022-10-12 12:22   ` Luca Ferrari
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Ferrari @ 2022-10-12 12:22 UTC (permalink / raw)
  To: Mark Barton; +Cc: emacs-org list

On Sat, Oct 8, 2022 at 4:43 PM Mark Barton <mbarton98@gmail.com> wrote:
> The last part forces the export to recognize just the LaTeX form of specifying subscripts.
>

Great! Thanks, this is what I was looking for.

Luca


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

end of thread, other threads:[~2022-10-12 12:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-08 13:58 prevent underscores to be translates in subscript when exporting to latex Luca Ferrari
2022-10-08 14:13 ` Ihor Radchenko
2022-10-08 14:32   ` Luca Ferrari
2022-10-08 14:43 ` Mark Barton
2022-10-12 12:22   ` Luca Ferrari

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