![siunitx出力のフォントサイズを変更する](https://rvso.com/image/475715/siunitx%E5%87%BA%E5%8A%9B%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%99%E3%82%8B.png)
siunitx パッケージを使用して単位付きの数値を書き込むと\SI{1064}{\um}
、数値と単位はテキストよりも著しく小さくなりますが、mu は正しいサイズのようです。メイン テキスト フォントとして Verdana を使用し、数学にはデフォルトの LaTeX フォントを使用しています。MiKTeX でコンパイルされ、LuaLaTeX でコンパイルされています。
ムウェ
\documentclass[10pt,a4paper]{article}
\usepackage{siunitx}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setsansfont{Verdana} % Setting sans font
\renewcommand*{\familydefault}{\sfdefault} % Making sans serif font the default
\linespread{1.16} % Increasing the linespacing
\usepackage{unicode-math}
\begin{document}
This is some text \SI{1064}{\um} m $m$
\end{document}
私はスケールを使って\defaultfontfeatures{Scale=MatchLowercase}
\documentclass[10pt,a4paper]{article} \usepackage{siunitx}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setsansfont{Verdana} % Setting sans font
\renewcommand*{\familydefault}{\sfdefault} % Making sans serif font the default
\linespread{1.16} % Increasing the linespacing
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\begin{document}
This is some text with scaling \SI{1064}{\um} m $m$
\end{document}}
数式モードで書かれた数字とmは大きくなったが、単位のmは大きくなっていません。試してみました\sisetup{detect-all}
が、Verdana で書かれたものがすべて変更されるだけで、\SI
私が求めているものではありません。単位のフォント サイズを大きくする方法はありますか?
答え1
問題は、数式モードのフォントが本文のフォントと異なるサイズであることです。たとえば、スケーリングすることでこれを修正しました。
\documentclass[10pt,a4paper]{article}
\usepackage{siunitx}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures = TeX, Scale = MatchLowercase}
\setsansfont{Verdana} % Setting sans font
\renewcommand*{\familydefault}{\sfdefault} % Making sans serif font the default
\usepackage{unicode-math}
\begin{document}
This is some text \qty{1064}{\um}.
\end{document}
答え2
siunitx
私の提案は、 オプション でロードすることですmode=text
。 そうすれば、テキスト フォント (ここでは Verdana) が\num
および\unit
ディレクティブで自動的に使用されます。
% !TEX TS-program = lualatex
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Verdana} % main font
\usepackage[mode=text]{siunitx}
\begin{document}
This is some text \dots\ \qty{1064}{\um}.
\end{document}
答え3
最初は @JosephWright の回答を解決策としてマークしましたが、これによりメインフォント (Verdana) が数学のフォントサイズに合わせて縮小されたようです。
そこで、彼の回答と、メインの数学フォントを変更する方法に関する@Micoのコメントを使用して、うまくいくと思われる解決策を見つけました。
\documentclass[10pt,a4paper]{article}
\usepackage{siunitx}
\usepackage{unicode-math}
\defaultfontfeatures{Ligatures=TeX}
\setsansfont{Verdana} % Setting sans font
\renewcommand*{\familydefault}{\sfdefault} % Making sans serif font the default
\setmathfont{Cambria Math}[Scale=MatchUppercase] % Setting the maths font and scaling to match Verdana size
\setmathrm{Cambria Math}[Scale=MatchUppercase] % Setting the upright maths font used by siunitx
\newfontfamily{\mufont}{Cambria Math} % Selecting the mu from the Cambria Math font...
\DeclareSIPrefix\micro{\ensuremath{\mufont μ}}{-6} % ...and the selecting it for use with siunitx and make it represent 10^-6
\begin{document}
This is some text \dots\ \qty{1064}{\um}.
\end{document}
直立数学フォントをCambria Mathに設定し、スケールを設定する必要がありました\setmathrm{Cambria Math}[Scale=MatchUppercase]