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?

2
  • 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
    Commented Nov 15, 2016 at 10:58
  • This will be fixed in chemgreek v1.1
    – cgnieder
    Commented Dec 20, 2016 at 10:59

1 Answer 1

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.

4
  • I wish I'd get bug reports in such cases. I don't always spot questions on tex.sx...
    – cgnieder
    Commented Nov 15, 2016 at 11:47
  • 1
    @clemens Opened github.com/cgnieder/chemgreek/issues/4 and github.com/cgnieder/chemgreek/issues/5
    – egreg
    Commented Nov 15, 2016 at 12:47
  • @clemens I'm sorry, I thought it was probably just my fault such as misunderstanding of setup options.
    – omasanori
    Commented Nov 15, 2016 at 13:57
  • I've confirmed that the problem has been fixed on latest TL2016. Thank you @egreg and @clemens!
    – omasanori
    Commented Dec 22, 2016 at 8:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .