1

The following code…

\documentclass[border=2mm]{standalone}
\usepackage{chemfig}
\usepackage{chemformula}

\begin{document}
\schemestart
 \chemname{\chemfig{Ca^{2+}}}{Calcium ion}
 \+
 \chemname{\chemfig{O(-[:30,0.7]H)-[:150](=[:90]O)-[:210](=[:-90]O)-[:150]O-[:-150,0.7]H}}{Oxalic Acid, \ch{H2C2O4}}
 \arrow{->}
 \chemname{\chemfig{Ca}}{Calcium}
 \+
 \chemname{\chemfig{O^{-}-[:150](=[:90]O)-[:210](=[:-90]O)-[:150]O^{-}}}{Oxalate, \ch{C2O4}}
\schemestop

\end{document}

…results in the following output:

chemfig_scheme

There are three problems here. The first is that, for some reason, the label "Calcium ion" is not aligned with the other labels, despite the fact that it is labelled just the same way as the three other molecules that follow it.

The second problem is that the page of my standalone document is too small to include that same label. What's weird, in my mind, is that the page size takes account of the labels vertically, but not horizontally.

The third and final problem is that the first plus sign, on the left side of the equation, "doesn't care" about the label underneath $C^{2+}$. Here's the thing, though: I don't want to fix the problem entirely. The truth is that I see it as a pretty neat thing, in terms of the right side of the equation, where it saves a bit of space on the canvas all while not being too cluttered. What annoys me is the left side, because the label "Calcium ion" is longer than "Calcium", so having the plus sign too close makes the scheme too crowded, in my eye.

The reason I mentioned the three above problems in a single question is that I'm sure they're all solvable using the same solution. It's gotta be something like putting the chemname label inside some box that pushes away other surrounding objects. I just have no clue what that command is, or how to type it into a search engine.

1 Answer 1

2

Use "chemnameinit" to adjust the molecule names.

Don't use O^{-}, use \charge command. Notice the space between the O^{-} and the bond?

To increase the borders, use the border option. As the names are entered after building the molecules, problems sometimes occur.

\documentclass[border=6mm]{standalone}
\usepackage{chemfig}
\usepackage{chemformula}

\begin{document}
    
    \chemnameinit{\chemfig{O(-[:30]H)-[:150](=[:90]O)-[:210](=[:-90]O)-[:150]O-[:-150]H}}
    
    \schemestart
    \chemname{\chemfig{Ca^{2+}}}{Calcium ion}
    \+
    \chemname{\chemfig{O(-[:30]H)-[:150](=[:90]O)-[:210](=[:-90]O)-[:150]O-[:-150]H}}{Oxalic Acid, \ch{H2C2O4}}
    \arrow{->}
    \chemname{\chemfig{Ca}}{Calcium}
    \+
    \chemname{\chemfig{\charge{30=-}{O}-[:150](=[:90]O)-[:210](=[:-90]O)-[:150]\charge{30=-}{O}}}{Oxalate, \ch{C2O4}}
    \schemestop
    
\end{document}

enter image description here

1
  • You fixed all my problems, plus another one. Wish I could vote this up twice. Thanks for the clear explanation too.
    – GPWR
    Commented Jan 19, 2023 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .