0

How can I replace the letter l in HCl with so it becomes HCℓ when using chemmacros? I would like to avoid confusion between l, 1 and I which look very similar.

0

One option:

\documentclass{article}
\usepackage{chemmacros}
\begin{document}
    
    \ch{HC$\ell$}
    \ch{HC$\ell$ + NaOH -> NaC$\ell$ + H2O}\par

    
\end{document}

enter image description here

UPDATE: Maybe the \ell from stix font package is more like you want it:

\documentclass{article}
\usepackage{stix}
\usepackage{chemmacros}

\begin{document}
\ch{HC$\ell$}\par
\ch{HC$\ell$ + NaOH -> NaC$\ell$ + H2O}\par

\end{document}

enter image description here

3
  • Your answer is a good apporach but there is a slight difference : $\ell$ gives an italic in the final document while I would the upright one. – Fizika Scienco Jan 19 at 23:30
  • Related: Typeset an upright ell – Werner Jan 19 at 23:45
  • @ Fizika Scienco see update – Roland Jan 20 at 0:15
3

First things first: chemmacros does not provide chemical formulas. With standard settings it loads the package chemformula so lets assume you meant that package.


You can tell chemformula to use ℓ instead of l. Of course you need a font that has the letter. Compiled with LuaLaTeX this example gives:

\documentclass{article}
\usepackage{libertine}

\usepackage{chemformula}
\NewChemCompoundProperty{l}{ℓ}

\begin{document}

\ch{HCl + 1 I2}

\end{document}

enter image description here

Or like @Roland's suggestion:

\documentclass{article}

\usepackage{chemformula}
\NewChemCompoundProperty{l}{$\ell$}

\begin{document}

\ch{HCl + 1 I2}

\end{document}

enter image description here


BTW depending on the font the real issue might already be solved by itself:

\documentclass{article}
\usepackage{libertine}
\begin{document}
1lI
\end{document}

enter image description here

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.