如何在 Org 模式下将 csquotes 与 LaTeX 导出一起使用? [英] How can I use csquotes with LaTeX export in Org-mode?

查看:14
本文介绍了如何在 Org 模式下将 csquotes 与 LaTeX 导出一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 csquotes 时,引号会根据上下文由 csquotes 添加.这是通过使用 enquote 宏标记引号来完成的,即作为 enquote{text}.

When using csquotes quotation marks are added by csquotes according to context. This is done by marking up quotation with the enquote macro, i.e. as enquote{text}.

从 Org 模式导出到 LaTeX 时,引号标记为 ``'',例如作为 ``text''.

When exporting to LaTeX from Org-mode quotation marks are marked up as `` and '', e.g. as ``text''.

Org-mode 可以导出到带有 enquote 标记的引号的 LaTeX 吗?

Can Org-mode export to LaTeX with quotations marked up by enquote?

我找到了 http://comments.gmane.org/gmane.emacs.orgmode/43689 正在计划这样的功能,但我不知道它是否已实现.

I found http://comments.gmane.org/gmane.emacs.orgmode/43689 where such a feature is being planned but I do not understand whether it was implemented.

在相关说明中,有 在 AUCTeX 中集成 csquotes.集成是当文档加载 csquotes 时," 分别扩展为 enquote{}.这不是我想要的但是可能有一些代码可能对设置 Org-mode 以导出由 enquote 标记的引用感兴趣.

On a related note there is integration of csquotes in AUCTeX. The integration is that when a document loads csquotes then " is expanded to enquote{ and } respectively. This is not what I am asking for but there might be bits of code that can be interested in setting up Org-mode to export quotations marked up by enquote.

推荐答案

跟踪该线程到最后,然后查看 7.7 的更改日志(请参阅 Headline for version 7.7) release 我发现他们添加了一个变量org-latex-export-quotes.我不完全确定这将如何定制,但我怀疑它最终必须如下所示:

Following that thread to the end and then looking at the changelog for the 7.7 (see Headline for version 7.7) release I find that they have added a variable org-latex-export-quotes. I'm not entirely sure how this would have to be customized, but I suspect it would have to end up something as follows:

原始(包括在内,因为它仅出现在 7.7 中,我相信您正在运行 7.6):

Original (included since it only appears in 7.7 and I believe you're running 7.6):

(defcustom org-export-latex-quotes
  '(("fr" ("\(\s-\|[[(]\)"" . "«~") ("\(\S-\)"" . "~»") ("\(\s-\|(\)'" . "'"))
    ("en" ("\(\s-\|[[(]\)"" . "``") ("\(\S-\)"" . "''") ("\(\s-\|(\)'" . "`")))
  "Alist for quotes to use when converting english double-quotes.

The CAR of each item in this alist is the language code.
The CDR of each item in this alist is a list of three CONS:
- the first CONS defines the opening quote;
- the second CONS defines the closing quote;
- the last CONS defines single quotes.

For each item in a CONS, the first string is a regexp
for allowed characters before/after the quote, the second
string defines the replacement string for this quote."

收件人:

(setq org-export-latex-quotes
  '(("en" ("\(\s-\|[[(]\)"" . "\enquote{") ("\(\S-\)"" . "}") ("\(\s-\|(\)'" . "`"))))

我刚刚对此进行了测试,它确实按预期执行.示例文件:

I just tested this and it does perform as expected. The sample file:

* test
this is a test of "this"

导出为(省略序言):

section{test}
label{sec-1}

this is a test of enquote{this}

我不知道是否可以在 7.6 中轻松添加此功能,更简单的解决方案可能是升级.否则 7.6 中更简单的解决方案可能是创建自定义链接(请参阅:组织教程).这不会那么快,但确实在 7.6 提供的功能范围内提供了所需的结果.

I do not know if it is possible to easily add this feature within 7.6, the easier solution would likely be to upgrade. Otherwise the easier solution in 7.6 would likely be to create a custom link (see: Org Tutorials). This would not be as fast but does provide the desired results within the features provided by 7.6.

这篇关于如何在 Org 模式下将 csquotes 与 LaTeX 导出一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