[Tex/LaTex] Aligning arrow fo Chemical reaction and much more

chemfigchemistry

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 enter image description here

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:

\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

enter image description here

or with \schemedebug{true}:

enter image description here


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

Related Question