1

I want to present a chemical equation, but all of the reactants do not align. How can I vertically center align E^+? This is my code:

\documentclass{report}

\usepackage[version=3]{mhchem}
\usepackage{mol2chemfig}  
\usepackage{float}
\usepackage{chemfig, chemmacros}
\usepackage{tikz}
\tikzset{
  elmove/.style={->,shorten >=3pt, shorten <=3pt}
}
\renewcommand*\printatom[1]{\ensuremath{\mathsf{#1}}}
\setatomsep{2em}
\setdoublesep{.6ex}
\setbondstyle{semithick}

\begin{document}
    \begin{figure}[H]
        \centering
        \schemestart
     \chemfig{
                        H% 7
                 -[:240]% 1
                 -[:180]% 2
                           (
                     -[:120]H% 8
                           )
                           (
        -[:300,,,,draw=none]\mcfcringle{1.3}% (o)
                           )
                 -[:240]% 3
                           (
                     -[:180]H% 9
                           )
                 -[:300]% 4
                           (
                     -[:240]H% 10
                           )
                       -% 5
                           (
                     -[:300]H% 11
                           )
                  -[:60]% 6
                           (
                     -[:120]% -> 1
                           )
                       -H% 12
    }
      {+}
      {E$^+$}
      \arrow{->}
       \chemfig{
                        H% 7
                 -[:240]% 1
                 -[:180]% 2
                           (
                     -[:120]H% 8
                           )
                           (
        -[:300,,,,draw=none]\mcfcringle{1.3}% (o)
                           )
                 -[:240]% 3
                           (
                     -[:180]E% 9
                           )
                 -[:300]% 4
                           (
                     -[:240]H% 10
                           )
                       -% 5
                           (
                     -[:300]H% 11
                           )
                  -[:60]% 6
                           (
                     -[:120]% -> 1
                           )
                       -H% 12
    }
     \schemestop
        \caption{Allmän reaktionsformel för elektrofil aromatisk substitution}
        \label{elsub}
    \end{figure}

    \end{document}

chemical equation where the reactants are not properly aligned

2

1 Answer 1

2

I think your code is more complicated than it needs to be. First of all, no need for defining the angles in the ring. Chemfig knows it automatically. Secondly, if done properly the E^+ is aligned automatically. Here is my suggestion:

\documentclass{report}

\usepackage{chemfig}
\usepackage{float}

\renewcommand*\printatom[1]{\ensuremath{\mathsf{#1}}}
\setatomsep{2em}
\setdoublesep{.6ex}
\setbondstyle{semithick}

\begin{document}
    \begin{figure}[H]
        \centering
        %\schemedebug{true}
        \schemestart
        \chemfig{[:-30]**6((-H)-(-H)-(-H)-(-H)-(-H)-(-H)-)}
        \arrow{0}[,0]\+
        \chemfig{E^+}
        \arrow
        \chemfig{[:-30]**6((-E)-(-H)-(-H)-(-H)-(-H)-(-H)-)}
        \schemestop
        \caption{Allmän reaktionsformel för elektrofil aromatisk substitution}
        \label{elsub}
    \end{figure}

\end{document}

You might tweak the sizes, alignments, etc. but in principle it does what you want without need of extra packages and too much typing.

You must log in to answer this question.

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