# Chemical LaTeX typeset

Staff Emeritus
Gold Member
Physicsforums now has a very cool feature, which enables complex typesetting for formulas or equations!

A tutorial is on the following page:
https://www.physicsforums.com/misc/howtolatex.pdf
The topic is also explained in the following thread:

The feature is LaTeX and the following is possible::

$$^{33}_{17}Cl^{16}\xrightarrow{n,n}~^{31}_{15}P^{16}+~^4_2He^2$$

Not long ago we had to write::
33 (1) 31 4
17 Cl + 2(0)n -----> 15 P + 2 He

Causing much confusion as you can imagine
So play around with some formulas if you like, click on the LaTeX image to popup the code with which it was written.

To explain the basics:
_ is subscript
^ is superscript
{} are delimiters, to keep text together
~ is a space

So the code in the above formula is::
[ tex]^{33}_{17}Cl^{16}\xrightarrow{n,n}~^{31}_{15}P^{16}+~^4_2He^2[ /tex]

Last edited:

Staff Emeritus
Gold Member
Henderson-Hasselbalch equation:

$$pH=pK_a+log\frac{[A^-]}{[HA]}$$

Last edited:
Staff Emeritus
Gold Member
Michaelis-Menten equation

$$V=\frac{k_2[E]_t}{K_M+}$$

or

$$6CO_2+6H_2O\xrightarrow{Light~Energy}C_6H_{12}O_6+CO_2~~~\Delta G^\circ=+2870kJ/mol$$

