4

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?

3
  • Consider to keep the items in a drawer.
    – Marco Wahl
    May 11, 2018 at 14:33
  • 2
    @MarcoWahl -- do you have a link to any documentation to support the proposition that these types of in-buffer settings will work if they are stored in a drawer?: orgmode.org/manual/In_002dbuffer-settings.html
    – lawlist
    May 11, 2018 at 14:56
  • @lawlist -- Could not find a reference in the documentation. So this proposition obeys the rules. ;) Looks like regexp patterns are used to find the settings. So you could write them also e.g. at the bottom or see the answer of Konstantin Morenko for another idea.
    – Marco Wahl
    May 12, 2018 at 7:18

3 Answers 3

2

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.

2
  • 1
    I figured that #+BEGIN_PREFACE ... #+END_PREFACE will also work. :) But yours is an easier approach
    – deshmukh
    May 12, 2018 at 10:16
  • 1
    You could mark that special heading with the ":ARCHIVE:" tag, then it won't expand with Global Cycling. You can always expand it with C-TAB on that heading if you want to get in there. May 18, 2020 at 20:19
0

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.

0

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:).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.