0

I am working with beamer templates. I have set a template for usual slides with a purple line in its background, using this code:

%set purple line
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{decorations}
\addtobeamertemplate{frametitle}{}{ %purple line
\begin{textblock*}{15mm}(-45,155)
    \begin{tikzpicture}
        \draw (-8.5,1.5) .. controls (-3,0) and (3, 0) .. (8.5,1.5);
    \end{tikzpicture}
\end{textblock*}
}

Some standard colors in my presentation are purple, so it indeed appears purple.

Now, I am trying to make some template for a different type of slide in the same beamer presentation, using this code:

\defbeamertemplate{background canvas}{picture background}
{
\begin{textblock*}{15mm}(0,0)
    \begin{tikzpicture}
        \draw[TIGblauw,fill=TIGblauw] (-8.5,1.5) .. controls (-3,0) and (3, 0) .. (8.5,1.5);
    \end{tikzpicture}
\end{textblock*}
}

As you can see, I am using the same rounding. However, I want it to be blue (which does not work) and I want it to fill to the top. It should look like this: enter image description here

However, it should only apply to slides that I use this background template with.

Currently, the line is still purple and nothing changes.

I feel like multiple things are problematic here, but my main question is about filling the background with blue color starting from a non-linear line. The other info is to exclude some solutions which would interfere with the rest of my presentation.

Here a minimal reproducable example, although I feel it might not be minimal. Not sure what interferes

\documentclass[aspectratio=169]{beamer} %Most screens have 16:9 display

%--------------------------           PACKAGES          --------------------------
\usepackage{textpos} %absolute text positioning on slide
\usepackage{caption, subcaption} %Captions for figures and tables
\usepackage{graphicx} %Figures
\usepackage[export]{adjustbox} %Great if graphicx is not enough
\usepackage[dutch]{babel} %To make some things Dutch, such as month in date
\usepackage{datetime} %To be able to work with dates

%--------------------------        OVERALL THEME        --------------------------
\useoutertheme[subsection=false]{miniframes} %great for navigation <3
\AtBeginSection{} % hides section page

%--------------------------            COLORS            --------------------------
\definecolor{TIGpaars}{RGB}{117,21,88}
\definecolor{TIGgroen}{RGB}{180,220,0}
\definecolor{TIGblauw}{RGB}{81,199,253}

\setbeamercolor{frametitle}{fg=TIGpaars}
\setbeamercolor{framesubtitle}{fg=TIGblauw}
\setbeamercolor{palette primary}{fg=TIGpaars, bg=white}
\setbeamercolor{normal text}{fg=black, bg=white}
\setbeamercolor{section in head/foot}{fg=white, bg=TIGpaars}
\setbeamercolor{alerted text}{fg=TIGblauw}
\setbeamercolor{item}{fg=TIGpaars}

%--------------------------           TITLE PAGE          --------------------------
\newcommand{\titlem}{Default title}
\newcommand{\subtitlem}{} %default is no subtitle
\newdateformat{dutchformat}{\twodigit{\THEDAY}{\THEMONTH}{\THEYEAR}}
\newcommand{\datem}{\today} %default date is today
\setbeamertemplate{title page}{
    \begin{picture}(0pt,0pt)
    %\centering
        \put(-35pt,-147pt){ %background picture
             \includegraphics[width=1.01\paperwidth]{Include/Overige afbeeldingen/Front page.png}
        }

        \put(0pt,-78pt){ %titles
            \begin{minipage}[b][45mm][t]{226mm}
                \usebeamerfont{title}{\textcolor{white}{\titlem} \par}
                \usebeamerfont{subtitle}{\textcolor{TIGgroen}{\subtitlem}}
            \end{minipage}
        }
        \put(330pt,-243pt){ %text right bottom
            \begin{minipage}[b][45mm][t]{226mm}
            {\tiny \textcolor{TIGpaars}{Deventer, \datem}}
            \end{minipage}
        }
    \end{picture}
}

%-----------------------        ALL SLIDES DEFAULT       -----------------------
\setbeamertemplate{frame numbering}[none]{} %no page numbering

%set purple line
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{decorations}
\addtobeamertemplate{frametitle}{}{ %purple line
\begin{textblock*}{15mm}(-45pt,155pt)
    \begin{tikzpicture}
        \draw (-8.5,1.5) .. controls (-3,0) and (3, 0) .. (8.5,1.5);
    \end{tikzpicture}
\end{textblock*}
}

