我在 chemfig 中连续绘制两个箭头时遇到问题。我需要:
点到点
但是当我放置两个箭头时,它们之间会出现一个我不需要的空格:
点到点
如何解决?如能提供任何帮助,我们将不胜感激!
\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}
答案1
这是一个新箭头类型的想法->>
,允许输入两个箭头作为一。箭头类型将获得 6 个参数:
\arrow{->>[above first]
[below first]
[above second]
[below second]
[ratio of arrow lengths (first:both)]
[label offset]}
输入
\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
给出
这是使用 完成的chemfig
。\definearrow
整个代码:
\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}
答案2
文档的“12 + 号”部分中的最新示例chemfig
显示\arrow(--[yshift=-10pt]){...}
。这也适用于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}