[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] How do I format numbers to an exported table to latex, produced
From: |
Rasmus |
Subject: |
Re: [O] How do I format numbers to an exported table to latex, produced by a code block? |
Date: |
Sun, 28 Feb 2016 12:51:06 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Hi,
Diogo Ramos <address@hidden> writes:
> I have the following org file:
>
> #+BEGIN_SRC python :exports both
> import numpy as np
>
> return np.matrix([[.123456789, 2], [3, 4]])
> #+END_SRC
>
> #+RESULTS:
> | 0.12345679 | 2 |
> | 3 | 4 |
>
> I want to export it to latex to produce a pdf but I want to format the
> numbers of the table so I get, say
>
> | 123.456e-3 | 2.000 |
> | 3.000 | 4.000 |
>
> on the exported pdf.
>
> How can I do it?
tblfm allows a printf descriptions. E.g.
| 0.120 | 2.000 |
| 3.000 | 4.000 |
#+tblfm: $1=$1;%.3f :: $2=$2;%.3f
You can attach it via :post.
There are probably also other ways.
Rasmus
--
To err is human. To screw up 10⁶ times per second, you need a computer