XeTeX/mathspec 标点符号问题

XeTeX/mathspec 标点符号问题

在一个上一个问题,给出了使用 mathspec 时更改数学环境中标点符号字体的解决方案。不幸的是,此解决方案将标点符号变成斜体(就像数学环境中其余的拉丁文本一样),而标点符号通常采用罗马字母。

逗号的差异非常细微,因此如果不直接与普通文本进行比较,很难发现。分号的差异更明显(但逗号的差异也很明显)。

这是一个最简单的例子,使用了前面的问题和解决方案,以及我添加的其他几行:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amsthm}
\usepackage[MnSymbol]{mathspec}
\usepackage[no-sscript]{xltxtra}
\defaultfontfeatures{Mapping=tex-text}
\setallmainfonts{Minion Pro}


\makeatletter
\DeclareMathSymbol{,}{\mathpunct}{\eu@LatinLowercase@symfont}{`,}
\DeclareMathSymbol{.}{\mathord}{\eu@LatinLowercase@symfont}{`.}
\DeclareMathSymbol{<}{\mathrel}{\eu@LatinLowercase@symfont}{`<}
\DeclareMathSymbol{>}{\mathrel}{\eu@LatinLowercase@symfont}{`>}
\DeclareMathSymbol{/}{\mathord}{\eu@LatinLowercase@symfont}{`/}
\DeclareMathSymbol{;}{\mathord}{\eu@LatinLowercase@symfont}{`;}
\XeTeXDeclareMathSymbol{^^^^2026}{\mathinner}{\eu@LatinLowercase@symfont}{"2026}   [\mathellipsis]
\makeatother


\begin{document}

This, is some normal text; with weird punctuation. 

$\phi, \varphi, \delta \ldots A \vee B$

We can see an italic \emph{x} and, some punctuation; $x_i;x_0,x_1,x_2, {\dots} = x_i +x_0/60+x_1/60^2+x_2/60^3 {\dots}$

\end{document} 

答案1

您说得对,符号是斜体的。但是,似乎存在一个限制,即mathspec没有定义“标点符号”集,因此基本上只能从\eu@LatinLowercase@symfont或中选择\eu@LatinUppercase@symfont,而默认设置下,这两个都指向Latin:m:it

因此完整的解决方案可能是

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amsthm}
\usepackage[MnSymbol]{mathspec}
%\usepackage[no-sscript]{xltxtra} % no longer needed
%\defaultfontfeatures{Ligatures=TeX} % is default
\setallmainfonts{Minion Pro}
%\setmathsfont(Latin)[Uppercase=Regular]{Minion Pro}

\makeatletter
\ernewcommand\eu@MathPunctuation@symfont{Latin:m:n}
\DeclareMathSymbol{,}{\mathpunct}{\eu@MathPunctuation@symfont}{`,}
\DeclareMathSymbol{.}{\mathord}{\eu@MathPunctuation@symfont}{`.}
\DeclareMathSymbol{<}{\mathrel}{\eu@MathPunctuation@symfont}{`<}
\DeclareMathSymbol{>}{\mathrel}{\eu@MathPunctuation@symfont}{`>}
\DeclareMathSymbol{/}{\mathord}{\eu@MathPunctuation@symfont}{`/}
\DeclareMathSymbol{;}{\mathpunct}{\eu@MathPunctuation@symfont}{`;}
\XeTeXDeclareMathSymbol{^^^^2026}{\mathinner}{\eu@MathPunctuation@symfont}{"2026}[\mathellipsis]
\makeatother

\begin{document}

This, is some normal text; with weird punctuation. 

$\phi, \varphi, \delta \ldots A \vee B$

We can see an italic \emph{x} and, some punctuation; $x_i;x_0,x_1,x_2, {\dots} = x_i +x_0/60+x_1/60^2+x_2/60^3 {\dots}$

\end{document} 

在此处输入图片描述

相关内容