我正在尝试改变这些轨道的颜色。因此,我希望它们不是透明和蓝色,而是红色和蓝色。我尝试更改设置颜色,但结果只是红色和透明或蓝色和透明。我该如何更改它?
\documentclass{general}
\usepackage{chemfig,chemmacros}
\chemsetup{modules=all}
\begin{document}
\setbondoffset{0pt}
\chemsetup[orbital]{
overlay ,
opacity = .75 ,
p/scale = 1.6 ,
s/color = blue!50 , %changing to red!50 is no help%
s/scale = 1.6
}
\chemfig{
-[:-20]\orbital{p}
(-[:-150])-\orbital{p}
}
\end{document}
答案1
看起来包装默认为黑白色,唯一可用的选项是将上半部分黑色更改为另一种色调,就像您对蓝色所做的那样。
然而,我们可以变通一下,欺骗一下包来产生这个
无需重新定义任何包定义(我同意这是一个临时解决方案)
\documentclass[a5paper]{report}
% \documentclass{general} % I do not have a general.sty
\usepackage{chemfig,chemmacros}
\chemsetup{modules=all}
\begin{document}
\setbondoffset{0pt}
\chemsetup[orbital]{
overlay ,
opacity = .75 ,
p/color = blue!50 , %setting black to another color%
p/scale = 1.6
}
\chemfig{
-[:-20]{\orbital[phase=-]{p}}{\orbital[half,color=red!75]{p}} %Note a half does not work well inverted so invert p
(-[:-150])-{\orbital[phase=-]{p}}{\orbital[half,color=red!75]{p}} % and over-strike white half with red half @75%
}
\hspace{12mm}
{ \chemfig{
-[:-20]{\orbital[phase=-]{p}}{\orbital[half,color=red!75]{p}} %Note a half does not work well inverted so invert p
(-[:-150])-{\orbital{p}}{\orbital[half,angle=270,color=red!75]{p}} % and over-strike white half with red half @75%
}
\hspace{12mm}
{ \chemfig{
-[:-20]{\orbital{p}}{\orbital[half,angle=270,color=red!75]{p}} %Note a half does not work well inverted so invert p
(-[:-150])-{\orbital{p}}{\orbital[half,angle=270,color=red!75]{p}} % and over-strike white half with red half @75%
}
\end{document}