2

This might be a simple question but I'm relatively new to LaTeX and couldn't find how to do this.

I want to number my \newtheorem through the natural numbers but resetting every subsection.

If I set it as:

\newtheorem{example}{Example}[subsection]

It orders it as a.b.c whereas I only want it as c.

Essentially I want examples to be ordered and reset each subsection.

Any solution would be much appreciated, Thanks in advance.

1
  • Welcome to TeX SX! Adding \renewcommand{theexample}{\alph{example}} to your preamble should be enough
    – Bernard
    Dec 25, 2019 at 15:09

2 Answers 2

2

You can change the numbering style of some theorem name by renewing \thename. Here is a MWE for example:

\documentclass{article}

\newtheorem{example}{Example}[subsection]
\renewcommand{\theexample}{\alph{subsection}}

\begin{document}
    \subsection{This is the subsection}
    \begin{example}
        Here is the example.
    \end{example}

\end{document}

Other numbering styles are \roman, \Roman, \arabic and \Alph. One can also mix these, e.g.

\renewcommand{\theexample}{\arabic{section}.\alph{subsection}}
0
1

You want to redefine \theexample, after defining the environment to be a slave of subsection:

\newtheorem{example}{Example}[subsection]
\renewcommand{\theexample}{\alph{example}}
0

You must log in to answer this question.

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