From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Including setupfile settings during subtree export (new exporter) Date: Sat, 23 Mar 2013 23:37:32 +0100 Message-ID: <87li9dzqs3.fsf@gmail.com> References: <87obebwj3s.fsf@gmail.com> <87620h27br.fsf@gmail.com> <871ub5264z.fsf@gmail.com> <87ppypzs3t.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJX4I-0005V1-1q for emacs-orgmode@gnu.org; Sat, 23 Mar 2013 18:37:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJX4G-000471-8g for emacs-orgmode@gnu.org; Sat, 23 Mar 2013 18:37:41 -0400 Received: from mail-we0-x22b.google.com ([2a00:1450:400c:c03::22b]:33187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJX4G-00046q-2v for emacs-orgmode@gnu.org; Sat, 23 Mar 2013 18:37:40 -0400 Received: by mail-we0-f171.google.com with SMTP id d46so2345853wer.16 for ; Sat, 23 Mar 2013 15:37:39 -0700 (PDT) In-Reply-To: (John Hendy's message of "Sat, 23 Mar 2013 17:18:28 -0500") 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: John Hendy Cc: emacs-orgmode John Hendy writes: >> #+INCLUDE: "file" replaces keyword with "file" contents. During subtree >> export, replacement will happen if the keyword is located within the >> subtree being exported. >> >> #+SETUPFILE: "file" just reads Org keywords within "file". All Org >> keywords are global, this one makes no exception. >> > > Got it... I think :) Perhaps the Worg page should clarify this, as it > does, then, seem like #+include is the best practice for LaTeX options > and #+setupfile is just supposed to be for TODO settings? I say this > as my googling for "Org keywords org-mode" yields this: > - http://orgmode.org/manual/Per_002dfile-keywords.html > > Is that the meaning of "Org keywords" (just TODO keyword/work flow > settings)? Or would you also include #+options in that group? Org keywords are any keyword you can think of, excepted INCLUDE keywords. Thus, it makes sense to have an OPTIONS keyword within a SETUPFILE. >> In a nutshell, SETUPFILE should be used for Org set-up. INCLUDE is very >> general and can be used to build complex documents. The fact that it >> also copies Org keywords from "file" in the current buffer is merely >> a side-effect. >> >>> What's the preferred way to customize subtrees? Just add #+latex: or >>> #+latex_header: options inside the subtree? >> >> #+LATEX_HEADER: is also global. Use :EXPORT_LATEX_HEADER: in property >> drawer instead. >> > > Good to know. I was unaware of that. Is there a list of these? For each keyword related to export (e.g. AUTHOR), there's an :EXPORT_AUTHOR: property for subtree export. It is also true for back-end specific keywords (like Beamer's). > Out of curiosity, would #+include in the header of the file be > overridden by #+include in the subtree? Not at all. Each include will be replaced by the contents of the file it points to. You can have as many INCLUDE keywords as you want in a file. Though, if first INCLUDE keyword adds an Org keyword (e.g. AUTHOR) and the second one also inserts AUTHOR keyword, the last AUTHOR keyword in the buffer will have precedence over the first one. The same holds for SETUPFILE keywords. > If not, it could be as simple as having a temporary include file that > I'd modify prior to subtree export and then just comment out the main > buffer #+include prior to exporting. That would probably work. But, again, I highly suggest to use SETUPFILE for setting up the export (among other things). Use INCLUDE when you need to add contents, not only Org meta-data. Regards, -- Nicolas Goaziou