From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: Something to watch out for when including files Date: Tue, 20 Sep 2016 16:32:05 -0700 Message-ID: References: <87y42mfvgw.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmUWK-0003D9-W1 for emacs-orgmode@gnu.org; Tue, 20 Sep 2016 19:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmUWH-0007pV-5r for emacs-orgmode@gnu.org; Tue, 20 Sep 2016 19:32:12 -0400 Received: from iport-acv6-out.ucsd.edu ([132.239.0.13]:41144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmUWG-0007pE-UM for emacs-orgmode@gnu.org; Tue, 20 Sep 2016 19:32:09 -0400 In-Reply-To: <87y42mfvgw.fsf@ucl.ac.uk> 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" To: Eric S Fraga Cc: Emacs Org mode mailing list On Tue, 20 Sep 2016, Eric S Fraga wrote: > Hello all, > > just wanted to help others avoid spending a long time trying to figure > out some strange (well, unexpected) behaviour in org... > > I have a document for which the LaTeX export was ignoring a > #+begin_abstract ... #+end_abstract construct near the start of the > document. The text was simply not appearing in the LaTeX file. > > Long story short: I had a #+include: directive as the first line of the > file which included an org file called preamble.org. In that preamble > file, the last headline had the tag :noexport:. It would seem that this > tag is not processed until after the include file has been included. I > hope that makes sense. In any case, this means that my abstract was > considered to be part of the noexport headline and was therefore not > exported. > > Took me a very long time to figure out... the simple solution was to > remove that noexport section entirely from the preamble file. > I find myself in the habit of using inlinetasks tagged noexport for various things and that might serve you in this case. That is, convert the headline section to an inlinetask. Another possibility is to use something like: #+header: :exports results :results raw replace #+NAME: import-include-dot-org #+BEGIN_SRC emacs-lisp (require 'ox-org) (org-export-string-as "#+INCLUDE: include.org" 'org t) #+END_SRC which will strip out headlines tagged with noexport during the babel phase of export (i.e. before parsing). > I do wonder whether the org export approach (i.e. how it "includes" > files) is correct but I can understand why the implementation is the way > it is. I agree about the implementation. Trying to make it smarter is asking for trouble. Chuck