如何以英式英语风格重新定义 csquotes 引语?

如何以英式英语风格重新定义 csquotes 引语?

看看下面的代码。我想知道为什么它不能用单引号工作。

\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 发行版中使用。输出如下:

1


 *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 MarkU+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}

在此处输入图片描述

相关内容