emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [patch][ox-latex] context-aware subscript


From: Rasmus
Subject: [O] [patch][ox-latex] context-aware subscript
Date: Sun, 18 Aug 2013 03:29:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi,

Currently one can't write something like \beta_t and get a nice result
in org when exporting to LaTeX (where nice result := $\beta_t$).  This
patch tries to fix it.

Nicolas, you might consider this a "can of worms", but since I'd
already worked on it a while ago I'll try my luck.  I'd appreciate if
you'd let me know something like this would be acceptable before I put
more work into it.

With this patch the following document

--8<---------------cut here---------------start------------->8---
#+TITLE:
#+OPTIONS: toc:nil num:nil
#+LATEX:\Huge
* Math entity
1. \(\alpha\)\(\beta\)\(_\text{t}\)
2.  \(\alpha\)\(\beta\)\(_t\)
3. \alpha\beta_t
4. \alpha\times\beta_t\gamma
5. foo_bar
6. \beta_bar
--8<---------------cut here---------------end--------------->8---

translates to something like

--8<---------------cut here---------------start------------->8---
\begin{enumerate}
\item \(\alpha\)\(\beta\)\(_t\)
\item $\alpha\beta_t$
\item $\alpha$\texttimes{}$\beta_{t\gamma}$
\item foo$_{\text{bar}}$
\item $\beta_{bar}$
\end{enumerate}
--8<---------------cut here---------------end--------------->8---

For the reference, this is the output with the current HEAD

--8<---------------cut here---------------start------------->8---
\begin{enumerate}
\item \(\alpha\)\(\beta\)\(_\text{t}\)
\item \(\alpha\)\(\beta\)\(_t\)
\item $\alpha$$\beta$$_{\text{t}}$
\item $\alpha$\texttimes{}$\beta$$_{\text{t}\gamma}$
\item foo$_{\text{bar}}$
\item $\beta$$_{\text{bar}}$
\end{enumerate}
--8<---------------cut here---------------end--------------->8---

As is evident from the pdf output

  $\alpha$$\beta$$_{\text{t}}$ ≠ $\alpha$$\beta$$_{{t}}$ ≠ $\alpha\beta_{t}$

There seems to be no difference between $\alpha$$\beta$ and
$\alpha\beta$ in the pdf, but the latter is more aesthetically
pleasing in the source.

I (currently) don't see much use in trying to be context aware outside
of the entity case (e.g. \(x\)_t?), but I could be wrong.

–Rasmus

Attachment: 0001-Improved-subscript-handling-in-ox-latex.patch
Description: Text Data


--
Need more coffee. . .

reply via email to

[Prev in Thread] Current Thread [Next in Thread]