In the Modern Toolchain
If you can use LuaLaTeX or XeLaTeX, this will get you the specific fonts you requested, with other sans-serif math symbols from Fira Math.
\documentclass{article}
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TeX Gyre Heros}[Scale=1.0]
\setsansfont{TeX Gyre Heros}
\setmathfont{Fira Math}
\setmathfont{TeX Gyre Heros}[range=up/{Latin,latin,Num}]
\setmathfont{TeX Gyre Heros Italic}[range=it/{Latin,latin}]
\setmathfont{TeX Gyre Heros Bold}[range=bfup/{Latin,latin,Num}]
\setmathfont{TeX Gyre Heros Bold Italic}[range=bfit/{Latin,latin}]
\setmathfont{CMU Bright}[range=up/{Greek,greek}]
\setmathfont{CMU Bright Oblique}[range=it/{Greek,greek}]
\setmathfont{CMU Bright Bold}[range=bfup/{Greek,greek}]
\setmathfont{CMU Bright Bold Oblique}[range=bfit/{Greek,greek}]
\begin{document}
a
$\alpha a$
\end{document}
If what you really want is a consistent set of sans-serif fonts for text and math, a much simpler way is
\usepackage[fira]{fontsetup}
Note that this also only works in LuaLaTeX or XeLaTeX. (And that I got beaten to it while writing this answer.)
With Legacy Fonts
Another frame challenge: if what you want is to use sans-serif math throughout your document, not to switch between serif and sans-serif math versions, you may get better results with a sans-serif math package, such as sansmathfonts
or newtxsf
—or even cmbright
—and no longer feel the need to use CM Bright for Greek only.
If you still do, you have to load the cmbr
family as a math font in OML encoding, and redefine all the Greek letters. The sansmath
package breaks this, but it works with sansmathfonts
.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{sansmathfonts}
\usepackage{tgheros}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[italic]{mathastext}
\DeclareSymbolFont{cmbright}{OML}{cmbr}{m}{it}
\SetSymbolFont{cmbright}{bold}{OML}{cmbr}{bx}{it}
\DeclareMathSymbol{\alpha}{\mathalpha}{cmbright}{"0B}
\DeclareMathSymbol{\beta}{\mathalpha}{cmbright}{"0C}
% etc.
\begin{document}
a
$\alpha a \boldsymbol{\alpha a}$
\end{document}
Note that TeX Gyre Heros and Computer Modern Bright do not have the same x-height.
You can look up and manually-enter the slot of every Greek letter in the seven-bit OML encoding, keeping in mind that it reuses several Latin letters such as A, B, H, etc. as Greek capitals.
Both of these problems would be possible to fix by copying and editing a lot of boilerplate (see OMLcmbr.fd
), if you really, truly want to go that route.