Chemfig 中的共振杂化物

Chemfig 中的共振杂化物

如何才能最好地创建用于共振结构的虚线/实线配对键线?例如,我有

$ \chemfig{
C(=[:90]\lewis{1:3:, O}) (-[:210]\lewis{3:5:7:, O}) (-[:330]\lewis{1:5:7:, O})
} \longleftrightarrow \chemfig{
C(-[:90]\lewis{2:4:0:, O}) (=[:210]\lewis{4:6:, O}) (-[:330]\lewis{1:5:7:, O})
} \longleftrightarrow \chemfig{
C(-[:90]\lewis{2:4:0:, O}) (-[:210]\lewis{3:5:7:, O}) (=[:330]\lewis{6:0:, O})
} $

这会创建碳酸盐的三部分混合图。我还知道我可以使用-[:210,,,,dash pattern=on 2pt off 2pt]创建一条虚线。有没有一种相对简单的方法来添加实线旁边是虚线?从上面的例子来看,我还想画出一个分子,其中每个 CO 键都是实线/虚线对。

答案1

文献中的第 6 节“离域双键” chemfig。我也建议用它\schemestart ... \schemestop来绘制反应方案。

\documentclass{article}
\usepackage{chemfig}
\usetikzlibrary{decorations}
\pgfdeclaredecoration{ddbond}{initial}
{
\state{initial}[width=4pt]
{
\pgfpathlineto{\pgfpoint{4pt}{0pt}}
\pgfpathmoveto{\pgfpoint{2pt}{2pt}}
\pgfpathlineto{\pgfpoint{4pt}{2pt}}
\pgfpathmoveto{\pgfpoint{4pt}{0pt}}
}
\state{final}
{
\pgfpathlineto{\pgfpointdecoratedpathlast}
}
}
\tikzset{lddbond/.style={decorate,decoration=ddbond}}
\tikzset{rddbond/.style={decorate,decoration={ddbond,mirror}}}
\begin{document}
\schemestart
\chemfig{
C(=[:90]\lewis{1:3:, O}) (-[:210]\lewis{3:5:7:, O}) (-[:330]\lewis{1:5:7:, O})
} \arrow{<->} \chemfig{
C(-[:90]\lewis{2:4:0:, O}) (=[:210]\lewis{4:6:, O}) (-[:330]\lewis{1:5:7:, O})
} \arrow{<->} \chemfig{
C(-[:90]\lewis{2:4:0:, O}) (-[:210]\lewis{3:5:7:, O}) (=[:330]\lewis{6:0:, O})
}
\arrow{<->}
\chemfig{
C(-[:90,,,,lddbond]\lewis{1:3:, O}) (-[:210,,,,lddbond]\lewis{4:6:, O}) (-[:330,,,,lddbond]\lewis{6:0:, O})
}
\schemestop
\end{document}

相关内容