附录部分中的算术溢出与大都会投影机

附录部分中的算术溢出与大都会投影机

我想创建beamer带有主题和进度条选项的演示文稿metropolis。我还需要在附录中添加一个部分,因此我添加了包appendixnumberbeamer以避免增加附录中的进度条。然后,当我编译时,我得到了一个arithmetic overflow error。此错误指向附录中的部分。

以下是 MWE:

\documentclass{beamer}

    \usepackage{appendixnumberbeamer} % appendix
    \usetheme[progressbar=frametitle]{metropolis} % Metropolis Theme
        % Set size to make thing easier to see
        \makeatletter
            \setlength{\metropolis@progressinheadfoot@linewidth}{1ex}
            \setlength{\metropolis@progressonsectionpage@linewidth}{1ex}
        \makeatother
        
    % Presentation information
    \title{Title of the presentation}
    \date{\today}
    \author{John DOE}
    \institute{My Institute}

\begin{document}
        % FRAME
        \begin{frame}[plain,noframenumbering]
            \titlepage  
        \end{frame}
    
    \section{First section}
    
        % FRAME
        \begin{frame}{Slide title}
            Last slide before the appendix
        \end{frame}
    
    \appendix

    \section{Here comes the problems}
        
        % FRAME
        \begin{frame}
            Something that is in a section within the appendix
        \end{frame}
    
\end{document}

我猜想问题出在除以零或类似情况。那么如何正确解决这个问题呢?

答案1

看来您没有积极使用\appendixtotalframenumber,因此也许您可以使用这个快速技巧避免第一次编译时出现的错误:

\documentclass{beamer}

    \usepackage{appendixnumberbeamer} % appendix
    \gdef\appendixtotalframenumber{1}
    
    \usetheme[progressbar=frametitle]{moloch}% modern fork of the metropolis theme
        % Set size to make thing easier to see
        \makeatletter
            \setlength{\moloch@progressinheadfoot@linewidth}{1ex}
            \setlength{\moloch@progressonsectionpage@linewidth}{1ex}
        \makeatother
        
    % Presentation information
    \title{Title of the presentation}
    \date{\today}
    \author{John DOE}
    \institute{My Institute}

\begin{document}
        % FRAME
        \begin{frame}[plain,noframenumbering]
            \titlepage  
        \end{frame}
    
    \section{First section}
    
        % FRAME
        \begin{frame}{Slide title}
            Last slide before the appendix
        \end{frame}
    
    \appendix

    \section{Here comes the problems}
        
        % FRAME
        \begin{frame}
            Something that is in a section within the appendix
        \end{frame}
    
\end{document}

相关内容