
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}