emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Something to watch out for when including files


From: Charles C. Berry
Subject: Re: [O] Something to watch out for when including files
Date: Tue, 20 Sep 2016 16:32:05 -0700
User-agent: Alpine 2.20 (OSX 67 2015-01-07)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]