emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Superscript and non-blank character
@ 2020-07-11  0:33 Bo Grimes
  2020-07-14 11:51 ` ian martins
  0 siblings, 1 reply; 3+ messages in thread
From: Bo Grimes @ 2020-07-11  0:33 UTC (permalink / raw)
  To: emacs-orgmode

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

Emacs 26.3, Org-mode 9.1.9, Kubuntu 20.04, 5.4.0-39-generic

Hi,

I've tried my hardest to find an answer in the manuals (print book and 
on-line), this list, Reddit, and Stack Exchange with no luck.  I use 
Emacs for org-mode, and I don't code or know Elisp. I have no use for or 
interest in learning LaTeX.  I never use subscript, and I only use 
superscript in poetry/prose (mostly quotes, not original), and I don't 
foresee (but admit I may) a need to export.

I understand that:

> ^2H is not recognized as superscript _on purpose_. Per Org syntax, you 
> have to add a non-blank character before the caret. Otherwise, there 
> would be ambiguity between underline (e.g., _under_) and subscript 
> (_under). And superscript syntax follows subscript's. [1]

That makes sense to me as a default [2], given that so many org-mode 
users use both in math, science, and literate coding context, so I 
wouldn't think to suggest it to be changed.  All I want to know is how I 
can change it for *me*.

I would like to org-toggle-pretty-entities in a buffer and see 
superscript before, say, a poetry line or Bible verse I'm quoting in a 
note or journal entry, and not see the non-blank character.

Can this be done via customize or with an Elisp snippet in init.el?

Thanks!

[1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg01022.html

[2] Though I wish it were made explicit in the manuals 
https://orgmode.org/manual/Subscripts-and-Superscripts.html#Subscripts-and-Superscripts 
(Org Mode 9 Reference Manual p 132). It took me a while to figure out 
why it wasn't working at all.




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

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

* Re: Superscript and non-blank character
  2020-07-11  0:33 Superscript and non-blank character Bo Grimes
@ 2020-07-14 11:51 ` ian martins
  2020-07-15 23:40   ` Bo Grimes
  0 siblings, 1 reply; 3+ messages in thread
From: ian martins @ 2020-07-14 11:51 UTC (permalink / raw)
  To: Bo Grimes; +Cc: emacs-orgmode

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

Bo, you can try this. I don't know what else it will break, so I did it as
a file local. alternatively you could set `org-match-substring-regexp' in
your init.

---
;;; -*- org-match-substring-regexp:
"\\(\\)\\([_^]\\)\\(\\(?:{\\([^{}]*?\\|\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?\\|\\(?:[^{}]*?{\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?}\\)+[^{}]*?\\)}\\)\\|\\(?:(\\([^()]*?\\|\\(?:[^()]*?([^()]*?)\\)+[^()]*?\\|\\(?:[^()]*?(\\(?:[^()]*?([^()]*?)\\)+[^()]*?)\\)+[^()]*?\\))\\)\\|\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)";
org-pretty-entities: t; -*-

here are some verses where there's a space after the verse number:

^1 In the beginning God created the heavens and the earth. ^2 Now the earth
was formless and empty, darkness was over the surface of the deep, and the
Spirit of God was hovering over the waters.

if you don't want the space after the verse number, you can use curlys:

^{3}And God said, “Let there be light,” and there was light. ^{4}God saw
that the light was good, and he separated the light from the darkness.
^{5}God called the light “day,” and the darkness he called “night.” And
there was evening, and there was morning—the first day.

On Fri, Jul 10, 2020 at 8:33 PM Bo Grimes <vcg3rd@fastmail.com> wrote:

