Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
Are you refering to chemfig's schemes, i.e. the \schemestart ... \arrow ...\schemestop? Can you please add a minimal working example (MWE) –  cgnieder Jun 24 '13 at 17:38
    
\mbox gave an error, but \mbox{} worked well! Thanks! –  chemist Jun 24 '13 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 Jun 24 '13 at 18:00
    
I apologize for not providing MWE, usually I draw my chemfig scheme like this: –  chemist Jun 24 '13 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 Jun 24 '13 at 18:11
add comment

2 Answers

up vote 3 down vote accepted

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}
share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.