From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diogo Ramos Subject: Re: How do I format numbers to an exported table to latex, produced by a code block? Date: Sun, 28 Feb 2016 20:55:47 -0300 Message-ID: <8760x8v18c.fsf@riseup.net> References: <87d1rhvkma.fsf@riseup.net> <87lh65jbo5.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaBEF-0000nA-6d for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 18:58:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaBEB-00063w-Vr for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 18:58:23 -0500 Received: from mx1.riseup.net ([198.252.153.129]:57010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaBEB-00063N-ON for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 18:58:19 -0500 Received: from cotinga.riseup.net (unknown [10.0.1.164]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 4E3071A1DD6 for ; Sun, 28 Feb 2016 23:58:18 +0000 (UTC) In-Reply-To: <87lh65jbo5.fsf@gmx.us> (rasmus@gmx.us's message of "Sun, 28 Feb 2016 12:51:06 +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 >> 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. How do I use `:post'? In the (info "(org) A LaTeX example") node there is the description of `:fmt' and `:efmt' which seem to do what I want but I can't figure out how to use them.