emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Include another org-document without settings
@ 2015-02-01 10:51 Stefan Nobis
  2015-02-01 11:53 ` Eric S Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Nobis @ 2015-02-01 10:51 UTC (permalink / raw)
  To: emacs-orgmode

Hi.

I try to build an org document that has two parts. One file contains
the first part of the resulting document and should be useable
stand-alone. The second file is some kind of extension to the first
file.

My idea is to simple #+INCLUDE the first file in the second one. But
then the global settings will be mixed. For example the keywords
contains all keywords of both files. Also some export options like
LATEX_EXTRA_HEADER are duplicated in some cases (I found no easy way
to reproduce this in the simple example).

Here are two example files:

--8<---------------cut here---------------start------------->8---
#+TITLE: FILE A
#+KEYWORDS: a x

* First Section

Some text in file A.
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
#+TITLE: FILE B
#+KEYWORDS: b x

#+INCLUDE: a.org

* Second section

Some text in file b.
--8<---------------cut here---------------end--------------->8---

Is there a better way to handle this use-case or is it possible to
force org to ignore (global) settings on include (I tried only to
include lines after the global settings but that seems not to work).
My main target is LaTeX/PDF, but exporting to HTML shows similiar
problems.


GNU Emacs 24.4.1.
Org-mode version 8.2.10 (8.2.10-30-gca21b7-elpaplus).

--
Until the next mail...,
Stefan.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Include another org-document without settings
  2015-02-01 10:51 Include another org-document without settings Stefan Nobis
@ 2015-02-01 11:53 ` Eric S Fraga
  2015-02-02  7:05   ` Stefan Nobis
  0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2015-02-01 11:53 UTC (permalink / raw)
  To: emacs-orgmode

On Sunday,  1 Feb 2015 at 11:51, Stefan Nobis wrote:
> Hi.
>
> I try to build an org document that has two parts. One file contains
> the first part of the resulting document and should be useable
> stand-alone. The second file is some kind of extension to the first
> file.

When I used to do this in LaTeX, I usually had a /master/ document which
included the others.  So, in your case, I would suggest a ~master.org~
document which includes your a.org and b.org documents, each of which
could be useable individually.  This is more symmetric than one of them
including the other.  The master document would be processed only when
you wanted to create a complete document export.

I hope this makes sense.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-750-gb6fce5.dirty

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Include another org-document without settings
  2015-02-01 11:53 ` Eric S Fraga
@ 2015-02-02  7:05   ` Stefan Nobis
  2015-02-02 12:23     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Nobis @ 2015-02-02  7:05 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> When I used to do this in LaTeX, I usually had a /master/ document
> which included the others.

That's what I did with pure LaTeX, too. But then there is the nice
feature in AucTeX which allows you to compile the whole document while
you are in one of the slaves.

I'm just curious if the #+INCLUDE statement is supposed to work with
complete org documents full of global options or if it is intended to
work only with slave documents (as in the LaTeX case) without any kind
of preamble.

Maybe it would be a helful extension to give #+INCLUDE an option to
just ignore global settings?

-- 
Until the next mail...,
Stefan.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Include another org-document without settings
  2015-02-02  7:05   ` Stefan Nobis
@ 2015-02-02 12:23     ` Nicolas Goaziou
  2015-02-02 13:55       ` Stefan Nobis
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2015-02-02 12:23 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Stefan Nobis <stefan-ml@snobis.de> writes:

> Maybe it would be a helful extension to give #+INCLUDE an option to
> just ignore global settings?

You can skip the first lines of an INCLUDEd file with :line parameter.
You can also only include a section.  See manual for details.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Include another org-document without settings
  2015-02-02 12:23     ` Nicolas Goaziou
@ 2015-02-02 13:55       ` Stefan Nobis
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Nobis @ 2015-02-02 13:55 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> You can skip the first lines of an INCLUDEd file with :line parameter.
> You can also only include a section.  See manual for details.

Thank you for the hint. I used something like

   #+INCLUDE "a.org" :lines 3-

but still got duplicate keywords (the KEYWORDS option is in line 2 of
my example).

It seems, I got the syntax wrong. The correct version is

   #+INCLUDE: a.org :lines "3-"

so the quotations marks around the parameter are mandatory and not
optional. Using the correct syntax everything works as expected.

--
Until the next mail...,
Stefan.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-02-02 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-01 10:51 Include another org-document without settings Stefan Nobis
2015-02-01 11:53 ` Eric S Fraga
2015-02-02  7:05   ` Stefan Nobis
2015-02-02 12:23     ` Nicolas Goaziou
2015-02-02 13:55       ` Stefan Nobis

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).