2

I would like to modify a Beamer Theme so that I add some text in every slides, but not in the ToC (table of content) pages.

Consequently, I guess I would need to use a "if/then"-like condition in my theme like this (pseudo-code style):

if(we are not in a ToC page)
     addText()
 else
     do nothing

But I do not know at all how I could write that in Beamer, and could not find it on the Internet.

Do you know how I should write that?

Thanks!


In response to the comments I received, here are some precisions: The beamer theme I want to modify is provided by my company. What I want to add is a title at the top of every slides (just underneath a top bar where we have the company logo and title). So I edited the outer .sty file of the Beamer theme, in the frametitle section, to add a beamerbox. It would look like this:

 \defbeamertemplate*{frametitle}{watermelon theme}
 { 
     [...]
     \begin{beamercolorbox}[wd=.95\paperwidth,ht=0.0cm,leftskip=.1\paperwidth]{section title}
     \begin{flushleft}
     {\usebeamercolor[fg]{frametitle}\usebeamerfont{framesubtitle}\insertsection\par}%
     \end{flushleft}
     \end{beamercolorbox}
     [...]
}

However, this beamerbox is shown every slides, even on ToC. Hence I thought that if I had a way to write an "if(we are not in a ToC page)" before this beamercolorbox, it would be the simplest way to make it work.

Is it enough?


Following samcarter answer, I tested the following work-around in code (enough for me now, until I finally find some time to learn latex/beamer): at a change of section, I write:

 \setbeamertemplate{frametitle}[default]
 \section{My title}
 \setbeamertemplate{frametitle}[My company theme]

Thanks !

  • Welcome to TeX.Stackexchange! Where do you want to add text on the normal slides? Can you show us a minimal working example (MWE) that also shows what theme you are using? – samcarter is at topanswers.xyz Sep 7 '16 at 10:11
  • 2
    With this information is hard to say, but usually, automatic TOCs slides before every section or subsection are all defined at the beginning, so I do not see the point of a conditional, as you can simply apply the insert to the following frames. Obviously the "How?" need before a "where" as minimum as noted samcarter. Having a MWE won't hurt either (not to say that in this web site the MWE is essential). – Fran Sep 7 '16 at 11:16
  • Thanks you both for your answer, here are some precisions. Hope it is ok for you! – snowfox Sep 7 '16 at 12:54
  • So you want to use another frametitle on the toc page. How about { \setbeamertemplate{frametitle}[default] \begin{frame} \tableofcontents \end{frame} }? If this does not help, can you please make a compilable MWE that demonstrates your problem? – samcarter is at topanswers.xyz Sep 7 '16 at 13:04
  • Ok, your code is the type I was looking for. Thanks mate! Original post updated. – snowfox Sep 7 '16 at 13:26
1

If the section pages should use another frametitle template than the normal frames, you can add it to the definition of the section pages. To keep it localised wrapp it into an additional layer of {}.

\documentclass{beamer}

\defbeamertemplate*{frametitle}{watermelon}
{ 
     \begin{beamercolorbox}[wd=.95\paperwidth,ht=0.0cm,leftskip=.1\paperwidth]{section page}
     \begin{flushleft}
         {\color{red} \usebeamerfont{framesubtitle}\insertsection\par}%
     \end{flushleft}
     \end{beamercolorbox}
}

\AtBeginSection{%
{
    \setbeamertemplate{frametitle}[default] 
    \begin{frame}
        \frametitle{toc}
    \end{frame}
}
}

\begin{document}


\section{bla}
\begin{frame}
\frametitle{bla}
    abc
\end{frame}

\section{blub}
\begin{frame}
\frametitle{blub}
    abc
\end{frame}     

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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