lualatex で xits-math.otf ファイルを読み込むことができません。\endcsname が挿入されていません。

lualatex で xits-math.otf ファイルを読み込むことができません。\endcsname が挿入されていません。

ここで私が言及している問題の MWE を示します。lualatex コマンドを使用しています。

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}

\begin{document}
\setmathfont[Path=~/texmf,
             Extension=.otf,
            ]{xits-math}


\end{document}

次のような出力が得られます。

*************************************************
* fontspec warning: "script-not-exist"
* 
* Font 'xits-math' does not contain script 'Math'.
*************************************************

*************************************************
* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Style=MathScript' (+ssty) not available for font
* 'xits-math' with script 'Math' and language 'Default'.
*************************************************

*************************************************
* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Style=MathScriptScript' (+ssty) not available for font
* 'xits-math' with script 'Math' and language 'Default'.
*************************************************
! Missing \endcsname inserted.
<to be read again> 
\protect 
l.8             ]{xits-math}

私は XITS github のファイルを使用しています。Latin Modern Math には必要な文字がなく、XITS Math にはあるため、このフォントを使用しようとしていますが、フォントを正常に読み込む方法がまったくわかりません。

答え1

xits-math.otfTeX Live で配布されているのに、なぜ のプライベートコピーを使用する必要があるのか​​わかりません。

とにかく、必要なものは次のとおりです\string~

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}

\setmathfont[
  Path=\string~/texmf/,
  Extension=.otf,
]{xits-math}

\begin{document}

$a+b=c$

\end{document}

ターミナルとログファイルには、

</Users/MASKED/texmf/xits-math.otf>

関連情報