# How do I get chemgreek to use κ instead of ϰ with fontspec and newcomputermodern?

Yesterday I appeared to find the perfect bit of magic code for my thesis, however, I noticed LaTeX is using the cursive version of kappa (ϰ) instead of the symbol chemistry uses for denticity (κ).

ϰ is GREEK KAPPA SYMBOL and κ is GREEK SMALL LETTER KAPPA.

MWE:

\documentclass[]{article}
\usepackage{newcomputermodern}\usepackage{chemgreek}\selectchemgreekmapping{fontspec}
%\changechemgreeksymbol{fontspec}{lower}{kappa}{κ}\selectchemgreekmapping{fontspec}

\usepackage{chemmacros}
\chemsetup{formula=chemformula}

\begin{document}
Math mode:
$$\chemalpha \chembeta \chemeta \chemkappa \chemmu$$

Text mode:
\chemalpha
\chembeta
\chemeta
\chemkappa
\chemmu

ch:
\ch{\dento{1}\bridge{1}\hapto{1}}

Text:
\dento{1}\bridge{1}\hapto{1}
\end{document}


No trouble, chemgreek has an interface for changing a symbol mapping, and you can just past symbols right into lualatex right? That is the whole point. I uncomment out that one line from above to give:

\documentclass[]{article}
\usepackage{newcomputermodern}\usepackage{chemgreek}\selectchemgreekmapping{fontspec}
\changechemgreeksymbol{fontspec}{lower}{kappa}{κ}\selectchemgreekmapping{fontspec}

\usepackage{chemmacros}
\chemsetup{formula=chemformula}

\begin{document}
Math mode:
$$\chemalpha \chembeta \chemeta \chemkappa \chemmu$$

Text mode:
\chemalpha
\chembeta
\chemeta
\chemkappa
\chemmu

ch:
\ch{\dento{1}\bridge{1}\hapto{1}}

Text:
\dento{1}\bridge{1}\hapto{1}
\end{document}


But for some reason this ONLY works to fix the math mode symbol. Is there a way to use κ throughout? I will not need ϰ anywhere in my document if that makes things easier, so replacing it entirely is fine.

Ensure math mode. The text font has the “x-like” kappa.

\documentclass[]{article}
\usepackage{newcomputermodern}
\usepackage{chemmacros}
\usepackage{chemgreek}

\selectchemgreekmapping{fontspec}
\changechemgreeksymbol{fontspec}{lower}{kappa}{\ensuremath{κ}}
\selectchemgreekmapping{fontspec}

\chemsetup{formula=chemformula}

\begin{document}
Math mode:
$$\chemalpha \chembeta \chemeta \chemkappa \chemmu$$

Text mode:
\chemalpha
\chembeta
\chemeta
\chemkappa
\chemmu

ch:
\ch{\dento{1}\bridge{1}\hapto{1}}

Text:
\dento{1}\bridge{1}\hapto{1}
\end{document}


One tweak to the excellent answer by @egreg: \ensuremath{κ} will give you a slanted κ, and you want an upright κ to match your other symbols. Therefore, load \ensuremath{\symup{\kappa}} in unicode-math. (With some other packages, you might want \upkappa or \kappaup.)

\documentclass{article}
\usepackage{newcomputermodern}
\usepackage{chemgreek}
\changechemgreeksymbol{fontspec}{lower}{kappa}{\ensuremath{\symup{\kappa}}}
\selectchemgreekmapping{fontspec}

\usepackage{chemmacros}
\chemsetup{formula=chemformula}

\begin{document}
Math mode:
$$\chemalpha \chembeta \chemeta \chemkappa \chemmu$$

Text mode:
\chemalpha
\chembeta
\chemeta
\chemkappa
\chemmu

ch:
\ch{\dento{1}\bridge{1}\hapto{1}}

Text:
\dento{1}\bridge{1}\hapto{1}
\end{document}