有几种类型的引号在英语中(在其他语言中甚至更多)。在 LaTeX 中也有几种表示这些的方法。我见过能够直接输入“和”我也见过这样的事情`''。
那么,在 LaTeX 中处理英文引号的最佳方法是什么?
答案1
可用解决方案的快速摘要:
使用 Unicode 编辑器,您只需键入
“text”
或即可‘text’
输入代码。这应该适用于 XeTeX/LuaTeX 和较新版本的 LaTeX,只需确保您的源文件以 UTF-8 编码保存即可。在旧版本的 LaTeX 中,您可能需要添加
\usepackage[utf8]{inputenc}
此输入法才能正常工作。输入
``text''
您的源代码以生成“文本”,然后输入`text'
以生成“文本”。随着
csquotes
包中,您输入\enquote{text}
,但您还可以获得大量其他选项,如上下文敏感性和外文引文。
答案2
TeX/LaTeX 默认显示真正的引号:`
和``
转换为开引号;'
和''
为闭引号。您通常总是会在输出中看到默认字体的弯曲引号。您应该始终引用如下
``this''
而不是像''this''
或"this"
,因为它看起来像 ”这样”(两边都有引号),对读者来说非常烦人。(如果您在 Emacs 中输入双引号字符,它会自动猜测您是否要插入``
或''
;其他编辑器可能也会这样做。)
如果您使用的环境支持 Unicode 输入,您也可以直接输入弯曲的引号字符: 或\usepackage[utf8]{inputenc}
XeTeX/LuaTeX。请参阅问题字形插入。
答案3
正如其他答案所指出的,csquotes
非常棒。以下是我非常喜欢的三个原因csquotes
。
- 主动引号。
- 自动管理嵌套引用,以便您几乎总是只需说“引用此”并
csquotes
找出正确的操作。 - 引号可以自动适应文档的全球语言和当地语言环境(如果不同)。
以下是在文档的不同位置使用英式和美式惯例的示例。英式惯例是默认惯例,因为这是文档的默认语言。但是,由于autostyle
指定了,因此当此语言处于活动状态时将使用美式惯例。
\documentclass[american,british]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[autostyle]{csquotes}
\MakeAutoQuote{‘}{’}
\begin{document}
This is an excerpt from Lewis Carroll, \emph{Alice's Adventures in Wonderland in The Complete Works of Lewis Carroll}, The Modern Library: Random House. Pp.~75--76. (Note: no copyright year is included as none is given.):
\begin{quotation}
‘Come, we shall have some fun now!’ thought Alice. ‘I'm glad they've begun asking riddles --- I believe I can guess that,’ she added aloud.
‘Do you mean that you think you can find out the answer to it?’ said the March Hare.
‘Exactly so,’ said Alice.
‘Then you should say what you mean,’ the March Hare went on.
‘I do,’ Alice hastily replied; ‘at least --- at least I mean what I say --- that's the same thing, you know.’
‘Not the same thing a bit!’ said the Hatter. ‘Why, you might just as well say that ‘I see what I eat’ is the same thing as ‘I eat what I see’!’
‘You might just as well say,’ added the March Hare, ‘that ‘I like what I get’ is the same thing as ‘I get what I like’!’
‘You might just as well say,’ added the Dormouse, which seemed to be talking in its sleep, ‘that ‘I breathe when I sleep’ is the same thing as ‘I sleep when I breathe’!’
\end{quotation}
\selectlanguage{american}
Here is the same passage with American conventions:
\begin{quotation}
‘Come, we shall have some fun now!’ thought Alice. ‘I'm glad they've begun asking riddles --- I believe I can guess that,’ she added aloud.
‘Do you mean that you think you can find out the answer to it?’ said the March Hare.
‘Exactly so,’ said Alice.
‘Then you should say what you mean,’ the March Hare went on.
‘I do,’ Alice hastily replied; ‘at least --- at least I mean what I say --- that's the same thing, you know.’
‘Not the same thing a bit!’ said the Hatter. ‘Why, you might just as well say that ‘I see what I eat’ is the same thing as ‘I eat what I see’!’
‘You might just as well say,’ added the March Hare, ‘that ‘I like what I get’ is the same thing as ‘I get what I like’!’
‘You might just as well say,’ added the Dormouse, which seemed to be talking in its sleep, ‘that ‘I breathe when I sleep’ is the same thing as ‘I sleep when I breathe’!’
\end{quotation}
\end{document}
答案4
如果您的需求很简单,您仍然可以使用该csquotes
包,但将其配置为识别"
字符:
\MakeOuterQuote{"}
这样,当您将某些文本括在双引号中时,它将使用适合您的语言的引号进行呈现。
不过,如果有嵌套引号,这种方法效果就不好了。您可以`
使用 为内引号指定另一个字符(如 )\MakeInnerQuote
,但您需要手动维护嵌套,并且不能使用'
,因为这会与撇号的其他用途相冲突。