Perda de números de subseções de figuras ao usar o assunto principal

Perda de números de subseções de figuras ao usar o assunto principal

Recentemente adicionei \frontmatter, \mainmatter, etc. com a \numberwithinconfiguração de minhas figuras e tabelas em um documento, mas agora minhas figuras não são mais numeradas por subseção de exportação. Dentro do LyX, eles ainda mostram a numeração correta, mas perco o número da subseção na exportação. Estou usando o pacote de memórias. Aqui está parte do meu preâmbulo:

\setsecnumdepth{subsubsection}
\maxtocdepth{subsubsection}
\numberwithin{figure}{subsubsection}
\numberwithin{table}{subsubsection}

Toda a numeração estava funcionando antes de inserir as \...matterdeclarações.

Responder1

Internamente, memoirfaz

\newcommand\@memmain@floats{%
   \counterwithin{figure}{chapter}
   \counterwithin{table}{chapter}
}

o que significa que as figuras e tabelas da matéria principal serão numeradas subordinadas ao chaptercontador; para substituir isso, você pode adicionar ao preâmbulo

\makeatletter
\renewcommand\@memmain@floats{%
  \counterwithin{figure}{subsubsection}
  \counterwithin{table}{subsubsection}
}
\makeatother

Um exemplo completo:

\documentclass{memoir}
\usepackage{amsmath}

\setsecnumdepth{subsubsection}
\maxtocdepth{subsubsection}
\numberwithin{figure}{subsubsection}
\numberwithin{table}{subsubsection}

\makeatletter
\renewcommand\@memmain@floats{%
  \counterwithin{figure}{subsubsection}
  \counterwithin{table}{subsubsection}
}
\makeatother

\begin{document}

\mainmatter
\chapter{Test chapter}
\vfill% just for the example
\section{Test section}
\subsection{Test subsection}
\subsubsection{Test subsubsection}
\begin{figure}
\caption{test}
\end{figure}

\end{document}

insira a descrição da imagem aqui

A propósito, como memoirusa internamente chngcntr, você pode usar diretamente \counterwithinem vez de \numberwithin:

\counterwithin{figure}{subsubsection}
\counterwithin{table}{subsubsection}

Como observação pessoal, sugiro que você reconsidere esse esquema de numeração; ter uma string tão longa para os números não é muito fácil de ler.

informação relacionada