siunitx出力のフォントサイズを変更する

siunitx出力のフォントサイズを変更する

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]

関連情報