\(\KaTeX\) ではセリフ体に KaTeX_SansSerif
が、タイプライタ体に KaTeX_Typewriter
が用いられているのだが、これらの見た目があまりよろしくない.ダサい.
\begin{align*}
e^{i\theta} = \cos\theta + i\sin\theta &&(\underset{\texttt{\tiny\%u30AA\%u30A4\%u30E9\%u30FC\%u306E\%u516C\%u5F0F}}{\textsf{オイラーの公式 {\scriptsize ; Euler's formula ; 欧拉公式}}})
\end{align*}
フォント変更 #
\textsf
のセリフ体や \texttt
のタイプライタ体のフォントを変更するには、次のように指定する.
.katex .textsf, .textboldsf, .textitsf {
/* font-family: KaTeX_SansSerif; */
font-family: ui-sans-serif,system-ui,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji !important;
}
.katex .texttt, .mathtt {
/* font-family: KaTeX_Typewriter; */
font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,liberation mono,courier new,monospace !important;
}
\(\KaTeX\) 数式中のテキストのフォントを本文中と揃えることができた.
サイズ変更 #
テキストのサイズが大きい.\footnotesize
命令を入れるとバランスが良くなる.或いは次のようにして本文中のフォントサイズと同じにする.
.katex .textsf:not(.sizing), .textboldsf:not(.sizing), .textitsf:not(.sizing), .texttt:not(.sizing) {
font-size: initial !important;
}
:not(.sizing)
としないと、サイズを変更する命令を入れても変わらなくなってしまうので注意する.
フォント命令比較表 #
function | output |
---|---|
mathrm |
\(\mathrm{Windowsでコンピューターの世界が広がります。1234567890}\) |
mathnormal |
\(\mathnormal{Windowsでコンピューターの世界が広がります。1234567890}\) |
textrm |
\(\textrm{Windowsでコンピューターの世界が広がります。1234567890}\) |
rm |
\({\rm Windowsでコンピューターの世界が広がります。1234567890}\) |
textnormal |
\(\textnormal{Windowsでコンピューターの世界が広がります。1234567890}\) |
text |
\(\text{Windowsでコンピューターの世界が広がります。1234567890}\) |
mathsf |
\(\mathsf{Windowsでコンピューターの世界が広がります。1234567890}\) |
textsf |
\(\textsf{Windowsでコンピューターの世界が広がります。1234567890}\) |
sf |
\({\sf Windowsでコンピューターの世界が広がります。1234567890}\) |
mathbf |
\(\mathbf{Windowsでコンピューターの世界が広がります。1234567890}\) |
textbf |
\(\textbf{Windowsでコンピューターの世界が広がります。1234567890}\) |
bf |
\({\bf Windowsでコンピューターの世界が広がります。1234567890}\) |
bold |
\(\bold{Windowsでコンピューターの世界が広がります。1234567890}\) |
boldsymbol |
\(\boldsymbol{Windowsでコンピューターの世界が広がります。1234567890}\) |
bm |
\({\bm Windowsでコンピューターの世界が広がります。1234567890}\) |
textmd |
\(\textmd{Windowsでコンピューターの世界が広がります。1234567890}\) |
mathtt |
\(\mathtt{Windowsでコンピューターの世界が広がります。1234567890}\) |
texttt |
\(\texttt{Windowsでコンピューターの世界が広がります。1234567890}\) |
tt |
\({\tt Windowsでコンピューターの世界が広がります。1234567890}\) |
mathit |
\(\mathit{Windowsでコンピューターの世界が広がります。1234567890}\) |
textit |
\(\textit{Windowsでコンピューターの世界が広がります。1234567890}\) |
it |
\({\it Windowsでコンピューターの世界が広がります。1234567890}\) |
textup |
\(\textup{Windowsでコンピューターの世界が広がります。1234567890}\) |
Bbb |
\(\Bbb{Windowsでコンピューターの世界が広がります。1234567890}\) |
mathbb |
\(\mathbb{Windowsでコンピューターの世界が広がります。1234567890}\) |
frak |
\(\frak{Windowsでコンピューターの世界が広がります。1234567890}\) |
mathfrac |
\(\mathfrak{Windowsでコンピューターの世界が広がります。1234567890}\) |
mathcal |
\(\mathcal{Windowsでコンピューターの世界が広がります。1234567890}\) |
cal |
\({\cal Windowsでコンピューターの世界が広がります。1234567890}\) |
mathscr |
\(\mathscr{Windowsでコンピューターの世界が広がります。1234567890}\) |
| function | output |
| --- | --- |
| `mathrm` | \(\mathrm{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `mathnormal` | \(\mathnormal{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `textrm` | \(\textrm{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `rm` | \({\rm Windowsでコンピューターの世界が広がります。1234567890}\) |
| `textnormal` | \(\textnormal{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `text` | \(\text{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `mathsf` | \(\mathsf{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `textsf` | \(\textsf{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `sf` | \({\sf Windowsでコンピューターの世界が広がります。1234567890}\) |
| `mathbf` | \(\mathbf{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `textbf` | \(\textbf{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `bf` | \({\bf Windowsでコンピューターの世界が広がります。1234567890}\) |
| `bold` | \(\bold{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `boldsymbol` | \(\boldsymbol{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `bm` | \({\bm Windowsでコンピューターの世界が広がります。1234567890}\) |
| `textmd` | \(\textmd{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `mathtt` | \(\mathtt{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `texttt` | \(\texttt{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `tt` | \({\tt Windowsでコンピューターの世界が広がります。1234567890}\) |
| `mathit` | \(\mathit{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `textit` | \(\textit{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `it` | \({\it Windowsでコンピューターの世界が広がります。1234567890}\) |
| `textup` | \(\textup{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `Bbb` | \(\Bbb{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `mathbb` | \(\mathbb{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `frak` | \(\frak{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `mathfrac` | \(\mathfrak{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `mathcal` | \(\mathcal{Windowsでコンピューターの世界が広がります。1234567890}\) |
| `cal` | \({\cal Windowsでコンピューターの世界が広がります。1234567890}\) |
| `mathscr` | \(\mathscr{Windowsでコンピューターの世界が広がります。1234567890}\) |