私はPNASのテンプレートを使用しています(http://www.pnas.org/site/authors/LaTex.xhtml) を sharelatex に追加し、次のような単位を追加する場合:
\SI{15}{\mL}
添付画像に見られるように、それらは適切に拡大縮小されていません。
さらに、siunitx に周囲のフォントを使用させる方法はありますか。私は前文で以下を使用しようとしました:
\sisetup{detect-weight=true, detect-family=true}
運がありませんでした。
どんな助けでもいただければ幸いです。
編集1: 最小限の例を追加しました
\documentclass{pnastwo}
\usepackage[dvips]{graphicx}
\usepackage{amssymb,amsfonts,amsmath}
\usepackage{gensymb,fixltx2e}
\usepackage{fontspec}
\usepackage{siunitx}
\sisetup{detect-weight=true, detect-family=true}
\begin{document}
\begin{article}
\begin{materials}
This is a minimal example. The following units \SI{15}{\mL} do not render with the same typeface and size as the surrounding text.
\end{materials}
\end{article}
\end{document}
答え1
このクラスはフォントの定義に nfss を使用しないため、siunitx はフォントを検出する機会がまったくありません (補足として、非 ASCII 文字には注意してください。xelatex/lualatex と組み合わせると、文字が間違って表示されるか、まったく表示されない場合があります)。この問題は、フォント コマンドを再定義することで回避できます。
\documentclass{pnastwo}
\usepackage{graphicx}
\usepackage{amssymb,amsfonts,amsmath}
\usepackage{gensymb,fixltx2e}
\usepackage{fontspec}
\renewcommand\materialfont{\sffamily\fontsize{7pt}{\baselineskip}\selectfont}
\usepackage{siunitx}
\sisetup{detect-weight=true, detect-family=true}
\begin{document}
\begin{article}
\begin{materials}
This is a minimal example. The following units \SI{15}{\mL} do not render with the same typeface and size as the surrounding text.
\end{materials}
\end{article}
\end{document}
答え2
(コメントするには長すぎるので、一種の回答として投稿しました。)
ドキュメントの設定で、これまで私たちに伝えていない何かが起こっているに違いありません。pnastwo
ドキュメント クラス自体は、少なくともパッケージのマクロに影響を与えるような方法では、フォントを混乱させることはありません\siunitx
。
ぜひ教えてください。ムウェ-- テキスト フォントをサンセリフに変更する方法。
\documentclass{pnastwo}
\usepackage[detect-family=true]{siunitx}
\begin{document}
\sffamily
abc
\SI{15}{\milli\liter}
\end{document}