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.

I am trying to manipulate the font, font size and thickness of the mathematical characters individually. I came into this solution at stackexchange; XeTeX/mathspec punctuation issue

...
\makeatletter
\ernewcommand\eu@MathPunctuation@symfont{Latin:m:n}
\DeclareMathSymbol{,}{\mathpunct}{\eu@MathPunctuation@symfont}{`,}
...

To make the +-= bold and plain other I tried this way (which did not work);

\documentclass[9pt]{article}
\usepackage{extsizes}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathspec}


\setmathfont(Digits,Latin)[Numbers={Lining,Proportional},Lowercase={Regular},Uppercase={Regular}]{Arial}
\setmathfont(Greek)[Scale=1.15, Lowercase={Regular},Uppercase={Regular}]{Symbol}
\setmainfont[Ligatures=TeX]{Arial}

\makeatletter
\ernewcommand\eu@MathPunctuation@symfont{Latin:bx:n}
\DeclareMathSymbol{+}{\mathpunct}{\eu@MathPunctuation@symfont}{`+}
\DeclareMathSymbol{-}{\mathord}{\eu@MathPunctuation@symfont}{`-}
\DeclareMathSymbol{=}{\mathrel}{\eu@MathPunctuation@symfont}{`=}
\makeatother


\begin{document}
\thispagestyle{empty}

$+-=$+-=

\end{document}

Question 1) How can we make only characters "+-=" bold and other characters plain. Question 2) Can we set the font size of the "a" in the expression "x^a". I want my normal text to be 9pt and sub, sup, frac and frac{frac} characters to be fixed at 8pt not shrinking as the level increases. Any help is appreciated. Thank you all reading or responding.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You're forgetting to declare the suitable math symbol font; you have also to use \XeTeXDeclareMathSymbol if you want a real minus sign.

\documentclass[9pt]{article}
\usepackage{extsizes}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathspec}


\setmathfont(Digits,Latin)[
  Numbers={Lining,Proportional},
  Lowercase=Regular,
  Uppercase=Regular
]{Arial}
\setmathfont(Greek)[
  Scale=1.15,
  Lowercase=Regular,
  Uppercase=Regular
]{Symbol}
\setmainfont[Ligatures=TeX]{Arial}

% subscripts are 8pt at any level
\DeclareMathSizes{9}{9}{8}{8}

\makeatletter
\DeclareSymbolFont{Latin:bx:n}{EU1}{\eu@Latinmathsfont}{bx}{n}
\ernewcommand\eu@MathPunctuation@symfont{Latin:bx:n}
\DeclareMathSymbol{+}{\mathbin}{\eu@MathPunctuation@symfont}{`+}
\DeclareMathSymbol{=}{\mathrel}{\eu@MathPunctuation@symfont}{`=}
% fight against amsmath using the mathcode of `-`
\AtBeginDocument{%
  \XeTeXDeclareMathSymbol{-}{\mathbin}{\eu@MathPunctuation@symfont}{"2212}%
}
\makeatother


\begin{document}
\thispagestyle{empty}

$+-=$+-=

$a^{a^a}$

\end{document}

enter image description here

share|improve this answer
    
It is flawlessly correct. Thank you so much :) –  ahmetbayirli Feb 14 at 12:48

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.