From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: Re: Orthogonality of blocks Date: Wed, 28 Dec 2011 00:14:18 +0000 Message-ID: References: <4EFA208B.6040905@gmail.com> <87zkedkaz5.fsf@gmx.com> <4EFA34C0.3000200@christianmoe.com> <7612.1325028604@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf307f375e82440604b51be143 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rfh9x-0000eI-Ol for emacs-orgmode@gnu.org; Tue, 27 Dec 2011 19:14:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rfh9w-0006cj-8A for emacs-orgmode@gnu.org; Tue, 27 Dec 2011 19:14:21 -0500 Received: from mail-vw0-f41.google.com ([209.85.212.41]:47344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rfh9w-0006ca-4w for emacs-orgmode@gnu.org; Tue, 27 Dec 2011 19:14:20 -0500 Received: by vbbfn1 with SMTP id fn1so11135487vbb.0 for ; Tue, 27 Dec 2011 16:14:19 -0800 (PST) In-Reply-To: <7612.1325028604@alphaville.dokosmarshall.org> 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: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org, mail@christianmoe.com, Eric Schulte , Charles Turner --20cf307f375e82440604b51be143 Content-Type: text/plain; charset=ISO-8859-1 Hi, just want to point out, there is orgs beamer support which can easily place blocks side by side. Worg has a tutorial about this. Torsten On Dec 28, 2011 8:30 AM, "Nick Dokos" wrote: > 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 > > --20cf307f375e82440604b51be143 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Hi,
just want to point out, there is orgs beamer support which can easily place= blocks side by side.
Worg has a tutorial about this.
Torsten

On Dec 28, 2011 8:30 AM, "Nick Dokos" = <nicholas.dokos@hp.com> = wrote:
Christian Moe <mail@christianmo= e.com> wrote:

> On 12/27/11 9:37 PM, Eric Schulte wrote:
> > Charles Turner<chturne@gm= ail.com> =A0writes:
> >
> >> 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 co= ntent
> > is displayed on the page. =A0The "display" css style wo= uld be relevant
> > here.
>
> Yes,
>
> =A0 =A0pre.src {display: table-cell;}
>
> will do it in HTML. Full example follows below. I'll leave LaTeX t= o
> 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: <style>pre.src {display: table-cell;}</style>

How to say hello in two languages:

#+LaTeX: \begin{minipage}[t]{2.5in}
#+begin_src perl :results output
=A0 # Perl
=A0 sub say_hello {
=A0 =A0 =A0 print "Hello, world";
=A0 }

=A0 say_hello;
#+end_src
#+LaTeX: \end{minipage}\begin{minipage}[t]{2.5in}
#+begin_src python :results output
=A0 # Python
=A0 def say_hello():
=A0 =A0 =A0 print("Hello, world")

=A0 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: <style>pre.src {display: table-cell;}</style>
>
> How to say hello in two languages:
>
> #+begin_src perl :results output
> =A0 =A0# Perl
> =A0 =A0sub say_hello {
> =A0 =A0 =A0 =A0print "Hello, world";
> =A0 =A0}
>
> =A0 =A0say_hello;
> #+end_src
> #+begin_src python :results output
> =A0 =A0# Python
> =A0 =A0def say_hello():
> =A0 =A0 =A0 =A0print("Hello, world")
>
> =A0 =A0say_hello()
> #+end_src

--20cf307f375e82440604b51be143--