emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* superscript without base
@ 2015-03-19 12:15 Andreas Leha
  2015-03-19 12:51 ` John Kitchin
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Leha @ 2015-03-19 12:15 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

quick question: What is the syntax of superscripts without a 'base
character'?

I tried to use ^{foo} and {}^{foo} which both do not produce what I
expect in the latex export.

\nbsp^{foo} comes close.

Best,
Andreas

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

* Re: superscript without base
  2015-03-19 12:15 superscript without base Andreas Leha
@ 2015-03-19 12:51 ` John Kitchin
  2015-03-19 13:13   ` Rasmus
  2015-03-19 13:21   ` Andreas Leha
  0 siblings, 2 replies; 9+ messages in thread
From: John Kitchin @ 2015-03-19 12:51 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode


I suppose $^{foo}$ will do what you want. you may need some additional
\mathrm command if you do not want math fonts.

or maybe try \textsuperscript{foo}

(untested)


Andreas Leha writes:

> Hi all,
>
> quick question: What is the syntax of superscripts without a 'base
> character'?
>
> I tried to use ^{foo} and {}^{foo} which both do not produce what I
> expect in the latex export.
>
> \nbsp^{foo} comes close.
>
> Best,
> Andreas

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

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

* Re: superscript without base
  2015-03-19 12:51 ` John Kitchin
@ 2015-03-19 13:13   ` Rasmus
  2015-03-19 13:30     ` Andreas Leha
  2015-03-19 13:21   ` Andreas Leha
  1 sibling, 1 reply; 9+ messages in thread
From: Rasmus @ 2015-03-19 13:13 UTC (permalink / raw)
  To: emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> or maybe try \textsuperscript{foo}

This would work in at least KOMA-Script.

Check org-match-substring-regexp.  As you see at subscripts must start
with something that's not a space.  So I guess you could use a filter to
remove some otherwise unused character or the the like...  Or change the
the syntax table changed so that zero width space is somehow not an \s,
but that's probably asking for trouble.

—Rasmus


-- 
In theory, practice and theory are the same. In practice they are not

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

* Re: superscript without base
  2015-03-19 12:51 ` John Kitchin
  2015-03-19 13:13   ` Rasmus
@ 2015-03-19 13:21   ` Andreas Leha
  1 sibling, 0 replies; 9+ messages in thread
From: Andreas Leha @ 2015-03-19 13:21 UTC (permalink / raw)
  To: emacs-orgmode

Hi John,

Thanks a lot for your answer.

John Kitchin <jkitchin@andrew.cmu.edu> writes:
> I suppose $^{foo}$ will do what you want. you may need some additional
> \mathrm command if you do not want math fonts.
>
> or maybe try \textsuperscript{foo}
>
> (untested)
>

These both work (you are right about the math font).  But obviously only
in LaTeX.

I did not say explicitly but I'd prefer a
more backend-agnostic solution.

Best,
Andreas


>
> Andreas Leha writes:
>
>> Hi all,
>>
>> quick question: What is the syntax of superscripts without a 'base
>> character'?
>>
>> I tried to use ^{foo} and {}^{foo} which both do not produce what I
>> expect in the latex export.
>>
>> \nbsp^{foo} comes close.
>>
>> Best,
>> Andreas
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu

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

* Re: superscript without base
  2015-03-19 13:13   ` Rasmus
@ 2015-03-19 13:30     ` Andreas Leha
  2015-03-19 13:34       ` Rasmus
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Leha @ 2015-03-19 13:30 UTC (permalink / raw)
  To: emacs-orgmode

Hi Rasmus,

Rasmus <rasmus@gmx.us> writes:
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> or maybe try \textsuperscript{foo}
>
> This would work in at least KOMA-Script.
>
> Check org-match-substring-regexp.  As you see at subscripts must start
> with something that's not a space.  So I guess you could use a filter to
> remove some otherwise unused character or the the like...  Or change the
> the syntax table changed so that zero width space is somehow not an \s,
> but that's probably asking for trouble.
>

Thanks for the answer.  So, there is no easy way out.  I think I'll
stick to the \nbsp version, then.  Although introducing some character
that will be removed during export through a filter might be handy in
other cases, too.  I'll think about it.

Thanks,
Andreas

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

* Re: superscript without base
  2015-03-19 13:30     ` Andreas Leha
@ 2015-03-19 13:34       ` Rasmus
  2015-03-19 13:46         ` Andreas Leha
  0 siblings, 1 reply; 9+ messages in thread
From: Rasmus @ 2015-03-19 13:34 UTC (permalink / raw)
  To: emacs-orgmode

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> Thanks for the answer.  So, there is no easy way out.  I think I'll
> stick to the \nbsp version, then.  Although introducing some character
> that will be removed during export through a filter might be handy in
> other cases, too.  I'll think about it.

Why not make a \zwsp that inserts a zero width space?  You can also use a
macro like {{{script(^whatever)}}} that expands to your liking.

—Rasmus

-- 
Together we will make the possible totalllly impossible!

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

* Re: superscript without base
  2015-03-19 13:34       ` Rasmus
