数学フォントの再定義

数学フォントの再定義

数式モードで使用するフォントを再定義する方法を探しています\mathcal。関数を使用する文字\mathcal{}はすべて、たとえば Asana Math フォントで記述し、その他のすべての数式テキストはデフォルトのテキストで記述したいと思います。これまでのところ、次の操作を実行しました。

\documentclass[11pt]{report}

%%%Packages%%%

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{unicode-math}
%\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}

%\setmathfont{Asana Math}
\let\mathcal=\mathscr

\begin{document}

\begin{equation}
\mathcal{p} = U(x,t)
\end{equation}

\end{document}

私のMWEとして。

答え1

で数式フォントを設定する場合、メインの数式フォントを定義しておけば、変更する数式アルファベットを指定するオプションを\setmathfont使用できます。これはフォントではうまく機能しますが、コメントで他の人が言っているように、ほとんどの場合、パッケージは、、およびフォントを変更するのに非常に適しています。rangeunicode-mathmathalphamathcalmathscrmathbbmathfrak

unicode-math次の例では、(Latin Modern Math)で使用されるデフォルトのアルファベットを使用し、\mathscrフォントを Asana Math に設定します。

\documentclass[11pt]{report}

\usepackage{amssymb, amsmath, amsthm}
\usepackage{unicode-math}
\setmathfont{LatinModern-Math.otf}
\setmathfont{Asana-Math.otf}[range=scr]

\begin{document}

\begin{gather*}
ABCDEFGHIJKLMNOPQRSTUVWXYZ \\
abcdefghijklmnopqrstuvwxyz \\
\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
\mathcal{abcdefghijklmnopqrstuvwxyz} \\
\mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
\mathscr{abcdefghijklmnopqrstuvwxyz} \\
\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
\mathfrak{abcdefghijklmnopqrstuvwxyz}
\end{gather*}

\end{document}

答え2

を試してみてください\usepackage{eucal}。これにより、\mathcal文字が異なるフォントで表示されます...

関連情報