From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Orthogonality of blocks Date: Fri, 30 Dec 2011 14:17:13 +0000 Message-ID: <87lipuywie.fsf@ucl.ac.uk> References: <4EFA208B.6040905@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:58862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgdGx-0006Jd-MD for emacs-orgmode@gnu.org; Fri, 30 Dec 2011 09:17:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgdGw-0003Km-P4 for emacs-orgmode@gnu.org; Fri, 30 Dec 2011 09:17:27 -0500 Received: from vscane-b.ucl.ac.uk ([144.82.108.141]:34272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgdGw-0003KM-IK for emacs-orgmode@gnu.org; Fri, 30 Dec 2011 09:17:26 -0500 In-Reply-To: <4EFA208B.6040905@gmail.com> (Charles Turner's message of "Tue, 27 Dec 2011 19:46:19 +0000") 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: Charles Turner Cc: emacs-orgmode@gnu.org Charles Turner writes: > Problem: I have two code blocks (#+BEGIN_SRC .. #+END) and I want to > display them side by side on the page, perhaps within an org table. > > Is this possible? It doesn't seem to be. I think it would be nice to > shove collapsed blocks into org table cells and have them rendered in > the usual fashion with the different exporters. "First-class blocks" > :-) > > Thanks, > Charles. I know you have received answers for both HTML and ODT. This is also possible with latex. One possible solution is as follows: #+begin_src org * Source code blocks arranged horizontally #+latex: \newsavebox{\blockone}\begin{lrbox}{\blockone} #+begin_src octave :exports code :results silent function f(x) y = 2*x; end #+end_src #+latex: \end{lrbox} #+latex: \newsavebox{\blocktwo}\begin{lrbox}{\blocktwo} #+begin_src octave :exports code :results silent a = 10; b = f(a); disp(b) #+end_src #+latex: \end{lrbox} | Function definition | Function use | |---------------------+--------------------| | \usebox{\blockone} | \usebox{\blocktwo} | |---------------------+--------------------| #+end_src I hope this makes sense but basically you save the output of the formatting of the blocks into latex boxes which you later place wherever you want. The side benefit is you can use these blocks more than one... HTH, eric -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1 : using Org-mode version 7.8.02 (release_7.8.02.55.g1870)