我正在创建一个文档,其中主要文字是罗马文字,但我使用 内联切换到高棉语(柬埔寨语)\ucharclasses
。(使用 排版XeLaTeX
)。除非我将高棉语文本放在括号、方括号或引号中,否则这种方法效果很好。以下是 MWE:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\khmerfamily[Scale=0.8,Script=Khmer]{Khmer Mondulkiri}
\usepackage[Khmer]{ucharclasses}
\setTransitionTo{Khmer}{\khmerfamily}
\setTransitionFrom{Khmer}{\rmfamily}
\begin{document}
Here is a bit of text, ហើយអាហ្នឹងជាឃ្លាសសេជាអក្សរខ្មែរដែ។ But if I put a Khmer word in parentheses (អញ្ចឹង) or square brackets [អញ្ចឹង], or quotation marks `អញ្ចឹង' ``អញ្ចឹង'', it doesn't typeset properly. In the middle of a sentence កណ្ដាល it's fine.
\end{document}
输出如下:
任何意见都将不胜感激。(我承认我并不真正理解ucharclasses
它的工作原理——对我来说它完全是一个黑匣子。)
答案1
您需要使用以下Latin
选项加载/激活更多设置:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\khmerfamily[Scale=0.8,Script=Khmer]{Khmer Mondulkiri}
\usepackage[Latin,Khmer]{ucharclasses}
\setTransitionTo{Khmer}{\khmerfamily}
\setTransitionFrom{Khmer}{\rmfamily}
\begin{document}
Here is a bit of text, ហើយអាហ្នឹងជាឃ្លាសសេជាអក្សរខ្មែរដែ។ But if I put a Khmer word in parentheses (អញ្ចឹង) or square brackets [អញ្ចឹង], or quotation marks `អញ្ចឹង' ``អញ្ចឹង'', it doesn't typeset properly. In the middle of a sentence កណ្ដាល it's fine.
\end{document}