Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I created a latex beamer presentation using "Montepellier" theme with default color theme. I need to modify this theme (I want to change the color of the upper and lower border of header - separately). So I copied "beamercolorthemedefault" to my project, renamed and included it (this is working!). But I can't change any colors - changing colors has no effect. I changed the default the this way (only the changed first lines):

\ProvidesPackageRCS $Header:   

    /Users/joseph/Documents/LaTeX/beamer/base/themes/color/beamercolorthemedefault.sty,v d02a7cf4d8ae 2010/06/17 09:11:41 rivanvx $


\mode<presentation>

\definecolor{beamer@blendedblue}{rgb}{0.5,0.5,0.3} % changed this

\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{alerted text}{fg=red}
\setbeamercolor{example text}{fg=green!50!black}

\setbeamercolor{structure}{fg=beamer@blendedblue}

\setbeamercolor{background canvas}{parent=normal text}
\setbeamercolor{background}{parent=background canvas}

\setbeamercolor{palette primary}{fg=yellow,bg=yellow} % changed this
\setbeamercolor{palette secondary}{use=structure,fg=structure.fg!100!green} % changed this
\setbeamercolor{palette tertiary}{use=structure,fg=structure.fg!100!green} % changed this

But all this changes have no effect?! (replacing the complete content by another theme works) So how to change any colors and how to change the borders of header?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

I think you did something very complicated while the solution could have been much more easy. Moreover it is preferable to not modify the default themes: if you do it, at least change theme name.

For example, look at this code:

\documentclass{beamer}
\usetheme{Montpellier}
\begin{document}

\title{My title}
\author{My name}
\institute{My institute}

\makeatletter
\definecolor{beamer@blendedblue}{rgb}{0.5,0.5,0.3} % changed this

\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{alerted text}{fg=red}
\setbeamercolor{example text}{fg=green!50!black}

\setbeamercolor{structure}{fg=beamer@blendedblue}

\setbeamercolor{background canvas}{parent=normal text}
\setbeamercolor{background}{parent=background canvas}

\setbeamercolor{palette primary}{fg=yellow,bg=yellow} % changed this
\setbeamercolor{palette secondary}{use=structure,fg=structure.fg!100!green} % changed this
\setbeamercolor{palette tertiary}{use=structure,fg=structure.fg!100!green} % changed this
\makeatother

\begin{frame}
\titlepage
\end{frame}

\begin{frame}{A frame}
\begin{itemize}
\item hello
\item hello again
\end{itemize}
\end{frame}

\end{document}

In a very simple manner I got:

enter image description here

enter image description here

If you want to create your own color theme, create a file called for example beamercolorthememyct.sty as:

\definecolor{beamer@blendedblue}{rgb}{0.5,0.5,0.3} % changed this

\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{alerted text}{fg=red}
\setbeamercolor{example text}{fg=green!50!black}

\setbeamercolor{structure}{fg=beamer@blendedblue}

\setbeamercolor{background canvas}{parent=normal text}
\setbeamercolor{background}{parent=background canvas}

\setbeamercolor{palette primary}{fg=yellow,bg=yellow} % changed this
\setbeamercolor{palette secondary}{use=structure,fg=structure.fg!100!green} % changed this
\setbeamercolor{palette tertiary}{use=structure,fg=structure.fg!100!green} % changed this

You can put it in the same folder of your .tex presentation file (I have TeXLive and it works) or in your personal tree.

Then, the MWE shown above will become:

\documentclass{beamer}

\usetheme{Montpellier}
\usecolortheme{myct}
\begin{document}

\title{My title}
\author{My name}
\institute{My institute}
\begin{frame}
\titlepage
\end{frame}

\begin{frame}{A frame}
\begin{itemize}
\item hello
\item hello again
\end{itemize}
\end{frame}
\end{document}

with the same two frames as graphical result.

EDIT

To change just colors in the upper and lower line head you should use the proper keys. For example adding these lines to your theme color:

\setbeamercolor{upper separation line head}{bg=green}
\setbeamercolor{lower separation line head}{bg=red}

allows you to get:

enter image description here

enter image description here

share|improve this answer
    
that is exactly what i did - i took the default theme and renamed it. And in meantime changing the "structure" via "\definecolor{beamer@blendedblue}{rgb}{0.5,0.5,0.3}" is working (i get same result as you - i guess deleting tmp folder helped ;-)). But main question remains how to change "structure" but only the color of upper and lower border of header. –  dermoritz May 8 '12 at 10:46
    
thx! it works -> accepted –  dermoritz May 8 '12 at 11:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.