1

Here is my MWE:

\documentclass[a4paper,openany,12pt]{book}           
\usepackage[a]{esvect}                                
\usepackage[utf8x]{inputenc}                       
\usepackage{amsmath,amssymb,amsthm,amsfonts}                   
\usepackage{mathrsfs,mathtools}                                                                               
\usepackage{fontenc}                                   
\usepackage{geometry}                           
\usepackage{fontspec}                    
\RequirePackage{hyperref}                    
\usepackage{etoolbox}           
\usepackage[computeautoilg=off]{xepersian}                   
\settextfont[Scale=1.1]{IRXLotus}                                                      
\setdigitfont[Scale=1.1]{IRXLotus}                  
\setlatintextfont[Scale=1.1]{Times New Roman}                 
\begin{document}               
\chapter{بردارهای ویژه و مقادیر ویژه}                             
    بردار $\mathbf{x}$ و $\mathbf{y}$    بر حسب پایه‌ای متعامد از فضای $\mathfrak{L}$ با مجموع حاصل‌ضرب دوبه‌دو متناظر مختصات آن‌ها به‌دست می‌آید. حال $\mathbf{x}$ را از $\mathfrak{L}$ بگیرید. اگر $\mathop{\xi_i=(\mathbf{x},\mathbf{e}_i)}_{(1 \leqslant i \leqslant n)}$ فرض شود، آنگاه
    \begin{equation*}
        \mathbf{x}=\xi_1 \mathbf{e}_1 +\cdots +\xi_n \mathbf{e}_n
    \end{equation*}
    و علت این است که
    \begin{equation*}
        (\mathbf{x},\mathbf{e}_i)=\displaystyle\xi_1 (\mathbf{e}_1,\mathbf{e}_i) +\cdots +\xi_n (\mathbf{e}_n,\mathbf{e}_i)=\xi_i (\mathbf{e}_i,\mathbf{e})=\xi_i (\mathbf{e}_i ,\mathbf{e}_i)=\xi_i (\mathbf{e}_i,\mathbf{e}_i )= \xi_i.
    \end{equation*}                                 
\end{document}       

I would like to import certain open math fonts for mathematical objects as suggested in this neat answer. It seems that they work under unicode-math package but, in this minimal work it crashed. May I ask you what to do? Thanks for your effort and the TIME!

David Carlisle
  • 757,742
Mikasa
  • 589

1 Answers1

2

You have not provided any example of the problem or showed what error you got. It is hard to debug "it crashed" without knowing what the input was.

I don't have the fonts you used, but if I switched fonts and added a couple of fixes for xepersion being incompatible with current latex loading unicode-math gives no error.

In comments you said you wanted Asana-Math, so:

enter image description here

If you edit the question to show an example of the problem, it would be easier to debug.

\documentclass[a4paper,openany,12pt]{book}           
\usepackage[a]{esvect}                                
%\usepackage[utf8x]{inputenc}                       
\usepackage{amsmath,amssymb,amsthm,amsfonts}                   
\usepackage{mathrsfs,mathtools}                                                                               
\usepackage{fontenc}                                   
\usepackage{geometry}                           
\usepackage{fontspec}                    
\RequirePackage{hyperref}                    
\usepackage{etoolbox}           
\usepackage[computeautoilg=off]{xepersian}
% https://github.com/persiantex/xepersian/issues/17
\ExplSyntaxOn
\cs_set_eq:NN \etex_iffontchar:D \tex_iffontchar:D 
\def\c_one{1~}
\ExplSyntaxOff                    
\settextfont[Scale=1.1]{Arial}%{IRXLotus}                                                      
\setdigitfont[Scale=1.1]{Arial}%{IRXLotus}                                                                  
\setlatintextfont[Scale=1.1]{Times New Roman}

\usepackage{unicode-math} \setmathfont{Asana-Math.otf}

\begin{document}
\chapter{بردارهای ویژه و مقادیر ویژه}
بردار $\mathbf{x}$ و $\mathbf{y}$ بر حسب پایه‌ای متعامد از فضای $\mathfrak{L}$ با مجموع حاصل‌ضرب دوبه‌دو متناظر مختصات آن‌ها به‌دست می‌آید. حال $\mathbf{x}$ را از $\mathfrak{L}$ بگیرید. اگر $\mathop{\xi_i=(\mathbf{x},\mathbf{e}i)}{(1 \leqslant i \leqslant n)}$ فرض شود، آنگاه \begin{equation} \mathbf{x}=\xi_1 \mathbf{e}_1 +\cdots +\xi_n \mathbf{e}_n \end{equation} و علت این است که \begin{equation} (\mathbf{x},\mathbf{e}_i)=\displaystyle\xi_1 (\mathbf{e}_1,\mathbf{e}_i) +\cdots +\xi_n (\mathbf{e}_n,\mathbf{e}_i)=\xi_i (\mathbf{e}_i,\mathbf{e})=\xi_i (\mathbf{e}_i ,\mathbf{e}_i)=\xi_i (\mathbf{e}_i,\mathbf{e}_i )= \xi_i. \end{equation}
\end{document}

David Carlisle
  • 757,742
  • Dear David, I am interested to use Asana Math fonts. I don't know where to insert the codes as written in noted answer. This is my problem. Sorry! – Mikasa Aug 12 '21 at 16:05
  • @Mikasa so was your error ! Package fontspec Error: The font "Asana Math" cannot be found. ? – David Carlisle Aug 12 '21 at 16:17
  • @Mikasa you should just need \setmathfont{Asana-Math.otf} after loading unicode-math but the font seems missing in texlive, if you download AsanaMath.otf from https://ctan.org/tex-archive/fonts/Asana-Math then it will work (I'm checking why the font is not there) – David Carlisle Aug 12 '21 at 16:24
  • I assumed to add the codes \setmainfont[Ligatures={Common,Rare,TeX}]{TeX Gyre Pagella} and \setmathfont[Scale=MatchUppercase]{Asana Math} after the line 18. So I got empty boxes in output instead of words and maths objects. May I add a picture below in answer your question for a while to illustrate better? – Mikasa Aug 12 '21 at 16:24
  • you don't want \setmainfont[Ligatures={Common,Rare,TeX}]{TeX Gyre Pagella} that will make the main font Pagella which has no Persian, just simply add \setmathfont{Asana Math} – David Carlisle Aug 12 '21 at 16:26
  • Thanks a lot!!!!! I got that David. Thanks for taking me out of darkness! :) – Mikasa Aug 12 '21 at 16:28
  • Beautiful response. One question: but in Arabic should they use the letters i, j as subscripts and not the Arabic characters ones? :-) – Sebastiano Aug 13 '21 at 12:24
  • 1
    @Sebastiano Thanks for the comment :-) He deserved more than I said. About your question: I don't know the way of that in Arabic (or Arabic academic world) but in in Persian (I mean in Iran) it is acceptable and Xepersian does for us. – Mikasa Aug 18 '21 at 13:28
  • @Mikasa Ah, I not known it. Excuse me :-( – Sebastiano Aug 18 '21 at 20:49