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

When I compile, it displays the error:

though it generates the PDF file correctly. I'd like to get it working correctly since it is a little annoying to get that error every time I compile. I removed \usepackage{subfig} to solve one error about Undefined control sequence \begin{ducument} and this command have this error:: 'not found .\end{frame}`

maedeh
  • 23
  • Do not use \includegraphics{} as this looks for a file with an empty file name (unless you make sure you have an image without a name) – samcarter_is_at_topanswers.xyz May 02 '16 at 17:20
  • aha...you mean that I should edit name for \includegraphics{}? – maedeh May 02 '16 at 17:25
  • Why do you have \logo{\includegraphics[...]{...}} in four places? Why isn't one enough? –  May 02 '16 at 17:29
  • At least you should write a file name inside the {}. – samcarter_is_at_topanswers.xyz May 02 '16 at 17:34
  • 2
    do you really need all those packages? You seem to be using xetex so you definitely should not be using inputenc or fontenc or epstopdf – David Carlisle May 02 '16 at 17:35
  • related discussion: http://tex.stackexchange.com/questions/307485/undefined-control-sequence-endframe-in-beamer-document?lq=1 – samcarter_is_at_topanswers.xyz May 02 '16 at 17:37
  • @Gremler I use defference photo by this command – maedeh May 02 '16 at 17:37
  • @DavidCarlisle I try to fix it – maedeh May 02 '16 at 17:39
  • Please delete this question (otherwise it will most likely be closed) as it seems to be an exact duplicate of your previous one – David Carlisle May 02 '16 at 17:40
  • sorry for post duplicate questions :( I come here firt time – maedeh May 02 '16 at 17:41
  • You don't have \end{document}. You are loading many packages twice or more with incompatible options. You are loading packages loaded by Beamer. You are loading packages which you cannot possibly need or make no sense with Beamer. You are using \makeatletter ... \makeatother around code which contains no @. It is not, to be honest, surprising if it doesn't compile without error. But the specific error appears to be that you have used the environment ducument, which is not defined, rather than document, which would be. But your MWE will not reproduce this error. – cfr May 02 '16 at 19:12
  • Or maybe that was the first error - not clear as you've not provided complete error messages. But, if so, that's nothing to do with subfig. – cfr May 02 '16 at 19:13
  • @all In the CW answer below I tried to summarise the comments. Feel free to edit if I missed something. – samcarter_is_at_topanswers.xyz May 02 '16 at 22:04

1 Answers1

1

I think the immediate cause of this error message were the empty brackets in \includegraphics{}, as this will look for an image with an empty file name which will most likely not be found.

But to avoid further errors, much of the superfluous code should be removed.

  • beamer itself provides many packages, so there is no need use graphicx, hyperref, color or xcolor. On the contrary, if you call them yourself a second time, you risk to get in trouble with contradictory package options.
  • Do not load packages multiple times. For example caption is at least loaded three times.
  • Try not to use obsolete packages, for a (incomplete) list see How to keep up with packages and know which ones are obsolete?
  • As @DavidCarlisle wrote in his comment inputenc, fontenc and epstopdf should not be used with xetex.

The attempt to clean up a bit:

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

enter image description here