我正在编辑一篇文本,其中几篇文章是梵文,其余文章是英文。开头和结尾的引号显示不正确。我已经浏览了本网站上的大部分讨论,但问题仍然存在。
\documentclass[paper=17cm:24cm,11pt,DIV=12,BCOR=10mm,headinclude=true,pagesize=false,headings=small,table]{scrbook}
\usepackage[frame,a4,center]{crop}
\usepackage{xspace}
\usepackage{hyperref}
\usepackage{csquotes}
\usepackage{newunicodechar}
\addtokomafont{disposition}{\rmfamily}
\renewcommand{\sffamily}{\rmfamily}
\usepackage{xunicode}
\usepackage{fontspec}
\usepackage[osf]{libertine}
\usepackage{polyglossia}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt
\setdefaultlanguage[variant=uk]{english}
\setmainfont{Linux Libertine O}
\newfontfamily\ef{Linux Libertine O}
\setotherlanguage{sanskrit}
\newfontfamily\devanagarifont[Script=Devanagari,Mapping=devanagarinumerals]{Sanskrit2003}
\font\df="Sanskrit 2003:script=devanagari" at 12pt
\font\dfs="Sanskrit 2003:script=devanagari" at 10pt
\setotherlanguage{tibetan}
\newfontfamily\tf {Kailasa}
\newfontfamily\stsong{STSong}
\newcommand\chinese[1]{{\stsong #1}}
\begin{document}
\df {अधुना कवेः कुलनाम विमर्शितव्यम्~। अत्र विद्येते द्वौ पाठौ ``उदुम्बरनामान" इति ``डम्बरनामान" इति च~।}
\ef {In a way, we can say that ``Jain poetics" is not given proper attention in the entire history of Sanskrit poetics on which scholars of the rank of Mahāmahopādhyāya Kane }
\end{document}
答案1
csquotes
问题中显示的代码有三个主要障碍
代码加载
csquotes
但并未使用。它仍然使用以下代码“硬编码”引号:``Jain poetics"
您想使用
csquotes
以下设施\enquote
\enquote{Jain poetics}
csquotes
仅适应语言更改,而不是字体更改。目前代码只是切换字体\df
,而不是语言。你想尝试类似\begin{document} \begin{sanskrit} अधुना कवेः कुलनाम विमर्शितव्यम्~। अत्र विद्येते द्वौ पाठौ \enquote{उदुम्बरनामान} इति \enquote{डम्बरनामान} इति च~। \end{sanskrit} In a way, we can say that \enquote{Jain poetics} is not given proper attention in the entire history of Sanskrit poetics on which scholars of the rank of Mahāmahopādhyāya Kane \end{document}
但您还需要使用该
csquotes
选项autostyle
来csquote
适应文档中的所有语言变化。csquotes
没有梵语引号的配置。所以你必须自己提供一个。我在谷歌上搜索梵语引号时找不到任何东西,所以你必须自己填写正确的字符\DeclareQuoteStyle{sanskrit} {<outer left>} {<outer right>} {<inner left>} {<inner right>}
请注意,您的 Sanskrit 字体必须包含您使用的字符。这也是问题代码中的一个问题:您的 Sanskrit 字体没有 和 字符
``
,"
因此您只能得到空框。
总的来说,代码如下所示(但您需要调整\DeclareQuoteStyle{sanskrit}
)
\documentclass{article}
\usepackage{fontspec}
\usepackage[osf]{libertine}
\usepackage{polyglossia}
\usepackage[autostyle=true]{csquotes}
\usepackage{hyperref}
\setdefaultlanguage[variant=uk]{english}
\setotherlanguage{sanskrit}
\newfontfamily\devanagarifont[Script=Devanagari,Mapping=devanagarinumerals]
{NotoSansDevanagari-Regular.ttf}
\DeclareQuoteStyle{sanskrit}
{<outer left>}
{<outer right>}
{<inner left>}
{<inner right>}
\begin{document}
\begin{sanskrit}
अधुना कवेः कुलनाम विमर्शितव्यम्~। अत्र विद्येते द्वौ पाठौ
\enquote{उदुम्बरनामान} इति \enquote{डम्बरनामान} इति च~।
\end{sanskrit}
In a way, we can say that \enquote{Jain poetics} is not given proper attention
in the entire history of Sanskrit poetics on which scholars
of the rank of Mahāmahopādhyāya Kane
\end{document}