[Top][All Lists]

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

Re: [O] Improved way to include some headlines from an external org file

From: Rasmus
Subject: Re: [O] Improved way to include some headlines from an external org file
Date: Wed, 01 Oct 2014 01:10:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Hi Xavier,

Xavier Garrido <address@hidden> writes:

> Le 12/09/2014 02:45, Andrea Rossetti a écrit :
>> Xavier Garrido <address@hidden> writes:
>>> Of course, I can achieve that by using =:lines= and calculating how many
>>> lines embeds the given headline.
>>    Hi Xavier, another possible approach (maybe less handy, but in
>> some cases it might fit): the user could keep one .org file
>> per headline, and #+INCLUDE one headline (= one entire file)
>> when needed.
> This is something I use when dealing with a book or report with
> basically one big file per chapter. Here the problem is slightly
> different : I have 4 org/Beamer presentations that almost 80% of them
> are the same. So instead of maintening this 80% in 4 different places,
> I'd like to write them and change them in one place and then include
> the needed headlines at the right place in each of the 4
> presentations.
> I know this can't be done with #+INCLUDE maybe with a nice babel
> function or a bit of elisp. So maybe someone already did
> that. Otherwise this may be a nice addition for further release of org
> ;)

You could test the patch here:


I think it introduces something close to what you are looking for.

> #+BEGIN_SRC org
> #+INCLUDE: "./base.org" :headline "First base chapter"
> ,* A more personal chapter
> #+INCLUDE: "./base.org" :headline "Second base chapter"
> ,* Another personal chapter

You'd be able to do

* first chapter
  Note how we're renaming /first base chapter/ on the fly.
* In this book /first base chapter/ is my second chapter
#+INCLUDE: "./base.org::*First base chapter" :only-contents t

Of course, you can also include other named objects such as tables and
probably code blocks.


Hvor meget poesi tror De kommer ud af et glas isvand?

reply via email to

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