My chemical reaction latex codes look like this
\document[11pt]{article}
\usepackage{chemfig}
\begin{document}
\schemestart
\chemname{\chemfig{R-H}}{Alkane} \arrow(.{5.5}--){->[light,heat or catalyst]}[0,2,] \chemname{\chemfig{R-X}}{Haloalkane} \+ \chemfig{HX}
\schemestop
\schemestart
\chemfig{CH_4} \+ \chemfig{Cl_2} \arrow(.{5.5}--){->[light]}[0,2,] \chemfig{CH_3Cl} \+ \chemfig{HCl}
\schemestop
\schemestart
\chemfig{CH_3Cl} \+ \chemfig{Cl_2} \arrow(.{5.5}--){->[light]}[0,2,] \chemfig{CH_2Cl_2} \+ \chemfig{HCl}
\schemestop
\schemestart
\chemfig{CH_2Cl_2} \+ \chemfig{Cl_2} \arrow(.{5.5}--){->[light]}[0,2,] \chemfig{CHCl_3} \+ \chemfig{HCl}
\schemestop
\schemestart
\chemfig{CH_3Cl} \+ \chemfig{Cl_2} \arrow(.{5.5}--){->[light]}[0,2,] \chemfig{CCl_4} \+ \chemfig{HCl}
\schemestop
\end{document}
It looks like this on compiling
I thought adding \arrow{0}[,0] will fix it but it didn't actually i don't' know why 🙁 . But i think it works for reaction containing benzene etc 🙁
- +How to i balance the position of arrow of chemical reaction ?
- How to i give blue color to Cl_2 atoms ? i thought of adding \colors but dont' know how it works 🙁
- How do i show all arrow of same length ?
- How to i show these reaction with arrow center so it
looks very nice ? - How to i reduce the distance between names of compound and their names?
Thank you .
Best Answer
Basically the answer is: have a look at TikZ anchors and how to use them with
chemfig
's\arrow
: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
):Here is an example alignment:
or with
\schemedebug{true}
:Coloring can be done by placing braces around the atom and adding
\color{blue}
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