Just what the title says.
My org files often have large prefaces (area containing #+TAGS:, #+STARTUP, etc.) and would like to keep it folded most of the times.
How do I achieve this?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityJust what the title says.
My org files often have large prefaces (area containing #+TAGS:, #+STARTUP, etc.) and would like to keep it folded most of the times.
How do I achieve this?
I use in my files special heading, for example Settings and hide all the in-buffer settings there. It works very well even in the beginning and in the end of the file.
If you use Global Cycling (S-Tab
), a text in this heading will be showed at third stage. I don't know how to prevent this when using Global Cycling, but with Local Cycling (Tab
on headings) it works very well.
#+BEGIN_PREFACE ... #+END_PREFACE
will also work. :) But yours is an easier approach
As someone commented above, storing them in a drawer works. I usually start any document something like:
:preamble:
#+startup: entitiespretty overview indent
#+options: toc:nil num:nil
#+todo: TODO FANCY OPTIONS | DONE
# ...etc.
:end:
#+title: My title
...Then fold the drawer, and all the ugly but necessary stuff is neatly tucked away. Works like a charm, is accessible and looks nice.
I combined everything I found in the answers and comments here (and added something else), and I'm very glad with the result.
I use both the star and the preamble declaration, as well as the :ARCHIVE:
tag.
* Settings :ARCHIVE::noexport:
:preamble:
#+startup: entitiespretty overview indent
#+options: toc:t num:nil
#+todo: TODO FANCY OPTIONS | DONE
# ...etc.
#+EXPORT_EXCLUDE_TAGS: noexport
:end:
#+title: My title
#+date: The date
* First section
* Second section
As you surely noticed, I also added a :noexport:
tag and #+EXPORT_EXCLUDE_TAGS: noexport
inside the preamble, so that the Settings "section" is not exported into the ToC if I try to turn my text into something else (LaTeX, HTML...).
When you do open the Settings section you only see the part where you add the title, date and maybe other information, but you still don't see the contents of the preamble, unless you really want to see it (in which case you have to hit the tab
key over the word :preamble:
).