1

Here after mixing some codes on internet, I made the desired presentation based on metropolis slides. First problem is I want to have the progress bar to be placed under headline. (Using footline place is somehow ugly and using headline keyword would place the progress bar in top of the slides). Also another thing I need is to stop counting the frames both in page number inserted at bottom of page and in the progress bar counter. Thanks in advance to whom may help!

Presentation.tex file

\documentclass[10pt]{beamer}
\usepackage{booktabs}
\definecolor{DarkTeal}{HTML}{23373b}
\usetheme[progressbar=frametitle]{metropolis}
\useoutertheme{sidebar}
\setbeamercolor{sidebar}{parent=palette primary}
\makeatletter
\setbeamertemplate{sidebar canvas \beamer@sidebarside}%
[vertical shading][top=green,bottom=blue]
\makeatother
\setbeamercolor{palette sidebar secondary}{fg=yellow,bg=blue}
\setbeamercolor{section in sidebar shaded}{fg=red,bg=black}
\AtBeginSection{
    \begingroup
    \setbeamercolor{background canvas}{bg=DarkTeal}
    \setbeamercolor{normal text}{fg=white}
    \begin{frame}[plain,noframenumbering]
    \sectionpage
    \end{frame}
    \endgroup
}
\setbeamertemplate{footline}[frame number]
\title{Report}
\subtitle{Last Part}
\date{\today}
\author{V A}
\institute{Lab}
 %\titlegraphic{\hfill\includegraphics[height=1.5cm]{logo1.png}}
%\logo{\includegraphics[width = 0.1\textwidth]{logo2.png}}
\definecolor{lightgr}{rgb}{1 0.7 0.7}
\makeatletter
\addtobeamertemplate{footline}{%
    \color{lightgr}% to color the progressbar
    \hspace*{-\beamer@leftmargin}%
    \rule{\beamer@leftmargin}{2pt}%
    \rlap{\rule{\dimexpr
            \beamer@startpageofframe\dimexpr
            \beamer@rightmargin+\textwidth\relax/\beamer@endpageofdocument}{1pt}}
    \vspace{0\baselineskip}
    {}
}
\makeatother
\begin{document}
\maketitle
\begin{frame}{Table of contents}
  \setbeamertemplate{section in toc}[sections numbered]
  \tableofcontents[hideallsubsections]
\end{frame}
\section{S1}
\begin{frame}{F1}
\end{frame}
\begin{frame}{F2}
\end{frame}
\begin{frame}{F3}
\end{frame}
\appendix
\end{document}

beamerinnerthememetropolis.sty

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerinnerthememetropolis}[2017/01/23 Metropolis inner theme]
\RequirePackage{etoolbox}
\RequirePackage{keyval}
\RequirePackage{calc}
\RequirePackage{pgfopts}
\RequirePackage{tikz}
\setbeamertemplate{title page}{
  \begin{minipage}[b][\paperheight]{\textwidth}
    \ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
    \vfill%
    \ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
    \ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
    \usebeamertemplate*{title separator}
    \ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
    \ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
    \ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
    \vfill
    \vspace*{1mm}
  \end{minipage}
}
\def\maketitle{%
  \ifbeamer@inframe
    \titlepage
  \else
    \frame[plain,noframenumbering]{\titlepage}
  \fi
}
\def\titlepage{%
  \usebeamertemplate{title page}
}
\setbeamertemplate{title graphic}{
  \vbox to 0pt {
    \vspace*{2em}
    \inserttitlegraphic%
  }%
  \nointerlineskip%
}
\setbeamertemplate{title}{
  \raggedright%
  \linespread{1.0}%
  \inserttitle%
  \par%
  \vspace*{0.5em}
}
\setbeamertemplate{subtitle}{
  \raggedright%
  \insertsubtitle%
  \par%
  \vspace*{0.5em}
}
\newlength{\metropolis@titleseparator@linewidth}
\setlength{\metropolis@titleseparator@linewidth}{0.4pt}
\setbeamertemplate{title separator}{
  \begin{tikzpicture}
    \fill[fg] (0,0) rectangle (\textwidth, \metropolis@titleseparator@linewidth);
  \end{tikzpicture}%
  \par%
}
\setbeamertemplate{author}{
  \vspace*{2em}
  \insertauthor%
  \par%
  \vspace*{0.25em}
}
\setbeamertemplate{date}{
  \insertdate%
  \par%
}
\setbeamertemplate{institute}{
  \vspace*{3mm}
  \insertinstitute%
  \par%
}

