chemmacros 中軌道的顏色變化

chemmacros 中軌道的顏色變化

我正在嘗試改變這些軌道的顏色。因此,我希望它們只是紅色和藍色,而不是透明和藍色。我嘗試更改設定顏色,但只是變成紅色且清晰或藍色且清晰。我該如何改變它?

軌道

\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}

相關內容