4

I have a problem drawing two arrows in a row in chemfig. I need :

A->->B

but when I place two arrows, I get a space between them which I don't need:

A-> ->B

How to fix that? Any help is appreciated!

\documentclass[12pt,doublespacing,letterpaper]{report}

\usepackage{chemfig}


\begin{document}


\setatomsep{2em}
\setbondoffset{1pt}
\setdoublesep{3pt}
\setbondstyle{line width=1pt}


\renewcommand{\printatom}[1]{\fontsize{11pt}{11pt}\selectfont{\ensuremath{\mathrm{#1}}}}


\schemestart
    \scriptsize\chemfig{*6(-=-(-=_[:-30]-OMe)=-=)}
    \arrow{->[\footnotesize \textit{t}-BuLi, B(O\textit{i}-Pr$_3$)
    \footnotesize][\centering\footnotesize\
    {THF, -78$^\circ$C to rt}]}[,2.2,thick]
\mbox{}
\arrow{->[\footnotesize KHF$_2$(aq)\footnotesize][\centering\footnotesize\ {THF, rt, 31\%}]}[,1.7,thick]
\scriptsize\chemfig{*6(-=-(-=_[:-30]-BF_3K)=-=)}
\schemestop

\end{document}
5
  • Are you refering to chemfig's schemes, i.e. the \schemestart ... \arrow ...\schemestop? Can you please add a minimal working example (MWE)
    – cgnieder
    Commented Jun 24, 2013 at 17:38
  • \mbox gave an error, but \mbox{} worked well! Thanks!
    – chemist
    Commented Jun 24, 2013 at 17:49
  • Really? I removed it from my comment since it is not clear how you draw the arrows and \mbox{} still would leave a space between two \arrows in a scheme...
    – cgnieder
    Commented Jun 24, 2013 at 18:00
  • I apologize for not providing MWE, usually I draw my chemfig scheme like this:
    – chemist
    Commented Jun 24, 2013 at 18:10
  • \schemestart \scriptsize\chemfig{*6(-=-(-=_[:-30]-OMe)=-=)} \arrow{->[\footnotesize \textit{t}-BuLi, B(O\textit{i}-Pr$_3$)\footnotesize][\centering\footnotesize{THF, -78$^\circ$C to rt}]}[,2.5,thick] \mbox{} \arrow{->[\footnotesize KHF$_2$(aq)\footnotesize][\centering\footnotesize\ {THF, rt, 31\%}]}[,2,thick] \scriptsize\chemfig{*6(-=-(-=_[:-30]-BF_3K)=-=)} \schemestop
    – chemist
    Commented Jun 24, 2013 at 18:11

2 Answers 2

3

Here is an idea for a new arrow type ->> that allows to input both arrows as one. The arrow type will get 6 arguments:

\arrow{->>[above first]
          [below first]
          [above second]
          [below second]
          [ratio of arrow lengths (first:both)]
          [label offset]}

The input

\schemestart
  \scriptsize\chemfig{*6(-=-(-=_[:-30]-OMe)=-=)}
  \arrow{%
    ->>[\footnotesize \textit{t}-BuLi, B(O\textit{i}-Pr$_3$)]%
       [\footnotesize THF, -78$^\circ$C to rt]%
       [\footnotesize KHF$_2$(aq)\footnotesize]%
       [\footnotesize THF, rt, 31\%]%
       [.57]%
  }[,3.5,thick]
  \scriptsize\chemfig{*6(-=-(-=_[:-30]-BF_3K)=-=)}
\schemestop

gives

enter image description here

This is done using chemfig's \definearrow. The whole code:

\documentclass{article}
\usepackage{chemfig}

\makeatletter
\definearrow{6}{->>}{%
  \CF@arrow@shift@nodes{#6}%
  \path (\CF@arrow@start@node) -- (\CF@arrow@end@node)
    coordinate[pos=\ifx\@empty#5\@empty.5\else#5\fi] (mid@point) ;
  \expandafter\draw\expandafter[\CF@arrow@current@style,-CF@full,shorten >=1pt]
    (\CF@arrow@start@node) -- (mid@point);%
  \expandafter\draw\expandafter[\CF@arrow@current@style,-CF@full,shorten <=1pt]
    (mid@point) -- (\CF@arrow@end@node);%
  \CF@arrow@display@label{#1}{0.5}{+}{\CF@arrow@start@node}{#2}{0.5}{-}{mid@point}%
  \CF@arrow@display@label{#3}{0.5}{+}{mid@point}{#4}{0.5}{-}{\CF@arrow@end@node}%
}
\makeatother

\setatomsep{2em}
\setbondoffset{1pt}
\setdoublesep{3pt}
\setbondstyle{line width=1pt}

\renewcommand\printatom[1]{\fontsize{11pt}{11pt}\selectfont\ensuremath{\mathrm{#1}}}

\begin{document}

\schemestart
 A \arrow{->>[a][b]} B
\schemestop

\schemestart
 A \arrow{->>[a][][b]} B
\schemestop

\schemestart
 A \arrow{->>[a][b][c][d]} B
\schemestop

\schemestart
    \scriptsize\chemfig{*6(-=-(-=_[:-30]-OMe)=-=)}
    \arrow{%
        ->>[\footnotesize \textit{t}-BuLi, B(O\textit{i}-Pr$_3$)]%
        [\footnotesize THF, -78$^\circ$C to rt]%
        [\footnotesize KHF$_2$(aq)\footnotesize]%
        [\footnotesize THF, rt, 31\%]%
    }[,4,thick]
    \scriptsize\chemfig{*6(-=-(-=_[:-30]-BF_3K)=-=)}
\schemestop

\schemestart
    \scriptsize\chemfig{*6(-=-(-=_[:-30]-OMe)=-=)}
    \arrow{%
        ->>[\footnotesize \textit{t}-BuLi, B(O\textit{i}-Pr$_3$)]%
        [\footnotesize THF, -78$^\circ$C to rt]%
        [\footnotesize KHF$_2$(aq)\footnotesize]%
        [\footnotesize THF, rt, 31\%]%
        [.57]%
    }[,3.5,thick]
    \scriptsize\chemfig{*6(-=-(-=_[:-30]-BF_3K)=-=)}
\schemestop
\end{document}
4

The latest example in section "12 The + sign" of the documentation of chemfig shows \arrow(--[yshift=-10pt]){...}. This also works for xshift:

\documentclass[12pt,doublespacing,letterpaper]{report}

\usepackage{chemfig}

\begin{document}

\setatomsep{2em}
\setbondoffset{1pt}
\setdoublesep{3pt}
\setbondstyle{line width=1pt}

\renewcommand{\printatom}[1]{\fontsize{11pt}{11pt}\selectfont{\ensuremath{\mathrm{#1}}}}

% \schemedebug{true}
\schemestart
  \scriptsize\chemfig{*6(-=-(-=_[:-30]-OMe)=-=)}
  \arrow(--[xshift=-20pt]){%
    ->[\footnotesize \textit{t}-BuLi, B(O\textit{i}-Pr$_3$)]%
      [\footnotesize THF, -78$^\circ$C to rt]%
  }[,2.2,thick]
  \mbox{}%
  \arrow{%
    ->[\footnotesize KHF$_2$(aq)\footnotesize]%
      [\footnotesize THF, rt, 31\%]%
  }[,1.7,thick]
  \scriptsize\chemfig{*6(-=-(-=_[:-30]-BF_3K)=-=)}
\schemestop

\end{document}

Result

You must log in to answer this question.

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