회고록의 하위 인덱스에서 짝수 페이지에 테이블을 강제로 적용하면 amsmath의 \numberwithin이 엉망이 됩니다.

회고록의 하위 인덱스에서 짝수 페이지에 테이블을 강제로 적용하면 amsmath의 \numberwithin이 엉망이 됩니다.

내가 사용할 때테이블이 짝수 페이지에 배치되도록 하는 Schweinebacke의 솔루션memoir의 환경 내부에서 ' subappendices와 함께 사용 하면 더 이상 작동하지 않습니다. 즉, 테이블 번호는 "1.A.1"이 아닌 "1.1.1"로 지정됩니다.amsmath\numberwithin\numberwithin

어떻게 해결하나요?

\documentclass{memoir}
\usepackage{afterpage}
\usepackage{amsmath}
\newcommand{\atevenpage}[1]{%
  \afterpage{\clearpage%
    \ifodd\value{page}%
      \atevenpage{#1}%
    \else%
      #1%
    \fi%
  }%
}
\usepackage{filecontents}
\begin{filecontents*}{my_input.tex}
  \begin{table}[p]
    \caption{A table}
    \begin{tabular}{lrr}
      & A & B \\
      First row & 123 & 456 \\
      Second row & 123 & 456 \\
    \end{tabular}
  \end{table}
\end{filecontents*}
\begin{document}
  \chapter{A chapter}
  \begin{subappendices}
    \numberwithin{table}{section}
    \section{An appendix}
    \atevenpage{\input{my_input}}
  \end{subappendices}
\end{document}

답변1

긴 댓글입니다.

이것을 서문에 추가해 보세요

\AddToHook{env/subappendices/begin}{\typeout{begin subapp}}
\AddToHook{env/subappendices/end}{\typeout{end subapp}}
\AddToHook{env/table/begin}{\typeout{begin table}}
\AddToHook{env/table/end}{\typeout{end table}}

그러면 테이블의 지연으로 인해 테이블이 실행될 때 하위 부록이 이미 종료되었음을 로그에서 확인할 수 있습니다. 이는 \numberwithin{table}{section}로컬 정의이므로 다음 위치에서 사라집니다.\end{subappendices}

관련 정보