2

I am trying to draw a blue filled rectangle on half of the slide space. However, I do not want it to overlay the navigation bar. The following figures illustrate the current situation:

The title page

enter image description here

The first slide of the first section. I would like the navigation bar to appear in this one.

I would like the navigation bar to appear in this slide.

The content of the first section

enter image description here

Here follows an MWE for this case

    \documentclass{beamer}

% To make the navigation bullets appear
\usepackage{remreset}
\makeatletter
    \@removefromreset{subsection}{section}
\makeatother
\setcounter{subsection}{1}

\useoutertheme[subsection=false]{smoothbars}
\setbeamercolor{section in head/foot}{fg=white, bg=black}
\setbeamertemplate{section in head/foot shaded}{\color{white!50!black}\insertsectionhead}

\setbeamertemplate{frametitle}[default][colsep=-4bp,rounded=false,shadow=false]


\setbeamercolor{frametitle}{fg=white,bg=blue}

\setbeamercovered{transparent}
\setbeamertemplate{navigation symbols}{} %remove navigation symbols
\setbeamercovered{invisible} %No transparent layers

\usepackage{tikz}
\usepackage{pdfrender}

\title{My Presentation}
\author[My short name]{\bfseries My name}
\institute{University}
\date[19/05/15]{\today}

\begin{document}
{   
\setbeamertemplate{section in head/foot shaded}[default][100]
\frame{ % This is the title slide where I'd like to highlight the sections
  \frametitle{}
  \setbeamertemplate{footline}{} 
  \maketitle  
}
}

\section{First section}
    {
    \setbeamertemplate{footline}{}
    \frame{
        \begin{tikzpicture}[remember picture,overlay]
\fill[blue]
  ([yshift=0pt]current page.west) rectangle (current page.north east);
\node[anchor=center]
  at ([yshift=10pt,xshift=0pt]current page.center) 
  {\parbox[t]{\textwidth}{\centering%
 \usebeamerfont{author}\textcolor{white}{%
    \textpdfrender{
    TextRenderingMode=FillStroke,
    FillColor=white,
    LineWidth=.1ex,
    }{\insertsection}}}};
\end{tikzpicture}
\addtocounter{framenumber}{-1}
    }
    }
    \frame{\frametitle{My Frame Title}}\frame{}

\section{Second section}
{
    \setbeamertemplate{footline}{}
    \frame{
        \begin{tikzpicture}[remember picture,overlay]
\fill[blue]
  ([yshift=0pt]current page.west) rectangle (current page.north east);
\node[anchor=center]
  at ([yshift=10pt,xshift=0pt]current page.center) 
  {\parbox[t]{\textwidth}{\centering%
 \usebeamerfont{author}\textcolor{white}{%
    \textpdfrender{
    TextRenderingMode=FillStroke,
    FillColor=white,
    LineWidth=.1ex,
    }{\insertsection}}}};
\end{tikzpicture}
\addtocounter{framenumber}{-1}
    }
    }
    \frame{}\frame{}\frame{}

\section{Third section}
{
    \setbeamertemplate{footline}{}
    \frame{
        \begin{tikzpicture}[remember picture,overlay]
\fill[blue]
  ([yshift=0pt]current page.west) rectangle (current page.north east);
\node[anchor=center]
  at ([yshift=10pt,xshift=0pt]current page.center) 
  {\parbox[t]{\textwidth}{\centering%
 \usebeamerfont{author}\textcolor{white}{%
    \textpdfrender{
    TextRenderingMode=FillStroke,
    FillColor=white,
    LineWidth=.1ex,
    }{\insertsection}}}};
\end{tikzpicture}
\addtocounter{framenumber}{-1}
    }
    }\frame{}\frame{}\frame{}

\section{Conclusion}
\frame{}
\end{document}

Does someone knows how to proceed in this case?

Best, Humberto

1

In order to not have your rectangle cover the header on your slide, you can add a yshift=-\headheight to your rectangle. The code in the first section would then look like:

\section{First section}
    {
    \setbeamertemplate{footline}{}
    \frame{
        \begin{tikzpicture}[remember picture,overlay]
\fill[blue]
  ([yshift=0pt]current page.west) rectangle ([yshift=-\headheight]current page.north east);
\node[anchor=center]
  at ([yshift=10pt,xshift=0pt]current page.center) 
  {\parbox[t]{\textwidth}{\centering%
 \usebeamerfont{author}\textcolor{white}{%
    \textpdfrender{
    TextRenderingMode=FillStroke,
    FillColor=white,
    LineWidth=.1ex,
    }{\insertsection}}}};
\end{tikzpicture}
\addtocounter{framenumber}{-1}
    }
    }