If I can do it, anyone can! Last edited:
$$\newcommand{\atom}[ 4 ]{{}^{#1}_{#2} {#3}^{#4}} \atom{33}{17}{Cl}{16} \xrightarrow{n,n} \atom{31}{15}{P}{16} + \atom{4}{2}{He}{2}$$

$$pH = pK_a + \log\frac{[A^-]}{[HA]}$$

\begin{equation*} \begin{align} &6CO_2+6H_2O\xrightarrow{\textit{Light Energy}}C_6H_{12}O_6+CO_2 \\ &\Delta G^\circ=+2870~\textrm{kJ/mol} \end{align} \end{equation*}

Staff Emeritus
Gold Member
Ambitwistor is not such a simple soul as me I actually noticed that I am putting in too many spacers (~), those are not always necessary next to '+' or '\xrightarrow' or '='

Originally posted by Monique
I actually noticed that I am putting in too many spacers (~), those are not always necessary next to '+' or '\xrightarrow' or '='

In fact, they're almost never necessary; TeX is smart enough in most cases to get the spacing right. If you want to add more spacing, use /, (not ~, that's to prevent line breaks), and if you want to remove spacing, use /; --- but use them sparingly. (There are well-known cases where TeX isn't smart and you need to use them, though; not enough spaces in integrals and too many spaces in bra-kets.)

Enthalpy of Vaporization
The amount of energy to change 1 g of liquid to gas at its boiling point. For water,

$$\Delta H_{vap} = 540~cal~g^{-1}$$

Last edited by a moderator:
$$\Delta H_\textrm{vap} = 540 \mbox{ cal~g}^{-1}$$

Another God
Staff Emeritus
Gold Member
OK, exams are over so I have no reason to not learn this stuff now.... here I go.

Moniques version...
$$^{33}_{17}{Cl}^{16} \xrightarrow{n,n} ^{31}_{15}P^{16} +~^4_2He^2$$

Ambitwistors version...
$$\newcommand{\atom} [ 4 ] { ^{#1}_{#2} {#3}^{#4}} \atom {33}{17}{Cl}{16} \xrightarrow{n,n} \atom {31}{15}{P}{16}+\atom {4}{2}{He}{2}$$

Last edited:
Another God
Staff Emeritus
Gold Member
$${pH} = {pK_a} + \log\frac{[A^-]}{[HA]} \\ V = \frac{k_2{[E]}+{}}{K_m + {}} \\ 6CO_2 + 6H_2O \xrightarrow{Light Energy} C_6H_{12}O_6 + CO_2 \ \delta G^{\circ} = +2870kJ/mol$$
Oh, ok, so \\ can only be used as part of an equation to start a new line. To do different equations, you have to use diferent tex flags i guess...?

And why didn't my C6H12) finish....

$${pH} = {pK_a} + \log\frac{[A^-]}{[HA]}$$

$$V = \frac{k_2{[E]}_t{}}{K_M + {}}$$

Now, will this come up as I want it to? $6CO_2 + 6H_2O \xrightarrow{Light Energy} C_6 H_{12} O_6 + CO_2 \delta G^{\circ} = +2870kJ/mol$ Lets find out...

Last edited:
Another God
Staff Emeritus
Gold Member
wow, capitals matter.

that should have been $\Delta$ not $\delta$.

So

$6CO_2 + 6H_2O \xrightarrow{Light Energy} C_6 H_{12} O_6 + CO_2 ~\Delta G^{\circ} = +2870kJ/mol$

Another God
Staff Emeritus
Gold Member
that \ thing never does what I want...$6CO_2 + 6H_2O \xrightarrow{Light\Energy} C_6 H_{12} O_6 + CO_2 ~\Delta \ \ \ \G^{\circ} = +2870kJ/mol$

Maybe I should use that comma? $6CO_2 + 6H_2O \xrightarrow{Light/,Energy} C_6 H_{12} O_6 + CO_2 ~\Delta /, /, /, G^{\circ} = +2870kJ/mol$

$6CO_2 + 6H_2O \xrightarrow{Light\,Energy} C_6 H_{12} O_6 + CO_2 ~\Delta \, \, \, G^{\circ} = +2870kJ/mol$
I think i prefer the tilde (~) key...$6CO_2 + 6H_2O \xrightarrow{Light~Energy} C_6 H_{12} O_6 + CO_2 ~\Delta~~~G^{\circ} = +2870kJ/mol$

Last edited:
$6CO_2 + 6H_2O \xrightarrow{\mathit{Light Energy}} C_6 H_{12} O_6 + CO_2, \Delta G^{\circ} = +2870~\mathrm{kJ/mol}$

Staff Emeritus
Gold Member
You are using itex, that stands for inline?

tex
$$^{33}_{17}{Cl}^{16} \xrightarrow{n,n} ^{31}_{15}P^{16} +~^4_2He^2$$

inline
$$\inline{^{33}_{17}{Cl}^{16} \xrightarrow{n,n} ^{31}_{15}P^{16} +~^4_2He^2}$$

itex
$^{33}_{17}{Cl}^{16} \xrightarrow{n,n} ^{31}_{15}P^{16} +~^4_2He^2$

Apparently :) that's cool!

Another God
Staff Emeritus
Gold Member
It would be nice if it $did fit inline$ a little better though. At the moment it sits a little low and disrupts the line below, so it doesn't look quite as neat.

Another God
Staff Emeritus
Gold Member
I $stand~corrected$. I guess it depends on the physical size of the formula and stuff. It does a good job of fitting it where it can.

chem_tr
Gold Member
Could you give some information about how to use this typeset in another place?

If you mean how to use it outside of PF, you need to download a program such as miktex (www.miktex.org).

dextercioby
Homework Helper
Thanks for the link,Sirus.Maybe i'll get read of the old Scientific Workplace that i'm using now.

For small applications, you can preview a post on PF with the required code in it, then copy and paste the latex into MS Word or another word processing application. This is discouraged, however, to avoid excess traffic on the PF server (copy/pasting Latex is not, after all, the purpose of PF).

GCT
Homework Helper
Trying it out,

$$H^+ _{(aq)} + OH^- _{(aq)} \xrightarrow~H_2 O _{(l)}$$

Last edited:
GCT
Homework Helper
I should be studying,

$$1/p + 1/q = 1/f$$

GCT
Homework Helper
this is killing me

$${\Delta G} = {\Delta G^_o} - RT\textit{lnQ}$$

from my current physics course
lens maker's equation
$$\frac{n_1}{p} + \frac{n_2}{q} = (n_1-1) \left[ \frac{1}{R_1} - \frac{1}{R_2} \right]$$

I'll just do my hw here
$$\int ( \textit{lnt} )^2 dt$$

$$u= ( \textit{lnt} )^2$$
$$du=2( \textit{lnt} )( \frac{1}{t} )$$
$$dv= dt$$
$$v= \int dt = t$$

$$\int ( \textit{lnt} )^2 dt = ( \textit{lnt} )^2t - \int 2t( \textit{lnt} )( \frac{1}{t} )$$

Last edited:
Gokul43201
Staff Emeritus
Gold Member
Anyone (ambitwistor ?) know the symbol for the equilibrium (upper half of right arrow above lower half of left arrow) sign ?

GCT
$$\xrightarrow{\leftarrow}$$
$$\xrightarrow{\xleftarrow}$$