我的 org 文件在顶部包含许多缓冲区设置/导出选项行,例如:
#+LaTeX_CLASS: koma-article
#+LaTeX_CLASS_OPTIONS: [a4paper,captions=nooneline,DIV=15]
这占用了大量屏幕空间,并且在打开文件时需要向下滚动到工作区域。有没有办法将它们隐藏起来,例如隐藏在抽屉或盒子中,可以根据需要向上或向下折叠?我发现此链接提供了 #+SETUPFILE 的使用,但我会更喜欢将选项保留在我正在处理的文件中的选项。我尝试创建一个抽屉,如下所示:
#+BEGIN_OPTIONS
#+LaTeX_CLASS: koma-article
#+LaTeX_CLASS_OPTIONS: [a4paper,captions=nooneline,DIV=15]
...
#+END_OPTIONS
上面的工作如我所愿,能够将选项折叠到文件顶部的一行中。但是,导出到 PDF 时,抽屉的内容显示在 PDF 文件中(抽屉中的导出选项也应用于导出的 PDF 的格式,这正是我想要的,只是没有它们显示在 PDF 本身中) 。
预先感谢您提供任何提示或建议。
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.
发布评论
评论(3)
导出选项可以放置在文档中的任何位置,不一定位于顶部。
一个选项是在文件末尾的注释标题上包含导出选项。
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.
当你编写上面的内容时,你创建的是一个“块”而不是一个“抽屉”。
有一些默认块,例如
#+BEGIN_EXAMPLE ... #+END_EXAMPLE
,但您也可以使用#+BEGIN_ 创建自定义块。 ... #+END_
,这实际上就是您所做的。如果将这样的块导出到 LaTeX,您将得到\begin{X} ... \end{X}
。如果您成功地将选项放入抽屉,您就会获得所需的行为。它看起来像这样:
注意:绘图的名称不必是
:OPTIONS:
位于抽屉内对于该行是否导出没有影响。
诸如
#+LaTeX_CLASS: koma-article
之类的行不会按字面意思导出,因此也不会从抽屉内导出。What you created when you wrote the above is a 'block' not a 'drawer'.
There are some default blocks, such as
#+BEGIN_EXAMPLE ... #+END_EXAMPLE
, but you can also create custom blocks with#+BEGIN_<X> ... #+END_<X>
, which is effectively what you did. If you export such a block to LaTeX you get\begin{X} ... \end{X}
.If you had successfully put the options into a drawer, you would have had the desired behaviour. It would look like this:
NB: the name of the draw doesn't have to be
:OPTIONS:
Being inside a drawer has no effect on whether or not the line will export.
Lines such as
#+LaTeX_CLASS: koma-article
do not get exported literally, and so will not export from within a drawer either.正如 Juancho 所说,您可以将导出选项放置在文档中的任何位置,但是要稍微扩展文件末尾的标题,您可以简单地在 已存档标题,带有 :noexport: 标记(请参阅:选择性导出 和 Latex 选择性导出)
这样,不仅在您处理文件时内容会隐藏在标题中(只有在标题上使用 C-Tab 时才会展开,而不是在全局循环标题时),而且不会导出到最终的PDF。
您还应该能够将 :ARCHIVE: 设置为 org-export-exclude-tags 列表中的排除标签,这样您只需要在标题上有一个标签,但上述内容在默认设置下有效。
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)
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.