From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Can't export LaTeX source code blocks Date: Mon, 22 Apr 2013 12:25:12 -1000 Message-ID: References: <86obd67427.fsf@somewhere.org> <87zjwqb9wd.fsf@gmail.com> <867gju6xyd.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUPB5-0002zp-Q6 for emacs-orgmode@gnu.org; Mon, 22 Apr 2013 18:25:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUPB1-0006cr-Ln for emacs-orgmode@gnu.org; Mon, 22 Apr 2013 18:25:39 -0400 Received: from plane.gmane.org ([80.91.229.3]:59491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUPB1-0006ce-FX for emacs-orgmode@gnu.org; Mon, 22 Apr 2013 18:25:35 -0400 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UUPAz-0000S0-Ft for emacs-orgmode@gnu.org; Tue, 23 Apr 2013 00:25:33 +0200 In-Reply-To: <867gju6xyd.fsf@somewhere.org> (Sebastien Vauban's message of "Mon, 22 Apr 2013 23:46:02 +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: Sebastien Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org Aloha Seb, "Sebastien Vauban" writes: >>> * TODO Documentation >>> >>> Here is the LaTeX code: >>> >>> #+name: doc-macro-a >>> #+begin_src latex >>> \DescribeMacro{\dummyMacro} >>> This macro does nothing.\index{doing nothing|usage} It is merely an >>> example. If this were a real macro, you would put a paragraph here >>> describing \textbf{what} the macro is supposed to do, what its mandatory and >>> optional arguments are, and so forth. >>> #+end_src >>> >>> followed by the LaTeX output: >>> >>> #+results: doc-macro-a >>> #+BEGIN_LaTeX >>> \DescribeMacro{\dummyMacro} >>> This macro does nothing.\index{doing nothing|usage} It is merely an >>> example. If this were a real macro, you would put a paragraph here >>> describing \textbf{what} the macro is supposed to do, what its mandatory and >>> optional arguments are, and so forth. >>> #+END_LaTeX >>> >>> * Results >>> >>> As you can see, the code block is NEVER exported. I don't understand >>> why? >> >> I'm not sure either. >> >> This is not a problem from the exporter as >> `org-export-execute-babel-code' on your ECM makes the src block >> disappear. >> >>> The results block is exported, but then (interpreted and) only visible in the >>> LaTeX back-end. The HTML document is completely empty... >> >> I can answer that one: "#+begin_BACKEND" means "export this block when >> using export BACKEND, otherwise ignore it". Therefore, html back-end >> ignores the results. > > Yes, I agree: that second behavior is logical. I just emphasized it as, > consequently, we can't export anything (not even the results -- though, that > does not make much sense) to HTML, as exposed by the ECM. > > The only buggy behavior is the first one: the fact that the "code" block > disappears, as you say. I took a quick look at ob-latex.el. The code there sets `:exports results' and then, IIUC, goes on its way without checking if :exports has been set in the buffer. IIRC, the main uses of LaTeX code blocks were for tangling .tex documents, and for preview snippets. This seems to be supported by the documentation, which says "LaTeX source code blocks can be used to tangle a LaTeX source file, or to create bitmap images or pdf snippets of arbitrary LaTeX code." It looks to me like ob-latex.el would need to be revised to work with your use case (a document about LaTeX authoring?). hth, Tom -- Thomas S. Dye http://www.tsdye.com