在 pdfLaTex 中使用自定义主题时出现算术溢出错误

在 pdfLaTex 中使用自定义主题时出现算术溢出错误

我正在尝试在 TeXworks 中编译一个 70 帧的beamer演示文稿(在 Ubuntu 11.10 上)。我使用的主题名为beamer-goddard(位于这一页)。当我编译时,我收到此控制台错误:

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

以及此 LaTeX 错误:

软件包 hyperref 警告:选项‘pdfpagelabels’已关闭(hyperref),因为 \thepage 未定义。

 \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}

我猜测可能需要修改\divide部分中的某些值goddard@theme

答案1

没有工作示例(或该主题的工作安装),这是未经测试的,但我认为错误来自这段代码

\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

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

如果是这样,它会乘以和除以两个数字但溢出,所以你需要重新调整问题(在局部重新定义中)\goddard@progressbar

如果不严格遵循代码,使其自动缩放以保持在数字限制内可能会很困难,但您可以插入适合这项工作的缩放比例,尝试说 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

相关内容