Color changes of orbitals in chemmacros












4















I'm trying to change the colors of these orbitals. So instead of the clear and blue color, I want them to be red and blue only. I tried changing the setup color, but just becomes red and clear or blue and clear. How would I change it?



Orbitals



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}









share|improve this question





























    4















    I'm trying to change the colors of these orbitals. So instead of the clear and blue color, I want them to be red and blue only. I tried changing the setup color, but just becomes red and clear or blue and clear. How would I change it?



    Orbitals



    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}









    share|improve this question



























      4












      4








      4








      I'm trying to change the colors of these orbitals. So instead of the clear and blue color, I want them to be red and blue only. I tried changing the setup color, but just becomes red and clear or blue and clear. How would I change it?



      Orbitals



      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}









      share|improve this question
















      I'm trying to change the colors of these orbitals. So instead of the clear and blue color, I want them to be red and blue only. I tried changing the setup color, but just becomes red and clear or blue and clear. How would I change it?



      Orbitals



      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}






      chemfig chemmacros






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 9 mins ago









      andselisk

      1,0022725




      1,0022725










      asked 11 hours ago









      Dave2343Dave2343

      785




      785






















          1 Answer
          1






          active

          oldest

          votes


















          2














          It would appear the package default is black and white and the only available option is to change the upper black half to another color tone as you have done to blue.



          However we can workaround and trick the package to produce this



          enter image description here



          without resorting to redefining any package definitions (I do agree its a kludge)



          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}





          share|improve this answer


























          • Thank you for the answer, it was really helpful! How would I do it for the sp2 orbital command? Would it be the same process? @KJO

            – Dave2343
            6 hours ago











          • I would say "roughly" yes since that is the way the package appears to be constructed (I did not look into wrestling with the code, just at how to simply work within its limitations) I suspect scaling will be the bigger part of adjusting for sp2 but once you have the relative scales correct once it is then simply a bigger volume of cut and paste. Thinking about it for sp2 it would be easier to just have the 2 scaled coloured halves of P and not use sp2 at all

            – KJO
            5 hours ago













          • Oh ok. Then I'll try that out. Thanks!

            – Dave2343
            5 hours ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477767%2fcolor-changes-of-orbitals-in-chemmacros%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          It would appear the package default is black and white and the only available option is to change the upper black half to another color tone as you have done to blue.



          However we can workaround and trick the package to produce this



          enter image description here



          without resorting to redefining any package definitions (I do agree its a kludge)



          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}





          share|improve this answer


























          • Thank you for the answer, it was really helpful! How would I do it for the sp2 orbital command? Would it be the same process? @KJO

            – Dave2343
            6 hours ago











          • I would say "roughly" yes since that is the way the package appears to be constructed (I did not look into wrestling with the code, just at how to simply work within its limitations) I suspect scaling will be the bigger part of adjusting for sp2 but once you have the relative scales correct once it is then simply a bigger volume of cut and paste. Thinking about it for sp2 it would be easier to just have the 2 scaled coloured halves of P and not use sp2 at all

            – KJO
            5 hours ago













          • Oh ok. Then I'll try that out. Thanks!

            – Dave2343
            5 hours ago
















          2














          It would appear the package default is black and white and the only available option is to change the upper black half to another color tone as you have done to blue.



          However we can workaround and trick the package to produce this



          enter image description here



          without resorting to redefining any package definitions (I do agree its a kludge)



          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}





          share|improve this answer


























          • Thank you for the answer, it was really helpful! How would I do it for the sp2 orbital command? Would it be the same process? @KJO

            – Dave2343
            6 hours ago











          • I would say "roughly" yes since that is the way the package appears to be constructed (I did not look into wrestling with the code, just at how to simply work within its limitations) I suspect scaling will be the bigger part of adjusting for sp2 but once you have the relative scales correct once it is then simply a bigger volume of cut and paste. Thinking about it for sp2 it would be easier to just have the 2 scaled coloured halves of P and not use sp2 at all

            – KJO
            5 hours ago













          • Oh ok. Then I'll try that out. Thanks!

            – Dave2343
            5 hours ago














          2












          2








          2







          It would appear the package default is black and white and the only available option is to change the upper black half to another color tone as you have done to blue.



          However we can workaround and trick the package to produce this



          enter image description here



          without resorting to redefining any package definitions (I do agree its a kludge)



          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}





          share|improve this answer















          It would appear the package default is black and white and the only available option is to change the upper black half to another color tone as you have done to blue.



          However we can workaround and trick the package to produce this



          enter image description here



          without resorting to redefining any package definitions (I do agree its a kludge)



          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}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 7 hours ago

























          answered 7 hours ago









          KJOKJO

          2,7241119




          2,7241119













          • Thank you for the answer, it was really helpful! How would I do it for the sp2 orbital command? Would it be the same process? @KJO

            – Dave2343
            6 hours ago











          • I would say "roughly" yes since that is the way the package appears to be constructed (I did not look into wrestling with the code, just at how to simply work within its limitations) I suspect scaling will be the bigger part of adjusting for sp2 but once you have the relative scales correct once it is then simply a bigger volume of cut and paste. Thinking about it for sp2 it would be easier to just have the 2 scaled coloured halves of P and not use sp2 at all

            – KJO
            5 hours ago













          • Oh ok. Then I'll try that out. Thanks!

            – Dave2343
            5 hours ago



















          • Thank you for the answer, it was really helpful! How would I do it for the sp2 orbital command? Would it be the same process? @KJO

            – Dave2343
            6 hours ago











          • I would say "roughly" yes since that is the way the package appears to be constructed (I did not look into wrestling with the code, just at how to simply work within its limitations) I suspect scaling will be the bigger part of adjusting for sp2 but once you have the relative scales correct once it is then simply a bigger volume of cut and paste. Thinking about it for sp2 it would be easier to just have the 2 scaled coloured halves of P and not use sp2 at all

            – KJO
            5 hours ago













          • Oh ok. Then I'll try that out. Thanks!

            – Dave2343
            5 hours ago

















          Thank you for the answer, it was really helpful! How would I do it for the sp2 orbital command? Would it be the same process? @KJO

          – Dave2343
          6 hours ago





          Thank you for the answer, it was really helpful! How would I do it for the sp2 orbital command? Would it be the same process? @KJO

          – Dave2343
          6 hours ago













          I would say "roughly" yes since that is the way the package appears to be constructed (I did not look into wrestling with the code, just at how to simply work within its limitations) I suspect scaling will be the bigger part of adjusting for sp2 but once you have the relative scales correct once it is then simply a bigger volume of cut and paste. Thinking about it for sp2 it would be easier to just have the 2 scaled coloured halves of P and not use sp2 at all

          – KJO
          5 hours ago







          I would say "roughly" yes since that is the way the package appears to be constructed (I did not look into wrestling with the code, just at how to simply work within its limitations) I suspect scaling will be the bigger part of adjusting for sp2 but once you have the relative scales correct once it is then simply a bigger volume of cut and paste. Thinking about it for sp2 it would be easier to just have the 2 scaled coloured halves of P and not use sp2 at all

          – KJO
          5 hours ago















          Oh ok. Then I'll try that out. Thanks!

          – Dave2343
          5 hours ago





          Oh ok. Then I'll try that out. Thanks!

          – Dave2343
          5 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477767%2fcolor-changes-of-orbitals-in-chemmacros%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)