Сделайте упражнение по «обновлению» счетчика в упражнении по окружающей среде

Сделайте упражнение по «обновлению» счетчика в упражнении по окружающей среде

Я написал книгу где-то в 2010 году. Теперь я хочу добавить (обновить) некоторые упражнения и посчитать все обновленные упражнения. Но я могу только Update 2014. Как мне сделать Update 0ne 2014, Update two 2014, ... или Update_01_2014, Update_02_2014, ...?

\documentclass{book}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\newtheorem{ex}{Exercise}[chapter]
\newenvironment{ex*}
  {\renewcommand\theex{\thechapter.\arabic{ex}\rlap{$^*$}}\ex}
  {\endex}

\newenvironment{New}
  {\renewcommand\theex{\thechapter.\arabic{ex}{$^{\text{(Update 2014)}}$}}\ex}
  {\endex}  
\begin{document}
\chapter{First Chapter}
\section{First section}
\begin{ex}
This is an Exercise
\end{ex}

\begin{ex}
This is an Exercise
\end{ex}
\begin{ex*}
This is a difficult Exercise
\end{ex*}
\begin{New}
This is an update Exercise
\end{New}
\end{document}

введите описание изображения здесь

решение1

Используйте счетчик. Вы можете настроить форматирование по своему усмотрению.

\documentclass{book}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\newtheorem{ex}{Exercise}[chapter]
\newenvironment{ex*}
  {\renewcommand\theex{\thechapter.\arabic{ex}\rlap{$^*$}}\ex}
  {\endex}

\newcounter{updatecounter}

\newenvironment{New}
  {\stepcounter{updatecounter}
   \renewcommand\theex{\thechapter.\arabic{ex}{$^{\text{(Update
           \arabic{updatecounter}, 2014)}}$}}\ex}
  {\endex}  
\begin{document}
\chapter{First Chapter}
\section{First section}
\begin{ex}
This is an Exercise
\end{ex}

\begin{ex}
This is an Exercise
\end{ex}
\begin{ex*}
This is a difficult Exercise
\end{ex*}
\begin{New}
This is an updated Exercise
\end{New}
\begin{New}
This is another updated Exercise
\end{New}
\end{document}

введите описание изображения здесь

Связанный контент