Trying to write a thesis, and I need some reaction equations. How can I write this in LaTeX?
[Tex/LaTex] How to write these chemical reaction equations
chemistryequations
Related Solutions
A name can be put below a molecule with \chemname{<molecule>}{<name>}
.
In a scheme everything between different \arrow
s is consideres as one compound and the arrow is centered to the whole structure. This can be made visible with \schemedebug{true}
:
So one possibility is to put invisible arrows of zero length (\arrow{0}[,0]
) in between:
\schemedebug{true}
\schemestart
\sodiumbenzoate \arrow{0}[,0]
+
\NaOH
\arrow{->[\footnotesize\chemfig{CaO}][$\Delta$]}
\benzene \arrow{0}[,0] + \CaO
\schemestop
In combination this would give (note that I use a different possibility to draw sodium benzoate in order to give it a different baseline (page 4 of the chemfig
manual: »ChemFig always places the first atom of the molecule on the baseline of the preceding code.«)):
\schemedebug{true}
\schemestart
\chemname{\chemfig{COONa-[4]**6(------)}}{sodium benzoate}
\+
NaOH
\arrow{->[\footnotesize\chemfig{CaO}][$\Delta$]}
\chemfig{**6(------)}
\arrow{0}[,0]
\+
CaO
\schemestop
The name disturbs alignment again. Now you can either not use \chemname
but put the name below with more invisible arrows or you can adjust the anchor where the \arrow
starts (have a look at the (.{4.85}--)
argument of \arrow
and study section »Anchoring« in part »reaction schemes« of the chemfig
manual):
\schemedebug{true}
\schemestart
\chemname{\chemfig{COONa-[4]**6(------)}}{sodium benzoate}
\+
NaOH
\arrow(.{4.85}--){->[\footnotesize\chemfig{CaO}][$\Delta$]}
\chemfig{**6(------)}
\arrow{0}[,0]
\+
CaO
\schemestop
There may be other solutions, too. I always tend to forget one or more ways…
Basically the answer is: have a look at TikZ anchors and how to use them with chemfig
's \arrow
:
\arrow(<node name>.<anchor>--<node name>.<anchor>)
All node names and anchors are optional. Those can be used with an invisible downarrow (angle: -90) to achieve alignment, e.g., by aligning the lower right-hand edge of the upper compound (south west
) with the upper right-hand edge of the lower compound (north west
):
\arrow(@c1.south east--.north east)
Here is an example alignment:
% \schemedebug{true} % shows (not only) the node names
\schemestart
% line one
A + B \arrow C + D
\arrow(@c1.south east--.north east){0}[-90,.15]
% line two:
E + F \arrow G + H
\arrow(@c3.south east--.north east){0}[-90,.15]
% line three:
I + J \arrow K + L
\schemestop
or with \schemedebug{true}
:
Coloring can be done by placing braces around the atom and adding \color{blue}
\chemfig{CH_3-{\color{blue}Cl}}
As for the distance between compounds and names: I supsect you have used \chemname
not in a group somewhere and have forgotten to reset it. Have a look at Placement of caption in \chemfig via \chemname command - how to reset spacing
Best Answer
There are a couple of packages for typesetting chemistry stuff, one such is
chemmacros
. The equation in your image can be typeset aswhich will give
I suggest you take a look at the manual for the package. It is probably installed along with the package in your TeX distribution, and you can find it by writing
texdoc chemmacros
in a command prompt/terminal (or in the search field in the start menu, if you're on Windows). Or you can get it at http://www.ctan.org/pkg/chemmacrosComplete code: