[Tex/LaTex] What are structural elements? Customizing the mechnism of beamer color theme

beamercolorthemes

When I search the Internet, I can find many pieces of code including \usecolortheme[named=XXX]{structure}. If I add it to my presentation, I can see maybe there are some changes. I would like to know when I choose a theme such as Rochester, the color of the structural elements (though I do not know the detail issues) is to be set to some type. Do the structural elements depend upon which theme (such as Rochester) is chosen? Would you please tell me what are included in the structural elements?

      \documentclass{beamer}
      \usetheme{CambridgeUS}


      \title{Title1}
      \author{Author}
      \institute{Institute}
      \date{Date}


      \begin{document}

      \frame{
        \titlepage

       }

      \section[Outline]{}
      \frame{\tableofcontents}

      \section{Header1}
      \subsection{Header2}
      \frame{\frametitle{Topic1}

          HTML color codes are the \textbf{hexadecimal triplets} representing the colors red, green, and blue.
      \vspace{0.25cm}

        These color codes can be used to change the color of the background, text, and tables on a web page.
       }

        \begin{frame}
          testQ
        \end{frame}
      \end{document}

Above is a piece of craft code .For this theme CambridgeUS ,if I add \usecolortheme[named=XXX]{structure} ,the headline color does not change,I notice some innertheme elements' colors are changed,while I change it to the theme Rochester,I add the \usecolortheme[named=XXX]{structure} ,the headline color also changed.Then my question comes out.

Best Answer

The command

\usecolortheme[named=XXX]{structure}

applies only to the Beamer themes that made use of the structure template.

Where can you check which themes use this template? Via shell you can easily find the path where the Beamer class is installed via:

kpsewhere beamer.cls

which gives to me:

/usr/local/texlive/2013/texmf-dist/tex/latex/beamer/beamer.cls

Open this directory and then /themes/theme. You will find, among the others, beamerthemeRochester.styand beamerthemeCambridgeUS.sty. The color themes they use are different:

  • Rochester uses whale and orchid;
  • CambridgeUS uses beaver.

Now, for what concern the color themes of Rochester, only whale is relevant for the structural elements as orchid defines the block colors. The important things to be noticed in whale is that the relevant color palettes has use=structure which are the magic words that allow to later customize the colors with the template structure. Instead, beaver does not make use of this.

This is why this code:

  \documentclass[svgnames]{beamer}
  \usetheme{Rochester}
  %\usetheme{CambridgeUS}


  \title{Title1}
  \author{Author}
  \institute{Institute}
  \date{Date}

  \usecolortheme[named=SeaGreen]{structure}


  \begin{document}

  \frame{
    \titlepage

   }

  \section[Outline]{}
  \frame{\tableofcontents}

  \section{Header1}
  \subsection{Header2}
  \frame{\frametitle{Topic1}

      HTML color codes are the \textbf{hexadecimal triplets} representing the colors red, green, and blue.
  \vspace{0.25cm}

    These color codes can be used to change the color of the background, text, and tables on a web page.
   }

    \begin{frame}
      testQ
    \end{frame}
  \end{document}

gives you:

enter image description here

while:

  \documentclass[svgnames]{beamer}
  %\usetheme{Rochester}
  \usetheme{CambridgeUS}


  \title{Title1}
  \author{Author}
  \institute{Institute}
  \date{Date}

  \usecolortheme[named=SeaGreen]{structure}


  \begin{document}

  \frame{
    \titlepage

   }

  \section[Outline]{}
  \frame{\tableofcontents}

  \section{Header1}
  \subsection{Header2}
  \frame{\frametitle{Topic1}

      HTML color codes are the \textbf{hexadecimal triplets} representing the colors red, green, and blue.
  \vspace{0.25cm}

    These color codes can be used to change the color of the background, text, and tables on a web page.
   }

    \begin{frame}
      testQ
    \end{frame}
  \end{document}

generates:

enter image description here

Final disclaimer: what I said is not completely true as you may notice that some elements in CambridgeUS inherits the customization given by \usecolortheme[named=SeaGreen]{structure}. This is because Beamer is highly modular, so you have to take care (carefully) of what you're doing while modifying some aspects, in other words check if some templates still inherit colors definition from structure.