0

I am using this custom beamer style

enter image description here

but it needs a tiny modification to work robustly. It is fine when we have no subtitle for frame

\begin{frame}{Introduction}%{My Title}
    some text about Latex
\end{frame}

but in subtitle mode, the subtitle box becomes baseline for defined circle then it jumps a little downward.

\begin{frame}{Introduction}{My Title}
    some text about Latex
\end{frame}

for this I want to set subtitle box visible even if it is empty. Another solution is to not use subtitle.

\documentclass{beamer}

\definecolor{devryblue}{RGB}{5, 51, 92}    
\makeatletter
\colorlet{beamer@blendedblue}{devryblue}
\makeatother

\usepackage[utf8]{inputenc}
\usepackage{tikz}

\usetheme{Madrid}
\usepackage{default}  

\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\fill[devryblue] (10.8,0.6) circle (.9cm);
\clip (10.8,0.6) circle (.75cm);
\node at (10.8,0.6) {\includegraphics[width=2.1cm]{example-image}};
\end{tikzpicture}}

\begin{document}

\section{title}

\begin{frame}
\frametitle{title}
\tableofcontents

\end{frame}
3
  • I'm very confused by your syntax \begin{frame}{Introduction}{My Title}{My sub-Title} -- a frame can have a title and a subtitle, but no subsubtitle. Commented Mar 8, 2023 at 11:33
  • You are right. I messed and mixed up \section{title} and \begin{frame}{Introduction}{My Title}!!
    – C.F.G
    Commented Mar 8, 2023 at 12:06
  • 1
    The easiest way to avoid such mix ups is to not use this dreadful syntax. The \frametitle{...} and \framesubtitle{...} macros are much more powerful and robust. Commented Mar 8, 2023 at 12:10

1 Answer 1

1

You can avoid any potential jumping of the logo by positioning it with respect to the page:

\documentclass{beamer}

\definecolor{devryblue}{RGB}{5, 51, 92}    
\makeatletter
\colorlet{beamer@blendedblue}{devryblue}
\makeatother

\usepackage[utf8]{inputenc}
\usepackage{tikz}

\usetheme{Madrid}
%\usepackage{default}  

\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\coordinate (logo) at ([xshift=-1.5cm,yshift=-1cm]current page.north east);
\fill[devryblue] (logo) circle (.9cm);
\clip (logo) circle (.75cm);
\node at (logo) {\includegraphics[width=2.1cm]{example-image}};
\end{tikzpicture}}

\begin{document}

\section{title}

\begin{frame}
\frametitle{title}
\tableofcontents

\end{frame}

\begin{frame}
\frametitle{title}
\framesubtitle{My Title}
    some text about Latex
\end{frame}


\end{document}

enter image description here

2
  • Sorry for my comment. I just installed TexLive 2023 and when I add the Xepersian package to this example, it does not show the circle and the logo! Can you try it?
    – C.F.G
    Commented May 23, 2023 at 18:43
  • @C.F.G I'm not a user of xepersian. If I just add the package to the example, I'm getting an error about fonts. Can you ask a new question including a minimal reproducible example? Commented May 23, 2023 at 18:58

You must log in to answer this question.

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