%set TIG text: www.tignl.eu
\addtobeamertemplate{frametitle}{}{ 
    \begin{textblock*}{110mm}(0.83\textwidth,67mm) % absolute positioning right lower corner
        {example}
    \end{textblock*}
}

\addtobeamertemplate{frametitle}{}{
        \begin{textblock*}{115mm}(0mm,67mm) 
        {\tiny \textcolor{TIGpaars}{\titlem | © 2023 Ex}}
    \end{textblock*}
}

\defbeamertemplate{background canvas}{picture background}
{
\begin{textblock*}{15mm}(0,0)
    \begin{tikzpicture}
        \draw[TIGblauw,fill=TIGblauw] (-8.5,1.5) .. controls (-3,0) and (3, 0) .. (8.5,1.5);
    \end{tikzpicture}
\end{textblock*}
}

\begin{document}
\begin{frame}
    \titlepage %title page is defined above
\end{frame}

\section{example slides - More nice stuff}
\begin{frame}{Example slide \hyperlink{Appendix}{\beamerbutton{Appendix}}}{lorem}
    Mus mauris vitae ultricies leo integer malesuada nunc vel. Maecenas volutpat blandit aliquam etiam erat.
    \begin{itemize}
        \item Pretium nibh ipsum consequat nisl. \alert{hello} Pretium nibh ipsum consequat nisl.
        \item Etiam erat velit scelerisque in dictum non.
    \end{itemize}   
\end{frame}

\section{example slides - final stuff}
\begin{frame}{Appendix}{lorem}\label{Appendix}
   Odio tempor orci dapibus ultrices in iaculis. Lorem sed risus ultricies tristique nulla aliquet enim. Arcu vitae elementum curabitur vitae nunc sed velit dignissim. Nunc vel risus commodo viverra maecenas accumsan. Sit amet tellus cras adipiscing enim.
\end{frame}

\setbeamertemplate{background canvas}[vertical color]{
\begin{frame}{test}
    
\end{frame}
}

\end{document}
7
  • 1
    Can you please make a compileable minimal working example? Feb 27, 2023 at 15:34
  • In particular, please add all the packages necessary to compile your code fragments. Feb 27, 2023 at 15:44
  • I was not sure if that was necessary. I use so many things that I do not know how to make one without fully uploading my code. For the question of making such a blue fill, no compilable example (other than the picture of how I want it) might not be necessary right? Feb 27, 2023 at 16:17
  • 1
    You could make a copy of your project, then trim it down so it only includes the things necessary to reproduce your problem. Feb 27, 2023 at 16:19
  • 2
    If I puzzle together your code fragments and remove all the macros from packages you don't show us, the code works fine. Unless you provide a minimal working example, it is hard to guess what problem you might have. Feb 27, 2023 at 16:23

1 Answer 1

2
  • I wouldn't use the textpos package to position your tikz pictures. TikZ is perfectly capable to do this itself using the overlay and remember picture option

  • to fill the whole upper part of the slide in your blue colour, I would simply draw a very large circle and shift it upwards.

  • the syntax with which you apply your to your last frame is wrong. 1) your template is not called vertical color and 2) your custom template does not have an argument. The frame goes outside.

  • then there's the additional complication that the frametitle would draw a line on top of the blue background. I suggest to use a separate colour for the arc and set it to blue for the special frame.

  • you should use the footline template for the footer instead of adding the information to the frame title, which can have different positions.


\documentclass[aspectratio=169]{beamer} %Most screens have 16:9 display

%--------------------------           PACKAGES          --------------------------
\usepackage{textpos} %absolute text positioning on slide
\usepackage{caption, subcaption} %Captions for figures and tables
\usepackage{graphicx} %Figures
\usepackage[export]{adjustbox} %Great if graphicx is not enough
\usepackage[dutch]{babel} %To make some things Dutch, such as month in date
\usepackage{datetime} %To be able to work with dates

%--------------------------        OVERALL THEME        --------------------------
\useoutertheme[subsection=false]{miniframes} %great for navigation <3
\AtBeginSection{} % hides section page

%--------------------------            COLORS            --------------------------
\definecolor{TIGpaars}{RGB}{117,21,88}
\definecolor{TIGgroen}{RGB}{180,220,0}
\definecolor{TIGblauw}{RGB}{81,199,253}

