* babel work flow @ 2011-07-13 23:09 Thomas S. Dye 2011-07-14 7:34 ` Sebastien Vauban 0 siblings, 1 reply; 5+ messages in thread From: Thomas S. Dye @ 2011-07-13 23:09 UTC (permalink / raw) To: Org-mode Aloha all, I want to use one of the dot utilities, tred, in a way that preserves my ability to distribute the Org-mode file as reproducible research, i.e., intermediate results should end up in the Org-mode file or be passed along in a chain. Right now I have a python routine that reads a couple of Org-mode tables and outputs a valid dot graph. I'm saving this to a file, dot-temp.gv, and then running some shell commands, like this: #+begin_src sh tred dot-temp.gv > test.gv dot -o test.pdf -Tpdf test.gv open test.pdf #+end_src The graph is just what I want, but I can't see how to automate the process in Org-mode. In particular, the tred step trips me up. Do I have to make babel, tred-aware? Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: babel work flow 2011-07-13 23:09 babel work flow Thomas S. Dye @ 2011-07-14 7:34 ` Sebastien Vauban 2011-07-14 15:53 ` Thomas S. Dye 0 siblings, 1 reply; 5+ messages in thread From: Sebastien Vauban @ 2011-07-14 7:34 UTC (permalink / raw) To: emacs-orgmode-mXXj517/zsQ Hi Thomas, Thomas S. Dye wrote: > I want to use one of the dot utilities, tred, in a way that preserves my > ability to distribute the Org-mode file as reproducible research, i.e., > intermediate results should end up in the Org-mode file or be passed > along in a chain. > > Right now I have a python routine that reads a couple of Org-mode tables > and outputs a valid dot graph. I'm saving this to a file, dot-temp.gv, > and then running some shell commands, like this: > > #+begin_src sh > tred dot-temp.gv > test.gv > dot -o test.pdf -Tpdf test.gv > open test.pdf > #+end_src > > The graph is just what I want, but I can't see how to automate the > process in Org-mode. In particular, the tred step trips me up. Do I > have to make babel, tred-aware? Sorry if I misunderstand, but could you be more explicit (for me) on what the problem is? Why is it a problem for you to have that sh block inside your Org. It is executed automagically upon exporting, no? If yes, why is that not good enough? Best regards, Seb -- Sebastien Vauban ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: babel work flow 2011-07-14 7:34 ` Sebastien Vauban @ 2011-07-14 15:53 ` Thomas S. Dye 2011-07-15 15:36 ` Eric Schulte 0 siblings, 1 reply; 5+ messages in thread From: Thomas S. Dye @ 2011-07-14 15:53 UTC (permalink / raw) To: Sebastien Vauban; +Cc: Org-mode "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes: > Hi Thomas, > > Thomas S. Dye wrote: >> I want to use one of the dot utilities, tred, in a way that preserves my >> ability to distribute the Org-mode file as reproducible research, i.e., >> intermediate results should end up in the Org-mode file or be passed >> along in a chain. >> >> Right now I have a python routine that reads a couple of Org-mode tables >> and outputs a valid dot graph. I'm saving this to a file, dot-temp.gv, >> and then running some shell commands, like this: >> >> #+begin_src sh >> tred dot-temp.gv > test.gv >> dot -o test.pdf -Tpdf test.gv >> open test.pdf >> #+end_src >> >> The graph is just what I want, but I can't see how to automate the >> process in Org-mode. In particular, the tred step trips me up. Do I >> have to make babel, tred-aware? > > Sorry if I misunderstand, but could you be more explicit (for me) on what the > problem is? Why is it a problem for you to have that sh block inside your > Org. It is executed automagically upon exporting, no? If yes, why is that not > good enough? > > Best regards, > Seb Aloha Seb, Yes, babel is working fine and the sh block does its job. The problem is that I like to see intermediate results in the Org-mode file and the sh block works instead with files that reside outside Org-mode. In this particular case, I'd prefer to have dot-temp.gv in a results block in the Org-mode file, and then pass this results block into a source code block where tred can manipulate it, and which returns its results to the Org-mode file. That way, the skeptical inquirer need only consult the Org-mode file to be convinced that tred removed the transitive relations from the digraph. It would be an easy matter to compare the two results blocks. All the best, Tom -- Thomas S. Dye http://www.tsdye.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: babel work flow 2011-07-14 15:53 ` Thomas S. Dye @ 2011-07-15 15:36 ` Eric Schulte 2011-07-15 16:58 ` Thomas S. Dye 0 siblings, 1 reply; 5+ messages in thread From: Eric Schulte @ 2011-07-15 15:36 UTC (permalink / raw) To: Thomas S. Dye; +Cc: Sebastien Vauban, Org-mode tsd@tsdye.com (Thomas S. Dye) writes: > "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes: > >> Hi Thomas, >> >> Thomas S. Dye wrote: >>> I want to use one of the dot utilities, tred, in a way that preserves my >>> ability to distribute the Org-mode file as reproducible research, i.e., >>> intermediate results should end up in the Org-mode file or be passed >>> along in a chain. >>> >>> Right now I have a python routine that reads a couple of Org-mode tables >>> and outputs a valid dot graph. I'm saving this to a file, dot-temp.gv, >>> and then running some shell commands, like this: >>> >>> #+begin_src sh >>> tred dot-temp.gv > test.gv >>> dot -o test.pdf -Tpdf test.gv >>> open test.pdf >>> #+end_src >>> >>> The graph is just what I want, but I can't see how to automate the >>> process in Org-mode. In particular, the tred step trips me up. Do I >>> have to make babel, tred-aware? >> >> Sorry if I misunderstand, but could you be more explicit (for me) on what the >> problem is? Why is it a problem for you to have that sh block inside your >> Org. It is executed automagically upon exporting, no? If yes, why is that not >> good enough? >> >> Best regards, >> Seb > > Aloha Seb, > > Yes, babel is working fine and the sh block does its job. > > The problem is that I like to see intermediate results in the Org-mode > file and the sh block works instead with files that reside outside Org-mode. > > In this particular case, I'd prefer to have dot-temp.gv in a results > block in the Org-mode file, and then pass this results block into a > source code block where tred can manipulate it, and which returns its > results to the Org-mode file. > > That way, the skeptical inquirer need only consult the Org-mode file to > be convinced that tred removed the transitive relations from the > digraph. It would be an easy matter to compare the two results blocks. > > All the best, > Tom Hi Tom, Maybe rather than saving the output of your python block to an external file you could save it into the Org-mode file, into a results block named e.g., "dot-temp", and then you could do the following in your sh code block... #+begin_src sh :var body=dot-temp echo $dot-temp > dot-temp.gv tred dot-temp.gv > test.gv dot -o test.pdf -Tpdf test.gv rm dot-temp.gv open test.pdf #+end_src Hope this helps -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: babel work flow 2011-07-15 15:36 ` Eric Schulte @ 2011-07-15 16:58 ` Thomas S. Dye 0 siblings, 0 replies; 5+ messages in thread From: Thomas S. Dye @ 2011-07-15 16:58 UTC (permalink / raw) To: Eric Schulte; +Cc: Sebastien Vauban, Org-mode Eric Schulte <schulte.eric@gmail.com> writes: > tsd@tsdye.com (Thomas S. Dye) writes: > >> "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes: >> >>> Hi Thomas, >>> >>> Thomas S. Dye wrote: >>>> I want to use one of the dot utilities, tred, in a way that preserves my >>>> ability to distribute the Org-mode file as reproducible research, i.e., >>>> intermediate results should end up in the Org-mode file or be passed >>>> along in a chain. >>>> >>>> Right now I have a python routine that reads a couple of Org-mode tables >>>> and outputs a valid dot graph. I'm saving this to a file, dot-temp.gv, >>>> and then running some shell commands, like this: >>>> >>>> #+begin_src sh >>>> tred dot-temp.gv > test.gv >>>> dot -o test.pdf -Tpdf test.gv >>>> open test.pdf >>>> #+end_src >>>> >>>> The graph is just what I want, but I can't see how to automate the >>>> process in Org-mode. In particular, the tred step trips me up. Do I >>>> have to make babel, tred-aware? >>> >>> Sorry if I misunderstand, but could you be more explicit (for me) on what the >>> problem is? Why is it a problem for you to have that sh block inside your >>> Org. It is executed automagically upon exporting, no? If yes, why is that not >>> good enough? >>> >>> Best regards, >>> Seb >> >> Aloha Seb, >> >> Yes, babel is working fine and the sh block does its job. >> >> The problem is that I like to see intermediate results in the Org-mode >> file and the sh block works instead with files that reside outside Org-mode. >> >> In this particular case, I'd prefer to have dot-temp.gv in a results >> block in the Org-mode file, and then pass this results block into a >> source code block where tred can manipulate it, and which returns its >> results to the Org-mode file. >> >> That way, the skeptical inquirer need only consult the Org-mode file to >> be convinced that tred removed the transitive relations from the >> digraph. It would be an easy matter to compare the two results blocks. >> >> All the best, >> Tom > > Hi Tom, > > Maybe rather than saving the output of your python block to an external > file you could save it into the Org-mode file, into a results block > named e.g., "dot-temp", and then you could do the following in your sh > code block... > > #+begin_src sh :var body=dot-temp > echo $dot-temp > dot-temp.gv > tred dot-temp.gv > test.gv > dot -o test.pdf -Tpdf test.gv > rm dot-temp.gv > open test.pdf > #+end_src > > Hope this helps -- Eric Aloha Eric, With a few modifications I got exactly what I wanted. Thanks! This takes a valid dot digraph in a results block, runs it through tred so transitive relations are removed, creates a pdf file, and then writes the dot source produced by tred back to the Org-mode file. #+begin_src sh :var body=dot-digraph :results output raw echo $body > dot-temp.gv tred dot-temp.gv > dot-temp-tred.gv dot -o test.pdf -Tpdf dot-temp-tred.gv cat dot-temp-tred.gv rm dot-temp-tred.gv #+end_src All the best, Tom -- Thomas S. Dye http://www.tsdye.com ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-07-15 16:58 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-07-13 23:09 babel work flow Thomas S. Dye 2011-07-14 7:34 ` Sebastien Vauban 2011-07-14 15:53 ` Thomas S. Dye 2011-07-15 15:36 ` Eric Schulte 2011-07-15 16:58 ` Thomas S. Dye
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).