* Help understanding what's imported from a #+SETUPFILE file
@ 2016-02-12 20:02 Kaushal Modi
2016-02-12 20:11 ` Kaushal Modi
0 siblings, 1 reply; 6+ messages in thread
From: Kaushal Modi @ 2016-02-12 20:02 UTC (permalink / raw)
To: emacs-org list
[-- 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 --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help understanding what's imported from a #+SETUPFILE file
2016-02-12 20:02 Help understanding what's imported from a #+SETUPFILE file Kaushal Modi
@ 2016-02-12 20:11 ` Kaushal Modi
2016-02-12 20:50 ` Eric S Fraga
2016-02-12 22:47 ` Nicolas Goaziou
0 siblings, 2 replies; 6+ messages in thread
From: Kaushal Modi @ 2016-02-12 20:11 UTC (permalink / raw)
To: emacs-org list
[-- Attachment #1: Type: text/plain, Size: 460 bytes --]
Actually, I just realized that changing those 2 lines to:
#+LaTeX_HEADER: \BeforeBeginEnvironment{minted}{\begin{mdframed}}
#+LaTeX_HEADER: \AfterEndEnvironment{minted}{\end{mdframed}}
in the SETUPFILE works too. I don't recall the reason why I did not have
them as LaTeX_HEADER earlier.
But the question still remains.. is SETUPFILE designed to not export lines
beginning with #+LaTeX? Or a general question would be.. what stuff doesn't
SETUPFILE export?
[-- Attachment #2: Type: text/html, Size: 808 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help understanding what's imported from a #+SETUPFILE file
2016-02-12 20:11 ` Kaushal Modi
@ 2016-02-12 20:50 ` Eric S Fraga
2016-02-12 22:47 ` Nicolas Goaziou
1 sibling, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2016-02-12 20:50 UTC (permalink / raw)
To: Kaushal Modi; +Cc: emacs-org list
On Friday, 12 Feb 2016 at 15:11, Kaushal Modi wrote:
> Actually, I just realized that changing those 2 lines to:
>
> #+LaTeX_HEADER: \BeforeBeginEnvironment{minted}{\begin{mdframed}}
> #+LaTeX_HEADER: \AfterEndEnvironment{minted}{\end{mdframed}}
This is indeed the solution.
> in the SETUPFILE works too. I don't recall the reason why I did not have
> them as LaTeX_HEADER earlier.
>
> But the question still remains.. is SETUPFILE designed to not export lines
> beginning with #+LaTeX? Or a general question would be.. what stuff doesn't
> SETUPFILE export?
I think you'll find that anything before the first headline (other than
header lines and document settings) is ignored when exporting to
LaTeX and that applies to all text, whether in the main file or from an
included file.
--
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-565-g4f499f
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help understanding what's imported from a #+SETUPFILE file
2016-02-12 20:11 ` Kaushal Modi
2016-02-12 20:50 ` Eric S Fraga
@ 2016-02-12 22:47 ` Nicolas Goaziou
2016-02-12 23:02 ` Kaushal Modi
1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2016-02-12 22:47 UTC (permalink / raw)
To: Kaushal Modi; +Cc: emacs-org list
Hello,
Kaushal Modi <kaushal.modi@gmail.com> writes:
> Actually, I just realized that changing those 2 lines to:
>
> #+LaTeX_HEADER: \BeforeBeginEnvironment{minted}{\begin{mdframed}}
> #+LaTeX_HEADER: \AfterEndEnvironment{minted}{\end{mdframed}}
>
> in the SETUPFILE works too. I don't recall the reason why I did not have
> them as LaTeX_HEADER earlier.
>
> But the question still remains.. is SETUPFILE designed to not export lines
> beginning with #+LaTeX? Or a general question would be.. what stuff doesn't
> SETUPFILE export?
SETUPFILE exports keywords defined in `org-export-options-alist' and in
back-end specific options (i.e. :options-alist). For example, in latex
back-end the latter category is
LATEX_CLASS, LATEX_CLASS_OPTIONS, LATEX_HEADER, LATEX_HEADER_EXTRA,
DESCRIPTION, KEYWORDS, SUBTITLE, LATEX_COMPILER, DATE
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help understanding what's imported from a #+SETUPFILE file
2016-02-12 22:47 ` Nicolas Goaziou
@ 2016-02-12 23:02 ` Kaushal Modi
2016-02-12 23:35 ` Nicolas Goaziou
0 siblings, 1 reply; 6+ messages in thread
From: Kaushal Modi @ 2016-02-12 23:02 UTC (permalink / raw)
To: Kaushal Modi, emacs-org list
[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]
> SETUPFILE exports keywords defined in `org-export-options-alist' and in back-end
specific options (i.e. :options-alist).
I tried "C-h v org-export-options-alist" but the result seemed cryptic to
me:
((:title "TITLE" nil nil parse) (:date "DATE" nil nil parse) (:author
"AUTHOR" nil user-full-name parse) (:email "EMAIL" nil
user-mail-address t) (:language "LANGUAGE" nil
org-export-default-language t) (:select-tags "SELECT_TAGS" nil
org-export-select-tags split) (:exclude-tags "EXCLUDE_TAGS" nil
org-export-exclude-tags split) (:creator "CREATOR" nil
org-export-creator-string) (:headline-levels nil "H"
org-export-headline-levels) (:preserve-breaks nil "\\n"
org-export-preserve-breaks) (:section-numbers nil "num"
org-export-with-section-numbers) (:time-stamp-file nil "timestamp"
org-export-time-stamp-file) (:with-archived-trees nil "arch"
org-export-with-archived-trees) (:with-author nil "author"
org-export-with-author) (:with-broken-links nil "broken-links"
org-export-with-broken-links) (:with-clocks nil "c"
...
> For example, in latex back-end the latter category is
> LATEX_CLASS, LATEX_CLASS_OPTIONS, LATEX_HEADER, LATEX_HEADER_EXTRA,
> DESCRIPTION, KEYWORDS, SUBTITLE, LATEX_COMPILER, DATE
That helps. Thanks!
[-- Attachment #2: Type: text/html, Size: 2727 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help understanding what's imported from a #+SETUPFILE file
2016-02-12 23:02 ` Kaushal Modi
@ 2016-02-12 23:35 ` Nicolas Goaziou
0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2016-02-12 23:35 UTC (permalink / raw)
To: Kaushal Modi; +Cc: emacs-org list
Hello,
Kaushal Modi <kaushal.modi@gmail.com> writes:
>> SETUPFILE exports keywords defined in `org-export-options-alist' and in back-end
> specific options (i.e. :options-alist).
>
> I tried "C-h v org-export-options-alist" but the result seemed cryptic to
> me:
Quoting its docstring:
Alist between export properties and ways to set them.
The key of the alist is the property name, and the value is a list
like (KEYWORD OPTION DEFAULT BEHAVIOR) where:
KEYWORD is a string representing a buffer keyword, or nil.
...
So you're looking for all string next to the keys, e.g. "TITLE".
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-02-12 23:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12 20:02 Help understanding what's imported from a #+SETUPFILE file Kaushal Modi
2016-02-12 20:11 ` 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
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.