\setbeamercolor{frametitle}{fg=TIGpaars}
\setbeamercolor{framesubtitle}{fg=TIGblauw}
\setbeamercolor{palette primary}{fg=TIGpaars, bg=white}
\setbeamercolor{normal text}{fg=black, bg=white}
\setbeamercolor{section in head/foot}{fg=white, bg=TIGpaars}
\setbeamercolor{alerted text}{fg=TIGblauw}
\setbeamercolor{item}{fg=TIGpaars}

\colorlet{arccolor}{TIGpaars}

%--------------------------           TITLE PAGE          --------------------------
\newcommand{\titlem}{Default title}
\newcommand{\subtitlem}{} %default is no subtitle
\newdateformat{dutchformat}{\twodigit{\THEDAY}{\THEMONTH}{\THEYEAR}}
\newcommand{\datem}{\today} %default date is today
\setbeamertemplate{title page}{
    \begin{picture}(0pt,0pt)
    %\centering
        \put(-35pt,-147pt){ %background picture
             \includegraphics[width=1.01\paperwidth]{example-image-duck}
        }

        \put(0pt,-78pt){ %titles
            \begin{minipage}[b][45mm][t]{226mm}
                \usebeamerfont{title}{\textcolor{white}{\titlem} \par}
                \usebeamerfont{subtitle}{\textcolor{TIGgroen}{\subtitlem}}
            \end{minipage}
        }
        \put(330pt,-243pt){ %text right bottom
            \begin{minipage}[b][45mm][t]{226mm}
            {\tiny \textcolor{TIGpaars}{Deventer, \datem}}
            \end{minipage}
        }
    \end{picture}
}

%-----------------------        ALL SLIDES DEFAULT       -----------------------
\setbeamertemplate{frame numbering}[none]{} %no page numbering

%set purple line
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{decorations}
\addtobeamertemplate{frametitle}{}{ %purple line
    \begin{tikzpicture}[remember picture,overlay]
      \draw[arccolor] ([yshift=21.6cm]current page.north) circle [radius=30cm];
    \end{tikzpicture}
}

%set TIG text: www.tignl.eu
\addtobeamertemplate{frametitle}{}{ 
    \begin{textblock*}{110mm}(0.83\textwidth,67mm) % absolute positioning right lower corner
        {example}
    \end{textblock*}
}

\addtobeamertemplate{frametitle}{}{
        \begin{textblock*}{115mm}(0mm,67mm) 
        {\tiny \textcolor{TIGpaars}{\titlem | © 2023 Ex}}
    \end{textblock*}
}

\defbeamertemplate{background canvas}{picture background}
{
    \begin{tikzpicture}[remember picture,overlay]
      \fill[TIGblauw] ([yshift=21.6cm]current page.north) circle [radius=30cm];
    \end{tikzpicture}    
}

\begin{document}
\begin{frame}
    \titlepage %title page is defined above
\end{frame}

\section{example slides - More nice stuff}
\begin{frame}{Example slide \hyperlink{Appendix}{\beamerbutton{Appendix}}}{lorem}
    Mus mauris vitae ultricies leo integer malesuada nunc vel. Maecenas volutpat blandit aliquam etiam erat.
    \begin{itemize}
        \item Pretium nibh ipsum consequat nisl. \alert{hello} Pretium nibh ipsum consequat nisl.
        \item Etiam erat velit scelerisque in dictum non.
    \end{itemize}   
\end{frame}

\section{example slides - final stuff}
\begin{frame}{Appendix}{lorem}\label{Appendix}
   Odio tempor orci dapibus ultrices in iaculis. Lorem sed risus ultricies tristique nulla aliquet enim. Arcu vitae elementum curabitur vitae nunc sed velit dignissim. Nunc vel risus commodo viverra maecenas accumsan. Sit amet tellus cras adipiscing enim.
\end{frame}

{
\setbeamertemplate{background canvas}[picture background]
\colorlet{arccolor}{TIGblauw}
\begin{frame}{test}
    
\end{frame}
}

\end{document}

enter image description here

2
  • Thank you. Multiple problems arised in my code and I couldn't figure out at what places everything went down. You did not only help me for my question, but also made extra improvements to my code. Highly appreciated! One thing I changed though, was that I moved the line \colorlet{arccolor}{TIGblauw} from the slide to the template of the slide. Mar 2, 2023 at 9:49
  • @MarjavanderWind You're welcome! Mar 2, 2023 at 9:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .