# How to use ntheorem and beamer together?

I want to create a presentation with beamer. In it I want to include the package ntheorem. When I do it, I get the following error message:

 ! LaTeX Error: \begin{altenv} on input line 40 ended by \end{itemize}.


It seems to be a known problem since I found some related questions (here and here). However, I tried to include some solution in my MWE, but it is not working. It also seems that this issue was not present in TeXLive 2019 (whithout any warranty), because I get a problem with ntheorem when I recompiled a presentation using it that I made last year.

Here is a MWE:

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{amsmath}
\usepackage{amssymb, amscd, amsxtra}

\makeatletter   % Releash command of ntheorem already defined by beamer to avoid conflict
\let\th@plain\relax
\let\openbox\relax
\let\proofname\relax
\let\proof\relax
\let\endproof\relax
\makeatother
\usepackage[amsthm, amsmath, thmmarks, hyperref]{ntheorem}
%       \newtheorem{proposition}{Proposition}
\newtheorem{defs}{Definition}
\usepackage[ntheorem]{empheq}

\title{Test}
\date{\today}
\author{John Doe}
\institute{My Institut}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}{Animation}
\item Now this
\item And now this
\end{itemize}
\end{frame}

\begin{frame}{Math}
$$e = \lim_{n\to \infty} \left(1 + \frac{1}{n}\right)^n$$

\begin{theorem}[test]
something
\end{theorem}
\end{frame}

\end{document}


So how to solve this problem and use ntheorem with beamer ?

• What happens if you remove the [amsthm] option of ntheorem? Dec 9 '20 at 21:09
• @Bernard I get the same error message.
– R. N
Dec 9 '20 at 21:23
• What about \documentclass[notheorems, noamsthm]{beamer} to turn off its theorem environments? Dec 9 '20 at 21:51
• @Davislor, It sounds clever, if I \documentclass[notheorems, noamsthm]{beamer} then I redefine the theorem with \newtheorem{theorem}{Theorem}. But unfortunately I also get the same error message...
– R. N
Dec 9 '20 at 22:00
• @R.N Posted a MWE that works for me in TeX Live 2020. Dec 9 '20 at 22:01

You want to turn off the theorem definitions of beamer, or else use those instead of ntheorem.

\documentclass[notheorems,noamsthm]{beamer}
\usepackage[utf8]{inputenc} % The default since 2018
\usepackage[T1]{fontenc}

\usepackage{amsmath}
\usepackage{amssymb, amscd, amsxtra}

\usepackage[amsthm, amsmath, thmmarks, hyperref]{ntheorem}
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}{Proposition}
\newtheorem{defs}{Definition}
\usepackage[ntheorem]{empheq}

\title{Test}
\date{\today}
\author{John Doe}
\institute{My Institut}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}{Animation}
\begin{itemize}
\item Now this
\item And now this
\end{itemize}
\end{frame}

\begin{frame}{Math}
$$e = \lim_{n\to \infty} \left(1 + \frac{1}{n}\right)^n$$

\begin{theorem}[test]
something
\end{theorem}
\end{frame}

\end{document}


I slightly edited the itemize command you used to avoid a clash with the option you gave it and the default inner theme. You’d want to fix that quick-and-dirty kludge, but it’s not germane to your question.

• Your solution seems to solve the problem. Thanks. However, do you know why the initial itemize option is clashing ?
– R. N
Dec 9 '20 at 22:06
• @R.N I haven’t investigated (other than that an inner theme is probably redefining itemize in a way that breaks it). I just deleted it to get the MWE to comiple. Dec 9 '20 at 22:08