From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: [babel] Meta-LaTeX-Python-Environment Date: Thu, 29 Oct 2009 11:52:25 -0400 Message-ID: <87y6mudwp2.fsf_-_@stats.ox.ac.uk> References: <200910261327.09576.torsten.wagner@googlemail.com> <878wexheeq.fsf@stats.ox.ac.uk> <4edb2bbc0910270629q23323792r4d15bd952c81d376@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3XIi-0001C4-7T for emacs-orgmode@gnu.org; Thu, 29 Oct 2009 11:52:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3XId-00010H-D6 for Emacs-orgmode@gnu.org; Thu, 29 Oct 2009 11:52:35 -0400 Received: from [199.232.76.173] (port=45619 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3XIc-0000zp-Of for Emacs-orgmode@gnu.org; Thu, 29 Oct 2009 11:52:31 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:53895) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N3XIc-0003S7-BJ for Emacs-orgmode@gnu.org; Thu, 29 Oct 2009 11:52:30 -0400 In-Reply-To: <4edb2bbc0910270629q23323792r4d15bd952c81d376@mail.gmail.com> (Torsten Wagner's message of "Tue, 27 Oct 2009 22:29:39 +0900") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Torsten Wagner Cc: Emacs-orgmode@gnu.org Hi Torsten, Torsten Wagner writes: <...> > I used the following simple example: <...> > #+srcname: test() > #+begin_src python :results latex <...> > As you can see, the result is wrapped now in LaTeX source code blocks. > However, if I export the file by > M-x org-export l > the resulting LaTeX file still contains the source code itself (the part in the > verbatim environment. Yes, you need ':exports results' as well as ':results latex'. The ':results latex' is necessary to specify that the *result* of the block is latex code. The ':exports results' is necessary in order to tell it only to include the result in the export product. <...> > Wished export-result (trimmed to relevant part): > ... > \usepackage{color} > \definecolor{gray}{gray}{0.95} > ... > \section{Simple Test of org-babel} > \label{sec-1} > \colorbox{gray}{ > This is a Test: if a =1 and b = 2 then a + b = 3 right ?! > } > ... > > As you can see, I like to indicate the source block results resp. the LaTeX > source code blocks in a way which indicate clearly that they belong to the > "official" output. E.g. by adding a slight gray background. OK, so I think what you want is that the results are (a) latex code, and (b) in a box, set apart as different from the main text Well, org-babel doesn't do anything like that with latex results by default, so you'd have to do it yourself. How about defining a source block function which does the job of putting your latex results in a box, and calling it with #+lob ? The following exports to latex with the results in a red box. (Please pull the latest org-mode as this required a change that I've just made.) --8<---------------cut here---------------start------------->8--- #+LATEX_HEADER: \usepackage{color} * Simple Test of org-babel #+srcname: test() #+begin_src python :exports none a = 1 b = 2 c = a+b "This is a Test: if a =" + str(a) + " and b = " + str(b) + " then a + b = " + str(c) + " right ?!" #+end_src #+lob: putinbox(body=test()) :results latex :exports results * Library code This could go in a separate file, as long as the file is added to the Library of Babel. #+srcname: putinbox(body) #+begin_src latex :exports none \colorbox{red}{ body } #+end_src --8<---------------cut here---------------end--------------->8--- > > As mentioned before, I like to have mainly three ways of export > 1. Export everything :exports both > 2. Export everything except the source codes itself :exports results > 3. Export a particular LaTeX source code session (e.g. by using the tangle > function) tangle Hth, Dan > > Nevertheless, I will try the other very good ideas in this thread. Maybe this > works for me already. > > Best regards and thanks again > > Torsten > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode