Al configurar mainfont y sansfont se desactiva CMU Bright como fuente matemática; ¿como arreglar?

Al configurar mainfont y sansfont se desactiva CMU Bright como fuente matemática; ¿como arreglar?

Me gustaría poder utilizar un TTF (News Gothic) personalizado como fuente principal en todo mi documento dondequiera que aparezca el texto, y CMU Bright para matemáticas. Pero \textdentro del modo matemático debería usar New Gothic. Sin embargo, intentar utilizar News Gothic como fuente principal desactiva CMU como fuente matemática, que puede ver en la imagen a continuación:  sinestá escrita en News Gothic, al igual que ABC, pero xy e^{-x}están en Computer Modern en lugar de CMU Bright.

Aquí hay un documento de muestra. Fue compilado con xelatex, aunque una solución exclusiva de luatex también estaría bien; No creo que pdflatex pueda manejar fuentes como esta, pero me encantaría equivocarme. Cualquier solución que funcione es aceptable.

\documentclass{article}

\usepackage{mathtools}
\usepackage{fontspec,unicode-math}

\usepackage{cmbright}
\usepackage[T1]{fontenc}

\setmainfont[
Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
Extension = .ttf,
BoldFont = News Gothic MT Bold,
ItalicFont = News Gothic MT Italic,
BoldItalicFont = News Gothic MT Bold Italic
]
{News Gothic MT}

\setsansfont[
Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
Extension = .ttf,
BoldFont = News Gothic MT Bold,
ItalicFont = News Gothic MT Italic,
BoldItalicFont = News Gothic MT Bold Italic
]
{News Gothic MT}

\begin{document}

\begin{center}
    This is math:
    \begin{align*}
        \int_{-\infty}^\infty \frac{\sin(x)e^{-x}}{x}\quad\textbf{\textit{ABC}}
    \end{align*}
\end{center}

\end{document}

Resultado:

ingrese la descripción de la imagen aquí

Si elimino \setmainfont, sintambién se convierte en Computer Modern. Si elimino \setsansfont, la fuente del cuerpo y ABCambas se convierten en CMU Bright (pero sinsiguen siendo News Gothic). Pero no puedo entender la combinación que resultará en:

  1. Fuente del cuerpo = Noticias góticas
  2. sin= News Gothic (esto es opcional; CMU Bright también estaría bien)
  3. \texten modo matemático = Noticias Góticas
  4. Números, variables, etc en modo matemático = CMU Bright

Respuesta1

Desea utilizar fuentes matemáticas heredadas, así que no las cargue unicode-math. Y, por supuesto, no cargue fontenccon codificación T1.

\documentclass{article}

\usepackage{mathtools}
\usepackage{fontspec}
\usepackage{cmbright}

%\usepackage[T1]{fontenc}% <--- don't

\setmainfont{News Gothic MT}[
  Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
  Extension = .ttf,
  ItalicFont = * Italic,
  BoldFont = * Bold,
  BoldItalicFont = * Bold Italic,
]

\setsansfont{News Gothic MT}[
  Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
  Extension = .ttf,
  ItalicFont = * Italic,
  BoldFont = * Bold,
  BoldItalicFont = * Bold Italic,
]

\begin{document}

This is math:
\begin{equation*}
\int_{-\infty}^\infty \frac{\sin(x)e^{-x}}{x}\quad\textbf{\textit{ABC}}+123
\end{equation*}

\end{document}

ingrese la descripción de la imagen aquí

Se pueden obtener los nombres de los operadores en News Gothic con un preámbulo ligeramente diferente:

\documentclass{article}

\usepackage{mathtools}
\usepackage{fontspec}
\usepackage{cmbright}

\setmainfont{News Gothic MT}[
  Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
  Extension = .ttf,
  ItalicFont = * Italic,
  BoldFont = * Bold,
  BoldItalicFont = * Bold Italic,
  NFSSFamily = ngmt,
]

\setsansfont{News Gothic MT}[
  Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
  Extension = .ttf,
  ItalicFont = * Italic,
  BoldFont = * Bold,
  BoldItalicFont = * Bold Italic,
]

\DeclareSymbolFont{operators}{TU}{ngmt}{m}{n}
\SetSymbolFont{operators}{bold}{TU}{ngmt}{b}{n}
\DeclareSymbolFont{cmbroperators}{OT1}{cmbr}{m}{n}

\makeatletter
\AtBeginDocument{\DeclareMathSymbol{\std@equal}{\mathrel}{cmbroperators}{`=}}
\makeatother


\begin{document}

\show\Relbar

This is math:
\begin{equation*}
\int_{-\infty}^\infty \frac{\sin(x)e^{-x}}{x}\quad\textbf{\textit{ABC}}+123
\end{equation*}

$\Longrightarrow\longrightarrow$

\end{document}

ingrese la descripción de la imagen aquí

información relacionada