2

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.

0
5

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

6
  • 1
    tgheros and the redefinition of \familydefault must come before loading newtxsf. Try to type $\sin$ to understand why ;-)
    – campa
    Nov 25 '20 at 10:38
  • @campa Fixed, thanks.
    – Davislor
    Nov 25 '20 at 10:45
  • 1
    Could you explain what you mean by the “modern toolchain” vs “legacy toolchain”? These terms are not very familiar or clear to me (not a serious expert, but a fairly experienced user who hangs out on this site a lot). I presume legacy means compiling with pdf(la)tex, and modern means… xe(la)tex? lua(la)tex? something else? Nov 25 '20 at 12:19
  • 1
    @PeterLeFanuLumsdaine That’s exactly right! LuaTeX is the branch that’s currently being developed, and XeTeX also supports Unicode, but is in maintenance mode.
    – Davislor
    Nov 25 '20 at 19:28
  • @PeterLeFanuLumsdaine I added a pair of sentences to clarify.
    – Davislor
    Nov 25 '20 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.