0

Could you help in adjusting this list of commands? It gives me several errors, but I don't understand why.

\documentclass{beamer}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{color}
\usepackage{xcolor}
\usepackage{bbm}
\usepackage{framed}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{enumerate}
\usepackage{mathrsfs}

\setbeamertemplate{footline}
{
\begin{beamercolorbox}{author in head/foot}
\usebeamerfont{authorinhead/foot}
% \vskip3pt \hskip3pt \insertshortauthor
\vskip2pt \hskip5pt \insertsection \hfill
(\insertframenumber/\inserttotalframenumber) \hskip3pt
\end{beamercolorbox}
}

\newcommand{\Def}{\color[rgb]{0,0,0}} %Black%
\newcommand{\Blue}{\color[rgb]{0,0,1}}
\newcommand{\beginbackup}{
   \newcounter{framenumbervorappendix}
   \setcounter{framenumbervorappendix}{\value{framenumber}}
}
\newcommand{\backupend}{
   \addtocounter{framenumbervorappendix}{-\value{framenumber}}
   \addtocounter{framenumber}{\value{framenumbervorappendix}} 
}
\newtheorem{proposition}[theorem]{Proposition}
\newcommand{\highlight}[1]{\colorbox{yellow}{$\displaystyle #1$}}


\DeclareCaptionStyle{mystyle}{name=}
\captionsetup[figure]{style=mystyle}
\begin{document}
\begin{frame}
blah blah
\end{frame}
\end{document}
  • 2
    And we are supposed to guess which errors show up... Let me look into my crystal ball... ah yes... option clashes because xcolor and graphicx are included multiple times with contradicting options –  May 28 '14 at 11:37
  • Sorry, but I'm new to Latex. Could you tell which lines I should remove? I tried to remove usepackage{xcolor} and usepackage{graphicx}, but then I get problems with usepackage{subfig}. Thanks – user52584 May 28 '14 at 11:59
  • Keep \usepackage{graphicx} but without the [demo] option. It seems, that that option conflicts with subfig package (I never used them both in conjunction, so it is just a guess) –  May 28 '14 at 12:01
  • 1
    You can't use \usepackage[demo]{graphicx} in beamer. Just delete this line. xcolor is used doubled. If you don't know, what the options are fore, just delete the longer version. You don't need color, if you already load xcolor. I would prefer to use subcaption over subfig, but in beamer this does not matter that much. – LaRiFaRi May 28 '14 at 12:01
  • @ChristianHupfer [demo] conflicts with beamer. Don't ask me why. @user52584 Delete all lines, you do not actually need. Then comment out half of the code in your preamble and look, if the errors disappear. That's how we do minimal examples here. I commented everything out, until I noticed, that just [demo]{graphicx} without anything else results in an error. – LaRiFaRi May 28 '14 at 12:04
  • @LaRiFaRi: Ok, good to know, I never used beamer with demo mode of``graphicx`. –  May 28 '14 at 12:05
  • @user52584 Great. Maybe you subscribe to this page with a username which is nicer then userxyz and accept the answer as such. This is, how we say thank you here. Happy TeXing! – LaRiFaRi May 28 '14 at 12:20
  • 1
    @LaRiFaRi demo (or any other option passed to graphicx in \usepackage, which by the way is not required since the package is already loaded) for graphicx in beamer produces a clash because internally beamer already loads graphicx without options. – Gonzalo Medina May 28 '14 at 12:36

1 Answers1

1
  • Do not load packages twice
  • Do not use [demo] from graphicx in beamer, or if you want to use it, pass the option as class option to prevent a clash (internally beamer loads graphicx without options):

    \documentclass[demo]{beamer}
    
  • Do not pass [usenames] or [dvipsnames] to xcolor directly in beamer; pass the option as class option to prevent a clash (internally beamer loads xcolor without options):

    \documentclass[dvipsnames]{beamer}
    
  • color is already loaded by xcolor, so leave the former away.

  • Have a look in here to see, which packages have become obsolete
LaRiFaRi
  • 43,807