This will shift the top of the rectangle down and uncover the header. This is what I get with that code:

Blue box shift example

| improve this answer | |
2

If you want that the rectangle is shown only on section frames, you can use \AtBeginSection command which defines how section frames are defined.

And as your rectangle covers the headline, you can place the rectangle on background which is drawn before headline.

This way you don't have to insert the code for every section page.

In following code, please note that lines from \setbeamertemplate{background} to \end{frame} inside \AtBeginSection command are inserted into a local scope { }. Otherwise the background is used in all frames.

Probably a better solution would be to define a new background with \defbeamertemplate and later on call it with \usebeamertemplate inside \AtBeginSection but I do not know how to do it.

\documentclass{beamer}

% To make the navigation bullets appear
\usepackage{remreset}
\makeatletter
    \@removefromreset{subsection}{section}
\makeatother
\setcounter{subsection}{1}

\useoutertheme[subsection=false]{smoothbars}
\setbeamercolor{section in head/foot}{fg=white, bg=black}
\setbeamertemplate{section in head/foot shaded}{\color{white!50!black}\insertsectionhead}

\setbeamertemplate{frametitle}[default][colsep=-4bp,rounded=false,shadow=false]


\setbeamercolor{frametitle}{fg=white,bg=blue}

\setbeamercovered{transparent}
\setbeamertemplate{navigation symbols}{} %remove navigation symbols
\setbeamercovered{invisible} %No transparent layers

\AtBeginSection[]{%
    {\setbeamertemplate{background}{
    \begin{tikzpicture}[remember picture,overlay]
    \fill[blue]
        ([yshift=0pt]current page.west) rectangle (current page.north east);
    \node[anchor=center]
        at ([yshift=10pt,xshift=0pt]current page.center) 
        {\parbox[t]{\textwidth}{\centering%
            \usebeamerfont{author}\textcolor{white}{%
                    \textpdfrender{
                        TextRenderingMode=FillStroke,
                        FillColor=white,
                        LineWidth=.1ex,
                    }{\insertsection}}}};
    \end{tikzpicture}}
    \begin{frame}
    \end{frame}}
    \addtocounter{framenumber}{-1}
}

\usepackage{tikz}
\usepackage{pdfrender}

\title{My Presentation}
\author[My short name]{\bfseries My name}
\institute{University}
\date[19/05/15]{\today}

\begin{document}
{   
\setbeamertemplate{section in head/foot shaded}[default][100]
\frame{ % This is the title slide where I'd like to highlight the sections
  \frametitle{}
  \setbeamertemplate{footline}{} 
  \maketitle  
}
}

\section{First section}

\frame{\frametitle{My Frame Title}}
\frame{}\frame{}

\section{Second section}
\frame{}\frame{}\frame{}

\section{Third section}
\frame{}\frame{}\frame{}

\section{Conclusion}
\frame{}
\end{document}

enter image description here

2nd version: with \defbeamertemplate

Now I've understood how to use a \defbeamertemplate. This command serves to define templates and assign them a name for further references.

In previous code, \AtBeginSection could be replaced with:

\defbeamertemplate{background}{blue half}{
    \begin{tikzpicture}[remember picture,overlay]
    \fill[blue]
        ([yshift=0pt]current page.west) rectangle (current page.north east);
    \node[anchor=center]
        at ([yshift=10pt,xshift=0pt]current page.center) 
        {\parbox[t]{\textwidth}{\centering%
            \usebeamerfont{author}\textcolor{white}{%
                    \textpdfrender{
                        TextRenderingMode=FillStroke,
                        FillColor=white,
                        LineWidth=.1ex,
                    }{\insertsection}}}};
    \end{tikzpicture}}

\AtBeginSection[]{%
    {\setbeamertemplate{background}[blue half]
    \begin{frame}
    \end{frame}
    \addtocounter{framenumber}{-1}}
}

where, \defbeamertemplate{background}{blue half}{...} defines a template for backgorund called blue half which is later on used in \AtBeginSection with \setbeamertemplate{background}[blue half]. Please, note [] for introducing name and that the change is locally applied with {...} help.

| improve this answer | |

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.