是否有一个选项可以在组织模式下更改目录的默认标题?
我的文档不是英语,所以我想翻译目录标题。
回答
正如JeanPierre所说,这与导出设置有关。您可以LANGUAGE
通过org
以下方式在文档顶部进行设置:
#+LANGUAGE: fr
法语将用作org
导出过程中产生的所有字符串的默认语言。
负责翻译映射的常量org-export-dictionary
位于其中ox.el
,如果不支持您的语言,可以将其eval-defun
放在此处,然后进行更改。就我而言:
(defconst org-export-dictionary
...
("Table of Contents"
...
("sr" :html "Sadržaj" :utf-8 "Sadržaj")
...)
...)
我写了一个天真的函数,它可以在以下方面有用init.el
:
(defun org-export-translate-to-lang (term-translations &optional lang)
"Adds desired translations to `org-export-dictionary'.
TERM-TRANSLATIONS is alist consisted of term you want to translate
and its corresponding translation, first as :default then as :html and
:utf-8. LANG is language you want to translate to."
(dolist (term-translation term-translations)
(let* ((term (car term-translation))
(translation-default (nth 1 term-translation))
(translation-html (nth 2 term-translation))
(translation-utf-8 (nth 3 term-translation))
(term-list (assoc term org-export-dictionary))
(term-langs (cdr term-list)))
(setcdr term-list (append term-langs
(list
(list lang
:default translation-default
:html translation-html
:utf-8 translation-utf-8)))))))
(org-export-translate-to-lang '(("Table of Contents"
"Sadržaj"
"Sadržaj"
"Sadržaj")
("Another term"
"coilogji"))
"sr")
免责声明
如果要通过Latex导出,则无法使用(在组织导出为PDF时会使用Latex)。看一下泰勒的回答和评论。