如何使用 lualatex-math 设置 mathfont - lualatex

如何使用 lualatex-math 设置 mathfont - lualatex

我已经使用过LuaLaTeX Version 1.12.0,我希望所有display-math字体都应在STIX字体中。如何实现。

我需要在使用lualatex-math字体时实现这一点。

    \documentclass{article}
    \usepackage{amsmath,hyperref,fontspec,luacolor,lualatex-math}
    \setmainfont{Arial Unicode MS}
    \begin{document}
    \title{Article Title Here}
    \author{Author Here}
    \maketitle
    
    \section{Introduction}
    
    The investigations of cylindrically symmetric spacetimes can be traced back as far as to 1919 when Levi-Civita (LC) discovered a class of solutions of Einstein’s vacuum field equations, corresponding to static cylindrical spacetimes [\href{cqgab7bbabib1}{\textcolor{blue}{1}}].
    \begin{align*}{\frac{G\mathrm{μ}}{{{c}^{{2}}}}}=\mathcal{O}{\left({{\frac{{{E}^{{2}}}}{{{M}_{pl}^{{2}}}}}}\right)},\tag{1.1}\end{align*}
    where ${{{M}_{pl}}{\left({≡{\mathrm{ℏ}c/G}}\right)}}$ denotes the Planck mass.
    \begin{thebibliography}{000}
    \bibitem{cqgab7bbabib1}{Aasi Jet alLIGO Scientific and VIRGO Collaborations (2014) Constraints on cosmic strings from the LIGO-Virgo gravitational-wave detectors\textit{Phys. Rev. Lett.} \textcolor{blue}{\textbf{112}} } 

\bibitem{cqgab7bbabib2}{Abbott B Pet alLIGO and Virgo Collaborations (2016) Astrophysical implications of the binary black hole merger GW150914\textit{Astrophys. J. Lett.} \textcolor{blue}{\textbf{818}} }
    \end{thebibliography}
        \end{document}

如何实现这一点?

答案1

作为@UlrikeFischer在评论中指出,lualatex-math不适合加载字体。事实上,如果你的 TeX 发行版相当新,那么lualatex-math根本没有理由加载。

您提到要使用 Stix 字体进行数学运算。Stix 是 Times Roman 的克隆,但已经很久没有更新了。我建议您使用XITS/XITS MathStix Two Text/Stix Two Math或这newtxtext/newtxmath对字体,而不是 Stix。

以下三组说明中的其中一组应该适合您:

\usepackage[no-math]{fontspec}
\usepackage{newtxtext,newtxmath}

或者

\usepackage{unicode-math}
\setmainfont{XITS}
\setmathfont{XITS Math}

或者

\usepackage{unicode-math}
\setmainfont{Stix Two Text}
\setmathfont{Stix Two Math}

在旁边:我忍不住要对你的代码提出一些评论:你似乎异常热衷于在数学模式中使用花括号。话虽如此,我看不出有什么理由写

${{{M}_{pl}}{\left({≡{\mathrm{ℏ}c/G}}\right)}}$

什么时候

$M_{pl}$ ($≡ℏc/G$)

产生相同的输出,并且没有任何代码混乱。

同样,请考虑更换

{\frac{G\mathrm{μ}}{{{c}^{{2}}}}}=\mathcal{O}{\left({{\frac{{{E}^{{2}}}}{{{M}_{pl}^{{2}}}}}}\right)}

\frac{G\symup{μ}}{c^2} = \mathcal{O}\left(\frac{E^2}{M_{pl}^2}\right)

附录为了解决 OP 的后续帖子:由于您的文档加载了该hyperref包,因此我将替换

[\href{cqgab7bbabib1}{\textcolor{blue}{1}}]

\cite{cqgab7bbabib1} 

此外,我会替换

\begin{thebibliography}{000}
\bibitem{cqgab7bbabib1}{Aasi Jet alLIGO Scientific and VIRGO Collaborations (2014) Constraints on cosmic strings from the LIGO-Virgo gravitational-wave detectors\textit{Phys. Rev. Lett.} \textcolor{blue}{\textbf{112}} } 

\bibitem{cqgab7bbabib2}{Abbott B Pet alLIGO and Virgo Collaborations (2016) Astrophysical implications of the binary black hole merger GW150914\textit{Astrophys. J. Lett.} \textcolor{blue}{\textbf{818}} }
\end{thebibliography}

\begin{thebibliography}{9}

\bibitem{cqgab7bbabib1}%{
Aasi J et al, LIGO Scientific and VIRGO Collaborations (2014) Constraints on cosmic strings from the LIGO-Virgo gravitational-wave detectors. \textit{Phys. Rev. Lett.} 
%\textcolor{blue}{\textbf{112}}} 

\bibitem{cqgab7bbabib2}%{
Abbott B P et al, LIGO and Virgo Collaborations (2016) Astrophysical implications of the binary black hole merger GW150914. \textit{Astrophys. J. Lett.}  
%\textcolor{blue}{\textbf{818}}}

\end{thebibliography}

特别注意,我Aasi Jet alLIGOAasi J et al, LIGO和替换Abbott B Pet alLIGOAbbott B P et al, LIGO。这些变化应该会使理解所写内容变得容易得多。


总而言之,我将按以下方式重写您的示例以使其更高效。

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath,luacolor}
\usepackage{hyperref}
\hypersetup{colorlinks,citecolor=blue}
\usepackage{unicode-math}
\setmainfont{Stix Two Text}
\setmathfont{Stix Two Math}

\begin{document}
\title{Article Title Here}
\author{Author Here}
\maketitle

\section{Introduction}

The investigations of cylindrically symmetric spacetimes can be 
traced back as far as to 1919 when Levi-Civita (LC) discovered 
a class of solutions of Einstein's vacuum field equations, 
corresponding to static cylindrical spacetimes 
\cite{cqgab7bbabib1}.
\begin{equation*}
\frac{G\symup{μ}}{c^2} = 
\mathcal{O}\biggl(\frac{E^2}{M_{pl}^2}\biggr)\,,\tag{1.1}
\end{equation*}
where $M_{pl}$ ($≡ℏc/G$) denotes the Planck mass.

\begin{thebibliography}{9}

\bibitem{cqgab7bbabib1}%{
Aasi J et al, LIGO Scientific and VIRGO Collaborations (2014) 
Constraints on cosmic strings from the LIGO-Virgo 
gravitational-wave detectors. \textit{Phys. Rev. Lett.} 
%\textcolor{blue}{\textbf{112}}} 

\bibitem{cqgab7bbabib2}%{
Abbott B P et al, LIGO and Virgo Collaborations (2016) 
Astrophysical implications of the binary black hole merger 
GW150914. \textit{Astrophys. J. Lett.}  
%\textcolor{blue}{\textbf{818}}}

\end{thebibliography}
\end{document}

相关内容