emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Help understanding what's imported from a #+SETUPFILE file


From: Kaushal Modi
Subject: [O] Help understanding what's imported from a #+SETUPFILE file
Date: Fri, 12 Feb 2016 15:02:53 -0500

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

reply via email to

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