From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Adding export option for babel language Date: Wed, 07 May 2014 22:46:07 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiELj-0000cm-AZ for emacs-orgmode@gnu.org; Wed, 07 May 2014 22:46:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiELb-0008UE-7P for emacs-orgmode@gnu.org; Wed, 07 May 2014 22:46:19 -0400 Received: from mail-qa0-x234.google.com ([2607:f8b0:400d:c00::234]:63463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiELb-0008U2-3S for emacs-orgmode@gnu.org; Wed, 07 May 2014 22:46:11 -0400 Received: by mail-qa0-f52.google.com with SMTP id cm18so1969981qab.11 for ; Wed, 07 May 2014 19:46:10 -0700 (PDT) Received: from gorgonzola (cpe-74-71-173-56.nyc.res.rr.com. [74.71.173.56]) by mx.google.com with ESMTPSA id i3sm22524025qgf.14.2014.05.07.19.46.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 May 2014 19:46:10 -0700 (PDT) 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: Org-mode mailing list 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} I found out that the minted export is handled in ox-latex.el, and I assume I could get pythontex support by going through that file and tearing it down and building it back up with pythontex in place of minted, but I also noticed this: ;; Case 2. Custom environment. (custom-env (format "\\begin{%s}\n%s\\end{%s}\n" custom-env (org-export-format-code-default src-block info) custom-env)) Can I take advantage of this code? It seems like this might be the support for Special Blocks http://orgmode.org/worg/org-contrib/org-special-blocks.html But that page says that the code is obsolete. And a special block won't be treated as a python org babel block in the Org file, which is important. Any advice where I should start digging to add pythontex support will be much appreciated. Thanks, -k.