3

In standard book class, it is very easy to achieve the caption counter as the form of "Table 3-4" where "3" is the counter value of \thechapter and the "4" is the order of apperance of this particular table in the chapter. Simply use caption package:

\usepackage{caption}
\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}}

\DeclareCaptionLabelFormat may be the better approach to achieve that.

I wonder if there exists a way to define this type of label format in memoir without using caption package, since I am very satisfied with the additional float functions provided by memoir and do not want caption package to take over.

I have read the memoir documentation and did not find the answer. What is the internal mechanism inside the memoir that dominates the float counters?

----------------update------------------------

I found if you put \mainmatter before any \chapter, the command

\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}}

simply has no effect.

\documentclass{memoir}

\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}}

\begin{document}
\mainmatter
\chapter{A chapter}

\begin{table}
  \caption{A table}
\end{table}

\end{document}
  • Please provide a complete minimal example. This will encourage answers and help people to help you effectively. – cfr May 21 '16 at 23:02
  • I've never used memoir, but section 10.6 of the manual looks relevant :) – Mark May 21 '16 at 23:24
1

There is no need to load the caption package for changing the numbering. It suffices to use

\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}}

with or without caption, even in memoir:

enter image description here

\documentclass{memoir}

\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}}

\begin{document}

\chapter{A chapter}

\begin{table}
  \caption{A table}
\end{table}

\end{document}
  • Thank you. But I actually tried before, it does not work. Now I find out it is the \mainmatter cause the problem. Please see the update of my question. Putting \mainmatter before \chapter make this ineffective. – Spaceship May 22 '16 at 6:54
  • Okay. Currently, the only simple way to solve that is to put \renewcommand{\thetable}{\arabic{chapter}-\arabic{table}} after \mainmatter. – Spaceship May 22 '16 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.