我不知道也不理解为什么使用箭头删除反应机制中的所有杂原子chemfig
。
\usepackage{chemfig,tikz}
\begin{document}
\begin{figure}
\centering
\schemestart
\definesubmol\N{\textcolor{blue}{N}}
\definesubmol\Ox{\textcolor{red}{O}}
\definesubmol\Am{\textcolor{blue}{NH_2}}
\chemname{\chemfig{*6((=!\Ox)-!\N(-)-@{a3}=@{a1}(-)-(=!\Ox)-!\N(-H)-)}}{Timina} \hspace{1.2em} \chemname{\chemfig{*6(@{a4}-!\N(-)-(=!\Ox)-!\N(-H)-(=!\Ox)-@{a2}(-)=)}}{Timina} \arrow \chemname{\chemfig{*6((=!\Ox)-!\N(-)-([:0]-([:30]*6(-!\N(-)-(=!\Ox)-!\N(-H)-(=!\Ox)-([:105]-)-)))-([:0]-)([:75]-)-(=!\Ox)-!\N(-H)-)}}{Dímero de timina ciclobutano}
\schemestop
\chemmove{\draw[red](a1)+(south:0.5cm)..controls+(north east:1cm)and +..(a2);\draw[red](a4)+(north:0.5cm)..controls+(south west:1cm)and+..(a3);}
\end{figure}
\end{document}
想要的结果是这样的,但是当我编译时,所有的杂原子都被删除了,出现了许多错误
答案1
\documentclass[border=5pt]{standalone}
\usepackage{chemfig}
\begin{document}
\definesubmol\N{\textcolor{blue}{N}}
\definesubmol\Ox{\textcolor{red}{O}}
\definesubmol\Am{\textcolor{blue}{NH_2}}
\schemestart
\chemname{\chemfig{
*6((=!\Ox)-!\N(-)-@{a1}=[@{a2}](-)-(=!\Ox)-!\N(-H)-)
}}{Timina}
\hspace{1.2em}
\chemname{\chemfig{
*6(-!\N(-)-(=!\Ox)-!\N(-H)-(=!\Ox)-@{a3}(-)=[@{a4}])
}}{Timina}
\arrow
\chemname{\chemfig{
*6((=!\Ox)-!\N(-)-([:0]-([:30]*6(-!\N(-)-(=!\Ox)-!\N(-H)-(=!\Ox)-([:105]-)-)))-([:0]-)([:75]-)-(=!\Ox)-!\N(-H)-)
}}{Dímero de timina ciclobutano}
\schemestop
\chemmove{
\draw[red] (a2) ..controls +(45:1) and +(180:0.2).. (a3);
\draw[red] (a4) ..controls +(225:1) and +(0:0.2).. (a1);
}
\end{document}
答案2
我把你的代码(来自第二篇文章的代码)放在了背面,它起作用了。
\documentclass[border=5pt]{standalone}
\usepackage{chemfig}
\begin{document}
\definesubmol\N{\textcolor{blue}{N}}
\definesubmol\Ox{\textcolor{red}{O}}
\definesubmol\Am{\textcolor{blue}{NH_2}}
\schemestart
\chemname{\chemfig{
*6((=!\Ox)-!\N(-)-@{a1}=[@{a2}](-)-(=!\Ox)-!\N(-H)-)
}}{Timina}
%
\hspace{1.2em}
%
\chemname{\chemfig{
*6(-!\N(-)-(=!\Ox)-!\N(-H)-(=!\Ox)-@{a3}(-)=[@{a4}])
}}{Timina}
%
\arrow %This arrow is deleting all heteroatoms and groups
%The problem still running in Overleaf
\chemname{\chemfig{
*6((=!\Ox)-!\N(-)-([:0]-([:30]*6(-!\N(-)-(=!\Ox)-!\N(-H)-(=!\Ox)-([:105]-)-)))-([:0]-)([:75]-)-(=!\Ox)-!\N(-H)-)
}}{Dímero de timina ciclobutano}
\schemestop
\chemmove{
\draw[red,shorten <=1pt,shorten >=2pt] (a2) ..controls +(45:1) and +(180:0.2).. (a3);
\draw[red,shorten <=1pt,shorten >=2pt] (a4) ..controls +(225:1) and +(0:0.2).. (a1);
}
\end{document}