From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Including setupfile settings during subtree export (new exporter) Date: Sat, 23 Mar 2013 17:18:28 -0500 Message-ID: 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; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJWlj-0007YV-KB for emacs-orgmode@gnu.org; Sat, 23 Mar 2013 18:18:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJWli-0006cr-7r for emacs-orgmode@gnu.org; Sat, 23 Mar 2013 18:18:31 -0400 Received: from mail-la0-x22f.google.com ([2a00:1450:4010:c03::22f]:41812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJWli-0006cl-0S for emacs-orgmode@gnu.org; Sat, 23 Mar 2013 18:18:30 -0400 Received: by mail-la0-f47.google.com with SMTP id fj20so9162787lab.6 for ; Sat, 23 Mar 2013 15:18:28 -0700 (PDT) In-Reply-To: <87ppypzs3t.fsf@gmail.com> 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: Nicolas Goaziou Cc: emacs-orgmode On Sat, Mar 23, 2013 at 5:08 PM, Nicolas Goaziou wrote: > John Hendy writes: > >>> At the moment, there's no way to override a #+setupfile: keyword >>> locally. >> >> I guess I don't understand the purpose of #+include, then. It seems we >> have only two options: >> >> 1) #+setupfile: Will apply to entire buffer as well as subtree >> exports. Cannot be overridden in subtrees. >> >> 2) #+include: Applies to entire buffer export only; does nothing for >> subtree exports. > > #+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? > 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? The only one I've run across is the new Beamer export Worg page: - http://orgmode.org/worg/exporters/beamer/ox-beamer.html#config That's a great table and it would be great to have that for all properties. Or perhaps this page could link to that comprehensive list if it exists, or let the user know how to find it: - http://orgmode.org/manual/Special-properties.html#Special-properties >> Going by the LaTeX export guide >> (http://orgmode.org/worg/org-tutorials/org-latex-export.html), I don't >> see recommendations for this. As a use case, perhaps I have a subtree >> with beamer-compatible markup (each subtree will fit on a slide), but >> that I might also include in the whole buffer, or perhaps a different >> css file for the whole buffer vs. the subtree. >> >> Can this be accomplished? > > Off the top of my head, I think there's no direct way to do it. Though, > you can define a property :MY_SETUP: setupfile in the subtree and, > within `org-export-before-processing-hook', call a function: > > - commenting every fSETUPFILE keyword > - adding #+SETUPFILE: setupfile at the beginning of the buffer. > > It involves some (simple) elisp, though. > I'll consider that. My setups aren't typically so complicated to probably require something like this. Out of curiosity, would #+include in the header of the file be overridden by #+include in the subtree? 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. >>>> Based on the above, should that line be removed from the Worg update >>>> guide? If so, I can do that. >>> >>> I think so. >> >> Will do. > > Thank you. > > > Regards, > > -- > Nicolas Goaziou Thanks again for the clarification. I do hope I can repay those doing work on actual code (where I lack the abilities) by getting some of these gems out of the mailing list and into Worg for the community. Best regards, John