From: John Kitchin <jkitchin@andrew.cmu.edu>
To: emacs-orgmode@gnu.org
Subject: example filter for code blocks?
Date: Wed, 25 Sep 2013 20:03:10 -0400 [thread overview]
Message-ID: <CAJ51ETqjsFAnWONKjsk8aszuakFLnuYR9T=JH78j6B88deS0XQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 1795 bytes --]
next reply other threads:[~2013-09-26 0:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-26 0:03 John Kitchin [this message]
2013-09-26 8:40 ` example filter for code blocks? Daniele Pizzolli
2013-09-26 9:04 ` Marcin Borkowski
2013-09-26 12:18 ` Eric Schulte
2013-09-26 18:31 ` Cook, Malcolm
2013-09-26 19:34 ` John Kitchin
-- strict thread matches above, loose matches on Subject: below --
2013-09-26 17:57 John Kitchin
2013-09-26 19:43 ` Thomas S. Dye
2013-09-26 19:48 ` John Kitchin
2013-09-26 20:58 ` Thomas S. Dye
2013-09-27 7:42 ` Sebastien Vauban
2013-09-30 0:33 ` Thomas S. Dye
2013-09-30 0:45 ` John Kitchin
2013-09-30 2:58 ` Thomas S. Dye
2013-09-30 7:34 ` Achim Gratz
2013-09-30 17:48 ` Thomas S. Dye
2013-09-27 12:59 John Kitchin
2013-09-27 15:24 ` Alan Schmitt
2013-09-27 15:34 ` John Kitchin
2013-09-30 7:49 ` Alan Schmitt
2013-09-27 18:44 John Kitchin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ51ETqjsFAnWONKjsk8aszuakFLnuYR9T=JH78j6B88deS0XQ@mail.gmail.com' \
--to=jkitchin@andrew.cmu.edu \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).