From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: example filter for code blocks? Date: Wed, 25 Sep 2013 20:03:10 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1c8f27302f004e73e1854 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOz34-0003TR-MX for emacs-orgmode@gnu.org; Wed, 25 Sep 2013 20:03:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOz33-0007B7-1t for emacs-orgmode@gnu.org; Wed, 25 Sep 2013 20:03:14 -0400 Received: from mail-pd0-x22a.google.com ([2607:f8b0:400e:c02::22a]:56496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOz32-0007B1-PJ for emacs-orgmode@gnu.org; Wed, 25 Sep 2013 20:03:12 -0400 Received: by mail-pd0-f170.google.com with SMTP id x10so360161pdj.1 for ; Wed, 25 Sep 2013 17:03:11 -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: emacs-orgmode@gnu.org --e89a8ff1c8f27302f004e73e1854 Content-Type: text/plain; charset=ISO-8859-1 Hi everyone, I have an idea for putting links in a pdf that would open python code blocks in an editor. To do that, I need to modify what happens when an org-file is published to latex. Essentially I want it to do exactly what it already does in terms of running pygments, and making nicely formatted and syntax highlighted code blocks and output. After that though, I want to tangle the code block to a file in a directory, and insert a new link after the rendered code block. I would prefer not to have to put :tangle headings in each code block because there are many (e.g. hundreds) of them in course notes. It would be sufficient if they were just sequentially numbered as dir/1.py, dir/2.py, etc... and it is fine if these get overwritten on each export. the link that would go after the code block in the latex export would be something like: \LaunchPython{dir/1.py}{Open code} Then clicking on it would open dir/1.py in whatever editor your system is configured for. \LaunchPython is a newcommand I have defined that works already. It seems like the new export engine should make this easy to do, but I am not sure where to start. Could anyone point me to a starting place? Thanks! John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu --e89a8ff1c8f27302f004e73e1854 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi everyone,

I have an idea for putting links in a pdf that would open python code bl= ocks in an editor. To do that, I need to modify what happens when an org-fi= le is published to latex.

Essentially I want it to do exactly what it already does in terms= of running pygments, and making nicely formatted and syntax highlighted co= de blocks and output.

After that though, I want to tangle the= code block to a file in a directory, and insert a new link after the rende= red code block. I would prefer not to have to put :tangle headings in each = code block because there are many (e.g. hundreds) of them in course notes. = It would be sufficient if they were just sequentially numbered as dir/1.py,= dir/2.py, etc... and it is fine if these get overwritten on each export.
the link that would go after the code block in the latex export w= ould be something like:
\LaunchPython{dir/1.py}{Open code}

=
Then clicking on it would open dir/1.py in whatever editor your syste= m is configured for. \LaunchPython is a newcommand I have defined that work= s already.

It seems like the new export engine should make this easy to do, = but I am not sure where to start. Could anyone point me to a starting place= ? Thanks!


John

-----------------------------------
John Kitchin
Ass= ociate Professor
Doherty Hall A207F
Department of Chemical Engineerin= g
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitc= hingroup.cheme.cmu.edu

--e89a8ff1c8f27302f004e73e1854--