mtheme
mtheme copied to clipboard
Add a right to left progress bar
Hi this is a request to add an RTL progress bar template to use in case of RTL beamer presentation with metropolis theme for progress bar in section page and progress bar in head/foot
https://tex.stackexchange.com/q/496489/54817
Here my attempt
\documentclass{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\title{A minimal example}
\date{\today}
\author{Matthias Vogelgesang}
\institute{Centre for Modern Beamer Themes}
\makeatletter
% define an RTL progress bar for metropolis theme
\defbeamertemplate{progress bar in section page}{RTL}{%
\setlength{\metropolis@progressonsectionpage}{%
\textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}%
\begin{tikzpicture}
\fill[bg] (0,0) rectangle (\textwidth, \metropolis@progressonsectionpage@linewidth);
\fill[fg] (\textwidth,0) rectangle (\textwidth-\metropolis@progressonsectionpage, \metropolis@progressonsectionpage@linewidth);
\end{tikzpicture}%
}
\defbeamertemplate{progress bar in head/foot}{RTL}{
\nointerlineskip
\setlength{\metropolis@progressinheadfoot}{%
\paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}%
\begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot}
\begin{tikzpicture}
\fill[bg] (0,0) rectangle (\paperwidth, \metropolis@progressinheadfoot@linewidth);
\fill[fg] (\paperwidth,0) rectangle (\paperwidth-\metropolis@progressinheadfoot, \metropolis@progressinheadfoot@linewidth);
\end{tikzpicture}%
\end{beamercolorbox}
}
\makeatother
\setbeamertemplate{progress bar in section page}[RTL]
\setbeamertemplate{progress bar in head/foot}[RTL]
\begin{document}
\maketitle
\section{First Section}
\begin{frame}{First Frame}
Hello, world!
\end{frame}
\section{Second Section}
\begin{frame}{Second Frame}
Hi..
\end{frame}
\end{document}
Very interesting. I think it will help me.