From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: [babel] Literate Programming for publication Date: Wed, 11 Apr 2012 23:35:16 +0900 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHydt-0006Z9-LU for emacs-orgmode@gnu.org; Wed, 11 Apr 2012 10:35:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHydj-0003oi-LI for emacs-orgmode@gnu.org; Wed, 11 Apr 2012 10:35:29 -0400 Received: from mail-vb0-f41.google.com ([209.85.212.41]:54922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHydj-0003oZ-Dd for emacs-orgmode@gnu.org; Wed, 11 Apr 2012 10:35:19 -0400 Received: by vbbey12 with SMTP id ey12so808765vbb.0 for ; Wed, 11 Apr 2012 07:35:17 -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 Hi, I just try (again) to use org-mode and babel for literate programming finally resulting in a camera ready manuscript for publication. I noticed that there are different ways of achieving this and wonder what others use or what others think might be the best. What I want do Ideally, I would like to separate the org-file into three parts 1. org-mode itself containing all kind of infos, notes, dates, links,etc -> for me and possibly co-authors 2. latex stuff, the parts which should present the final manuscript -> to the publisher, colleagues, etc 3. code, all the code to munch all input data into some graphs and to distill the final results -> for me, coauthors and people who request it. What I managed to do Today I started again combining python resp. pylab and matplotlib together with org-mode I managed to use * python source code blocks in session mode -> generation of graphs in png format * org-mode native text -> all text of the manuscript including the generated figures At this point I noticed I could use latex source code blocks or latex code blocks but I had the following problem with both of them. In python I define certain variables e.g. #+begin_src python U = 3 # applied voltage t = pl.arange(0,3.1,0.1) # time #many more... #+end_src later in the text I have to write this parameters as well. e.g. .... as shown in figure 3 the current increase after applying a voltage pulse with an amplitude of 3 V for 3 seconds.... Now here comes the problem. If I start playing around with my python code I might end up with different values in the calculation and in the text. This is very hard to spot and hence very dangerous to overlook. Thus, I used something like .... as shown in figure 3 the current increase after applying a voltage pulse with an amplitude of src_python[:session name]{print(U)} V for src_python[:session]{print(t[-1]} seconds.... The code blocks will be replaced on export and the original text will be the exported. Now, I have only one place to change parameters all numbers would be valid for both code and text. However, this did not work within latex code blocks or latex blocks. Having all text in org mode outline, however does not allow me to separate easily publishable text and notes. Maybe I could use drawers and property nodes etc. but I think this looks to make thinks even more complex. Finally, the biggest problem is the fact that I can't tangle the entire org-file into different files. I really would like to get * a tex/pdf/odt manuscript file for the publishers * a pdf/org/html/odt file including all and everything * a python source file. How can I manage to use different code blocks (latex and python) but still be able to inject results from python into the latex code blocks? noweb and vars looked good but it did not work for me. Thanks for all input Torsten src_{}