> Emacs 26.3, Org-mode 9.1.9, Kubuntu 20.04, 5.4.0-39-generic
>
> Hi,
>
> I've tried my hardest to find an answer in the manuals (print book and
> on-line), this list, Reddit, and Stack Exchange with no luck.  I use Emacs
> for org-mode, and I don't code or know Elisp.  I have no use for or
> interest in learning LaTeX.  I never use subscript, and I only use
> superscript in poetry/prose (mostly quotes, not original), and I don't
> foresee (but admit I may) a need to export.
>
> I understand that:
>
> ^2H is not recognized as superscript _on purpose_. Per Org syntax, you
> have to add a non-blank character before the caret. Otherwise, there would
> be ambiguity between underline (e.g., _under_) and subscript (_under). And
> superscript syntax follows subscript's. [1]
>
> That makes sense to me as a default [2], given that so many org-mode users
> use both in math, science, and literate coding context, so I wouldn't think
> to suggest it to be changed.  All I want to know is how I can change it for
> *me*.
>
> I would like to org-toggle-pretty-entities in a buffer and see superscript
> before, say, a poetry line or Bible verse I'm quoting in a note or journal
> entry, and not see the non-blank character.
>
> Can this be done via customize or with an Elisp snippet in init.el?
>
> Thanks!
>
> [1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg01022.html
>
> [2] Though I wish it were made explicit in the manuals
> https://orgmode.org/manual/Subscripts-and-Superscripts.html#Subscripts-and-Superscripts
> (Org Mode 9 Reference Manual p 132). It took me a while to figure out why
> it wasn't working at all.
>
>
>

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

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

* Re: Superscript and non-blank character
  2020-07-14 11:51 ` ian martins
@ 2020-07-15 23:40   ` Bo Grimes
  0 siblings, 0 replies; 3+ messages in thread
From: Bo Grimes @ 2020-07-15 23:40 UTC (permalink / raw)
  To: ian martins; +Cc: emacs-orgmode

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

Ian is a "steely-eyed rocket man"!  I thanked him off-list in order not 
to clutter it up, which led to several more exchanges. I wanted to add 
my final reply to him to the list in case others find it helpful in the 
future.

Begin quote:

I couldn't get it to work, but...it may have been that instead of 
closing the file I was testing on I was rather doing M-x eval-buffer.  
It kept giving me errors about entities or something.

However, after reading your links on local variables and more digging 
around on forums I decided to try footers before trying it in init.el.  
Thus, I arrived at:

 > # Local Variables:
 > # mode: org
 > # org-match-substring-regexp: 
"\\(\\)\\([_^]\\)\\(\\(?:{\\([^{}]*?\\|\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?\\|\\(?:[^{}]*?{\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?}\\)+[^{}]*?\\)}\\)\\|\\(?:(\\([^()]*?\\|\\(?:[^()]*?([^()]*?)\\)+[^()]*?\\|\\(?:[^()]*?(\\(?:[^()]*?([^()]*?)\\)+[^()]*?)\\)+[^()]*?\\))\\)\\|\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)"
 > # org-pretty-entities: t
 > # End

This also did not work when I evaluated the buffer.  After carefully 
rereading your last reply and noticing "The test is to save it with an 
.org extension and open it. When you try to open it, emacs should ask 
you if you want to load 'values that may not be safe'" I deduced I 
should close the file and re-open it (duh!).

This time I got the prompt you mentioned, and after accepting the risk, 
Viola! Rather than attempt it the original way, I think I will keep it 
as a footer where it is less distracting to me.


On 7/14/20 7:51 AM, ian martins wrote:
> Bo, you can try this. I don't know what else it will break, so I did it as
> a file local. alternatively you could set `org-match-substring-regexp' in
> your init.
>
> ---
> ;;; -*- org-match-substring-regexp:
> "\\(\\)\\([_^]\\)\\(\\(?:{\\([^{}]*?\\|\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?\\|\\(?:[^{}]*?{\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?}\\)+[^{}]*?\\)}\\)\\|\\(?:(\\([^()]*?\\|\\(?:[^()]*?([^()]*?)\\)+[^()]*?\\|\\(?:[^()]*?(\\(?:[^()]*?([^()]*?)\\)+[^()]*?)\\)+[^()]*?\\))\\)\\|\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)";
> org-pretty-entities: t; -*-
>
> here are some verses where there's a space after the verse number:
>
> ^1 In the beginning God created the heavens and the earth. ^2 Now the earth
> was formless and empty, darkness was over the surface of the deep, and the
> Spirit of God was hovering over the waters.
>
> if you don't want the space after the verse number, you can use curlys:
>
> ^{3}And God said, “Let there be light,” and there was light. ^{4}God saw
> that the light was good, and he separated the light from the darkness.
> ^{5}God called the light “day,” and the darkness he called “night.” And
> there was evening, and there was morning—the first day.
>
> On Fri, Jul 10, 2020 at 8:33 PM Bo Grimes <vcg3rd@fastmail.com> wrote:
>
>> Emacs 26.3, Org-mode 9.1.9, Kubuntu 20.04, 5.4.0-39-generic
>>
>> Hi,
>>
>> I've tried my hardest to find an answer in the manuals (print book and
>> on-line), this list, Reddit, and Stack Exchange with no luck.  I use Emacs
>> for org-mode, and I don't code or know Elisp.  I have no use for or
>> interest in learning LaTeX.  I never use subscript, and I only use
>> superscript in poetry/prose (mostly quotes, not original), and I don't
>> foresee (but admit I may) a need to export.
>>
>> I understand that:
>>
>> ^2H is not recognized as superscript _on purpose_. Per Org syntax, you
>> have to add a non-blank character before the caret. Otherwise, there would
>> be ambiguity between underline (e.g., _under_) and subscript (_under). And
>> superscript syntax follows subscript's. [1]
>>
>> That makes sense to me as a default [2], given that so many org-mode users
>> use both in math, science, and literate coding context, so I wouldn't think
>> to suggest it to be changed.  All I want to know is how I can change it for
>> *me*.
>>
>> I would like to org-toggle-pretty-entities in a buffer and see superscript
>> before, say, a poetry line or Bible verse I'm quoting in a note or journal
>> entry, and not see the non-blank character.
>>
>> Can this be done via customize or with an Elisp snippet in init.el?
>>
>> Thanks!
>>
>> [1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg01022.html
>>
>> [2] Though I wish it were made explicit in the manuals
>> https://orgmode.org/manual/Subscripts-and-Superscripts.html#Subscripts-and-Superscripts
>> (Org Mode 9 Reference Manual p 132). It took me a while to figure out why
>> it wasn't working at all.
>>
>>
>>


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

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

end of thread, other threads:[~2020-07-15 23:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11  0:33 Superscript and non-blank character Bo Grimes
2020-07-14 11:51 ` ian martins
2020-07-15 23:40   ` Bo Grimes

Code repositories for project(s) associated with this 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).