emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to tell Org mode radio table translator not to wrap, Greeks in dollars ($$)
@ 2015-04-04  2:52 Omid
  2015-04-04  5:42 ` William Henney
  2015-04-04  7:57 ` Nicolas Goaziou
  0 siblings, 2 replies; 4+ messages in thread
From: Omid @ 2015-04-04  2:52 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I'm trying to use an Org mode Radio Table in LaTeX according to:

http://orgmode.org/manual/Radio-tables.html
http://orgmode.org/manual/A-LaTeX-example.html#A-LaTeX-example

My Org mode table is representing a matrix containing Greek letters
denoted by LaTeX commands (e.g., \mu). The "radioing" process wraps
these commands in dollars (\mu changes to $\mu$). I'm using `:splice
t' to return only table body lines (without wrapping them in a tabular
environment) to insert the table in my equation and matrix
environments. I tried `:fmt "%s"' hoping that the table fields would
be left untouched, but, no the translator still wraps my \mu's in $$.

Here is an example:

\begin{comment}
#+ORGTBL: SEND Ah-advection orgtbl-to-latex :splice t :skip 0 :fmt "%s"
| 1-\mu |        |        |       |       |
| \mu   | 1-\mu  |        |       |       |
|       | \ddots | \ddots |       |       |
|       |        | \mu    | 1-\mu |       |
|       |        |        | \mu   | 1-\mu |
\end{comment}

with the translated result

\begin{equation}
  \label{eq:Ah-advection}
  A_{h}=
  \begin{bmatrix}
    % BEGIN RECEIVE ORGTBL Ah-advection
1-$\mu$ &  &  &  &  \\
$\mu$ & 1-$\mu$ &  &  &  \\
 & \ddots & \ddots &  &  \\
 &  & $\mu$ & 1-$\mu$ &  \\
 &  &  & $\mu$ & 1-$\mu$ \\
    % END RECEIVE ORGTBL Ah-advection
  \end{bmatrix}
\end{equation}

How can I tell the table translator not to wrap Greeks in $$?

Thanks,

-- 
Omid

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

* Re: How to tell Org mode radio table translator not to wrap, Greeks in dollars ($$)
  2015-04-04  2:52 How to tell Org mode radio table translator not to wrap, Greeks in dollars ($$) Omid
@ 2015-04-04  5:42 ` William Henney
  2015-04-04 18:30   ` Omid
  2015-04-04  7:57 ` Nicolas Goaziou
  1 sibling, 1 reply; 4+ messages in thread
From: William Henney @ 2015-04-04  5:42 UTC (permalink / raw)
  To: Omid; +Cc: emacs-org

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

Hi Omid

It looks like orgtbl-to-latex is calling org-export-string-as on each table
cell, which is presumably what is wrapping each \mu inside $$.   This seems
wrong-headed to me, but I can't say I really understand what the code is
trying to achieve.

A workaround would be to directly use orgtbl-to-generic instead. Just
replace your ORGTBL line with

#+ORGTBL: SEND Ah-advection orgtbl-to-generic :splice t :skip 0 :lend "
\\\\" :sep " & "

Will


On Fri, Apr 3, 2015 at 8:52 PM, Omid <omidlink@gmail.com> wrote:

> Hello,
>
> I'm trying to use an Org mode Radio Table in LaTeX according to:
>
> http://orgmode.org/manual/Radio-tables.html
> http://orgmode.org/manual/A-LaTeX-example.html#A-LaTeX-example
>
> My Org mode table is representing a matrix containing Greek letters
> denoted by LaTeX commands (e.g., \mu). The "radioing" process wraps
> these commands in dollars (\mu changes to $\mu$). I'm using `:splice
> t' to return only table body lines (without wrapping them in a tabular
> environment) to insert the table in my equation and matrix
> environments. I tried `:fmt "%s"' hoping that the table fields would
> be left untouched, but, no the translator still wraps my \mu's in $$.
>
> Here is an example:
>
> \begin{comment}
> #+ORGTBL: SEND Ah-advection orgtbl-to-latex :splice t :skip 0 :fmt "%s"
> | 1-\mu |        |        |       |       |
> | \mu   | 1-\mu  |        |       |       |
> |       | \ddots | \ddots |       |       |
> |       |        | \mu    | 1-\mu |       |
> |       |        |        | \mu   | 1-\mu |
> \end{comment}
>
> with the translated result
>
> \begin{equation}
>   \label{eq:Ah-advection}
>   A_{h}=
>   \begin{bmatrix}
>     % BEGIN RECEIVE ORGTBL Ah-advection
> 1-$\mu$ &  &  &  &  \\
> $\mu$ & 1-$\mu$ &  &  &  \\
>  & \ddots & \ddots &  &  \\
>  &  & $\mu$ & 1-$\mu$ &  \\
>  &  &  & $\mu$ & 1-$\mu$ \\
>     % END RECEIVE ORGTBL Ah-advection
>   \end{bmatrix}
> \end{equation}
>
> How can I tell the table translator not to wrap Greeks in $$?
>
> Thanks,
>
> --
> Omid
>
>


-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

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

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

* Re: How to tell Org mode radio table translator not to wrap, Greeks in dollars ($$)
  2015-04-04  2:52 How to tell Org mode radio table translator not to wrap, Greeks in dollars ($$) Omid
  2015-04-04  5:42 ` William Henney