@ 2015-03-19 13:46         ` Andreas Leha
  2015-03-19 14:08           ` Rasmus
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Leha @ 2015-03-19 13:46 UTC (permalink / raw)
  To: emacs-orgmode

Hi Rasmus,

Rasmus <rasmus@gmx.us> writes:
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> Thanks for the answer.  So, there is no easy way out.  I think I'll
>> stick to the \nbsp version, then.  Although introducing some character
>> that will be removed during export through a filter might be handy in
>> other cases, too.  I'll think about it.
>
> Why not make a \zwsp that inserts a zero width space?

Because I did not know about \zwsp.  But also, \zwsp is exported
literally to html, as my first quick test shows.

> You can also use a
> macro like {{{script(^whatever)}}} that expands to your liking.
>

I am not sure what you are suggesting here.

Best,
Andreas

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

* Re: superscript without base
  2015-03-19 13:46         ` Andreas Leha
@ 2015-03-19 14:08           ` Rasmus
  2015-03-19 20:16             ` Andreas Leha
  0 siblings, 1 reply; 9+ messages in thread
From: Rasmus @ 2015-03-19 14:08 UTC (permalink / raw)
  To: emacs-orgmode

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> Hi Rasmus,
>
> Rasmus <rasmus@gmx.us> writes:
>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>
>>> Thanks for the answer.  So, there is no easy way out.  I think I'll
>>> stick to the \nbsp version, then.  Although introducing some character
>>> that will be removed during export through a filter might be handy in
>>> other cases, too.  I'll think about it.
>>
>> Why not make a \zwsp that inserts a zero width space?
           ^^^^
> Because I did not know about \zwsp.  But also, \zwsp is exported
> literally to html, as my first quick test shows.

_You'd_ have to add it to org-entities-user.

>> You can also use a
>> macro like {{{script(^whatever)}}} that expands to your liking.
>
> I am not sure what you are suggesting here.

E.g.

#+MACRO: sub \nbsp$1
{{{sub(^foo)}}}


-- 
What will be next?

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

* Re: superscript without base
  2015-03-19 14:08           ` Rasmus
@ 2015-03-19 20:16             ` Andreas Leha
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Leha @ 2015-03-19 20:16 UTC (permalink / raw)
  To: emacs-orgmode

Hi Rasmus,

Thanks for your continuing help here.

Rasmus <rasmus@gmx.us> writes:
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> Hi Rasmus,
>>
>> Rasmus <rasmus@gmx.us> writes:
>>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>>
>>>> Thanks for the answer.  So, there is no easy way out.  I think I'll
>>>> stick to the \nbsp version, then.  Although introducing some character
>>>> that will be removed during export through a filter might be handy in
>>>> other cases, too.  I'll think about it.
>>>
>>> Why not make a \zwsp that inserts a zero width space?
>            ^^^^
>> Because I did not know about \zwsp.  But also, \zwsp is exported
>> literally to html, as my first quick test shows.
>
> _You'd_ have to add it to org-entities-user.
>

I see.  This did not occur to me, as the LaTeX export seemed to work
(well, it produced an Undefined control sequence error that I did not
spot).

But it put me on the right (?) track: I now found that both \zwnj and
\shy seem to produce what I want without any need for customization.  I
do not know which one is the bigger hack...

>>> You can also use a
>>> macro like {{{script(^whatever)}}} that expands to your liking.
>>
>> I am not sure what you are suggesting here.
>
> E.g.
>
> #+MACRO: sub \nbsp$1
> {{{sub(^foo)}}}

Thanks for the clarification.  I like the meaningful name (although I'd
go for #+MACRO: sup \zwnj^{$1}).  That even makes up for the syntax
of macros and I'll use that.

Thanks!
Andreas

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

end of thread, other threads:[~2015-03-19 20:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19 12:15 superscript without base Andreas Leha
2015-03-19 12:51 ` John Kitchin
2015-03-19 13:13   ` Rasmus
2015-03-19 13:30     ` Andreas Leha
2015-03-19 13:34       ` Rasmus
2015-03-19 13:46         ` Andreas Leha
2015-03-19 14:08           ` Rasmus
2015-03-19 20:16             ` Andreas Leha
2015-03-19 13:21   ` Andreas Leha

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