XeTeX/mathspec punctuation issue

In a previous question, a solution was given for changing the font of punctuation marks in a math environment when using mathspec. Unfortunately, this solution gives the punctuation marks in italics (like the rest of the Latin text in a math environment), whereas the punctuation marks are generally in Roman case.

The difference for the comma is pretty subtle, so it's hard to see without a direct comparison to normal text. It is more clear with the semi-colon (but it's there with the comma as well).

Here is a minimal example, using the previous question and solution, and a few other lines that I added:

\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}

-

You're right that the symbol are italic. However, there seems to be a limitation in mathspec that doesn't define a "Punctuation" set, so basically one has to choose either from \eu@LatinLowercase@symfont or \eu@LatinUppercase@symfont and these, with the default setting, both point to Latin:m:it.

So the complete solution may be

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amsthm}
\usepackage[MnSymbol]{mathspec}
\usepackage[no-sscript]{xltxtra}
\defaultfontfeatures{Mapping=tex-text}
\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}


-
Looks good. Thanks! –  Conic Oct 2 '12 at 11:08