`'未找到。`\end{frame}`

`'未找到。`\end{frame}`
\documentclass[hyperref={pdfpagelabels=false},xcolor=dvipsnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{color}
\usepackage{lmodern}
\usefonttheme[onlymath]{serif}
\usepackage{pdfpages} 
\usepackage{amsmath}
\usepackage[absolute,overlay]{textpos}
\usepackage{graphicx}
\usetheme{Boadilla}
%\usepackage{subfigure}
\usepackage{caption}
\usepackage{tikz}
\captionsetup{labelformat=empty,labelsep=none}
\usepackage{xecolor}
\usepackage{makeidx}
\usepackage{verbatim}
%%%%%%%%%%%% table
%\usepackage[latin1]{inputenc}
\usepackage{caption} 
\captionsetup{labelformat=empty,labelsep=none}
\usepackage{colortbl} 
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{booktabs}
%\usepackage[colorlinks,linkcolor=blue,citecolor=blue]{hyperref}
\usepackage{ifthen}
\usepackage{hhline}
\usepackage{pstricks-add}
\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
%%%%%%%%%%%%%%%                  Color of ‌Bullet
\newcommand*\MyPitem{%
    \item[\color{fg=brown!35!red}\scalebox{1.1}{\textbullet}]}
\newcommand*\MyCitem{%
    \item[\color{pink}\scalebox{1.1}{\textbullet}]}
%%%%%%%%%%%%%%%%%5            Color of b‌lock
\newenvironment{variableblock}[3]{%
    \setbeamercolor{block body}{#2}
    \setbeamercolor{block title}{#3}
    \begin{block}{#1}}{\end{block}}
%%%%%%%%%%%%%%%%%%%%5
\addtobeamertemplate{frametitle}{\vskip1.5ex}{}
%\usepackage{subfig}
\usepackage{epstopdf}
\usepackage{hyperref}
\usepackage[labelformat=empty]{caption}
\usepackage{setspace}
\usepackage[T1]{fontenc}
\usepackage[super,numbers,sort & compress]{natbib}
\usepackage[labelformat=empty]{caption}
\usepackage{xcolor}
\setbeamercolor{structure}{fg=green!55!blue}
\usepackage{lipsum}
\setbeamercolor{subsection in toc}{fg=green!70!blue}
%%%%%%%%%%%%%%55
\makeatletter
\setbeamertemplate{footline}
{
    \leavevmode%
    \hbox{%
        \begin{beamercolorbox}[wd=.143333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
            \usebeamerfont{author in head/foot}\insertshortauthor
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.593333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
            \usebeamerfont{title in head/foot}\insertshorttitle
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.263333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
            \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
            \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
        \end{beamercolorbox}}%
        \vskip0pt%
    }
    \makeatother
\begin{document}
\begin{frame}
\hspace{3cm}
 \vspace{2.3cm}
  \titlepage
\end{frame}
%%%%%%%%%%%%%%%%%%55
\setbeamertemplate{headline} {
    \begin{beamercolorbox}[ht=2ex]{section in head/foot}
        \insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt plus1fill}{\hskip0pt plus1fill}
    \end{beamercolorbox}
}
%%%%%%%%%%%%%%%%%%%%%
    %
 \usebackgroundtemplate{%
    \includegraphics[width=\paperwidth,height=2.5cm]{}}
    %$ $  $ $
    \logo{%
        \includegraphics[width=1cm,height=1cm,keepaspectratio]{logo}%
    }

\begin{frame}
 \frametitle{Outline}
\tableofcontents[subsubsectionstyle=hide].
\end{frame}
\logo{%
    \includegraphics[width=1cm,height=1cm,keepaspectratio]{}% 
    }
    \logo{%
        \includegraphics[width=1cm,height=1cm,keepaspectratio]{logo}%
    }

当我编译时,它显示错误:

尽管它可以正确生成 PDF 文件。我希望它能正常工作,因为每次编译时都会出现该错误,这有点烦人。我删除了它\usepackage{subfig}以解决一个有关未定义控制序列的错误\begin{ducument} ,并且此命令出现此错误:: 'not found .\end{frame}`

答案1

我认为导致此错误消息的直接原因是中的空括号\includegraphics{},因为这将查找文件名为空的图像,而该图像很可能找不到。

但为了避免进一步的错误,应该删除许多多余的代码。

  • beamer本身就提供了很多包,所以没必要使用graphicxhyperref或。color相反xcolor,如果你自己第二次调用它们,你可能会遇到包选项矛盾的问题。
  • 不要多次加载包。例如,caption至少加载三次。
  • 尽量不要使用过时的软件包,有关(不完整)列表,请参阅如何跟上软件包并知道哪些已经过时了?
  • 正如@DavidCarlisle 在他的文章中所写评论 inputencfontenc不应epstopdf与 一起使用xetex

尝试进行一点清理:

\documentclass[hyperref={pdfpagelabels=false},xcolor=dvipsnames]{beamer}

\usetheme{Boadilla}

\newcommand*\MyPitem{%
    \item[\color{fg=brown!35!red}\scalebox{1.1}{\textbullet}]}
\newcommand*\MyCitem{%
    \item[\color{pink}\scalebox{1.1}{\textbullet}]}

\newenvironment{variableblock}[3]{%
    \setbeamercolor{block body}{#2}
    \setbeamercolor{block title}{#3}
    \begin{block}{#1}}{\end{block}}

\addtobeamertemplate{frametitle}{\vskip1.5ex}{}
\setbeamercolor{structure}{fg=green!55!blue}
\setbeamercolor{subsection in toc}{fg=green!70!blue}

\setbeamertemplate{footline}{
    \leavevmode%
    \hbox{%
        \begin{beamercolorbox}[wd=.143333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
            \usebeamerfont{author in head/foot}\insertshortauthor
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.593333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
            \usebeamerfont{title in head/foot}\insertshorttitle
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.263333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
            \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
            \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
        \end{beamercolorbox}}%
        \vskip0pt%
}

\begin{document}

    \begin{frame}
        \hspace{3cm}
        \vspace{2.3cm}
      \titlepage
    \end{frame}

    \setbeamertemplate{headline}{%
        \begin{beamercolorbox}[ht=2ex]{section in head/foot}%
        \insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt plus1fill}{\hskip0pt plus1fill}%
    \end{beamercolorbox}%
    }

    \setbeamertemplate{background}{%
    \includegraphics[width=\paperwidth,height=2.5cm]{example-grid-100x100bp}%
  }

  \logo{%
       \includegraphics[width=1cm]{example-grid-100x100bp}%
    }

    \begin{frame}
        \frametitle{Outline}
        \tableofcontents[subsubsectionstyle=hide]
    \end{frame}

  \logo{%
    \includegraphics[width=1cm]{example-image-a}%
  }

    \begin{frame}
        another logo
    \end{frame}

\end{document}

在此处输入图片描述

相关内容