From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Berry Subject: Re: Adding export option for babel language Date: Thu, 8 May 2014 16:17:23 +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 ([2001:4830:134:3::10]:46079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiR0w-0002hh-95 for emacs-orgmode@gnu.org; Thu, 08 May 2014 12:17:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiR0q-0001g2-H3 for emacs-orgmode@gnu.org; Thu, 08 May 2014 12:17:42 -0400 Received: from plane.gmane.org ([80.91.229.3]:38661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiR0q-0001fq-AO for emacs-orgmode@gnu.org; Thu, 08 May 2014 12:17:36 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WiR0n-0002m2-Km for emacs-orgmode@gnu.org; Thu, 08 May 2014 18:17:33 +0200 Received: from 172-7-166-26.lightspeed.sndgca.sbcglobal.net ([172.7.166.26]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 May 2014 18:17:33 +0200 Received: from ccberry by 172-7-166-26.lightspeed.sndgca.sbcglobal.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 May 2014 18:17:33 +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 Ken Mankoff gmail.com> writes: > > > I'd like to add support for PythonTeX to Org Babel > https://github.com/gpoore/pythontex > > The motivation is that PythonTeX is a better literate environment than > just Org + Babel, because it can print results inline just like an > interactive Python session, instead of all the code followed by all the > results. > > This is just a modification to the existing LaTeX export for python, it > is not support for a new language. I'm new to Org development and seek > advice how to begin approaching the solution. > > I'd like the python code blocks to behave just as they do now, but if I > have set (setq org-latex-listings 'pythontex) instead of (setq > org-latex-listings 'minted), then instead of wrapping python code blocks > with: > > \begin{minted}[]{python} > x+2 > print x > \end{minted} > > It should wrap them with > > \begin{pyconsole} > x+2 > print x > \end{pyconsole} > A quick-and-dirty approach to do just that much would be to write an export filter for `src-block' and maybe `inline-src-block', see (info "(org) Advanced configuration") http://orgmode.org/worg/dev/org-export-reference.html#filter-system and http://orgmode.org/worg/exporters/filter-markup.html Also, `C-h f org--filter TAB' should give you a buffer of such filter functions (and a couple of false positives) that you might browse. HTH, Chuck