From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Orthogonality of blocks Date: Tue, 27 Dec 2011 18:30:04 -0500 Message-ID: <7612.1325028604@alphaville.dokosmarshall.org> References: <4EFA208B.6040905@gmail.com> <87zkedkaz5.fsf@gmx.com> <4EFA34C0.3000200@christianmoe.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RfgTE-0005SL-HH for emacs-orgmode@gnu.org; Tue, 27 Dec 2011 18:30:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RfgTC-00081r-KL for emacs-orgmode@gnu.org; Tue, 27 Dec 2011 18:30:12 -0500 Received: from g1t0026.austin.hp.com ([15.216.28.33]:24940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RfgTC-000811-EU for emacs-orgmode@gnu.org; Tue, 27 Dec 2011 18:30:10 -0500 In-Reply-To: Message from Christian Moe of "Tue, 27 Dec 2011 22:12:32 +0100." <4EFA34C0.3000200@christianmoe.com> 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: mail@christianmoe.com Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org, Eric Schulte , Charles Turner Christian Moe wrote: > On 12/27/11 9:37 PM, Eric Schulte wrote: > > 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. > (...) > > Note that what you describe is likely possible using the existing > > exporter and writing some custom CSS to control how the serial content > > is displayed on the page. The "display" css style would be relevant > > here. > > Yes, > > pre.src {display: table-cell;} > > will do it in HTML. Full example follows below. I'll leave LaTeX to > those in the know... > Here's one (rather less elegant than Christian's CSS magic) way that preserves the HTML behavior: --8<---------------cut here---------------start------------->8--- #+author: Christian Moe #+title: Side by side code blocks #+style: How to say hello in two languages: #+LaTeX: \begin{minipage}[t]{2.5in} #+begin_src perl :results output # Perl sub say_hello { print "Hello, world"; } say_hello; #+end_src #+LaTeX: \end{minipage}\begin{minipage}[t]{2.5in} #+begin_src python :results output # Python def say_hello(): print("Hello, world") say_hello() #+end_src #+LaTeX: \end{minipage} --8<---------------cut here---------------end--------------->8--- Anybody for ODT? while preserving the HTML and LaTeX behavior? :-) BTW, I use minted - I hope it works with listings but I have not tried it. Nick > hth, > Christian > > --- > > #+title: Side by side code blocks > #+style: > > How to say hello in two languages: > > #+begin_src perl :results output > # Perl > sub say_hello { > print "Hello, world"; > } > > say_hello; > #+end_src > #+begin_src python :results output > # Python > def say_hello(): > print("Hello, world") > > say_hello() > #+end_src