如果我想用这个chemfig
包装画一些类似的东西,我该怎么做?
我特别想知道如何以最简单、最美观的方式绘制箭头。
更新:在一位回复的帮助下,我已成功完成箭头右侧的部分。到目前为止,我的代码如下所示:
\documentclass[border=5mm]{standalone}
\usepackage{chemfig}
\definesubmol{e}{-[,.15,,,draw=none]}
\begin{document}
\schemestart
\chemfig{[:30]**6(--(-C(=[90]O)-O)----)}
%
\quad \arrow \quad
%
\chemfig{[:30]**6(--(!e\Lewis{0.,})----)}
\arrow{0}[,0]\+
\chemfig{C(=[90]O)(=[270]O)}
\schemestop
\end{document}
我仍然缺少一些您可能已经看到的元素:
- 氧分子上的路易斯点没有显示出来。
- 箭镞仍不见踪影。
- 左侧与箭头和右侧没有正确对齐。
如果有人对我的代码有任何改进,请随时告诉我!:)
答案1
\documentclass{article}
\usepackage{chemfig}
\usetikzlibrary{calc}
\begin{document}
\setchemfig{lewis radius =0.25ex,lewis sep =1ex}
\schemestart
\chemfig{
[:-30]**6(---(@{a1}-[@{a2}0]C(=[2]O)(=[6,,,,draw=none]\phantom{O})
-[@{a3}0]@{a4}\Lewis{0.,O}-[,0.7,,,draw=none])---)}
\arrow{->}
\chemfig{-[0,0.5,,,draw=none]**6(---(-[,0.3,,,draw=none]\Lewis{0.,})---)}
\arrow{0}[,0.2]
\+
\arrow{0}[,0.2]
\chemfig{C(=[2]O)(=[6]O)}
\schemestop
\chemmove{
\draw[arrows = {-Stealth[harpoon]}, shorten <=1pt, shorten >=1pt]
($(a2)+(-1pt,0)$) .. controls +(270:10mm) and +(270:10mm) .. (a1);
\draw[arrows = {-Stealth[harpoon]}, shorten <=1pt, shorten >=1pt]
($(a2)+(1pt,0)$) .. controls +(270:10mm) and +(270:10mm) .. ($(a3)+(-1pt,0)$);
\draw[arrows = {-Stealth[harpoon,swap]}, shorten <=2pt, shorten >=1pt]
($(a4)+(1.25ex,0)$) .. controls +(270:10mm) and +(270:10mm) .. ($(a3)+(1pt,0)$);
}
\end{document}
编辑
将 \Lewis 更改为 \charge
\documentclass{article}
\usepackage{chemfig}
\usetikzlibrary{calc}
\begin{document}
\setchemfig{lewis radius =0.25ex,lewis sep =1ex}
\schemestart
\chemfig{
[:-30]**6(---(@{a1}-[@{a2}0]C(=[2]O)(=[6,,,,draw=none]\phantom{O})
-[@{a3}0]@{a4}\charge{0=\.}{O}-[,0.7,,,draw=none])---)}
\arrow{->}
\chemfig{-[0,0.5,,,draw=none]**6(---\charge{0:2pt=\.}{}---)}
\arrow{0}[,0.2]
\+
\arrow{0}[,0.2]
\chemfig{C(=[2]O)(=[6]O)}
\schemestop
\chemmove{
\draw[arrows = {-Stealth[harpoon]}, shorten <=1pt, shorten >=1pt]
($(a2)+(-1pt,0)$) .. controls +(270:10mm) and +(270:10mm) .. (a1);
\draw[arrows = {-Stealth[harpoon]}, shorten <=1pt, shorten >=1pt]
($(a2)+(1pt,0)$) .. controls +(270:10mm) and +(270:10mm) .. ($(a3)+(-1pt,0)$);
\draw[arrows = {-Stealth[harpoon,swap]}, shorten <=2pt, shorten >=1pt]
($(a4)+(1.25ex,0)$) .. controls +(270:10mm) and +(270:10mm) .. ($(a3)+(1pt,0)$);
}
\end{document}