emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Escape individual underscore?
@ 2015-03-03 20:08 Jacob Gerlach
  2015-03-03 20:53 ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Gerlach @ 2015-03-03 20:08 UTC (permalink / raw)
  To: Org-mode

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

Hi List,

I want to include a literal underscore in LaTeX export, like FOO_BAR. Right
now I get:
FOO$_{\text{BAR}}$

Contrary to this stackexchange question
<http://stackoverflow.com/a/12753930/3371623>, if I try to escape the
underscore with a backslash, I get:
FOO$\backslash$$_{\text{BAR}}

I've found that I can set org-export-with-sub-superscripts to "{}" to avoid
this problem, but I'd rather escape individual underscores on a case by
case basis. Is this possible?

As an aside, section 11.7.2 of the org info says "Configure the variable
`org-use-sub-superscripts' to
change this convention." Fortunately the docstring for
org-use-sub-superscripts points out that display and export functionality
are now controlled by separate variables. I would propose a patch to update
the info to clarify that two variables are used, but I'm not currently set
up to do so.

Regards,
Jake

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

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

* Re: Escape individual underscore?
  2015-03-03 20:08 Escape individual underscore? Jacob Gerlach
@ 2015-03-03 20:53 ` Nick Dokos
  2015-03-03 21:02   ` Nicolas Goaziou
  2015-03-04  9:27   ` Sebastien Vauban
  0 siblings, 2 replies; 4+ messages in thread
From: Nick Dokos @ 2015-03-03 20:53 UTC (permalink / raw)
  To: emacs-orgmode

Jacob Gerlach <jacobgerlach@gmail.com> writes:

> Hi List,
>
> I want to include a literal underscore in LaTeX export, like FOO_BAR. Right now I get:
> FOO$_{\text{BAR}}$
>
> Contrary to this stackexchange question, if I try to escape the underscore with a backslash, I get:
> FOO$\backslash$$_{\text{BAR}}
>
> I've found that I can set org-export-with-sub-superscripts to "{}" to avoid this problem, but I'd rather escape individual
> underscores on a case by case basis. Is this possible?
>

I don't think so.

FWIW, I always set

#+OPTIONS: ^:{}

in my files. That allows me to use a_b  for the majority of my use
cases, but still allows {subscripts} in the rare cases when I need them.

I'm not sure how useful it would be but maybe there should be a setting
to accommodate the inverse case: mostly subscripts a_b but allow literal
underscores using some additional markup.

Nick

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

* Re: Escape individual underscore?
  2015-03-03 20:53 ` Nick Dokos
@ 2015-03-03 21:02   ` Nicolas Goaziou
  2015-03-04  9:27   ` Sebastien Vauban
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2015-03-03 21:02 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> I'm not sure how useful it would be but maybe there should be a setting
> to accommodate the inverse case: mostly subscripts a_b but allow literal
> underscores using some additional markup.

You can use \under entity, e.g.,

  a\under{}b


Regards,

-- 
Nicolas Goaziou

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

* Re: Escape individual underscore?
  2015-03-03 20:53 ` Nick Dokos
  2015-03-03 21:02   ` Nicolas Goaziou
@ 2015-03-04  9:27   ` Sebastien Vauban
  1 sibling, 0 replies; 4+ messages in thread
From: Sebastien Vauban @ 2015-03-04  9:27 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Nick,

Nick Dokos wrote:
> FWIW, I always set
>
> #+OPTIONS: ^:{}
>
> in my files.

You could set the following, then:

--8<---------------cut here---------------start------------->8---
  ;; Interpret "_" and "^" for export when braces are used.
  (setq org-export-with-sub-superscripts '{})
--8<---------------cut here---------------end--------------->8---

Best regards,
  Seb

-- 
Sebastien Vauban

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

end of thread, other threads:[~2015-03-04  9:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03 20:08 Escape individual underscore? Jacob Gerlach
2015-03-03 20:53 ` Nick Dokos
2015-03-03 21:02   ` Nicolas Goaziou
2015-03-04  9:27   ` Sebastien Vauban

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