
Helveticaフォントで文書を書く必要があり、サンスマスフォント数学に適した対応するものになると思いますが、他の提案も歓迎します。
今、私は本当に苦労していますサンセリフ直立ギリシャ語数式モードで文字を表示します。これを実現する方法はありますか?
セリフフォントについては、以前は ギリシャ語またはこれ素晴らしい答えどちらもhelvet+sansmathfontsでは動作しません。
\documentclass{article}
\usepackage[utf8]{luainputenc}
\usepackage[T1]{fontenc}
\usepackage{siunitx}
\usepackage{sansmathfonts}
\usepackage[scaled=0.95]{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{upgreek}
\begin{document}
Upright greek in math mode:
$\mathrm{\mu\alpha\beta\gamma}$, $\upmu\upalpha\upbeta\upgamma$,
\end{document}
MWE の Steven B. Segletes のコメントについて:
\documentclass{article}
\usepackage[utf8]{luainputenc}
\usepackage[T1]{fontenc}
\usepackage{siunitx}
\usepackage{sansmathfonts}
\usepackage[scaled=0.95]{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{tikz}
\usepackage{scalerel}
\newsavebox{\foobox}
\newcommand{\slantbox}[2][0]{\mbox{%
\sbox{\foobox}{#2}%
\hskip\wd\foobox
\pdfsave
\pdfsetmatrix{1 0 #1 1}%
\llap{\usebox{\foobox}}%
\pdfrestore
}}
\newcommand\unslant[2][-.2]{%
\mkern1mu%
\ThisStyle{\slantbox[#1]{$\SavedStyle#2$}}%
\mkern-1mu%
}
\newcommand\upmu{\unslant\mu}
\begin{document}
Upright greek in math mode: $\mathrm{\mu}$, $\upmu$,
\begin{tikzpicture}
\node[color=red,] {$\upmu$$\mu$};
\end{tikzpicture}
\end{document}
答え1
この回答は、質問に対するコメントでの議論に続いて出されたものです。読者の皆さんは、このコメントを参照してください。コンピュータモダンにフィットする直立ギリシャ語フォントフォントの傾きを直接元に戻す(これはBrunoの回答に基づいています)「ボックス」をせん断変形する)。そこでは、ギリシャ文字形式にそれを適用する方法を示していますが、これは pdflates にのみ適用されるのに対し、OP はプリアンブルで lualatex 呼び出しを行っていたことに注意してください。
その後、OP は、この\unslant
メソッドは lua でも機能する (halle-lua-jah) が、基礎となる部分ではノード\slantbox
の色を受け入れるのに問題があると教えてtikz
くれました。これは私にとっては新しい情報でした。なぜなら、引数の一部として、または宣言の後に\slantbox
色を問題なく受け入れるからです。\textcolor
\color
その後、pgfのバグレポートを見つけました。https://sourceforge.net/p/pgf/bugs/362/、それが問題に関係していると思われます。その問題を自分で解決できないので、回避策を探しました。
ハイコの回答現在の色を保存する方法\colorlet{slantcolor}{.}
は、に入る前に現在の色を保存するための の優れた手法を示しています。その後、内で\mbox
を再発行しました。これで問題は解決したようです。\color{slantcolor}
\foobox
要約すると、この\unslant
方法では既存のイタリック同じフォント デザインで文字を直立させる必要があり、\colorlet
修正により、このソリューションは色付きノードでも機能するようになりますtikz
。全体的なアプローチは、pdflatex および lualatex で機能します。
\documentclass{article}
%\usepackage[utf8]{luainputenc}
\usepackage[T1]{fontenc}
\usepackage{siunitx}
\usepackage{sansmathfonts}
\usepackage[scaled=0.95]{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{tikz}
\usepackage{scalerel}
\newsavebox{\foobox}
\newcommand{\slantbox}[2][0]{\colorlet{slantcolor}{.}\mbox{%
\sbox{\foobox}{\color{slantcolor}#2}%
\hskip\wd\foobox
\pdfsave
\pdfsetmatrix{1 0 #1 1}%
\llap{\usebox{\foobox}}%
\pdfrestore
}}
\newcommand\unslant[2][-.2]{%
\mkern1mu%
\ThisStyle{\slantbox[#1]{$\SavedStyle#2$}}%
\mkern-1mu%
}
\newcommand\upmu{\unslant\mu}
\begin{document}
Upright greek in math mode: $\mathrm{\mu}$, $\upmu$,
\begin{tikzpicture}
\node[color=red,] {$\upmu$$\mu$};
\end{tikzpicture}
\end{document}
答え2
CBフォントを使用することができます
\documentclass{article}
\usepackage[scaled=0.95]{helvet}
\usepackage{sansmathfonts}
\renewcommand{\familydefault}{\sfdefault}
\DeclareFontEncoding{LGR}{}{}
\DeclareSymbolFont{sfgreek}{LGR}{cmss}{m}{n}
\SetSymbolFont{sfgreek}{bold}{LGR}{cmss}{bx}{n}
\DeclareMathSymbol{\alpha}{\mathord}{sfgreek}{`a}
\DeclareMathSymbol{\beta}{\mathord}{sfgreek}{`b}
\DeclareMathSymbol{\gamma}{\mathord}{sfgreek}{`g}
\DeclareMathSymbol{\delta}{\mathord}{sfgreek}{`d}
\DeclareMathSymbol{\epsilon}{\mathord}{sfgreek}{`e}
\DeclareMathSymbol{\zeta}{\mathord}{sfgreek}{`z}
\DeclareMathSymbol{\eta}{\mathord}{sfgreek}{`h}
\DeclareMathSymbol{\theta}{\mathord}{sfgreek}{`j}
\DeclareMathSymbol{\iota}{\mathord}{sfgreek}{`i}
\DeclareMathSymbol{\kappa}{\mathord}{sfgreek}{`k}
\DeclareMathSymbol{\lambda}{\mathord}{sfgreek}{`l}
\DeclareMathSymbol{\mu}{\mathord}{sfgreek}{`m}
\DeclareMathSymbol{\nu}{\mathord}{sfgreek}{`n}
\DeclareMathSymbol{\xi}{\mathord}{sfgreek}{`x}
\DeclareMathSymbol{\omicron}{\mathord}{sfgreek}{`o}
\DeclareMathSymbol{\pi}{\mathord}{sfgreek}{`p}
\DeclareMathSymbol{\rho}{\mathord}{sfgreek}{`r}
\DeclareMathSymbol{\sigma}{\mathord}{sfgreek}{`s}
\DeclareMathSymbol{\tau}{\mathord}{sfgreek}{`t}
\DeclareMathSymbol{\upsilon}{\mathord}{sfgreek}{`u}
\DeclareMathSymbol{\phi}{\mathord}{sfgreek}{`f}
\DeclareMathSymbol{\chi}{\mathord}{sfgreek}{`q}
\DeclareMathSymbol{\psi}{\mathord}{sfgreek}{`y}
\DeclareMathSymbol{\omega}{\mathord}{sfgreek}{`w}
\let\varepsilon\epsilon
\let\vartheta\theta
\let\varpi\pi
\let\varrho\rho
\DeclareMathSymbol{\varsigma}{\mathord}{sfgreek}{`c}
\let\varphi\phi
\DeclareMathSymbol{\Gamma}{\mathalpha}{sfgreek}{`G}
\DeclareMathSymbol{\Delta}{\mathalpha}{sfgreek}{`D}
\DeclareMathSymbol{\Theta}{\mathalpha}{sfgreek}{`J}
\DeclareMathSymbol{\Lambda}{\mathalpha}{sfgreek}{`L}
\DeclareMathSymbol{\Xi}{\mathalpha}{sfgreek}{`X}
\DeclareMathSymbol{\Pi}{\mathalpha}{sfgreek}{`P}
\DeclareMathSymbol{\Sigma}{\mathalpha}{sfgreek}{`S}
\DeclareMathSymbol{\Upsilon}{\mathalpha}{sfgreek}{`U}
\DeclareMathSymbol{\Phi}{\mathalpha}{sfgreek}{`F}
\DeclareMathSymbol{\Psi}{\mathalpha}{sfgreek}{`Y}
\DeclareMathSymbol{\Omega}{\mathalpha}{sfgreek}{`W}
\begin{document}
Upright greek in math mode:
$\mu\alpha\beta\gamma$
$\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu$
$\nu\xi\omicron\pi\rho\sigma\varsigma\tau\upsilon\phi\chi\psi\omega$
$\mathrm{A}\mathrm{B}\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega$
\end{document}