emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Scott Randby <srandby@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: How to export a single subtree but include document preamble?
Date: Wed, 3 Apr 2024 17:13:44 -0400	[thread overview]
Message-ID: <5b49eb6e-9290-4654-9fcf-b72c14540c00@gmail.com> (raw)
In-Reply-To: <FBCFA6E8-DDCF-4C69-A083-F14A34379163@berkeley.edu>

On 4/3/24 15:00, Richard H. Stanton wrote:
> I just tried to export a single subtree from an org document to a PDF file:
> 
> 1) Type  C-c C-e [org-export-dispatch]
> 2) C-s to narrow to subtree
> 3) l -> o to export to PDF via LaTeX
> 
> However, instead of exporting the portion of the file I want, I get the error message
> 
> Undefined Org macro: newline; aborting
> 
> That macro is defined in a setup file that is #+included at the top of the file, so exporting the entire file works fine.
> 
> I assume the problem is that when I export only one subtree, the setup file is not #+included, and I can see it sort of makes sense, but it would be nice if there were an option to include one or more lines from the preamble when exporting just a subtree, since otherwise exporting a subtree doesn’t actually work! Is there a simple way to do this?
> 

I don't know if this does what you want, but I use a ‘PROPERTIES’ drawer right below the subtree's headline and in that drawer, I put the following code:

:EXPORT_LATEX_HEADER_EXTRA: \input{latex-preamble.tex}

Scott Randby


  reply	other threads:[~2024-04-03 21:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 19:00 How to export a single subtree but include document preamble? Richard H. Stanton
2024-04-03 21:13 ` Scott Randby [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-04 18:11 Richard Stanton
2024-04-04 18:32 ` Richard Stanton
2024-04-04 18:42 ` Scott Randby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b49eb6e-9290-4654-9fcf-b72c14540c00@gmail.com \
    --to=srandby@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).