
내 질문은 다음 질문입니다. 동일한 방정식의 두 가지 특별한 경우가 있습니다. a를 사용하여 수동으로 열거를 변경해야 \tag{}
하지만 방정식 표시가 이전 자동 열거를 따라야 합니다. 내 요점을 설명하기 위해 다음 예를 따르십시오.
\begin{equation} a+b=c \end{equation}
(1.1) 표시로 참조되는 사람입니다.
그런 다음 방정식의 특별한 경우가 있습니다.
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}
그러나 다음 방정식에서는 다음을 사용했습니다.
\begin{equation} a+b=2x+g \end{equation}
(1.2) 표시로 참조되었으며 이전 열거 다음에 해당 항목이 필요하므로 올바른 숫자는 (1.3)이어야 합니다.
관심을 가져주셔서 감사합니다.
답변1
명시적인 태그를 사용한 다음 카운터 매뉴얼을 사용하는 것은 권장되지 않습니다. 번호 매기기와 태그도 변경될 수 있기 때문입니다.
패키지 는 이러한 목적을 위해 amsmath
제공됩니다 subequations
. 아쉽게도 문자가 포함된 하위 번호 매기기는 고정되어 있지만 원하는 대로 변경하는 것은 어렵지 않습니다.
\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}
참고로, \log
가 아닌 을 사용해야 합니다 log
.
물론 내가 사용한 라벨은 원하는 대로 사용할 수 있습니다. \begin{subequations}
필요한 경우 텍스트에서 방정식 1.2를 참조할 수 있도록 뒤에도 레이블을 추가했습니다 .