Re: [O] Extract source code /with/ captions

2014-01-17 Thread James Harkins
Nick Dokos ndokos at gmail.com writes: Try: --8---cut here---start-8--- (defun hjh-print-src-blocks () Iterate src blocks from org-element and print them to *Messages*. (interactive) (let ((tree (org-element-parse-buffer))) (org-element-map tree

Re: [O] Extract source code /with/ captions

2014-01-17 Thread James Harkins
For posterity, this is doing what I want. It's with some shock that I note, I'm actually starting to understand LISP. hjh (defun hjh-get-string-from-nested-thing (thing) Peel off 'car's from a nested list until the car is a string. (while (and thing (not (stringp thing))) (setq thing

Re: [O] Extract source code /with/ captions

2014-01-13 Thread Nick Dokos
James Harkins jamshar...@gmail.com writes: ELEMENT: (((#(25% coin toss in SuperCollider 0 30 (:parent #2) This is correct, and I also see that I can use (plist-get ... :value) to get the code string. Here, I'm hung up on some (large?) gaps in my elisp knowledge. I have no idea what

Re: [O] Extract source code /with/ captions

2014-01-13 Thread Nick Dokos
[I sent a follow-up that has not shown up yet(?) but perhaps this is more useful in any case] James Harkins jamshar...@gmail.com writes: ELEMENT: (((#(25% coin toss in SuperCollider 0 30 (:parent #2) This is correct, and I also see that I can use (plist-get ... :value) to get the code

Re: [O] Extract source code /with/ captions

2014-01-13 Thread Nick Dokos
Nick Dokos ndo...@gmail.com writes: James Harkins jamshar...@gmail.com writes: ELEMENT: (((#(25% coin toss in SuperCollider 0 30 (:parent #2) This is correct, and I also see that I can use (plist-get ... :value) to get the code string. Here, I'm hung up on some (large?) gaps in my

[O] Extract source code /with/ captions

2014-01-12 Thread James Harkins
I'm working on a set of Beamer presentations with a bunch of source code blocks. I would like to collect all the blocks into one text file per presentation, but I also need the captions and ideally a numeric index. That is, I'm *not* looking for the normal behavior of org-babel-tangle, which

Re: [O] Extract source code /with/ captions

2014-01-12 Thread John Kitchin
I think I have done something like that before. What I did was make it so each code block would be written out to a file, e.g. course-notes/script-%d.py and a link would be put in the exported pdf right after that block. I do not know how you could get the captions though. In the header I have

Re: [O] Extract source code /with/ captions

2014-01-12 Thread Charles Berry
James Harkins jamshark70 at gmail.com writes: I'm working on a set of Beamer presentations with a bunch of source code blocks. I would like to collect all the blocks into one text file per presentation, but I also need the captions and ideally a numeric index. [deleted] So, for

Re: [O] Extract source code /with/ captions

2014-01-12 Thread James Harkins
On Monday, January 13, 2014 1:19:28 AM HKT, John Kitchin wrote: I think I have done something like that before. What I did was make it so each code block would be written out to a file, e.g. course-notes/script-%d.py and a link would be put in the exported pdf right after that block. I do not