Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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} 
share|improve this question

1 Answer 1

up vote 4 down vote accepted

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} 

enter image description here

share|improve this answer
    
Looks good. Thanks! –  Conic Oct 2 '12 at 11:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.