@ 2015-04-04  7:57 ` Nicolas Goaziou
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2015-04-04  7:57 UTC (permalink / raw)
  To: Omid; +Cc: emacs-orgmode

Hello,

Omid <omidlink@gmail.com> writes:

> I'm trying to use an Org mode Radio Table in LaTeX according to:
>
> http://orgmode.org/manual/Radio-tables.html
> http://orgmode.org/manual/A-LaTeX-example.html#A-LaTeX-example
>
> My Org mode table is representing a matrix containing Greek letters
> denoted by LaTeX commands (e.g., \mu). The "radioing" process wraps
> these commands in dollars (\mu changes to $\mu$). I'm using `:splice
> t' to return only table body lines (without wrapping them in a tabular
> environment) to insert the table in my equation and matrix
> environments. I tried `:fmt "%s"' hoping that the table fields would
> be left untouched, but, no the translator still wraps my \mu's in $$.
>
> Here is an example:
>
> \begin{comment}
> #+ORGTBL: SEND Ah-advection orgtbl-to-latex :splice t :skip 0 :fmt "%s"
> | 1-\mu |        |        |       |       |
> | \mu   | 1-\mu  |        |       |       |
> |       | \ddots | \ddots |       |       |
> |       |        | \mu    | 1-\mu |       |
> |       |        |        | \mu   | 1-\mu |
> \end{comment}
>
> with the translated result
>
> \begin{equation}
>   \label{eq:Ah-advection}
>   A_{h}=
>   \begin{bmatrix}
>     % BEGIN RECEIVE ORGTBL Ah-advection
> 1-$\mu$ &  &  &  &  \\
> $\mu$ & 1-$\mu$ &  &  &  \\
>  & \ddots & \ddots &  &  \\
>  &  & $\mu$ & 1-$\mu$ &  \\
>  &  &  & $\mu$ & 1-$\mu$ \\
>     % END RECEIVE ORGTBL Ah-advection
>   \end{bmatrix}
> \end{equation}
>
> How can I tell the table translator not to wrap Greeks in $$?

If you use the development version (Org 8.3), this is done using ":raw
t" parameter.

Regards,

-- 
Nicolas Goaziou

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

* Re: How to tell Org mode radio table translator not to wrap, Greeks in dollars ($$)
  2015-04-04  5:42 ` William Henney
@ 2015-04-04 18:30   ` Omid
  0 siblings, 0 replies; 4+ messages in thread
From: Omid @ 2015-04-04 18:30 UTC (permalink / raw)
  To: William Henney; +Cc: emacs-org

Thank you, Will.
Your workaround solves the problem. And when 8.3 goes to MELPA stable,
we can use ":raw t" that was suggested by Nicolas Goaziou.)

Omid

On 04/04/2015 01:42 AM, William Henney wrote:
> Hi Omid
> 
> It looks like orgtbl-to-latex is calling org-export-string-as on each
> table cell, which is presumably what is wrapping each \mu inside $$.  
> This seems wrong-headed to me, but I can't say I really understand what
> the code is trying to achieve.  
> 
> A workaround would be to directly use orgtbl-to-generic instead. Just
> replace your ORGTBL line with 
> 
> #+ORGTBL: SEND Ah-advection orgtbl-to-generic :splice t :skip 0 :lend "
> \\\\" :sep " & "
> 
> Will
> 
> 
> On Fri, Apr 3, 2015 at 8:52 PM, Omid <omidlink@gmail.com
> <mailto:omidlink@gmail.com>> wrote:
> 
>     Hello,
> 
>     I'm trying to use an Org mode Radio Table in LaTeX according to:
> 
>     http://orgmode.org/manual/Radio-tables.html
>     http://orgmode.org/manual/A-LaTeX-example.html#A-LaTeX-example
> 
>     My Org mode table is representing a matrix containing Greek letters
>     denoted by LaTeX commands (e.g., \mu). The "radioing" process wraps
>     these commands in dollars (\mu changes to $\mu$). I'm using `:splice
>     t' to return only table body lines (without wrapping them in a tabular
>     environment) to insert the table in my equation and matrix
>     environments. I tried `:fmt "%s"' hoping that the table fields would
>     be left untouched, but, no the translator still wraps my \mu's in $$.
> 
>     Here is an example:
> 
>     \begin{comment}
>     #+ORGTBL: SEND Ah-advection orgtbl-to-latex :splice t :skip 0 :fmt "%s"
>     | 1-\mu |        |        |       |       |
>     | \mu   | 1-\mu  |        |       |       |
>     |       | \ddots | \ddots |       |       |
>     |       |        | \mu    | 1-\mu |       |
>     |       |        |        | \mu   | 1-\mu |
>     \end{comment}
> 
>     with the translated result
> 
>     \begin{equation}
>       \label{eq:Ah-advection}
>       A_{h}=
>       \begin{bmatrix}
>         % BEGIN RECEIVE ORGTBL Ah-advection
>     1-$\mu$ &  &  &  &  \\
>     $\mu$ & 1-$\mu$ &  &  &  \\
>      & \ddots & \ddots &  &  \\
>      &  & $\mu$ & 1-$\mu$ &  \\
>      &  &  & $\mu$ & 1-$\mu$ \\
>         % END RECEIVE ORGTBL Ah-advection
>       \end{bmatrix}
>     \end{equation}
> 
>     How can I tell the table translator not to wrap Greeks in $$?
> 
>     Thanks,
> 
>     --
>     Omid
> 
> 
> 
> 
> -- 
> 
>   Dr William Henney, Centro de Radioastronomía y Astrofísica,
>   Universidad Nacional Autónoma de México, Campus Morelia

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

end of thread, other threads:[~2015-04-04 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-04  2:52 How to tell Org mode radio table translator not to wrap, Greeks in dollars ($$) Omid
2015-04-04  5:42 ` William Henney
2015-04-04 18:30   ` Omid
2015-04-04  7:57 ` 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).