I have seen solutions for bold lowercase greek, and lowercase sanserif, but have not seen the combination of all three.
What is the reliable way to generate lowercase, sanserif, bold math font?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI have seen solutions for bold lowercase greek, and lowercase sanserif, but have not seen the combination of all three.
What is the reliable way to generate lowercase, sanserif, bold math font?
You could use the (text) fonts for Greek, here the CB fonts, but other choices are possible.
\documentclass{article}
\usepackage[LGR,T1]{fontenc}
\usepackage{amsmath,etoolbox}
\newcommand{\declarebsfgreek}[2]{%
\protected\csdef{bsf#1}{\mathord{\text{\bsfgreekfont#2}}}%
}
\newcommand{\bsfgreekfont}{\usefont{LGR}{cmss}{bx}{it}}% change the family
\declarebsfgreek{alpha}{a}
\declarebsfgreek{beta}{b}
\declarebsfgreek{gamma}{g}
\declarebsfgreek{delta}{d}
\declarebsfgreek{epsilon}{e}
\declarebsfgreek{zeta}{z}
\declarebsfgreek{eta}{h}
\declarebsfgreek{theta}{j}
\declarebsfgreek{iota}{i}
\declarebsfgreek{kappa}{k}
\declarebsfgreek{lambda}{l}
\declarebsfgreek{mu}{m}
\declarebsfgreek{nu}{n}
\declarebsfgreek{xi}{x}
\declarebsfgreek{omicron}{o}
\declarebsfgreek{pi}{p}
\declarebsfgreek{rho}{r}
\declarebsfgreek{sigma}{s}
\declarebsfgreek{tau}{t}
\declarebsfgreek{upsilon}{u}
\declarebsfgreek{phi}{f}
\declarebsfgreek{chi}{q}
\declarebsfgreek{psi}{u}
\declarebsfgreek{omega}{w}
\begin{document}
$\bsfalpha\ne\bsfphi$
\end{document}
The boldface sans serif (italic) Greek letters are available via \bsf<name>
.
There are several methods that work with standard packages and non-LGR-encoded fonts.
The unicode-math
package provides the bfsfit
alphabet (boldface sans-serif font italic) as well as bfsfup
(boldface sans-serif font upright). This MCVE contrasts \symbfsfit{\alpha}
, \symbfsfup{\beta}
and \symsfit{\gamma}
.
\RequirePackage{luatex85} % Workaround for standalone 1.2 and LuaTeX.
\documentclass[preview,varwidth]{standalone}
\usepackage{unicode-math}
\begin{document}
\[ \symbfsfit{\alpha} + \symbfsfup{\beta} \neq \symsfit{\gamma} \]
\end{document}
You can also use \mathsfbfit
from the isomath
package, which allows you to select a legacy math font in OML rather than LGR encoding. It does not define an upright sans-serif bold math alphabet, but you can use a heavier sans-serif font such as Arev, or bold math style, or a symbol from a text font, to get bold weight.
\RequirePackage{luatex85} % Workaround for standalone 1.2 and LuaTeX.
\documentclass[preview,varwidth]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[OMLmathbf, OMLmathsf, OMLmathsfit]{isomath}
\begin{document}
\[ \mathsfbfit{\alpha} \neq \mathsfit{\gamma} \]
\end{document}
For LGR-encoded legacy fonts, mathastext
has a LGRGreek
option. If you want to use a solution similar to egreg’s (to use a Type 1 version of the excellent GFS fonts in PDFTeX, for example), I recommend you use the names \mbfitsansalpha
, etc. for bold sans-serif italic letters and \mbfsansalpha
, etc. for bold upright sans-serif letters, for compatibility with other packages.
There is another solution for LGR fonts by @jfbu here, mathspec
allows you to use Unicode text fonts in legacy math mode, and there are a few more packages that provide a way to do it. But I recommend you use unicode-math
whenever you’re allowed to.