From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: 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 Message-ID: <87lh65jbo5.fsf@gmx.us> References: <87d1rhvkma.fsf@riseup.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZzsd-0006yg-L0 for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 06:51:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZzsa-0000Zf-Ff for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 06:51:19 -0500 Received: from plane.gmane.org ([80.91.229.3]:54491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZzsa-0000ZW-8g for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 06:51:16 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aZzsW-0004o0-W6 for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 12:51:13 +0100 Received: from 46.189.28.67 ([46.189.28.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 28 Feb 2016 12:51:12 +0100 Received: from rasmus by 46.189.28.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 28 Feb 2016 12:51:12 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Diogo Ramos 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