4

Using the chemmacros commands \K... and \p..., equilibrium constants and p functions don't get resized when written as superscripts. For instance,

\documentclass{article}

\usepackage{chemmacros}

\begin{document}
\[
  \frac{[\ch{B^-}]}{[\ch{HB}]}=10^{\pH-\pKa}\mbox{.}
\]
\end{document

becomes

enter image description here

with too big superscripts.

  • I ran texdoc chemmacros and searched for both math and size, but nothing I could find seemed to have an answer ;-( – Thorbjørn E. K. Christensen Feb 20 '18 at 11:22
  • Need to check but this looks like a bug. – clemens Feb 20 '18 at 12:29
4

This is due to a bug in the acid-base module. Here is a fix:

\documentclass{article}

\usepackage{chemmacros}

\ExplSyntaxOn
\chemmacros_if_compatibility:nnT {<=} {5.8b}
  {
    \cs_set_protected:Npn \chemmacros_p:n #1
      {
        \group_begin:
          \chemmacros_text:n
            {
              \chemmacros_p_style:n {p}
              \ensuremath {#1}
            }
        \group_end:
      }
  }
\ExplSyntaxOff

\begin{document}

\[ 10^{pH}=10^{\pH} \]

\end{document}

enter image description here

  • I'll send the updated version to CTAN in a few days… – clemens Feb 22 '18 at 16:13

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.