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}

관련 정보