emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: emacs-org list <emacs-orgmode@gnu.org>
Subject: Help understanding what's imported from a #+SETUPFILE file
Date: Fri, 12 Feb 2016 15:02:53 -0500	[thread overview]
Message-ID: <CAFyQvY3xU2zV6btLKzcyrG+4hSAdfHcS1uD1dHLo+_LnhDhJAQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2050 bytes --]

Hi,

I have a common setup file for all my org files which configure the way the
latex and HTML files are exported.

#+SETUPFILE: ~/org/common/config.org

One of the snippets in my config.org is

# Allow multi-page code listings by wrapping the `minted' environment with
`mdframed' environment
# http://tex.stackexchange.com/a/30524/52678
#+LaTeX_HEADER: \usepackage{mdframed}
#+LaTeX_HEADER: \mdfsetup{%
#+LaTeX_HEADER: topline=true, bottomline=true,leftline=true,
rightline=true, %
#+LaTeX_HEADER: innerleftmargin=15pt, %
#+LaTeX_HEADER: leftmargin=-5pt, %
#+LaTeX_HEADER: rightmargin=-5pt, %
#+LaTeX_HEADER: linewidth=1pt, backgroundcolor=yellow!20!white %
#+LaTeX_HEADER: }

#+LaTeX: \BeforeBeginEnvironment{minted}{\begin{mdframed}}
#+LaTeX: \AfterEndEnvironment{minted}{\end{mdframed}}

The #+LaTeX_HEADER lines get imported into the exported .tex file but the
#+LaTeX lines do not.

From "C-h i g (org) In-buffer settings", I see that

‘#+SETUPFILE: file’
     This line defines a file that holds more in-buffer setup.  Normally
     this is entirely ignored.  Only when the buffer is parsed for
     option-setting lines (i.e., when starting Org mode for a file, when
     pressing ‘C-c C-c’ in a settings line, or when exporting), then the
     contents of this file are parsed as if they had been included in
     the buffer.  In particular, the file can be any other Org mode file
     with internal setup.  You can visit the file the cursor is in the
     line with ‘C-c '’.

But I did not find anything that explains which "#+" lines from SETUPFILE
are ignored.

I thought of using #+SETUPFILE as a clean way to import a common org setup
for exports. But should #+INCLUDE be used in this case instead?

Or what method would you guys suggest (may be using some elisp) so that I
do not need to manually enter the below in all my org files.

#+LaTeX: \BeforeBeginEnvironment{minted}{\begin{mdframed}}
#+LaTeX: \AfterEndEnvironment{minted}{\end{mdframed}}


--
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 2929 bytes --]

             reply	other threads:[~2016-02-12 20:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12 20:02 Kaushal Modi [this message]
2016-02-12 20:11 ` Help understanding what's imported from a #+SETUPFILE file Kaushal Modi
2016-02-12 20:50   ` Eric S Fraga
2016-02-12 22:47   ` Nicolas Goaziou
2016-02-12 23:02     ` Kaushal Modi
2016-02-12 23:35       ` Nicolas Goaziou

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=CAFyQvY3xU2zV6btLKzcyrG+4hSAdfHcS1uD1dHLo+_LnhDhJAQ@mail.gmail.com \
    --to=kaushal.modi@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).