Objective
Hi. I define a counter, say, no
for my customized commands, such as
\newcounter{no}
\counterwithin{no}{chapter}
\newcommand{\no}{\refstepcounter{no}%
\theno}
\newcommand{\df}{\normalfont{\textbf{Definition \no}}\;}
Now I would like the equation counter (\theequation
) follows the customized counter \thno
.
How I use customized counter and what I expect
For example,
\chapter{A chapter}
\begin{itemize}
\item[] \df This is some definition.
\end{itemize}
\begin{equation}
some equation.
\end{equation}
I expect the result would be
Definition 1.1 This is some definition.
some equation. (1.2)
What I've tried
I've tried
\let\theequation\theno
but
\theequation
does not update inequation
environment; the temporary remedy for usingequation
environment is\addtocounter{no}{1} % update the counter \begin{equation} ... \end{equation}
but that is annoying.
Since the customized counter
no
is NOT used for new environment, remedy using\newtheorem
does not fit for me.I've tried
\let\theequation\theno \renewenvironment{equation}{\refstepcounter{no}\begin{equation}}{\end{equation}}
or
\renewenvironment{equation}{\refstepcounter{no}\begin{equation}}{\tag{\theno}\end{equation}}
but they all give the error message:
! TeX capacity exceeded, sorry [save size=200000].
- By the way, I also wish that the counter of
align
can follow the customized counterno
so that the numbering ofno
,equation
, andalgin
are consecutive.
Could anyone help? Thanks.