在组织乳胶导出中禁用标题
Disable title in org latex export
是否可以完全禁用标题,即 甚至 \title{}
,当将 org 文件导出到 Latex 时?我正在使用 org 模式写论文 发布者提供的乳胶模板不允许 \title{}
命令出现在 \begin{document}
之前
我尝试了很多在网上找到的解决方案,但它们都不适用于我正在使用的 Latex 模板。目前,我将 #+BIND: org-latex-title-command "
放入我的组织文件中。从ox-latex
中的源码中,我发现org-latex-template (contents info)
里面有如下代码:
;; Title and subtitle.
(let* ((subtitle (plist-get info :subtitle))
(formatted-subtitle
(when subtitle
(format (plist-get info :latex-subtitle-format)
(org-export-data subtitle info))))
(separate (plist-get info :latex-subtitle-separate)))
(concat
(format "\title{%s%s}\n" title
(if separate "" (or formatted-subtitle "")))
(when (and separate subtitle)
(concat formatted-subtitle "\n"))))
这是否意味着没有办法去掉导出的乳胶文件中的\title{}
命令?
感谢您的帮助!
我想出了这个从输出中删除 \title{...}
行的小建议函数:
(defun my-org-latex-remove-title (str)
(replace-regexp-in-string "^\\title{.*}$" "" str))
(advice-add 'org-latex-template :filter-return 'my-org-latex-remove-title)
是否可以完全禁用标题,即 甚至 \title{}
,当将 org 文件导出到 Latex 时?我正在使用 org 模式写论文 发布者提供的乳胶模板不允许 \title{}
命令出现在 \begin{document}
我尝试了很多在网上找到的解决方案,但它们都不适用于我正在使用的 Latex 模板。目前,我将 #+BIND: org-latex-title-command "
放入我的组织文件中。从ox-latex
中的源码中,我发现org-latex-template (contents info)
里面有如下代码:
;; Title and subtitle.
(let* ((subtitle (plist-get info :subtitle))
(formatted-subtitle
(when subtitle
(format (plist-get info :latex-subtitle-format)
(org-export-data subtitle info))))
(separate (plist-get info :latex-subtitle-separate)))
(concat
(format "\title{%s%s}\n" title
(if separate "" (or formatted-subtitle "")))
(when (and separate subtitle)
(concat formatted-subtitle "\n"))))
这是否意味着没有办法去掉导出的乳胶文件中的\title{}
命令?
感谢您的帮助!
我想出了这个从输出中删除 \title{...}
行的小建议函数:
(defun my-org-latex-remove-title (str)
(replace-regexp-in-string "^\\title{.*}$" "" str))
(advice-add 'org-latex-template :filter-return 'my-org-latex-remove-title)