logo to the top right corner latex Beamer - latex

I want to add a logo to each frame of my latex beamer. The space I want to put it in is the right-corner. This is at the right of the rectangle where the current section is displayed.
Please find below the code :
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{mathrsfs}
\usepackage{graphics}
\usepackage{tikz}
\usepackage{beamerthemeWarsaw}
\usepackage[export]{adjustbox}
\title{Modélisation des courants de turbidité}
\date{}
\addtobeamertemplate{miniframe}{}{ %footline headline frametitle
\includegraphics[height=1cm]{Pics/organism/ifremer_logo.jpg} \hspace{0.5cm}
\includegraphics[height=1cm]{Pics/organism/polytech_logo.png}
}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
\begin{frame}{Contexte du stage}
\end{frame}
\begin{frame}{Intérêts}
\end{frame}
\begin{frame}{Objectifs}
\begin{block}{Améliorations du modèle }
\end{block}
\end{frame}
\begin{frame}
\tableofcontents
\end{frame}
\section{Equations du modèle}
\begin{frame}{Equations du modèle}
\end{frame}
\end{document}

Given that you have enough sections to make the headline tall enough to host your images, you could redefine the headline and replace the right hand site, which would normally show the subsections, with your images:
\documentclass{beamer}
%\usepackage[utf8]{inputenc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{mathrsfs}
%\usepackage{graphics}
\usepackage{tikz}
\usetheme{Warsaw}
\usepackage[export]{adjustbox}
\title{Modélisation des courants de turbidité}
\date{}
\makeatletter
\setbeamertemplate{headline}
{%
\leavevmode%
\#tempdimb=2.4375ex%
\ifnum\beamer#subsectionmax<\beamer#sectionmax%
\multiply\#tempdimb by\beamer#sectionmax%
\else%
\multiply\#tempdimb by\beamer#subsectionmax%
\fi%
\ifdim\#tempdimb>0pt%
\advance\#tempdimb by 1.825ex%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\#tempdimb]{section in head/foot}%
\vbox to\#tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
\end{beamercolorbox}%
% \begin{beamercolorbox}[wd=.4\paperwidth,ht=\#tempdimb]{subsection in head/foot}%
% \vbox to\#tempdimb{\vfil\insertsubsectionnavigation{.4\paperwidth}\vfil}%
% \end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\#tempdimb]{subsection in head/foot}%
\hfill
\includegraphics[height=\#tempdimb]{example-image-duck} \hspace{0.5cm}
\includegraphics[height=\#tempdimb]{example-image-duck}
\hfill\mbox{}
\end{beamercolorbox}%
\fi%
}
\makeatother
%\addtobeamertemplate{miniframe}{}{ %footline headline frametitle
%\includegraphics[height=1cm]{Pics/organism/ifremer_logo.jpg} \hspace{0.5cm}
%\includegraphics[height=1cm]{Pics/organism/polytech_logo.png}
%}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
\begin{frame}{Contexte du stage}
\end{frame}
\begin{frame}{Intérêts}
\end{frame}
\begin{frame}{Objectifs}
\begin{block}{Améliorations du modèle }
\end{block}
\end{frame}
\begin{frame}
\tableofcontents
\end{frame}
\section{Equations du modèle}
\begin{frame}{Equations du modèle}
\end{frame}
\section{Equations du modèle}
\begin{frame}{Equations du modèle}
\end{frame}
\section{Equations du modèle}
\begin{frame}{Equations du modèle}
\end{frame}
\section{Equations du modèle}
\begin{frame}{Equations du modèle}
\end{frame}
\end{document}
Some other comments:
if your tex distribution isn't completely outdated, you don't need \usepackage[utf8]{inputenc}, that's now default
no need for \usepackage{graphics}, beamer automatically loads the more powerful graphicx package
the more beamer way to load a theme is \usetheme{Warsaw}

Related

How could I list the subsections in beamer (table of contens)?

Hello I trying to list the subsections in table of contents (beamer), but I can't get the result ? Anyone knows how to do it ?
My code (I am using the \usetheme{CambridgeUS}):
\documentclass[handout,10pt,aspectratio=169]{beamer}
\usepackage[spanish]{babel}
\usepackage{multirow,rotating}
\usepackage{color}
\usepackage{hyperref}
\usepackage{tikz-cd}
\usepackage{array}
\usepackage{siunitx}
\usepackage{mathtools,nccmath}%
\usepackage{etoolbox, xparse}
\usecolortheme{dolphin}
\usepackage{lipsum}
\usepackage{natbib}
\usepackage{hyperref}
\usepackage{calc}
\usepackage{environ}
\usepackage{courier}
\usepackage{tcolorbox}
\usetheme{CambridgeUS}
\title[]{\textcolor{black}{\vskip 1.5cm\textbf {Title}}}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
\begin{frame}
\frametitle{Contenido}
\tableofcontents
\end{frame}
\section{Introducción}
\begin{frame}{Introducción}
\subsection{sismos lentos}
\end{frame}
\end{document}
Never use sectioning commands like \section or \subsection within a frame. They must be used outside the frame.
Apart from this problem, you can use https://stackoverflow.com/a/74094309/2777074 to get squares in the toc:
\documentclass[handout,10pt,aspectratio=169]{beamer}
\usepackage[spanish]{babel}
\usepackage{multirow,rotating}
%\usepackage{color}
%\usepackage{hyperref}
\usepackage{tikz-cd}
\usepackage{array}
\usepackage{siunitx}
\usepackage{mathtools,nccmath}%
\usepackage{
%etoolbox,
xparse}
\usecolortheme{dolphin}
\usepackage{lipsum}
\usepackage{natbib}
%\usepackage{hyperref}
\usepackage{calc}
\usepackage{environ}
\usepackage{courier}
\usepackage{tcolorbox}
\usetheme{CambridgeUS}
\title[]{\textcolor{black}{\vskip 1.5cm\textbf {Title}}}
\setbeamertemplate{sections/subsections in toc}[square]
\begin{document}
\begin{frame}
\maketitle
\end{frame}
\begin{frame}
\frametitle{Contenido}
\tableofcontents
\end{frame}
\section{Introduccion}
\subsection{sismos lentos}
\begin{frame}{Introduccion}
\end{frame}
\end{document}

Latex section custom numbering

I am using a document class article and package kafkanotes. I want to start my section numbering from 4 instead of 1. Is it possible? How to do it?
My complete sty file
%==============STYLE DIMULAI==============%
\usepackage[marginparwidth=6cm, marginparsep=0.7cm]{geometry}
%Package Matematika
\usepackage{amsmath}
%Style Gambar
\usepackage{graphicx}
\usepackage{floatrow}
\floatsetup[widefigure]{margins=hangright,capposition=beside,
capbesideposition={bottom, right},floatwidth=\textwidth}
%Package Catatan di Margin
\usepackage{sidenotes}
%Style \maketitle
\usepackage{titlesec}
\makeatletter
\renewcommand{\maketitle}{\bgroup\setlength{\parindent}{0pt}
\begin{flushleft}
{\Huge\sffamily\bfseries\#title}
\vskip 1.5em
{\sffamily\#author}
\end{flushleft}\egroup
}
\makeatother
%Header and Footer Package
\usepackage{fancyhdr}
%Style Abstract
\renewenvironment{abstract}
{\par{\bfseries \noindent \sffamily \abstractname.}}
{\vskip 0.1em \medskip\noindent \rule{\linewidth}{.5pt}}
%Font Teks Utama dan Sesi
\usepackage{lmodern}
\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif
\usepackage[T1]{fontenc}
\usepackage{sectsty}
\sectionfont{\sffamily\fontsize{15}{15}\selectfont}
\subsectionfont{\sffamily\fontsize{10}{5}\selectfont}
%Style Hyperlink
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
%Pembahasaan ke Indonesia
\renewcommand{\figurename}{\footnotesize Figure}
\renewcommand{\tablename}{\footnotesize Table}
\renewcommand{\contentsname}{Outline}
My tex file:
\documentclass{article}
\usepackage{kafkanotes}
\usepackage{booktabs}
\usepackage{biblatex} %Imports biblatex package
\addbibresource{bibliography.bib} %Import the bibliography file
%Judul dan Penulis
\title{XYZ}
\author{\textbf{ABC}}
\begin{document}
\begin{titlepage}
\thispagestyle{empty}
\maketitle
\begin{abstract}
Lorem
\end{abstract}
\tableofcontents
\end{titlepage}
\section{Some section}
\printbibliography
\end{document}
You could increase your section counter at the start of the document with \addtocounter{section}{3}
\documentclass{article}
\makeatletter
%==============STYLE DIMULAI==============%
\usepackage[marginparwidth=6cm, marginparsep=0.7cm]{geometry}
%Package Matematika
\usepackage{amsmath}
%Style Gambar
\usepackage{graphicx}
\usepackage{floatrow}
\floatsetup[widefigure]{margins=hangright,capposition=beside,
capbesideposition={bottom, right},floatwidth=\textwidth}
%Package Catatan di Margin
\usepackage{sidenotes}
%Style \maketitle
\usepackage{titlesec}
\makeatletter
\renewcommand{\maketitle}{\bgroup\setlength{\parindent}{0pt}
\begin{flushleft}
{\Huge\sffamily\bfseries\#title}
\vskip 1.5em
{\sffamily\#author}
\end{flushleft}\egroup
}
\makeatother
%Header and Footer Package
\usepackage{fancyhdr}
%Style Abstract
\renewenvironment{abstract}
{\par{\bfseries \noindent \sffamily \abstractname.}}
{\vskip 0.1em \medskip\noindent \rule{\linewidth}{.5pt}}
%Font Teks Utama dan Sesi
\usepackage{lmodern}
\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif
\usepackage[T1]{fontenc}
\usepackage{sectsty}
\sectionfont{\sffamily\fontsize{15}{15}\selectfont}
\subsectionfont{\sffamily\fontsize{10}{5}\selectfont}
%Style Hyperlink
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
%Pembahasaan ke Indonesia
\renewcommand{\figurename}{\footnotesize Figure}
\renewcommand{\tablename}{\footnotesize Table}
\renewcommand{\contentsname}{Outline}
\makeatother
\usepackage{booktabs}
\usepackage{biblatex} %Imports biblatex package
\addbibresource{bibliography.bib} %Import the bibliography file
%Judul dan Penulis
\title{XYZ}
\author{\textbf{ABC}}
\begin{document}
\addtocounter{section}{3}
\begin{titlepage}
\thispagestyle{empty}
\maketitle
\begin{abstract}
Lorem
\end{abstract}
\tableofcontents
\end{titlepage}
\section{Some section}
\printbibliography
\end{document}

Remove numbering on sub-section slide

I am preparing my thesis defense slides and I can't remove the numbering from the slide that displays the name of the sub-section (slide 5 and 7).
I have tried to modify the metropolis template I am using, but without success.
Is there anyone who knows how to do this?
Thank you very much for your help!
\documentclass{beamer}
\usetheme[progressbar=frametitle, sectionpage=progressbar, subsectionpage=progressbar, block=fill]{metropolis}
\setbeamertemplate{footline}{}
\setbeamertemplate{navigation symbols}{%
\ifnum\insertframenumber>0
\normalsize\insertframenumber%
\fi%
}
\title{Title}
\subtitle{Sub-title}
\date{\today}
\author{author}
\institute{institute}
\AtBeginSection[]
{
\setbeamertemplate{navigation symbols}{}
\frame[plain,c,noframenumbering]{
\sectionpage
\tableofcontents[currentsection,subsectionstyle=hide]}
\setbeamertemplate{navigation symbols}{\normalsize\insertframenumber}
}
\makeatletter
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[subsections numbered]
\makeatother
\begin{document}
\maketitle
\section{First section}
\begin{frame}
Content
\end{frame}
\section{Second section}
\subsection{First sub section}
\begin{frame}
Content
\end{frame}
\subsection{Second sub section}
\begin{frame}
Content
\end{frame}
\section{Third section}
\end{document}
Funny coincidence, I just answered basically the same problem a couple of hours ago at https://topanswers.xyz/tex?q=2047#a2293
\documentclass{beamer}
\usetheme[progressbar=frametitle, sectionpage=progressbar, subsectionpage=progressbar, block=fill]{metropolis}
\setbeamertemplate{footline}{}
\setbeamertemplate{navigation symbols}{\normalsize\insertframenumber}
\title{Title}
\subtitle{Sub-title}
\date{\today}
\author{author}
\institute{institute}
\AtBeginSection[]
{
\setbeamertemplate{navigation symbols}{}
\frame[plain,c,noframenumbering]{
\sectionpage
\tableofcontents[currentsection,subsectionstyle=hide]}
\setbeamertemplate{navigation symbols}{\normalsize\insertframenumber}
}
\makeatletter
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[subsections numbered]
\patchcmd{\ps#empty}{\usebeamertemplate***{navigation symbols}}{}{}{}
\makeatother
\begin{document}
\maketitle
\section{First section}
\begin{frame}
Content
\end{frame}
\section{Second section}
\subsection{First sub section}
\begin{frame}
Content
\end{frame}
\subsection{Second sub section}
\begin{frame}
Content
\end{frame}
\section{Third section}
\end{document}

Beamer Slide header is not including subsubsection

I am using beamer to make my slides. I managed to have the subsections show in the header. For example subsection of Security is (1) Background (2) PerSpectron (3) Commercial ....
How can I add subsubsections in the header too? For example, I want to have several subsections to the background appear in an extra column in the header, similar to subsections. Is there any way to do this? Thank you.
First I'd like to quote the beamer users guide:
"Do not use subsubsections, they are evil."
If you want to torture your audience, you can use this quick hack. Make sure that:
you have more sections/subsections than subsubsections, otherwise the height might be wrong
you set the counter for the number of subsubsection in each subsection
\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{pgffor}
\newcounter{totalsubsub}
\AtBeginSubsubsection[]{\label{subsubsec:\thesection:\thesubsection:\thesubsubsection}}
\makeatletter
\setbeamertemplate{headline}{%
\leavevmode%
\#tempdimb=2.4375ex%
\ifnum\beamer#subsectionmax<\beamer#sectionmax%
\multiply\#tempdimb by\beamer#sectionmax%
\else%
\multiply\#tempdimb by\beamer#subsectionmax%
\fi%
\ifdim\#tempdimb>0pt%
\advance\#tempdimb by 1.825ex%
\begin{beamercolorbox}[wd=.33\paperwidth,ht=\#tempdimb]{section in head/foot}%
\vbox to\#tempdimb{\vfil\insertsectionnavigation{.33\paperwidth}\vfil}%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.34\paperwidth,ht=\#tempdimb]{subsection in head/foot}%
\vbox to\#tempdimb{\vfil\insertsubsectionnavigation{.33\paperwidth}\vfil}%
\end{beamercolorbox}%
\begin{beamercolorbox}[leftskip=3.3ex,wd=.33\paperwidth,ht=\#tempdimb]{section in head/foot}%
\begin{minipage}[b][\#tempdimb][c]{.9\linewidth}%
\ifnum\thetotalsubsub>0
\foreach \i in {1,...,\thetotalsubsub}{%
\ifnum\i=\thesubsubsection
\usebeamercolor[fg]{subsubsection in sidebar}
\else
\usebeamercolor[fg]{subsubsection in sidebar shaded}
\fi
\hyperlink{subsubsec:\thesection:\thesubsection:\i}{\nameref{subsubsec:\thesection:\thesubsection:\i}}\par
}
\fi
\end{minipage}%
\end{beamercolorbox}%
\fi%
}
\makeatother
\begin{document}
\section{section}
\subsection{sub 1}
\setcounter{totalsubsub}{3}
\subsubsection{subsub 1}
\begin{frame}
subsub 1
\end{frame}
\subsubsection{subsub 2}
\begin{frame}
subsub 2
\end{frame}
\subsubsection{subsub 3}
\begin{frame}
subsub 3
\end{frame}
\subsection{sub 2}
\setcounter{totalsubsub}{0}
\begin{frame}
abc
\end{frame}
\subsection{sub 3}
\setcounter{totalsubsub}{2}
\begin{frame}
content...
\end{frame}
\subsubsection{subsub 1}
\begin{frame}
subsub 1
\end{frame}
\subsubsection{subsub 2}
\begin{frame}
subsub 2
\end{frame}
\end{document}

Custom titlepage in LaTeX

I am trying to create a custom title page in LaTeX according to my organization's template (in Word).
I managed to get close to it with the following code:
\documentclass{report}
\usepackage[a4paper,twoside,bindingoffset=0cm,nomarginpar,includeheadfoot,headheight=1.25cm,headsep=0cm,top=1cm,bottom=1.8cm,inner=1.75cm,outer=1.75cm,showframe]{geometry}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{calc}
\usepackage{graphicx}
\usepackage{tabularx}
\definecolor{greenBE}{RGB}{141,182,60}
\definecolor{blueBE}{RGB}{0,111,144}
\title{La qualité de l'air en Région de Bruxelles-Capitale}
\newcommand{\subtitle}{Rapport annuel 2019}
\author{}
\usepackage{lipsum}
\begin{document}
\makeatletter
\begin{titlepage}
\thispagestyle{empty}
\newlength{\rulewidth}\setlength{\rulewidth}{3cm}%
\newlength{\logowidth}\setlength{\logowidth}{2.5cm}%
\newlength{\logoheight}\setlength{\logoheight}{\logowidth*\ratio{592pt}{1538pt}}% image size : 1538 x 592
\begingroup
\setlength{\tabcolsep}{0pt}
\renewcommand{\arraystretch}{0}
\noindent%
\begin{tabularx}{\textwidth}{p{\rulewidth}c>{\centering}X}
\cellcolor{blueBE}&\includegraphics[width=\logowidth]{ILLU_FR_LogoBE.jpg}&\cellcolor{greenBE}\color{white}{RAPPORT TECHNIQUE}
\end{tabularx}
\endgroup
\vspace*{3cm}
\color{blueBE}
\raggedleft\MakeUppercase{\Large\textbf{\#title}}\\
~\\
\raggedleft\large\textbf{\subtitle}
\vfill
\raggedleft\MakeUppercase{\Large\#date}\\
\vspace*{4cm}
\noindent%
\color{blueBE}{\rule{\textwidth}{\logoheight}}
\end{titlepage}
\makeatother
\restoregeometry
\tableofcontents
\chapter{Prerequisites}\label{prerequisites}
\lipsum
\end{document}
and the image logo ILLU_FR_LogoBE.jpg
However, as you can notice below, the text "RAPPORT TECHNIQUE" on top of the first page is enlarging the height of the row. Instead, I would like to center it vertically in the middle of the logo.
What am I doing wrong ?
Many thanks,
Alessandro
You could use \usepackage[export]{adjustbox} and then play around with different valign options for the graphic.
\documentclass{report}
\usepackage[a4paper,twoside,bindingoffset=0cm,nomarginpar,includeheadfoot,headheight=1.25cm,headsep=0cm,top=1cm,bottom=1.8cm,inner=1.75cm,outer=1.75cm,showframe]{geometry}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{calc}
\usepackage{graphicx}
\usepackage{tabularx}
\definecolor{greenBE}{RGB}{141,182,60}
\definecolor{blueBE}{RGB}{0,111,144}
\title{La qualité de l'air en Région de Bruxelles-Capitale}
\newcommand{\subtitle}{Rapport annuel 2019}
\author{}
\usepackage{lipsum}
\usepackage[export]{adjustbox}
\begin{document}
\makeatletter
\begin{titlepage}
\thispagestyle{empty}
\newlength{\rulewidth}\setlength{\rulewidth}{3cm}%
\newlength{\logowidth}\setlength{\logowidth}{2.5cm}%
\newlength{\logoheight}\setlength{\logoheight}{\logowidth*\ratio{592pt}{1538pt}}% image size : 1538 x 592
\begingroup
\setlength{\tabcolsep}{0pt}
%\renewcommand{\arraystretch}{0}
\noindent%
\begin{tabularx}{\textwidth}{p{\rulewidth}c>{\centering}X}
\cellcolor{blueBE}&\includegraphics[width=\logowidth,valign=t]{ILLU_FR_LogoBE.jpg}&\cellcolor{greenBE}\color{white}RAPPORT TECHNIQUE
\end{tabularx}%
\endgroup
\vspace*{3cm}
\color{blueBE}
\raggedleft\MakeUppercase{\Large\textbf{\#title}}\\
~\\
\raggedleft\large\textbf{\subtitle}
\vfill
\raggedleft\MakeUppercase{\Large\#date}\\
\vspace*{4cm}
\noindent%
\color{blueBE}{\rule{\textwidth}{\logoheight}}
\end{titlepage}
\makeatother
\restoregeometry
\tableofcontents
\chapter{Prerequisites}\label{prerequisites}
\lipsum
\end{document}

Resources