emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* non-math superscripts in LaTeX export
@ 2018-12-17 22:21 Ken Mankoff
  2018-12-17 23:23 ` Ken Mankoff
  2018-12-17 23:45 ` Nicolas Goaziou
  0 siblings, 2 replies; 4+ messages in thread
From: Ken Mankoff @ 2018-12-17 22:21 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

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

Hi,

This file:

Math mode: a\(^{b}\)
Non-math mode: a^{b}
What I'd like: a\textsuperscript{b}

Is exported to this LaTeX code:

Math mode: a\(^{b}\)
Non-math mode: a\(^{\text{b}}\)
What I'd like: a\textsuperscript{b}


When viewing a PDF from that LaTeX source, the first (Math mode) appears correct. The second (non-math) appears correct in the PDF, but I'm not sure it is in the LaTeX source. The third looks correct.


A more severe end-product appearance issue comes downstream. I find Pandoc generates better ODT and DOCX files than Org when the inputs are complicated. When viewing a DOCX generated from the above LaTeX with:

$ pandoc -f LaTeX -i foo.tex -t DOCX -o foo.docx foo.tex

there is a more serious issue: The b power is not attached to the a, so there is an empty box and it looks like this (where ^b is actually raised as a superscript):  a[]^b. Or see attached screenshot.

I've tried toggling #+OPTIONS ^:{} and ^:nil but it doesn't solve this. It seems to me like a^b should export as a\textsuperscript{b}. Do others agree? Or is this a pandoc bug I should be raising in that project?

Thanks,

  -k.



[-- Attachment #2: Screenshot_20181217_142130.png --]
[-- Type: image/png, Size: 13184 bytes --]

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

* Re: non-math superscripts in LaTeX export
  2018-12-17 22:21 non-math superscripts in LaTeX export Ken Mankoff
@ 2018-12-17 23:23 ` Ken Mankoff
  2018-12-17 23:45 ` Nicolas Goaziou
  1 sibling, 0 replies; 4+ messages in thread
From: Ken Mankoff @ 2018-12-17 23:23 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist


I know pandoc is not the Org reference implementation, but digging into this further I noticed that pandoc exports a^{b} from Org to LaTeX the way I expected/hoped Org would:

$ echo "a^{b}" | pandoc -f Org -t latex
a\textsuperscript{b}

  -k.

On 2018-12-17 at 14:21 -0800, Ken Mankoff <mankoff@gmail.com> wrote:
> Hi,
>
> This file:
>
> Math mode: a\(^{b}\)
> Non-math mode: a^{b}
> What I'd like: a\textsuperscript{b}
>
> Is exported to this LaTeX code:
>
> Math mode: a\(^{b}\)
> Non-math mode: a\(^{\text{b}}\)
> What I'd like: a\textsuperscript{b}
>
>
> When viewing a PDF from that LaTeX source, the first (Math mode) appears correct. The second (non-math) appears correct in the PDF, but I'm not sure it is in the LaTeX source. The third looks correct.
>
>
> A more severe end-product appearance issue comes downstream. I find Pandoc generates better ODT and DOCX files than Org when the inputs are complicated. When viewing a DOCX generated from the above LaTeX with:
>
> $ pandoc -f LaTeX -i foo.tex -t DOCX -o foo.docx foo.tex
>
> there is a more serious issue: The b power is not attached to the a, so there is an empty box and it looks like this (where ^b is actually raised as a superscript):  a[]^b. Or see attached screenshot.
>
> I've tried toggling #+OPTIONS ^:{} and ^:nil but it doesn't solve this. It seems to me like a^b should export as a\textsuperscript{b}. Do others agree? Or is this a pandoc bug I should be raising in that project?
>
> Thanks,
>
>   -k.

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

* Re: non-math superscripts in LaTeX export
  2018-12-17 22:21 non-math superscripts in LaTeX export Ken Mankoff
  2018-12-17 23:23 ` Ken Mankoff
@ 2018-12-17 23:45 ` Nicolas Goaziou
  2018-12-18  0:17   ` Ken Mankoff
  1 sibling, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2018-12-17 23:45 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: emacs-orgmode Mailinglist

Hello,

Ken Mankoff <mankoff@gmail.com> writes:

> It seems to me like a^b should export as a\textsuperscript{b}.
> Do others agree?

I think you're right. I changed "ox-latex" to use \textsubscript and
\textsuperscript in master. Could you check the result is correct now?

Thank you.

Regards,

-- 
Nicolas Goaziou

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

* Re: non-math superscripts in LaTeX export
  2018-12-17 23:45 ` Nicolas Goaziou
@ 2018-12-18  0:17   ` Ken Mankoff
  0 siblings, 0 replies; 4+ messages in thread
From: Ken Mankoff @ 2018-12-18  0:17 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode Mailinglist


On 2018-12-17 at 15:45 -0800, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>> It seems to me like a^b should export as a\textsuperscript{b}.
>> Do others agree?
>
> I think you're right. I changed "ox-latex" to use \textsubscript and
> \textsuperscript in master. Could you check the result is correct now?

Seems to work.

I spent ~10 minutes browsing the code before I wrote the list, because I would have liked to submit a patch rather than just a comment/question. After your quick reply I thought "this must have been fairly easy" and I went and looked at the changeset

https://code.orgmode.org/bzg/org-mode/commit/0811af50b49de832b74222189695a09327ef6e6b

I would love to contribute more to this project but am still far from being able to do what you just did there.

Anyway... I'd have a hard time doing my work without Org, and I'm once again reminded that Org is People. Thank you for helping maintain and improve it!

  -k.

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

end of thread, other threads:[~2018-12-18  0:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-17 22:21 non-math superscripts in LaTeX export Ken Mankoff
2018-12-17 23:23 ` Ken Mankoff
2018-12-17 23:45 ` Nicolas Goaziou
2018-12-18  0:17   ` Ken Mankoff

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