TransWikia.com

Helvetica for Latin letters and a sans-serif font for Greek letters

TeX - LaTeX Asked by 2xMax on December 15, 2020

I’m trying to be a perfectionist and desperately trying to make things right:

  1. All Latin symbols should use Helvetica
  2. Greek letters should be at least sans-serif (Helvetica in an ideal world)

Here is how I tried to solve:

documentclass{beamer}

usepackage{helvet}
usepackage[EULERGREEK]{sansmath}
sansmath

begin{document}

GR17 alpha beta gamma mu
$GR17 alpha beta gamma mu$

end{document}

enter image description here

If I try this:

documentclass{beamer}

usepackage{sansmathfonts}
usepackage{helvet}

begin{document}

GR17 alpha beta gamma mu
$GR17 alpha beta gamma mu$

end{document}

enter image description here

Do you have any ideas how to fix this?

UPD:
so far I found only a complex solution here:

documentclass{beamer}

usepackage{helvet}

DeclareSymbolFont{sfletters}{OML}{cmbrm}{m}{it}
DeclareMathSymbol{alpha}{mathord}{sfletters}{"0B}
DeclareMathSymbol{beta}{mathord}{sfletters}{"0C}
DeclareMathSymbol{gamma}{mathord}{sfletters}{"0D}
DeclareMathSymbol{delta}{mathord}{sfletters}{"0E}
DeclareMathSymbol{epsilon}{mathord}{sfletters}{"0F}
DeclareMathSymbol{zeta}{mathord}{sfletters}{"10}
DeclareMathSymbol{eta}{mathord}{sfletters}{"11}
DeclareMathSymbol{theta}{mathord}{sfletters}{"12}
DeclareMathSymbol{iota}{mathord}{sfletters}{"13}
DeclareMathSymbol{kappa}{mathord}{sfletters}{"14}
DeclareMathSymbol{lambda}{mathord}{sfletters}{"15}
DeclareMathSymbol{mu}{mathord}{sfletters}{"16}
DeclareMathSymbol{nu}{mathord}{sfletters}{"17}
DeclareMathSymbol{xi}{mathord}{sfletters}{"18}
DeclareMathSymbol{pi}{mathord}{sfletters}{"19}
DeclareMathSymbol{rho}{mathord}{sfletters}{"1A}
DeclareMathSymbol{sigma}{mathord}{sfletters}{"1B}
DeclareMathSymbol{tau}{mathord}{sfletters}{"1C}
DeclareMathSymbol{upsilon}{mathord}{sfletters}{"1D}
DeclareMathSymbol{phi}{mathord}{sfletters}{"1E}
DeclareMathSymbol{chi}{mathord}{sfletters}{"1F}
DeclareMathSymbol{psi}{mathord}{sfletters}{"20}
DeclareMathSymbol{omega}{mathord}{sfletters}{"21}
DeclareMathSymbol{varepsilon}{mathord}{sfletters}{"22}
DeclareMathSymbol{vartheta}{mathord}{sfletters}{"23}
DeclareMathSymbol{varpi}{mathord}{sfletters}{"24}
DeclareMathSymbol{varrho}{mathord}{sfletters}{"25}
DeclareMathSymbol{varsigma}{mathord}{sfletters}{"26}
DeclareMathSymbol{varphi}{mathord}{sfletters}{"27}

begin{document}

GRQ17
$GRQ17 alpha beta gamma mu Delta delta Sigma Gamma pi$

end{document}

enter image description here

Maybe not bold enough, but it is better than it was before. I wonder if somebody knows a more elegant solution to the problem.

One Answer

In the Modern Toolchain

In LuaLaTeX or XeLaTeX, you can load a sans-serif math font with unicode-math. You can even load a font of your choice for Greek, with setmathfont[range=....

One sans-serif math font is Fira Math, and the version of Helvetica that comes with TeX is TeX Gyre Heros.

usepackage{unicode-math}
defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX }
setmainfont{TeX Gyre Heros}[Scale=1.0]
setmathfont{Fira Math}

To get actual Helvetica for mathit, add setmathfont[range=it/{Latin,latin,digits}]{TeX Gyre Heros Italic}. You can repeat this for upright, bold and bold italic if you need those too.

In the Legacy Toolchain

My personal recommendation is to use LuaLaTeX and unicode-math when you can, and PDFLaTeX when you have to. Some publishers in 2020 still require it. Here’s a solution for when you have to.

Load a sans-serif math package, such as newtxsf or sansmathfonts or arevmath, and tgheros as your sans-serif font, then renew familydefault to make it the main font.

documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc} % The default since 2018
usepackage{tgheros}
renewcommand*familydefault{sfdefault}
usepackage{newtxsf}

begin{document}

GRQ17
$GRQ17 alpha beta gamma mu Delta delta Sigma Gamma pi$

end{document}

TG Heroes/newtxsf sample

To get Helvetica in math mode, for Latin letters, load mathastext. There does not happen to be a Type 1 version of Helvetica that supports Greek.

documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc} % The default since 2018
usepackage{tgheros}
renewcommand*familydefault{sfdefault}
usepackage{newtxsf}
usepackage[italic]{mathastext}

begin{document}

GRQ17
$GRQ17 alpha beta gamma mu Delta delta Sigma Gamma pi$

end{document}

tgheros sample

Correct answer by Davislor on December 15, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP