4

Some Greek characters are not printed with chemgreek package when I use TeX Gyre fonts.

Test code:

\documentclass{article}

\usepackage{fontspec}
\newfontfamily\termes{texgyretermes-regular.otf}
\newfontfamily\schola{texgyreschola-regular.otf}
\newfontfamily\libertine{LinLibertine_R.otf}

\usepackage{chemgreek}
\selectchemgreekmapping{fontspec}

\begin{document}
{\termes Termes: \printchemgreekalphabet}
{\schola Schola: \printchemgreekalphabet}
{\libertine Linux Libertine: \printchemgreekalphabet}
\end{document}

The result with LuaTeX: The chemgreek + TeX Gyre test result with LuaTeX

The result with XeTeX: The chemgreek + TeX Gyre test result with XeTeX

The results looks slightly different between engines, but the both lack gamma, epsilon, iota and phi with all but Linux Libertine.

I have found an answer mentioning the lack of complete Greek support in TeX Gyre but I confirmed that these fonts contain "basic" Greek characters above.

Can I use chemgreek and TeX Gyre without missing characters?

  • Welcome to TeX.SX! The chemgreek package apparently assumes that \textphi maps to a Greek letter, but xunicode defines it as U+0278 LATIN SMALL LETTER PHI (it's thought for IPA). Not the only wrong case. – egreg Nov 15 '16 at 10:58
  • This will be fixed in chemgreek v1.1 – clemens Dec 20 '16 at 10:59
5

Update

This behaviour is due to issues in chemgreek which are fixed in the 1.1 (2016/12/20) release. Where possible, you should update your TeX distribution to install the current release. If this is not possible, for example if you want to change only this one package or where you do not have the privileges to update the entire distribution, you will need to install the package locally. This option should be considered a last resort, since for more complex packages there may be package dependencies that will make local installation more complicated and error-prone.


Original answer

The chemgreek package makes a few wrong assumptions: it assumes that \textgamma, \textepsilon, \textiota and \textphi map to the Greek characters, but they don't, as xunicode.sty defines them to be IPA characters (Latin small letter gamma, epsilon, iota and phi, respectively).

You can fix this, at least as far as chemgreek is concerned, by remapping the wrong targets:

\documentclass{article}

\usepackage{fontspec}
\newfontfamily\termes{texgyretermes-regular.otf}
\newfontfamily\schola{texgyreschola-regular.otf}
\newfontfamily\libertine{LinLibertine_R.otf}
\newfontfamily\tempora{Tempora}

\RenewDocumentCommand{\textgamma}{}{\symbol{"03B3}}
\RenewDocumentCommand{\textepsilon}{}{\symbol{"03B5}}
\RenewDocumentCommand{\textiota}{}{\symbol{"03B9}}
\RenewDocumentCommand{\textphi}{}{\symbol{"03C6}}

\usepackage{chemgreek}
\selectchemgreekmapping{fontspec}

\begin{document}

{\termes Termes: \printchemgreekalphabet}

{\tempora Tempora: \printchemgreekalphabet}

{\schola Schola: \printchemgreekalphabet}

{\libertine Linux Libertine: \printchemgreekalphabet}
\end{document}

I also added Tempora, but you can see that the coverage by TeX Gyre fonts is complete too.

enter image description here

By the way, chemgreek has a wrong alphabetical order, as it has chi after psi.

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.