From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Export tables as matrices (change tbl-export function on the fly) Date: Wed, 14 Nov 2012 15:49:47 +0100 Message-ID: <877gpojl2s.fsf@pank.iue.private> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYeI1-0008CE-7k for emacs-orgmode@gnu.org; Wed, 14 Nov 2012 09:50:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYeHx-0004TW-K6 for emacs-orgmode@gnu.org; Wed, 14 Nov 2012 09:50:04 -0500 Received: from plane.gmane.org ([80.91.229.3]:57439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYeHw-0004Rj-VN for emacs-orgmode@gnu.org; Wed, 14 Nov 2012 09:50:01 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TYeI4-0007VU-I7 for emacs-orgmode@gnu.org; Wed, 14 Nov 2012 15:50:08 +0100 Received: from dynamic-adsl-94-34-248-127.clienti.tiscali.it ([94.34.248.127]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Nov 2012 15:50:08 +0100 Received: from rasmus by dynamic-adsl-94-34-248-127.clienti.tiscali.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Nov 2012 15:50:08 +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, I'm doing some stuff where the natural output of my tables are matrices. I found a decent translation function here ¹. However, I'm not very successful in making org use it. I tried to add #+begin_src org * heading :PROPERTIES: :TABLE_EXPORT_FORMAT: orgtbl-to-latex-matrix :END: #+end src to the relevant section of my document, but this does not seem to be the correct usage. I also tried to radio tables. The problem is that when I do #+NAME: P #+ORGTBL: SEND P orgtbl-to-latex-matrix |1| I cannot send P to R/Octave. When I swap the ORGTBL and NAME around, I can't send it to a radio table. I also tried with TBLNAME. Anyway, the optimal would be to have Org just use a different translation mechanism on the fly. Is that possible? Thanks, Rasmus Footnotes:  ¹ http://www.patokeefe.com/archives/742 #+begin_src emacs-lisp (defun orgtbl-to-latex-matrix (table params) "Convert the Orgtbl mode TABLE to a LaTeX Matrix." (interactive) (let* ((params2 (list :tstart (concat "\\[\n\\begin{bmatrix}") :tend "\\end{bmatrix}\n\\]" :lstart "" :lend " \\\\" :sep " & " :efmt "%s\\,(%s)" :hline "\\hline"))) (orgtbl-to-generic table (org-combine-plists params2 params)))) (defcustom orgtbl-latex-matrix-string "% BEGIN RECEIVE ORGTBL %n % END RECEIVE ORGTBL %n \\begin{comment} #+ORGTBL: SEND %n orgtbl-to-latex-matrix :splice nil :skip 0 \\end{comment}\n" "Template for the latex matrix orgtbl translator All occurrences of %n in a template will be replaced with the name of the table, obtained by prompting the user." :type 'string :group 'org-table) #+end_src -- C is for Cookie