1

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}
            \begin{itemize}[<+- | alert@+>]
                \item \alert<4>{This is\only<4>{ really} important}
                \item Now this
                \item And now this
            \end{itemize}
        \end{frame}
        
        \begin{frame}{Math}
            \begin{equation}
                e = \lim_{n\to \infty} \left(1 + \frac{1}{n}\right)^n
            \end{equation}
            
            \begin{theorem}[test]
                something
            \end{theorem}
        \end{frame}
        
\end{document}

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

5
  • What happens if you remove the [amsthm] option of ntheorem?
    – Bernard
    Dec 9 '20 at 21:09
  • @Bernard I get the same error message.
    – R. N
    Dec 9 '20 at 21:23
  • 1
    What about \documentclass[notheorems, noamsthm]{beamer} to turn off its theorem environments?
    – Davislor
    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.
    – Davislor
    Dec 9 '20 at 22:01
2

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 \alert<4>{This is\only<4>{ really} important}
                \item Now this
                \item And now this
            \end{itemize}
        \end{frame}
        
        \begin{frame}{Math}
            \begin{equation}
                e = \lim_{n\to \infty} \left(1 + \frac{1}{n}\right)^n
            \end{equation}
            
            \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.

2
  • 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.
    – Davislor
    Dec 9 '20 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.