0

Here is my MWE: I may not use all of the packages but I put them all just to be safe.: I am using the command \newtcbtheorem with the commands \usepackage{tcolorbox} \tcbuselibrary{theorems} for theorems with the appendixnumberbeamer package to stop frame counting prior appendix in a beamer presentation. The problem is that the Appendix gets labelled section 3 in my MWE here and not section A. So in the title of the theorem in the appendix it states Theorem 3.1 instead of Theorem A.1 (same problem when referencing 3.1 instead of A.1). How do I get theorems in the appendix automatically labelled A.1 and so on with the Appendix section being A rather than Theorem 3.1 of section 3 (as in MWE)?

With MWE

First Section Theorem 1.1
An important result
Proof uses Stat lemma in 3.1

Appendix
Theorem 3.1

Wanted

First section Theorem 1.1
An important result
Proof: uses Stat lemma in A.1

Appendix
Theorem A.1

\documentclass[slidetop, 11pt, leqno, english,french]{beamer}   
\usepackage[french]{babel}   
\usepackage{epsf}  
\usepackage{graphicx}  
\usepackage{amssymb}  
\usepackage{latexsym}  
\usepackage{amsmath}  
\usepackage{amsthm}  
\usepackage{pifont}  
\usepackage{multicol}  
\usepackage{xcolor}  
\usepackage{textpos}  
\usepackage{arydshln}  
\usepackage{appendixnumberbeamer}  
\usepackage{tcolorbox}   
\tcbuselibrary{theorems}    
\usepackage{nameref}    
\usepackage{hyperref}  
\newtcbtheorem[number within=section]{lem}{Lemma}%  
{colback=white,colframe=bluegreen,fonttitle=\bfseries}{th}      
\newtcbtheorem[number within=section]{thm}{Theorem}%    
{colback=white,colframe=bluegreen,fonttitle=\bfseries}{th}    
\newtcbtheorem[number within=section]{cor}{Corollary}%  
{colback=white,colframe=bluegreen,fonttitle=\bfseries}{th}      
\usetheme{Dresden}  
\useoutertheme{miniframes}  
\definecolor{bluegreen}{rgb}{0.0,0.57,0.5}  
\usecolortheme[named=bluegreen]{structure}    
\begin{document}  
\section{First section}  
\begin{frame}  
\begin{thm}{}{}  
An important result  
\end{thm}  
Proof: uses the \nameref{th:stat} in \ref{th:stat}  
\end{frame}  
\section{Second section}  
\begin{frame}  
\begin{thm}{}{}  
An even more important result.  
\end{thm}  
Proof: Also uses \nameref{th:stat} in \ref{th:stat}  
\end{frame}  
\appendix  
\section{Appendix}  
\begin{frame}  
\begin{thm}{Stat lemma}{stat}  
Statement of the lemma here  
\end{thm}  
\end{frame}  
\end{document} 

2 Answers 2

1

After the command \appendix, just reset the counter section by \setcounter{section}{0} and re-define the command \thesection by \renewcommand{\thesection}{\Alph{section}} to change number to letters, see below.

\documentclass{beamer}
\usepackage{hyperref} 
\usepackage{nameref}  
% \usepackage{appendixnumberbeamer}  
\usepackage{tcolorbox}
\tcbuselibrary{theorems}

\definecolor{bluegreen}{rgb}{0.0,0.57,0.5}  
\usecolortheme[named=bluegreen]{structure} 
\newtcbtheorem[number within=section]{lem}{Lemma}%
  {colback=white,colframe=bluegreen,fonttitle=\bfseries}{th}    
\newtcbtheorem[number within=section]{thm}{Theorem}%
  {colback=white,colframe=bluegreen,fonttitle=\bfseries}{th} 
\newtcbtheorem[number within=section]{cor}{Corollary}%
  {colback=white,colframe=bluegreen,fonttitle=\bfseries}{th}

\begin{document}  

\section{First section}  
\begin{frame}  
    \begin{thm}{}{}  
    An important result  
    \end{thm}  
    Proof: uses the \nameref{th:stat} in \ref{th:stat}  
\end{frame}

\section{Second section}
\begin{frame}
    \begin{thm}{}{}  
    An even more important result.  
    \end{thm}  
    Proof: Also uses \nameref{th:stat} in \ref{th:stat}  
\end{frame}

\appendix
\setcounter{section}{0}
\renewcommand{\thesection}{\Alph{section}}
\section{Appendix}  
\begin{frame}  
    \begin{thm}{Stat lemma}{stat}
    Statement of the lemma here  
    \end{thm}
\end{frame}

\end{document}
0

Here is a solution with the apptools package.

Unrelated: epsf is obsolete and superseded by graphicx. Also the language option of babel should be loaded with the document class, so that all language dependent packages be informed.

\documentclass[slidetop, 11pt, leqno, english,french]{beamer}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{latexsym}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{pifont}
\usepackage{multicol}
\usepackage{xcolor}
\usepackage{textpos}
\usepackage{arydshln}
\usepackage{appendixnumberbeamer}

\usepackage{apptools}
\AtAppendix{\setcounter{section}{0}\renewcommand{\thesection}{\Alph{section}}}

\usepackage{tcolorbox} \tcbuselibrary{theorems} \newtcbtheorem[number within=section]{lem}{Lemma} {colback=white,colframe=bluegreen,fonttitle=\bfseries}{th} \newtcbtheorem[number within=section]{thm}{Theorem}%** {colback=white,colframe=bluegreen,fonttitle=\bfseries}{th} \newtcbtheorem[number within=section]{cor}{Corollary}%** {colback=white,colframe=bluegreen,fonttitle=\bfseries}{th} \usetheme{Dresden} \useoutertheme{miniframes} \definecolor{bluegreen}{rgb}{0.0,0.57,0.5} \usecolortheme[named=bluegreen]{structure} \usepackage{nameref} \usepackage{hyperref}

\begin{document}

\section{First section}
\begin{frame}
\begin{thm}{}{}
An important result
\end{thm}
Proof: uses the \nameref{th:stat} in \ref{th:stat}
\end{frame}
\section{Second section}
\begin{frame}
\begin{thm}{}{}
An even more important result.
\end{thm}
Proof: Also uses \nameref{th:stat} in \ref{th:stat}
\end{frame}
\appendix
\section{Appendix a}
\begin{frame}
\begin{thm}{Stat lemma}{stat}
Statement of the lemma here
\end{thm}
\end{frame}
\section{Appendix b}
\begin{frame}
\begin{thm}{Another Stat lemma}{stat2}
Statement of the lemma here
\end{thm}
\end{frame}

\end{document}

enter image description here

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.