No se puede cargar el archivo xits-math.otf en lualatex; falta \endcsname insertado

No se puede cargar el archivo xits-math.otf en lualatex; falta \endcsname insertado

Aquí hay un MWE del problema del que estoy hablando. Estoy usando el comando lualatex.

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

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


\end{document}

Obtengo el siguiente resultado:

*************************************************
* 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}

Estoy usando el archivo del github XITS. Estoy intentando utilizar esta fuente porque Latin Modern Math no tiene el carácter que quiero y XITS Math sí, pero no he podido descubrir cómo cargar correctamente la fuente.

Respuesta1

No estoy seguro de por qué tienes que usar una copia privada de xits-math.otf, ya que se distribuye con TeX Live.

De todos modos, necesitas \string~:

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

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

\begin{document}

$a+b=c$

\end{document}

Obtengo, en la terminal y en el archivo de registro,

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

información relacionada