0

I have bought a new win10 pc, and struggling in installing my XeLaTeX stuffs. Compiler gave me error at untxmia.fd.

enter image description here

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
Eric
  • 1,665
  • There may be some nonsense trash code in MWE, please ignore them. – Eric Sep 23 '18 at 11:44
  • I looked in newtx documentation and didn't found anything for usage with XeLaTeX... instead almost everywhere the code was using fontenc package... I suppose -but don't swear- this can not work in combination with XeLaTeX. So, please try changing your code to not use newtxtext or newtxmath and 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:52
  • @koleygr Thanks for replying. My old computer (win7) can compile the same code successively, so I suspect I might miss install some packages, or due to a big update of latest version of newtx package I can only install in today? (My old computer has an older version of newtx) – Eric Sep 23 '18 at 12:10
  • btw, is my MikTeX package manager loss some package? I remember there are several "unicode-*" package in my old computer's package manager. – Eric Sep 23 '18 at 12:16
  • Sorry @Eric, I don't use MikTeX... If a package was missing you would get an appropriate to understand error (the command is not defined or similar)... I suppose the new version of your TeX distribution just can't compile and I think that the reason is the combination of XeLaTeX and newtx. 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 (like newtx package's) help to do this. – koleygr Sep 23 '18 at 12:20
  • 2
    \iftx@ch means "if charter should be used then ...". It is a switch from newtxmath. You could add \newif\iftx@ch as 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:05
  • @UlrikeFischer I primary use mtpro2 except I like the + and - symbol from other times font (which is smaller). (I asked here) So I extract + and - from newtx. (I'm not familiar with LaTeX, so I am unable to write my own..) – Eric Sep 24 '18 at 04:39
  • On the other hand, can I remove all iftx@... between \makeatletter and \makeatother? Will it cause any problem? – Eric Sep 24 '18 at 04:40

0 Answers0