7

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}

Image of math mode, text mode, chemmacros and the semantic commands outside of a \ch enciorment

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}

The same image as above, but the math mode kappa is correct, and only the math mode kappa

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.

6

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}

enter image description here

2

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}

New Computer Modern sample

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.