开发者

Org-mode: Hide buffer settings/export options

开发者 https://www.devze.com 2023-04-03 11:18 出处:网络
My org file contains many buffer settings/export options lines at the top, such as: #+LaTeX_CLASS: koma-article

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

#+LaTeX_CLASS: koma-article
#+LaTeX_CLASS_OPTIONS开发者_StackOverflow中文版: [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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消