[Tex/LaTex] ‘β’ using Latin Modern fonts

fontsgreek

I’m typesetting a text with some math and Greek letters. LaTeX handles Greek letters just fine in math mode but I can’t get it to display the character ‘β’ using either direct input or the \b macro provided by the chemmacros package.

Here's a minimal example:

\documentclass{minimal}
\usepackage{fontspec}
\usepackage[greek=textgreek]{chemmacros}

\begin{document}    
\iupac{\b-carotene} % doesn't work

\iupac{β-carotene} % doesn't work

β % doesn't work

\Chembeta % doesn't work

$\beta$ % works fine
\end{document}

I’m compiling the document with lualatex.


Update

Using a different font (namely, Linux Libertine or Times New Roman) solves the problem. Does that mean the Latin Modern family has no support for upright Greek letters?

Best Answer

upgreek works fine both with XeLaTeX and LuaLaTeX. Apparently it isn't clear from chemmacros' documentation though that setting the option greek=upgreek does not load upgreek and greek=textgreek does not load textgreek! The option exists to prevent chemmacros from choosing between upgreek or textgreek automatically if either of them or both are loaded by the user. Using either option without loading the appropriate package usually throws an error like

! Undefined control sequence.
<argument> \textbeta 

l.9 \iupac{\b-carotene}

However, when fontspec is loaded, too, the code silently fails with Latin Modern. (I should probably add some checking whether the needed packages are loaded.)

\documentclass{article}
\usepackage{fontspec}
\usepackage{upgreek}% needs no be loaded
\usepackage{chemmacros}[2014/01/24]
\usepackage{newunicodechar}
\newunicodechar{β}{\chembeta}

\begin{document}    
\iupac{\b-carotene} % works

\iupac{β-carotene} % works

β % works

\chembeta % works

$\beta$ % works fine
\end{document}

enter image description here