\setbeamertemplate{subsection page}{%
  \usebeamertemplate*{section page}
}
\newcommand{\metropolis@disablesubsectionpage}{
  \AtBeginSubsection{
    % intentionally empty
  }
}
\newcommand{\metropolis@enablesubsectionpage}{
  \AtBeginSubsection{
    \ifbeamer@inframe
      \subsectionpage
    \else
      \frame[plain,c,noframenumbering]{\subsectionpage}
    \fi
  }
}
\newlength{\metropolis@progressonsectionpage}
\newlength{\metropolis@progressonsectionpage@linewidth}
\setlength{\metropolis@progressonsectionpage@linewidth}{0.4pt}
\setbeamertemplate{progress bar in section page}{
  \setlength{\metropolis@progressonsectionpage}{%
    \textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
  }%
  \begin{tikzpicture}
    \fill[bg] (0,0) rectangle (\textwidth, \metropolis@progressonsectionpage@linewidth);
    \fill[fg] (0,0) rectangle (\metropolis@progressonsectionpage, \metropolis@progressonsectionpage@linewidth);
  \end{tikzpicture}%
}
\def\inserttotalframenumber{100}
\newlength{\metropolis@blocksep}
\newlength{\metropolis@blockadjust}
\setlength{\metropolis@blocksep}{0.75ex}
\setlength{\metropolis@blockadjust}{0.25ex}
\providecommand{\metropolis@strut}{%
  \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}%
}
\newcommand{\metropolis@block}[1]{
  \par\vskip\medskipamount%
  \setlength{\parskip}{0pt}
  \ifbeamercolorempty[bg]{block title#1}{%
    \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{%
  \ifbeamercolorempty[bg]{block title}{%
    \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}%
  }%
  {%
    \begin{beamercolorbox}[
      sep=\dimexpr\metropolis@blocksep-\metropolis@blockadjust\relax,
      leftskip=\metropolis@blockadjust,
      rightskip=\dimexpr\metropolis@blockadjust plus 4em\relax
    ]{block title#1}%
  }}%
      \usebeamerfont*{block title#1}%
      \metropolis@strut%
      \insertblocktitle%
      \metropolis@strut%
  \end{beamercolorbox}%
  \nointerlineskip%
  \ifbeamercolorempty[bg]{block body#1}{%
    \begin{beamercolorbox}[vmode]{block body#1}}{
  \ifbeamercolorempty[bg]{block body}{%
    \begin{beamercolorbox}[vmode]{block body#1}%
  }{%
    \begin{beamercolorbox}[sep=\metropolis@blocksep, vmode]{block body#1}%
    \vspace{-\metropolis@parskip}
  }}%
      \usebeamerfont{block body#1}%
      \setlength{\parskip}{\metropolis@parskip}%
}
\setbeamertemplate{block begin}{\metropolis@block{}}
\setbeamertemplate{block alerted begin}{\metropolis@block{ alerted}}
\setbeamertemplate{block example begin}{\metropolis@block{ example}}
\setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}}
\setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}}
\setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}}
\setbeamertemplate{itemize items}{\textbullet}
\setbeamertemplate{caption label separator}{: }
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{footnote}{%
  \parindent 0em\noindent%
  \raggedright
  \usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
}
\newlength{\metropolis@parskip}
\setlength{\metropolis@parskip}{0.5em}
\setlength{\parskip}{\metropolis@parskip}
\linespread{1.15}
\define@key{beamerframe}{c}[true]{% centered
  \beamer@frametopskip=0pt plus 1fill\relax%
  \beamer@framebottomskip=0pt plus 1fill\relax%
  \beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
  \beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
  \def\beamer@initfirstlineunskip{}%
}
\providebool{metropolis@standout}
\define@key{beamerframe}{standout}[true]{%
  \booltrue{metropolis@standout}
  \begingroup
    \setkeys{beamerframe}{c}
    \setkeys{beamerframe}{noframenumbering}
    \ifbeamercolorempty[bg]{palette primary}{
      \setbeamercolor{background}{
        use=palette primary,
        bg=-palette primary.fg
      }
    }{
      \setbeamercolor{background}{
        use=palette primary,
        bg=palette primary.bg
      }
    }
  \centering
  \usebeamercolor[fg]{palette primary}
  \usebeamerfont{standout}
}
  \apptocmd{\beamer@reseteecodes}{%
    \ifbool{metropolis@standout}{
      \endgroup
      \boolfalse{metropolis@standout}
    }{}
  }{}{}
\metropolis@inner@setdefaults
\ProcessPgfPackageOptions{/metropolis/inner}
\endinput
  • 1
    The code you posted contains errors, which make it impossible to help. In beamerinnerthememetropolis.sty (which should be named beamerthememetropolis.sty according to your main file) some lines seem to be missing between \RequirePackage{tikz} and the next line (just }). At the end \metropolis@inner@setdefaults is undefined and the key /metropolis/inner too. Please fix this, so the code is compilable. – Mike Oct 16 '17 at 20:24
  • the problem is the site doesnt allow to uploud file otherwise I could send the files. I had copied them directly from my editor. but I should say that they are compilable – V.Ajall Oct 17 '17 at 4:51
  • Here you can find the files sharelatex.com/project/59e58e1f57347617eb6e0108 – V.Ajall Oct 17 '17 at 5:39
  • The page asks me for a login. I don't have a sharelatex account. – Mike Oct 17 '17 at 7:26
  • here now there is no problem with the edited code. put beamerinnerthememetropolis.sty in a folder called sty. – V.Ajall Oct 17 '17 at 9:42
1

The metropolis theme has option to place the progress bar below the frametitle. To remove the frame numbering from the footline, you could use \setbeamertemplate{frame numbering}[none]

\documentclass{beamer}

\usetheme[progressbar=frametitle]{metropolis}
\setbeamertemplate{frame numbering}[none]
\begin{document}

    \begin{frame}{test}  
            1
    \end{frame}

    \begin{frame}{bla}  
            2
    \end{frame}    
\end{document}
| 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.