0

I want to create my own progress bar in my beamer presentation. This is my preamble code:

\documentclass[9pt, hyperref={pdfpagemode=FullScreen}]{beamer}

\usepackage[utf8]{inputenc}

\definecolor{whitesmoke}{rgb}{0.96, 0.96, 0.96}

\title{\textbf{COMPLEJOS INTERMOLECULARES DE BASES DE ADN EN ESTADOS ELECTRÓNICOS EXCITADOS}}

\definecolor{ghostwhite}{rgb}{0.97, 0.97, 1.0}

\definecolor{columbiablue}{rgb}{0.61, 0.87, 1.0}

\usefonttheme{serif}

\usepackage{lewis} 

\usepackage{tikz}

\usetikzlibrary{calc}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PROGRESS BAR 


\newcommand{\progressbar}{

\begin{tikzpicture}

    \fill [gray] (10,0) rectangle (13.0,0.5) ;

    \fill [blue] (0,0) rectangle (10,0.5);  


\end{tikzpicture}


}

\setbeamertemplate{headline}{ \progressbar}

....

\begin{document} 

.....
\end{document} 

All the slides contain the same rectangles at the top:

enter image description here

I would like that in all slides the gray rectangle fills up with any color until the presentation ends, containing the frame number below.

New contributor
Aldo MorteraC is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Sorry for the typo. Is A progress bar with TIKZ – Aldo MorteraC 2 days ago
  • Welcome to TeX.SE! Feel free to edit your question to fix typos and formatting :) For the code, you can select it and hit the icon that lookes like {} so that it's properly formatted in the questions with proper indentation. – Alenanno 2 days ago
  • I did it for you. :) – Alenanno 2 days ago
1

I made this before for myself.

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = pdflatex
% !TEX spellcheck = English
% !TEX pdfSinglePage



\documentclass[14pt]{beamer}
    \beamertemplatenavigationsymbolsempty

\usepackage{tikz}

\title[Math of Communication]{A Mathematical Theory of Communication}
\author[C.~E.~Shannon]{Claude E.~Shannon}
\institute{University of Informatics}
\date[2020-10]{2020-10-10}

\begin{document}

\frame\maketitle

\makeatletter\defbeamertemplate*{sidebar right}{pro-bar}{
    \pgfmathsetmacro\safetotalframenumber{max(\insertmainframenumber-1,1)}
    \tikz[remember picture,overlay,x=3mm,y=\paperheight]{\footnotesize
        \pgfmathsetmacro\overlaytotal{\insertframeendpage+1-\insertframestartpage}
        \pgfmathsetmacro\overlayfraction{\insertoverlaynumber/\overlaytotal}
        \path[save path=\stare,yscale=1/\safetotalframenumber]
            (-1,0)-|(0,1-\insertframenumber)-|+(-\overlayfraction,1)-|cycle;
        \tikzset{bar/.pic={\node at(-.55,-.5)[rotate=-90]
            {\beamer@shorttitle~\beamer@shortdate~\beamer@shortauthor};}}
        \fill[use path=\stare,gray]pic[blue]{bar};
        \clip[use path=\stare]pic[green]{bar};
    }
}\makeatother

\frame{{Doe, a deer, a female deer}
    Beamer is a LaTeX document class for creating presentation slides,
    \pause\vfill
    with a wide range of templates and a set of features for making slideshow effects.
}

\frame{{Ray, a drop of golden sun}
    It supports pdfLaTeX, LaTeX + dvips, LuaLaTeX and XeLaTeX.[1]
    \pause\vfill
    The name is taken from the German word "Beamer"
    \pause\vfill
    as a pseudo-anglicism for "video projector".
}

\frame{{Me, a name I call myself}
    The Beamer class is not the first LaTeX class for creating presentations,
    \pause\vfill
    and like many of its predecessors
    \pause\vfill
    (such as slides, seminar, prosper, powerdot),[2]
    \pause\vfill
    it has special syntax for defining "slides"
    \pause\vfill
    (known in Beamer as "frames").
}

\frame{{Far, a long, long way to run}
    Slides can be built up on-screen in stages
    as if by revealing text that was previously hidden or covered.
    \pause\vfill
    This is handled with PDF output by creating successive pages
    that preserve the layout but add new elements,
    \pause\vfill
    so that advancing to the next page in the PDF file
    appears to add something to the displayed page,
    \pause\vfill
    when in fact it has merely redrawn the page.
}

\frame{{Sew, a needle pulling thread}
    The list of features supported by Beamer is quite long.
    \pause\vfill
    The most important features, according to the user guide[1] are:
}

\frame{{La, a note to follow Sew}
    \begin{itemize}[<+->]
        \item   Beamer can be used with pdfLaTeX, LaTeX+dvips, LuaLaTeX and XeLaTeX.
                LaTeX+dvipdfm isn’t supported.
        \item   The standard commands of LaTeX still work.
                A tableofcontents will still create a table of contents,
                section is still used to create structure,
                and itemize still creates a list.
        \item   Overlays and dynamic effects can be easily created.
        \item   The appearance of presentations can be modified using themes.
    \end{itemize}
}

\frame{{Tea, a drink with jam and bread}
    \begin{itemize}[<+->]
        \item   The layout, the colors, and the fonts
                used in a presentation can easily be changed globally,
                while preserving control over the most minute detail.
        \item   A special style file allows for the use the LaTeX source of
                a presentation directly in other LaTeX classes such as article or book.
                This makes it easy to create presentations out of
                lecture notes or lecture notes out of presentations.
        \item   The final output is typically a PDF file, making it highly portable
                and worry-free, in the sense that a given presentation
                will always look the same no matter the machine it is opened on.
    \end{itemize}
}

\end{document}

| improve this answer | |

Your Answer

Aldo MorteraC is a new contributor. Be nice, and check out our Code of Conduct.

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.