Subscript not working as expected with parentheses

Using the latest Logseq of iOS 17, I am attempting to write down the chemical synthesis of calcium acetate.

This is what I write down: CaCO_{3} + 2CH_{3}COOH = Ca(C_{2}H_{3}O_{2}){2} + H{2}O + CO_{2}

And this is how it’s interpreted:
IMG_9845

I haven’t been able to find the right character to separate the final parenthesis from the underscore, and any help is greatly appreciated.

1 Like

Try one of these:

  • CaCO_{3} + 2CH_{3}COOH = Ca\((C_{2}H_{3}O_{2})\)_{2} + H_{2}O + CO_{2}
    
  • $CaCO_{3} + 2CH_{3}COOH = Ca(C_{2}H_{3}O_{2})_{2} + H_{2}O + CO_{2}$
    
1 Like

The first one only partially worked, but the second one worked completely, albeit while changing the font. Which is fine by me, but I would still say this is a problem of the markdown system.

IMG_9848

Thank you very much!

If you commonly write chemical formulae in logseq, you may consider importing the mhchem extension for KaTeX, for quicker and more powerful and readable input:

$\ce{CaCO3 + 2CH3COOH -> Ca(C2H3O2)2 + H2O + CO2}$

$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$

image