From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: :RESULTS: drawer exported in LaTeX Date: Tue, 15 Jul 2014 13:10:11 -0400 Message-ID: <87r41m5z0s.fsf@alphaville.bos.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X76FU-0007aH-KR for emacs-orgmode@gnu.org; Tue, 15 Jul 2014 13:10:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X76FM-0003KN-1S for emacs-orgmode@gnu.org; Tue, 15 Jul 2014 13:10:40 -0400 Received: from plane.gmane.org ([80.91.229.3]:47615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X76FL-0003Jq-Ok for emacs-orgmode@gnu.org; Tue, 15 Jul 2014 13:10:31 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X76FH-0006X4-Bz for emacs-orgmode@gnu.org; Tue, 15 Jul 2014 19:10:27 +0200 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Jul 2014 19:10:27 +0200 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Jul 2014 19:10:27 +0200 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: emacs-orgmode@gnu.org Roland DONAT writes: > Dear Orgmode community, > > I have this piece of python code that generate Orgmode text : > > #+NAME: test > #+HEADER: :session test1 > #+HEADER: :results value drawer > #+BEGIN_SRC python > a = "** H1\nblabla\n** H2\nbloblo" > a > #+END_SRC > > #+RESULTS: test > :RESULTS: > ** H1 > blabla > ** H2 > bloblo > :END: > > But when I export my document in LaTeX, the :RESULTS: drawer appears in the > final pdf which it's not cool... > > I have a d:nil in my OPTIONS header. > There is either a bug in the parser or a drawer cannot contain headlines (probably the latter): running org-element-parse-buffer on the following: --8<---------------cut here---------------start------------->8--- #+STARTUP: noindent #+OPTIONS: toc:nil * foo :RESULTS: ** foo1 blabla bloblo :END: * Local variables :noexport: # Local Variables: # org-export-with-drawers: ("RESULTS") # End: --8<---------------cut here---------------end--------------->8--- gives me: --8<---------------cut here---------------start------------->8--- (org-data nil (section (:begin 1 :end 41 :contents-begin 1 :contents-end 40 :post-blank 1 :parent #0) (keyword (:key \"STARTUP\" :value \"noindent\" :begin 1 :end 21 :post-blank 0 :post-affiliated 1 :parent #1)) (keyword (:key \"OPTIONS\" :value \"toc:nil\" :begin 21 :end 40 :post-blank 0 :post-affiliated 21 :parent #1))) (headline (:raw-value \"foo\" :begin 41 :end 87 :pre-blank 0 :contents-begin 47 :contents-end 86 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :title (#(\"foo\" 0 3 (:parent #1))) :parent #0) (section (:begin 47 :end 58 :contents-begin 47 :contents-end 57 :post-blank 1 :parent #1) (paragraph (:begin 47 :end 57 :contents-begin 47 :contents-end 57 :post-blank 0 :post-affiliated 47 :parent #2) >>>> #(\":RESULTS:\\n\" 0 10 (:parent #3)))) (headline (:raw-value \"foo1\" :begin 58 :end 86 :pre-blank 0 :contents-begin 66 :contents-end 86 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :title (#(\"foo1\" 0 4 (:parent #2))) :parent #1) (section (:begin 66 :end 87 :contents-begin 66 :contents-end 86 :post-blank 1 :parent #2) (paragraph (:begin 66 :end 80 :contents-begin 66 :contents-end 80 :post-blank 0 :post-affiliated 66 :parent #3) #(\"blabla\\nbloblo\\n\" 0 14 (:parent #4))) >>>> (drawer (:begin 80 :end 86 :drawer-name \"END\" :contents-begin nil :contents-end nil :post-blank 0 :post-affiliated 80 :parent #3))))) (headline (:raw-value \"Local variables\" :begin 87 :end 198 :pre-blank 1 :contents-begin 133 :contents-end 198 :level 1 :priority nil :tags (\"noexport\") :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :title (#(\"Local variables\" 0 15 (:parent #1))) :parent #0) (section (:begin 133 :end 198 :contents-begin 133 :contents-end 198 :post-blank 0 :parent #1) (comment (:begin 133 :end 198 :value \"Local Variables:\\norg-export-with-drawers: (\\\"RESULTS\\\")\\nEnd:\" :post-blank 0 :post-affiliated 133 :parent #2))))) --8<---------------cut here---------------end--------------->8--- so :RESULTS: is somehow misinterpreted as a paragraph and :END: as an empty drawer, instead of as the end of the RESULTS drawer. If there is no headline inside the drawer, then there is no misinterpretation, IOW the following works: --8<---------------cut here---------------start------------->8--- #+STARTUP: noindent #+OPTIONS: toc:nil * foo :RESULTS: blabla bloblo :END: * Local variables :noexport: # Local Variables: # org-export-with-drawers: ("RESULTS") # End: --8<---------------cut here---------------end--------------->8--- The final verdict has to be issued by Nicolas however. If it's not a bug, then you will have to modify your method (I would have said that "raw" is the best solution, but since you have already rejected that, I'm not sure what else to suggest). -- Nick