Math & ScienceSuperSubscripts for chemistry equations:

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

SuperSubscripts for chemistry equations:

Post by Eenzc »

Hello,

I'm trying to format my chemical equations just right and I think I'm almost there.

The problem being that a normal subscript in just not low enough and the superscirpt following a chemical symbol that denotes charge needs to be slightly set to the right but not by a full space.

I wrote a simple macro to sub\sub\sub script my numbers to the correct place below the line.. it goes like this.

Code: Select all


%%%%%%%%%%%%

% new command for chemistry subscripts

\newcommand{\cu}[1]{_{_{_{\scriptsize #1}}}}

% useage eg: for H2 = H \cu{2}

%%%%%%%%%%%%

So thats fine, however now the text size is slightly smaller than that of the text size for the normal superscript which I'm using for the charge number.


For example:

Code: Select all


\begin{align}
\mathrm{Hg\cu{2}HPO\cu{4} + 2~e} 					~& \mathrm{\rightleftharpoons 2~Hg + HPO\cu{4}^{~2-} } 				
~& E : \SI{+0.6359}{V} 				\\
\end{align}

note: there was some extra formatting macros in the above code for the E symbol and numeration counter that I have omitted for clarity.

So my problem is that the superscript and the subsubsub script sizes are different but I cannot change their size using \scriptsize size command because they are inside the mathmode.

Any help greatly recieved.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

SuperSubscripts for chemistry equations:

Post by localghost »

I think the mhchem package will solve all your problems.


Best regards and welcome to the board
Thorsten¹
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Re: SuperSubscripts for chemistry equations:

Post by Eenzc »

Thanks, I will do that I invested some time trying to get it right but seeing that someone else has done the hard work there is no point in me reinventing the wheel.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

SuperSubscripts for chemistry equations:

Post by localghost »

This package will simplify typesetting chemical equations. It makes your example look like the following.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\usepackage{siunitx}

\begin{document}
  \begin{align}
    \cee{Hg2HPO4 &<=>C[+2e]} \ce{2Hg}+\ce{HPO4^2-} & E:~\SI{+0.6359}{V}
  \end{align}
\end{document}
I guess that should be suitable.
Post Reply