From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Berry Subject: Re: Inline code in tables? Date: Fri, 12 Apr 2013 02:26:37 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQThU-0004wy-Qy for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 22:26:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQThT-0000Ql-OI for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 22:26:52 -0400 Received: from plane.gmane.org ([80.91.229.3]:43913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQThT-0000Qa-Dg for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 22:26:51 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UQThP-0000k8-9W for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 04:26:47 +0200 Received: from 137.110.39.194 ([137.110.39.194]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Apr 2013 04:26:47 +0200 Received: from ccberry by 137.110.39.194 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Apr 2013 04:26:47 +0200 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 John Hendy gmail.com> writes: > > On Thu, Apr 11, 2013 at 8:06 PM, Jay Kerns gmail.com> wrote: > > Dear John, > > > > On Thu, Apr 11, 2013 at 6:56 PM, John Hendy gmail.com> wrote: > >> I have a table like so: > > > > Please see the responses by Eric S. and Charles B. in the following thread: > > > > http://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg00832.html > > > > Fantastic and thanks for the link. I *swore* this had just come up, > but wasn't able to find it in my email. That's exactly what I needed. > > So =brew= is accessing the results of a previous session even though > there's no session argument? Or do all R blocks you want to refer to > later with =brew= need to have happened in a persistent session? > John, The session is essential. This was in that thread: * jay's query :PROPERTIES: :session: *R:2* :exports: both :END: so any exports done under that subtree refer to the *R:2* session. ==== I like brew, but another work around goes like this: prefix every table row by 'vert-' (replace-regexp RET ^| RET vert-| RET) Then run this block to define a 'before-parsing' hook for the exporter --8<---------------cut here---------------start------------->8--- #+BEGIN_SRC emacs-lisp :exports none (defun strip-vert (backend) (while (search-forward "vert-|" nil t) (replace-match "|" nil t))) (add-hook 'org-export-before-parsing-hook 'strip-vert) #+END_SRC --8<---------------cut here---------------end--------------->8--- Then under the `table' headline here: --8<---------------cut here---------------start------------->8--- * table :PROPERTIES: :session: *R* :EXPORT_FILE_NAME: test-table :END: #+NAME: r-init #+BEGIN_SRC R :results silent var1 <- "var one" var2 <- "var two" var3 <- "var three" #+END_SRC I have a table like so: vert-| Title | Title | vert-|-------+-------------| vert-| var1 | src_R{var1} | vert-| var2 | src_R{var2} | vert-| var3 | src_R{var3} | --8<---------------cut here---------------end--------------->8--- Type this: C-c C-e C-b C-s l L y y y y y or something similar if the session has not been previously started This does: export body-only subtree latex in-a-buffer and execute each src block and you will get: ,---- | \begin{figure}[H] | \label{r-init} | \begin{verbatim} | var1 <- "var one" | var2 <- "var two" | var3 <- "var three" | \end{verbatim} | \end{figure} | | | | I have a table like so: | \begin{center} | \begin{tabular}{ll} | Title & Title\\ | \hline | var1 & \texttt{var one}\\ | var2 & \texttt{var two}\\ | var3 & \texttt{var three}\\ | \end{tabular} | \end{center} `---- in a buffer. I am not sure why the problem you identify happens. All this happens before the exporter parses anything. Maybe something to do with fancy table usage conflicting with inline babel in tables? HTH, Chuck