![如何以英式英语风格重新定义 csquotes 引语?](https://linux22.com/image/463585/%E5%A6%82%E4%BD%95%E4%BB%A5%E8%8B%B1%E5%BC%8F%E8%8B%B1%E8%AF%AD%E9%A3%8E%E6%A0%BC%E9%87%8D%E6%96%B0%E5%AE%9A%E4%B9%89%20csquotes%20%E5%BC%95%E8%AF%AD%EF%BC%9F.png)
看看下面的代码。我想知道为什么它不能用单引号工作。
\documentclass{article}
\usepackage[style=british]{csquotes}
\usepackage{fontspec}
\setmainfont{CharisSIL}
\newfontfamily\newcmbook{NewCM10-Book}
\DeclareTextCommand{\textquoteleft}{TU}{%
{{\newcmbook `}}% Doesn't work.
}
\DeclareTextCommand{\textquoteright}{TU}{%
{{\newcmbook '}}% Doesn't work.
}
\DeclareTextCommand{\textquotedblleft}{TU}{%
{{\newcmbook ``}}% Works.
}
\DeclareTextCommand{\textquotedblright}{TU}{%
{{\newcmbook ''}}% Works.
}
\begin{document}
\enquote{abcd}
\enquote*{abcd}
\end{document}
使用完全更新的 TeX Live 2023 中的 LuaLaTeX 进行编译。这两种字体都可以在 TeX 发行版中使用。输出如下:
*File List*
article.cls 2022/07/02 v1.4n Standard LaTeX document class
size10.clo 2022/07/02 v1.4n Standard LaTeX file (size option)
csquotes.sty 2022-09-14 v5.2n context-sensitive quotations (JAW)
etoolbox.sty 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
keyval.sty 2022/05/29 v1.15 key=value parser (DPC)
csquotes.def 2022-09-14 v5.2n csquotes generic definitions (JAW)
csquotes.cfg
fontspec.sty 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX
xparse.sty 2023-02-02 L3 Experimental document command parser
expl3.sty 2023-03-30 L3 programming layer (loader)
l3backend-luatex.def 2023-03-30 L3 backend support: PDF output (LuaTeX)
fontspec-luatex.sty 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX
答案1
当我使用正确的单引号(即,U+2018 Left Single Quotation Mark
而U+2019 Right Single Quotation Mark
不是撇号和重音符号(反引号))时,一切都按预期工作:
\documentclass{article}
\usepackage[style=british]{csquotes}
\usepackage{fontspec}
\setmainfont{CharisSIL}
\newfontfamily\newcmbook{NewCM10-Book}
\DeclareTextCommand{\textquoteleft}{TU}{%
{{\newcmbook ‘}}% Works.
}
\DeclareTextCommand{\textquoteright}{TU}{%
{{\newcmbook ’}}% Works.
}
\DeclareTextCommand{\textquotedblleft}{TU}{%
{{\newcmbook ``}}% Works.
}
\DeclareTextCommand{\textquotedblright}{TU}{%
{{\newcmbook ''}}% Works.
}
\begin{document}
\enquote{abcd}
\enquote*{abcd}
\end{document}