チルダと四角形の上線付き記号に関する問題、stix2

チルダと四角形の上線付き記号に関する問題、stix2

次の数学のテキストに問題があります: ここに画像の説明を入力してください

ご覧のとおり、S の上のチルダは実際には幅が広くありませんが、きれいに四角くなっています。一方、X の上のオーバーラインは問題ありませんが、デュースの配置が醜いです。

私は Stix 2.0 を使用しています。チルダの幅を X の上線と同じにし、X の四角形を適切に配置したいと思います。

数式フォントを変更せずにこれを実現するにはどうすればよいでしょうか?

私は XeLaTex を使用します。Stix2 は MWE と同様にロードされます。

MWE:

\documentclass[11pt]{article}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{unicode-math}
\setmathfont{STIX2Math.otf}[StylisticSet=02]
\begin{document}
$$\widetilde{S}^2 = \int x^2 dF_n - \left(\int x dF_n\right)^2 
     = \frac{1}{n}\sum X_i^2 - \overline{X}^2$$
\end{document}

答え1

\wideoverbarの代わりにを使うこともできます\overline

チルダについては、TeX Gyre Termes のチルダで置き換えることができますが、いくつかの低レベルのトリックが必要です。

\documentclass[11pt]{article}

\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{unicode-math}

\setmainfont{TeX Gyre Termes}
\setmathfont{STIX2Math.otf}[StylisticSet=02]

\newfontface{\termesmath}{texgyretermes-math.otf}[NFSSFamily=termesmath]
\DeclareSymbolFont{termesmath}{TU}{termesmath}{m}{n}

\AtBeginDocument{%
  \protected\def\widetilde{\Umathaccent 7 \symtermesmath "00303\relax}%
}

\begin{document}

\[
\widetilde{S}^2
= \int x^2 \,dF_n - \left(\,\int x \,dF_n\right)^{\!2}
= \frac{1}{n}\sum X_i^2 - \wideoverbar{X}^2
\]

\end{document}

ここに画像の説明を入力してください

関連情報