## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Acid-Base Pairs

Information and discussion about graphics, figures & tables in LaTeX documents.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

### Acid-Base Pairs

How do you produce acid-base lines with chemical equations? Sort of like redox lines but for conjugate acid-base pairs. Also how do you make the lines flow below the chemical reaction?
Last edited by ghostanime2001 on Fri Dec 16, 2011 11:42 pm, edited 1 time in total.

Tags:

cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm
I do not know what you mean by making lines flow. I also don't know what you mean by acid-base lines? Do you mean a line which connects them visually above or below the equation? You could "misuse" chemmacros' \redox command:
\documentclass{article}\usepackage{chemmacros} \begin{document} \ce{\OX{b1,CO3^2-} + \OX{a2,H2O} <=>  \OX{a1,HCO3-} + \OX{b2,OH-}}\redox(b1,a1){} \redox(b2,a2)[][-1]{} \end{document}
site moderator & package author

ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am
This is what I mean. Can this code be improved?

\ce{$\underset{\clap{\begin{tabular}[t]{@{}c@{}}\Rnode{A}{acid}\end{tabular}}}{\ce{HCO3-}}$ + $\underset{\clap{\begin{tabular}[t]{@{}c@{}}\Rnode{B}{base}\end{tabular}}}{\ce{S^{2-}}}$ <=> $\underset{\clap{\begin{tabular}[t]{@{}c@{}}\Rnode{C}{base}\end{tabular}}}{\ce{CO3^{2-}}}$ + $\underset{\clap{\begin{tabular}[t]{@{}c@{}}\Rnode{D}{acid}\end{tabular}}}{\ce{HS-}}$}\ncbar[linewidth=0.1pt,angle=-90,nodesep=3pt,arm=0.5em]{A}{C}\ncbar[linewidth=0.1pt,angle=-90,nodesep=3pt,arm=1.1em]{B}{D}

cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm
site moderator & package author

ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am
Compile with XeLaTeX


cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm
The result looks fine to me. What is it exactly you want to improve?

BTW: your example code is far from being minimal. For example you're loading lot's of packages twice: siunitx, tikz, xfrac, xspace, mhchem and mathtools (=improved amsmath) are already loaded by chemmacros.
This:
\usepackage{siunitx,tikz,xfrac,xspace,amsmath,chemmacros}\usepackage[version=3]{mhchem}

and this
\usepackage{chemmacros}

will work the same way
site moderator & package author

ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am
So i can substitute all those packages with just 1 package?

cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm
This is no substitution. These packages are loaded anyway by chemmacros, if you need them or not. tikz for example is also loaded by chemfig so if you use the latter you won't have to load tikz by yourself.
site moderator & package author