[Tex/LaTex] Arithmetic overflow error using custom theme in pdfLaTex

beamererrors

I am attempting to compile a 70 frame beamer presentation in TeXworks (on Ubuntu 11.10). The theme I am using is called beamer-goddard (located at the bottom of This Page) .
When I compile I receive this console error:

! Arithmetic overflow.
\goddard@progressbar ... by \goddard@temp@count@a 
                                                  \divide \goddard@temp@dime...

as well as this LaTeX error:

Package hyperref Warning: Option `pdfpagelabels' is turned off
(hyperref) because \thepage is undefined.

 \documentclass[xcolor=table,serif,8pt]{beamer}
 \setbeamertemplate{footline}[page number]{}

 \usepackage[american]{babel}
 \usepackage[T1]{fontenc}
 \usepackage{listings}
 \usepackage{lmodern}
 \usepackage{textcomp}
 \usepackage{wrapfig}
 \usepackage[pdf]{pstricks}
 \usetheme{Goddard}

 \newcommand{\filepath}{\texttt}
 \newcommand{\command}{\texttt}
 \newcommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}}
 \newcommand{\latexcode}{\texttt}
 \newcommand{\parameter}[1]{\textlangle #1\textrangle}


 \lstset{basicstyle=\ttfamily,keywordstyle\color{goddardblue}               \bfseries,commentstyle=\color{goddardblue!75}\itshape,columns=flexible}

 \rowcolors{1}{goddardblue!50}{goddardblue!30} 
  ...

 \end{document}

I am guessing some values may need to be modified in the \divide portion of the goddard@theme.

Best Answer

without a working example (or a working installation of that theme) this is untested but I assume that error comes from this bit of code

\def\goddard@progressbar{%
  % No draw if there is only one slide
  \ifnum\inserttotalframenumber=1
  \else
    % Compute the width of the filled part of the progress bar
    \goddard@temp@count@a=\insertframenumber
    \advance\goddard@temp@count@a by -1
    \goddard@temp@count@b=\inserttotalframenumber
    \advance\goddard@temp@count@b by -1
    \goddard@temp@dimen@a=\goddard@barwidth
    \multiply\goddard@temp@dimen@a by \goddard@temp@count@a
    \divide\goddard@temp@dimen@a by \goddard@temp@count@b

in

beamer-goddard-0.1/tex/latex/beamer/themes/outer/beamerouterthemegoddard.sty

If so it's multiplying and dividing by two numbers but overflowing, so you need to rescale the problem (in a local redefinition of \goddard@progressbar.

Without following the code closely making it automatically scale to keep within numeric limits might be hard but you can insert a scaling suitable for this job, try say 100

\def\goddard@progressbar{%
  % No draw if there is only one slide
  \ifnum\inserttotalframenumber=1
  \else
    % Compute the width of the filled part of the progress bar
    \goddard@temp@count@a=\insertframenumber
    \advance\goddard@temp@count@a by -1
    \goddard@temp@count@b=\inserttotalframenumber
    \advance\goddard@temp@count@b by -1
    \goddard@temp@dimen@a=\goddard@barwidth
              \divide\goddard@temp@dimen@a  by 100
    \multiply\goddard@temp@dimen@a by \goddard@temp@count@a
    \divide\goddard@temp@dimen@a by \goddard@temp@count@b
              \multiply\goddard@temp@dimen@a  by 100
Related Question