4

Im using the package chemformula, but I can't find a way to write something like this:

enter image description here

2
  • 2
    Welcome to TeX.SE, @Eduardo Romero. Please, read about MWEs. Here, a good and also a polite practice is to present (when possible) what you have already tried.
    – FHZ
    Apr 14, 2022 at 4:19
  • 2
    chemfig can do it
    – cgnieder
    Apr 14, 2022 at 4:25

4 Answers 4

8

With use of chemfig and mhchem packages, chem formulas arein \llap (left) and rlap (right) commands:

\documentclass{article}
\usepackage{chemfig}
\usepackage[version=4]{mhchem}

\begin{document}
    \begin{center}  % or figure[ht]\centering
\schemestart
    \llap{\ce{C2H5OH}}\arrow{->[\color{teal}\ce{ZnO}][]}[30]          \rlap{\ce{C2H4 + H2O}} 
                      \arrow(@c1--C){->[][\color{teal}\ce{Cu}]}[-30]  \rlap{\ce{C2H4O + H2}}
\schemestop
    \end{center}
\end{document}

enter image description here

3
  • 2
    One of a best suggestion...
    – MadyYuvi
    Apr 14, 2022 at 16:02
  • @MadyYuvi, thank you very much!
    – Zarko
    Apr 14, 2022 at 16:03
  • Thank u so much!!! Apr 15, 2022 at 2:34
6

with chemfig and chemformula

\documentclass[border=3pt]{standalone}
\usepackage{chemfig}
\usepackage{chemformula}
\begin{document}
\schemestart
\ch{C2H5OH}
\arrow(eth.mid east--.mid west){->[ \color{green!80!black}\scriptsize\ch{ZnO} ]}[10]
\ch{C2H4 + H2O}
\arrow(@eth.mid east--.mid west){->[][ \color{green!80!black}\scriptsize\ch{Cu} ]}[-10]
\ch{C2H4O + H2}
\schemestop
\end{document}

enter image description here

1
  • Thank u, it looks really nice👍 Apr 15, 2022 at 2:34
3

Package chemformula doesn't seem to be concerned with spatial chemistry. No such example is presented. On the other hand, chemfig does present many spatial chemistry compounds.

Chemformula presents in section 7.2 some examples using more than on line and in section 12 some example inside the math environment align. I reproduced both below.

A possible workaround if you don't want to swap packages (or can't) is using TikZ wherever needed.

\documentclass{article}
\usepackage{chemformula}
\usepackage{tikz}
\begin{document}
% 7.2. Option Input
\ch{H2O +}\textcolor{red}{\ch{H2SO4}}\ch{-> H3O+ + HSO4-} \par
2 \ch{H2O +}\ch[subscript-vshift=2pt]{H2SO4}\ch{-> H3O+ + HSO4-}
% 12. Usage In Math Equations
\begin{align}
  \ch{
    H2O & ->[a] H2SO4 \\
    Cl2 & ->[x][y] CH4
  }
\end{align}
% Possible workaround with TikZ
\begin{tikzpicture}
  \draw[->] (0,0) coordinate(A) node[left]{\ch{H2O +}\textcolor{red}{\ch{H2SO4}}} -- 
    ++(1,1) node[right]{\ch{H3O+ + HSO4-}};
  \draw[->] (A) -- 
    ++(1,-1) node[right]{\ch{H3O+ + HSO4-}};;
\end{tikzpicture}  
\end{document}

enter image description here

1
  • 1
    wow, that's a great solution, thanks! Apr 15, 2022 at 2:35
2

A slightly more colorful solution

\documentclass[margin={2mm 4mm}]{standalone}
\usepackage{chemfig}
\usepackage{tikz}

\begin{document}
\schemestart
%
\chemfig{C_2H_5O@{z}H}
%
\arrow(@{z}--){0}[60,.1]\chemfig{-[:60,1,,,red,thick]@{y}}
\arrow(@{y}--){->[\chemfig{\textcolor{blue}{ZnO}}]}[0,1.5,,,red,thick,shorten <=-10pt]
%
\chemfig{C_2H_4} \+ \chemfig{H_2O}
%-------------------------------------------------------------------------------------------
\arrow(@{z}--){0}[300,.1]\chemfig{-[:300,1,,,blue,thick]@{x}}
\arrow(@{x}--){->[\chemfig{\textcolor{red}{Cu}}]}[0,1.5,,blue,thick,shorten <=-10pt]
%
\chemfig{C_2H_4O} \+ \chemfig{H_2}
%
\schemestop
\end{document}

enter image description here

1
  • It looks really good 👍, I appreciate it! Apr 15, 2022 at 2:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .