6

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} 

1 Answer 1

11

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

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .