
Minha dúvida é a seguinte: tenho dois casos especiais da mesma equação, preciso alterar enumerar manualmente com um \tag{}
mas depois, preciso que a marca das equações siga a anterior enumerar automaticamente. Para ilustrar meu ponto, siga o próximo exemplo:
\begin{equation} a+b=c \end{equation}
Quem é referenciado com nota (1.1).
Então eu tenho os casos especiais da equação:
1.
\begin{equation} u(c,n)=log(C_{t})-log(n_{t}) \tag(1.2.1) \end{equation}
\begin{equation} u(c,n)=C_{t}-n_{t} \tag(1.2.2) \end{equation}
Mas na próxima equação usei:
\begin{equation} a+b=2x+g \end{equation}
Foi referenciado com marca (1.2) e preciso que siga a enumeração anterior, portanto, o número correto deve ser (1.3).
Obrigado pela sua atenção.
Responder1
Usar uma tag explícita e depois pisar no contador manual não é recomendado, pois a numeração pode mudar e assim a tag com ela.
O amsmath
pacote prevê subequations
esse propósito. Infelizmente, a subnumeração com letras é programada, mas não é difícil alterá-la conforme desejado.
\documentclass{article}
\usepackage{amsmath}
\usepackage{etoolbox}
\numberwithin{equation}{section}
\appto\subequations{%
\renewcommand{\theequation}{\theparentequation.\arabic{equation}}%
}
\begin{document}
\section{Title}
One equation with its number
\begin{equation}\label{A}
x^2+y^2=z^2
\end{equation}
and some text after it.
\begin{subequations}\label{B}
Now we state an equation
\begin{equation}\label{B1}
u(c,n)=\log(C_{t})-\log(n_{t})
\end{equation}
and next a variant thereof
\begin{equation}\label{B2}
u(c,n)=C_{t}-n_{t}
\end{equation}
with some text after them.
\end{subequations}
One equation with its number
\begin{equation}\label{C}
x^2+y^2=z^2
\end{equation}
and some text after it.
\end{document}
Observe, de passagem, que \log
deve ser usado, não log
.
Os rótulos que usei podem ser os que você desejar, é claro. Adicionei um rótulo também depois \begin{subequations}
, para que você possa consultar a equação 1.2 no texto, se precisar.