gpt4 book ai didi

emacs - 组织模式下的 secret 结构?

转载 作者:行者123 更新时间:2023-12-04 22:46:34 25 4
gpt4 key购买 nike

我想知道 org-mode 中是否有任何功能可以使我能够使用 secret 结构进行操作,即:我在编辑时可以看到的结构,但在导出时被视为不存在.它主要是在我导出为 ascii 时导入。

示例:

我想在 .org 文件中这样做:

* Normal heading
** Secret heading 1
Some text 1
** Secret heading 2
Some text 2
** Secret heading 3
Some text 3

要导出到这个:
Normal heading
--------------
Some text 1
Some text 2
Some text 3

使标题保密的东西可以是标签、属性或其他东西,但 secret 标题应该是可折叠的。

编辑:

找到此解决方案 (from here) (我使用的是 org-mode 7.9.3 f。它不起作用。带有 :ignoreheading: 标签的标题仍然显示:
;; backend aware export preprocess hook
(defun sa-org-export-preprocess-hook ()
"My backend aware export preprocess hook."
(save-excursion
(when (eq org-export-current-backend 'latex)
;; ignoreheading tag for bibliographies and appendices
(let* ((tag "ignoreheading"))
(org-map-entries (lambda ()
(delete-region (point-at-bol) (point-at-eol)))
(concat ":" tag ":"))))))

(add-hook 'org-export-preprocess-hook 'sa-org-export-preprocess-hook)

最佳答案

您可以使用 EXCLUDE_TAGS属性并标记某些部分,然后使用 org-export-exclude-tags 导出.例如:

#+EXCLUDE_TAGS: noexport

* Public Section

* Secret Section :noexport:

文档 here .

关于emacs - 组织模式下的 secret 结构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22906715/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com