5

It seems \renewcommand{\theexample}{\Alph{example}} makes the section numbering disappear. Is there a way to avoid this?

\documentclass{article}
\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{example}{Example}[section]
\renewcommand*{\theexample}{\Alph{example}}

\begin{document}
\section{Intro}
\begin{example}[special curve]
Let something be something.
\end{example}
\section{Outro}
\begin{example}[special manifold]
Let something be something.
\end{example}
\end{document}
8

When you do

\newtheorem{example}{Example}[section]

then \theexample is defined by

\newcommand{\theexample}{\thesection.\arabic{example}}

and the example counter is reset any time section is stepped.

So you want to redefine \theexample by

\renewcommand*{\theexample}{\thesection.\Alph{example}}
  • FWIW, this also saved me for the LIPIcs 2016 style, where theorem numbering seems broken for theorems defined in the appendix. Just do a \renewcommand*\thetheorem{\thesection.\arabic{theorem}} in the appendix and it's fine again. – srs Jan 3 '17 at 0:06

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.