Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Org-mode: Hide buffer settings/export options

Tags:

org-mode

My org file contains many buffer settings/export options lines at the top, such as:

#+LaTeX_CLASS: koma-article
#+LaTeX_CLASS_OPTIONS: [a4paper,captions=nooneline,DIV=15]

This takes up a lot of screen space and requires having to scroll down to the working area when I open the file. Is there a way to hide these, such as in a drawer or block, that can be folded up or down as needed? I found this link which offers the use of #+SETUPFILE but I would prefer an option that keeps the options in the file I am working in. I tried creating a drawer as in:

#+BEGIN_OPTIONS
#+LaTeX_CLASS: koma-article
#+LaTeX_CLASS_OPTIONS: [a4paper,captions=nooneline,DIV=15]
...
#+END_OPTIONS

The above worked as I would like, being able to fold the options away into a single line at the top of my file. However, on export to PDF the contents of the drawer were displayed in the PDF file (The export options in the drawer were also applied to the format of the exported PDF, which is what I want, just without them displaying in the PDF itself).

Thank you in advance for any tips or advice.

like image 644
Toby Avatar asked Sep 06 '11 09:09

Toby


2 Answers

As Juancho said you can place the export options anywhere in the document, however to expand slightly on his heading at the end of the file you can simply set up your configuration in an archived headline with a :noexport: tag (See: Selective Export and Latex Selective Exporting)

C-c C-x a   ;archive sub-tree while keeping in file
C-c C-q noexport ;add the noexport tag

* Export Configuration                                     :noexport:ARCHIVE:

With this not only will the content be hidden in a headline while you work on the file (It will only expand if you use C-Tab on the headline, not when cycling headlines globally), but it will not be exported to the final PDF.

You should also be able to set :ARCHIVE: as an excluded tag in the org-export-exclude-tags list so that you'd only need to have one tag on the headline, but the above works from the default settings.

like image 109
Jonathan Leech-Pepin Avatar answered Oct 22 '22 11:10

Jonathan Leech-Pepin


The export options can be placed anywhere in the document, not necessarily at the top.

An option is to include the export options on a COMMENTed heading at the end of the file.

like image 20
Juancho Avatar answered Oct 22 '22 11:10

Juancho



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!