From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: inline Babel calls in math environments and table cells Date: Mon, 11 Mar 2013 15:26:11 -0600 Message-ID: <8738w1fx1o.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFAOk-0001am-6k for emacs-orgmode@gnu.org; Mon, 11 Mar 2013 17:36:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFAEY-0002ZB-NW for emacs-orgmode@gnu.org; Mon, 11 Mar 2013 17:26:21 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]:45912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFAEY-0002YT-DI for emacs-orgmode@gnu.org; Mon, 11 Mar 2013 17:26:14 -0400 Received: by mail-pb0-f42.google.com with SMTP id xb4so4205699pbc.1 for ; Mon, 11 Mar 2013 14:26:13 -0700 (PDT) In-Reply-To: (Jay Kerns's message of "Mon, 11 Mar 2013 16:54:33 -0400") 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: Jay Kerns Cc: Org Mode List Jay Kerns writes: > Greetings, > > I am in the process of updating materials to the new exporter in > anticipation of Org 8.0. It appears that inline SRC blocks are not > being evaluated in table cells and math environments in the new > exporter, for instance, something like this: > > \( SRC_R[:exports results]{2+3} \) > > or like this: > > | SRC_R[:exports results]{2+3} | > > Is the above intentional? I am reading the Org Syntax document and it > looks like inline Babel calls are "objects". It also looks like the > pair \(...\) is a "LaTeX fragment" (also an object). At the beginning > of the section it says, "Most objects cannot contain objects." And it > also says right above that, "Objects can be found in... table cells." > If my reading of the syntax is correct then it would look like the > latter example is meant to be supported while the former example is > not. > > Am I reading that correctly? > > Thank you, Hi Jay, This sounds like a question about the new exporter which is beyond my ken. However, code blocks may be called from Org-mode tables, using the `sbe' [1] macro. Hope this helps, Footnotes: [1] ,----[sbe] | sbe is a Lisp macro in `ob-table.el'. | | (sbe SOURCE-BLOCK &rest VARIABLES) | | Return the results of calling SOURCE-BLOCK with VARIABLES. | Each element of VARIABLES should be a two | element list, whose first element is the name of the variable and | second element is a string of its value. The following call to | `sbe' would be equivalent to the following source code block. | | (sbe 'source-block (n $2) (m 3)) | | #+begin_src emacs-lisp :var results=source-block(n=val_at_col_2, m=3) :results silent | results | #+end_src | | NOTE: by default string variable names are interpreted as | references to source-code blocks, to force interpretation of a | cell's value as a string, prefix the identifier a "$" (e.g., | "$$2" instead of "$2" or "$@2$2" instead of "@2$2"). | | NOTE: it is also possible to pass header arguments to the code | block. In this case a table cell should hold the string value of | the header argument which can then be passed before all variables | as shown in the example below. | | | 1 | 2 | :file nothing.png | nothing.png | | #+TBLFM: @1$4='(sbe test-sbe $3 (x $1) (y $2)) | | [back] `---- -- Eric Schulte http://cs.unm.edu/~eschulte