0

I have a preamble that goes:

\documentclass[]{beamer}

%opening
\title{}
\author{Sean Thrasher}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{url}
\usepackage{biblatex}
\usepackage{setspace} 
\usepackage{comment}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{subcaption}
\usepackage{braket}
\usepackage[dvipsnames]{xcolor}
\usepackage[linesnumbered,ruled]{algorithm2e}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
\addbibresource{bibliography.bib}
\newtheorem{theorem}{Theorem}[section] 
\newtheorem{lemma}[theorem]{Lemma} 
\newtheorem{proposition}{Proposition}[section]
\newtheorem{cor}[theorem] {Corollary} 
\newtheorem{remark}[theorem] {Remark} 
\newtheorem{ass}[theorem] {Assumptions} 
\theoremstyle{definition}
\newtheorem{definition}[theorem] {Definition} 
\newtheorem{conj}[theorem]{Conjecture} 
\newtheorem{step}{STEP}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{example}[theorem] {Example}
\newtheorem{idea}[theorem]{Idea}
\newtheorem{claim}[theorem]{Claim}
\newcommand{\nn}{\in \mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\bv}{\bibitem}
\DeclareMathOperator{\Cor}{Cor}

\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\Cov}{Cov}
\DeclareMathOperator{\Var}{Var}

\newtheorem{lem}{Lemma}
\newtheorem{thm}{Theorem}

and it is not rendering properly in beamer.

It says: option clash for package geometry, option clash for package xcolor (for the inputenc package), and then it says \theorem, \lemma, \definition, \example are all already defined, and there is a missing \begin{document}.

Something does render, but it has "Theroem[section]" etc on the first page of the slide.

I don't have these issues when doing a normal document, so why is beamer having trouble with it?

1 Answer 1

2

A couple of problems:

  • beamer automatically defines the most commonly used theorems for you. If you don't want to use them and define your own theorems instead, you can use the notheorems class option. This way beamer knows to not define them.

  • if your latex distribution outdated, using things like \usepackage[dvipsnames]{xcolor} in your preamble will cause an option clash error because beamer already loads packages like xcolor, hyperref, graphicx, ams* and many more. You can avoid this by either updating your latex distribution or using beamer class options like xcolor={dvipsnames} instead of loading these packages yourself.

In summary: don't copy your preamble from other classes to beamer. Instead only add the packages which you actually need to avoid such problems.


\documentclass[notheorems,xcolor={dvipsnames}]{beamer}

%opening
\title{}
\author{Sean Thrasher}
%\usepackage{amsthm}
%\usepackage{amsmath}
%\usepackage{amssymb}
%\usepackage{amsfonts}
%\usepackage{graphicx}
%\usepackage{epstopdf}
%\usepackage{url}
\usepackage{biblatex}
\usepackage{setspace} 
\usepackage{comment}
%\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{subcaption}
\usepackage{braket}
%\usepackage[dvipsnames]{xcolor}
\usepackage[linesnumbered,ruled]{algorithm2e}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
\addbibresource{bibliography.bib}
\newtheorem{theorem}{Theorem}[section] 
\newtheorem{lemma}[theorem]{Lemma} 
\newtheorem{proposition}{Proposition}[section]
\newtheorem{cor}[theorem] {Corollary} 
\newtheorem{remark}[theorem] {Remark} 
\newtheorem{ass}[theorem] {Assumptions} 
\theoremstyle{definition}
\newtheorem{definition}[theorem] {Definition} 
\newtheorem{conj}[theorem]{Conjecture} 
\newtheorem{step}{STEP}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{example}[theorem] {Example}
\newtheorem{idea}[theorem]{Idea}
\newtheorem{claim}[theorem]{Claim}
\newcommand{\nn}{\in \mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\bv}{\bibitem}
\DeclareMathOperator{\Cor}{Cor}

\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\Cov}{Cov}
\DeclareMathOperator{\Var}{Var}

\newtheorem{lem}{Lemma}
\newtheorem{thm}{Theorem}

\begin{document}
\begin{frame}
test
\end{frame}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .