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>

관련 정보