emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Feature request: Add support for org-toggle-pretty-entities preview of org-entities-user which are more than one unicode character
@ 2018-12-25 12:07 Ilja Kocken
  2019-01-01 16:56 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Ilja Kocken @ 2018-12-25 12:07 UTC (permalink / raw)
  To: emacs-orgmode

Hi there!

I've recently added some custom entries to my org-entities-user 
(below), but the ones that are more than one UTF-8 character long 
(most) do not show in my org-buffer with 
org-toggle-pretty-entities on. Is there a particular reason that 
I'm missing for why it will only preview single-character 
entities?

(setq org-entities-user
      '(("dO" "\\(\\delta^{18}\\)O" nil "&delta;<sup>18</sup>O" 
      "δ18O" "δ18O" "δ¹⁸O")
        ("eO" "\\({}^{18}\\)O" nil "<sup>18</sup>O" "18O" "18O" 
        "¹⁸O")
        ("dC" "\\(\\delta^{13}\\)C" nil "&delta;<sup>13</sup>O" 
        "δ13C" "δ¹³C" "δ¹³C")
        ("tC" "\\({}^{13}\\)C" nil "<sup>13</sup>C" "13C" "¹³C" 
        "¹³O")
        ("COt" "CO\\(_{2}\\)" nil "CO<sub>2</sub>" "CO2" "CO₂" 
        "CO₂")
        ("D" "\\Delta_{47}" t "&Delta;<sub>47</sub>" "Δ47" "Δ47" 
        "Δ₄₇")
        ("celsius" "\\(^{\\circ}\\)C" nil "&deg;C" "°C" "°C" "℃")
        ;; unit space, for something like 15\us{}kg
        ("us" "\\," nil "&nbsp;" " " " " " ")
        ("appr" "\\sim" t "&tilde;" "~" "~" "~")
        ;; for gps-coordinates
        ("degree" "^{\\circ}" t "&deg;" "°" "°" "°")
        ("arcminute" "^{'}" t "&prime;" "'" "′" "′")
        ("arcsecond" "^{''}" t "&Prime;" "\"" "″" "″")
        ))

Or am I going about this the wrong way in this particular case? I 
could of course also write yasnippets to autocomplete the full 
org-source, but I would like more control over what the latex 
export looks like (since I have to format everything according to 
strict latex conventions for scientific journals, so for example 
the default CO_2 -> CO\(_{\text{2}}\) is wrong).

Kind regards,

Ilja

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

* Re: Feature request: Add support for org-toggle-pretty-entities preview of org-entities-user which are more than one unicode character
  2018-12-25 12:07 Feature request: Add support for org-toggle-pretty-entities preview of org-entities-user which are more than one unicode character Ilja Kocken
@ 2019-01-01 16:56 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2019-01-01 16:56 UTC (permalink / raw)
  To: Ilja Kocken; +Cc: emacs-orgmode

Hello,

Ilja Kocken <i.j.kocken@uu.nl> writes:

> Is there a particular reason that I'm missing for why it will only
> preview single-character entities?

Entities provide a way to insert special characters using only ASCII.
You are trying to use them as a templating system, or some such, which
is not the initial use case.

> Or am I going about this the wrong way in this particular case?
> I could of course also write yasnippets to autocomplete the full
> org-source, but I would like more control over what the latex export
> looks like (since I have to format everything according to strict
> latex conventions for scientific journals, so for example the default
> CO_2 -> CO\(_{\text{2}}\) is wrong).

You have control over what the LaTeX output will be, e.g., CO_{$2$}, or
\(CO_2\), whichever you need.

IOW, I think a package like Yasnippet already fulfills your needs.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2019-01-01 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-25 12:07 Feature request: Add support for org-toggle-pretty-entities preview of org-entities-user which are more than one unicode character Ilja Kocken
2019-01-01 16:56 ` Nicolas Goaziou

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