我怎样才能使这些箭头变成阴影,例如从白色变成蓝色?
\documentclass{article}
\usepackage{chemfig}
\usepackage[version=3]{mhchem}
\begin{document}
\begin{figure}[!htb]
\centering
\scalebox{2}{
\schemestart
\chemfig{@{O1-2}\textcolor{gray}{O}=@{C1-2}\textbf{C}=@{O2-2}\textcolor{gray}{O}}
\schemestop
\chemmove{
\draw[blue][shorten <=3pt, shorten >=3pt](O1-2).. controls +(north:1cm) and +(120:1cm).. (C1-2);
\draw[blue][shorten <=3pt, shorten >=3pt](O2-2).. controls +(north:1cm) and +(60:1cm).. (C1-2);
}
}
\end{figure}
\end{document}
答案1
建立在塞巴斯蒂亚诺的回答,也可以将该path fading
选项直接应用于chemfig
箭头,如下例所示:
\documentclass{article}
\usepackage{chemfig}
\usepackage[version=3]{mhchem}
\usetikzlibrary{fadings}
\begin{document}
\begin{figure}[!htb]
\centering
\scalebox{2}{
\schemestart
\chemfig{@{O1-2}\textcolor{gray}{O}=@{C1-2}\textbf{C}=@{O2-2}\textcolor{gray}{O}}
\schemestop
\chemmove{
\draw[blue, path fading = west][shorten <=3pt, shorten >=3pt](O1-2).. controls +(north:1cm) and +(120:1cm).. (C1-2);
\draw[blue, path fading = east][shorten <=3pt, shorten >=3pt](O2-2).. controls +(north:1cm) and +(60:1cm).. (C1-2);
}
}
\end{figure}
\end{document}
答案2
一个可能的解决方案tikz-cd
非常简单,让箭头从白色变为蓝色。
\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd,amsmath}
\usetikzlibrary{fadings}
\begin{document}
\begin{tikzcd}[column sep=.7cm]
\color{gray}{\mathrm{O}}
\arrow[r, equal, no head] \arrow[r, bend left=49, blue, path fading=west] & \mathbf{C} \arrow[r, no head, equal] & \color{gray}{\mathrm{O}} \arrow[l, bend right=49, blue, path fading=east]
\end{tikzcd}
\end{document}