I have bought a new win10 pc, and struggling in installing my XeLaTeX stuffs. Compiler gave me error at untxmia.fd.
I guess it means that I miss-install some fonts/packages. But I can't figure out what does iftx@ch mean.
MWE
\documentclass[12pt,a4paper,openany,fleqn]{book}
\usepackage[margin=2cm, top=2cm]{geometry}
\renewcommand{\rmdefault}{ptm}
\usepackage{amsmath}
\usepackage[no-math]{fontspec}
\usepackage{xeCJK}
\setmainfont{Times New Roman Bold}
\usepackage[subscriptcorrection,nofontinfo,zswash,mtphrb]{mtpro2}
\defaultfontfeatures{Ligatures=TeX}
\setCJKmainfont[ItalicFont={新細明體},BoldFont={新細明體}]{新細明體}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\newfontfamily\schola{Times New Roman}
\makeatletter
\newif\iftx@libertine
\newif\iftx@minion
\newif\iftx@coch
\makeatother
\DeclareSymbolFont{lettersffA}{U}{ntxmia}{m}{it}
\SetSymbolFont{lettersffA}{bold}{U}{ntxmia}{b}{it}
\DeclareMathSymbol{+}{\mathbin}{lettersffA}{253}
\DeclareSymbolFont{vvsymbols}{OMS}{txsy}{m}{n} %OMS, txsy works
\SetSymbolFont{vvsymbols}{bold}{OMS}{txsy}{bb}{n}
\DeclareMathSymbol{\times}{\mathbin}{vvsymbols}{2}
\DeclareMathSymbol{-}{\mathbin}{vvsymbols}{0}
\begin{document}
$123$
\end{document}
The code of untxmia.fd is as follows
%Filename: untxmia.fd
%Created by: tex mia-drv
%Created using fontinst v1.933
%THIS FILE SHOULD BE PUT IN A TEX INPUTS DIRECTORY
\ProvidesFile{untxmia.fd}
[2018/04/14 Fontinst v1.933 font definitions for U/ntxmia.]
\expandafter\ifx\csname ntxmath@scaled\endcsname\relax
\let\ntxmath@scaled\@empty%
\fi
\DeclareFontFamily{U}{ntxmia}{\skewchar \font =127}
\iftx@libertine
\DeclareFontShape{U}{ntxmia}{m}{it}{
<-> \ntxmath@scaled nxlmia
}{}
\DeclareFontShape{U}{ntxmia}{b}{it}{
<-> \ntxmath@scaled nxlbmia
}{}
\else
\iftx@minion
\DeclareFontShape{U}{ntxmia}{m}{it}{
<-> \ntxmath@scaled zmnmia
}{}
\DeclareFontShape{U}{ntxmia}{b}{it}{
<-> \ntxmath@scaled zmnbmia
}{}
\else
\iftx@coch
\DeclareFontShape{U}{ntxmia}{m}{it}{
<-> \ntxmath@scaled zcochmia
}{}
\DeclareFontShape{U}{ntxmia}{b}{it}{
<-> \ntxmath@scaled zcochbmia
}{}
\else
\iftx@ch
\DeclareFontShape{U}{ntxmia}{m}{it}{
<-> \ntxmath@scaled zchmia
}{}
\DeclareFontShape{U}{ntxmia}{b}{it}{
<-> \ntxmath@scaled zchbmia
}{}
\else
\iftx@stxtwo
\DeclareFontShape{U}{ntxmia}{m}{it}{
<-> \ntxmath@scaled ntxstx2mia
}{}
\DeclareFontShape{U}{ntxmia}{b}{it}{
<-> \ntxmath@scaled ntxstx2bmia
}{}
\else
\DeclareFontShape{U}{ntxmia}{m}{it}{
<-> \ntxmath@scaled ntxmia
}{}
\DeclareFontShape{U}{ntxmia}{b}{it}{
<-> \ntxmath@scaled ntxbmia
}{}
\fi
\fi
\fi
\fi
\fi
\DeclareFontShape{U}{ntxmia}{m}{sl}{<->ssub * ntxmia/m/it}{}
\DeclareFontShape{U}{ntxmia}{bx}{it}{<->ssub * ntxmia/b/it}{}
\DeclareFontShape{U}{ntxmia}{b}{sl}{<->ssub * ntxmia/b/it}{}
\DeclareFontShape{U}{ntxmia}{bx}{sl}{<->ssub * ntxmia/b/sl}{}
\endinput

fontencpackage... I suppose -but don't swear- this can not work in combination with XeLaTeX. So, please try changing your code to not usenewtxtextornewtxmathand relevant content and tell us if it works for you. Sure are other (easier) ways to use fonts in XeLaTeX. See the related: https://tex.stackexchange.com/questions/281525/combination-of-newtx-and-fontspec-breaks-siunitx – koleygr Sep 23 '18 at 11:52newtxpackage I can only install in today? (My old computer has an older version ofnewtx) – Eric Sep 23 '18 at 12:10XeLaTeXandnewtx. I would try to avoid it anyway, because XeLaTeX is build in a way that makes simple the font handling and doesn't need an external (likenewtxpackage's) help to do this. – koleygr Sep 23 '18 at 12:20\iftx@chmeans "if charter should be used then ...". It is a switch from newtxmath. You could add\newif\iftx@chas you added\newif\iftx@minion(and similar for the followings if's) but it is quite unclear if you get at the end the font you want. Instead of misusing the fd-files from newtxmath you should better write your own. – Ulrike Fischer Sep 23 '18 at 14:05mtpro2except I like the + and - symbol from other times font (which is smaller). (I asked here) So I extract + and - fromnewtx. (I'm not familiar with LaTeX, so I am unable to write my own..) – Eric Sep 24 '18 at 04:39iftx@...between\makeatletterand\makeatother? Will it cause any problem? – Eric Sep 24 '18 at 04:40