2

For example, in the appendix, I want to enumerate theorems as Theorem A.1, Theorem A.2, etc... while in the text I enumerate theorems as Theorem 1, Theorem 2, etc...

How can I do this? I am using the amsthm package.

Edit: I am using the ieeeconf document class.

1
  • 1
    @Miso If you need clarification, please say so instead of being rude and sarcastic.
    – Ralff
    Commented Sep 29, 2020 at 21:21

2 Answers 2

1

You just need to \renewcommand{\thetheorem} and, of course, reset the numbering.

\documentclass{IEEEconf}

\usepackage{amsthm}

\newtheorem{theorem}{Theorem}

\begin{document}

\section{First Section}
\begin{theorem}
    My theorem.
\end{theorem}

\section{Last Section}
\begin{theorem}
    My other theorem.
\end{theorem}

\section*{APPENDIX}
\renewcommand{\thetheorem}{A.\arabic{theorem}}
\setcounter{theorem}{0}

\begin{theorem}
    Theorem in appendix.
\end{theorem}

\begin{theorem}
    Another theorem in the appendix.
\end{theorem}

\end{document}

Note that the class is called IEEEconf. Using ieeeconf may work on case insensitive file systems such as Windows, but not generally.

enter image description here

3
  • Thanks! This works! By the way, how do you should the latex output in stack exchange?
    – Ralff
    Commented Sep 29, 2020 at 23:08
  • @Ralff This site doesn’t support MathJax for several reasons, the main being that we’re interested in the code, rather than an approximation of the outcome.
    – egreg
    Commented Sep 30, 2020 at 8:23
  • Oh. I see. You just uploaded an image of the output. Thanks.
    – Ralff
    Commented Sep 30, 2020 at 15:07
0

I figured out a solution, but please, feel free to pose a more elegant solution.

I needed to 1) reset the section counter at the appendix, 2) change the numbering from \Roman to \Alph , and 3) add a counter to the appendix. Here is a minimal example:

\documentclass{ieeeconf}

\usepackage{amsthm}

\newtheorem{theorem}{Theorem}

\begin{document}

\section{First Section}
\begin{theorem}
    My theorem.
\end{theorem}

\section{Last Section}
\begin{theorem}
    My other theorem.
\end{theorem}

\setcounter{section}{1}
\renewcommand{\thesection}{\Alph{section}}
\counterwithin{theorem}{section}
\section*{APPENDIX}

\begin{theorem}
    Theorem in appendix.
\end{theorem}

\begin{theorem}
    Another theorem in the appendix.
\end{theorem}

\end{document}

Hopefully, this is helpful to someone.

You must log in to answer this question.

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