3

I'm editing a book using the memoir class. Each chapter has a different author, and I restart numbering of all elements at the start of each chapter. So far, so good. However, I want to eliminate the chapter number that occurs in front of tables and figures (e.g. Table 1, not Table 0.1). I put this into my preamble, but it does only have an effect on footnotes and section titels.

\counterwithout{footnote}{chapter}
\counterwithout{section}{chapter}
\counterwithout{table}{chapter}
\counterwithout{figure}{chapter}

I suspected the fact that I use the caption-package with the memoir class was what caused the problem. Removing this did however not help.

The code runs like this:

\begin{table}[h!]
    \captionof{table}{\emph{some caption}}
    \begin{tabular}{lrr}
        \hline & \textbf{column A}  & \textbf{column B}  \\
        \hline  \textbf{Alpha}  & a  & b  \\
        \textbf{Beta}  & a  & b  \\
        \textbf{Gamma}  & a  & b \\
        \hline  \textbf{Total} & 100  & 100  \\

        \hline \label{fig1}
    \end{tabular}
\end{table}

I've been reading he memoir manual and poking around the web all day, but I haven't got any closer to solving this problem.

Grateful for any help.

UPDATE:

This is my main document. I didn't want to include it, because it is loooooong.

\documentclass [paperwidth=170mm, paperheight=240mm, 11 pt]{memoir}
\usepackage[cyr]{aeguill}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais, english]{babel}
\usepackage{multirow}
\usepackage{multicol}

\usepackage{tablefootnote}
\usepackage[dvipsnames,svgnames,table]{xcolor}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{linguex}
\usepackage{epstopdf}
\usepackage{amsmath}

\usepackage{phonetic}
\usepackage{xyling}
\usepackage{titling}
\usepackage{lipsum}
\usepackage{titlesec}
\usepackage{enumitem}
\usepackage{textcomp}

\usepackage{chngcntr}
\usepackage{setspace}
\usepackage{etoolbox}
\usepackage{makeidx}
\usepackage{setspace}
\usepackage{multirow}
\usepackage{caption}

\usepackage[figurename=Fig.]{caption}
\usepackage[tablename=Tab.]{caption}
\usepackage{colortbl}
\usepackage[dvipsnames,svgnames,table]{xcolor}
\renewcommand{\arraystretch}{1}
 \setfloatadjustment{figure}{\small\centering}
\setfloatadjustment{table}{\small\centering}

\makeatletter

\preto{\@ex}{\topsep=0pt \parskip=0pt \parsep=0pt \partopsep=0pt }
\makeatother


\titleformat{\section}{\normalsize \bfseries}{\thesection}{1.75em}{\textsc}
\titleformat{\subsection}{\normalsize \bfseries}{\thesubsection}{1em}{\emph}
\titleformat{\subsubsection}{\normalsize \mdseries}{\thesubsubsection}{1em}{\emph}

\renewcommand{\cftchapterfont}{\normalfont}
\renewcommand{\cftpartfont}{\bfseries}
\renewcommand{\cftchapterpagefont}{\normalfont}

\renewcommand{\captionfont}{\small}
\renewcommand{\firstrefdash}{}

\pagestyle{myheadings}

\setlength{\parsep}{0pt}

\setsecnumdepth{subsection}

\makeatletter
\let\@afterindenttrue\@afterindentfalse
\makeatother

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{0}

\renewcommand{\baselinestretch}{1}
\counterwithout{footnote}{chapter}
\counterwithout{section}{chapter}
\counterwithout{table}{chapter}
\counterwithout{figure}{chapter}


\begin{document}

\selectlanguage{francais}

\frontmatter

\selectlanguage{francais}

\tableofcontents*


\include{introduction}

\newpage

\mainmatter

\part{La langue française}

\include{somepaper}

\backmatter

\include{index}

\end{document}

The problems I'm experiencing is in the {somepaper} under \mainmatter. (Actually, in all papers that contain tables or figures.) I tried \stepcounter{table}, which removed the numbering all together.

  • 1
    Are you using \mainmatter in your master document? Because that changes the numbering of things like this. As always a full minimal example helps a lot more than sniplets like this. – daleif Jan 24 '14 at 13:42
  • 2
    That is not a minimal example. This has nothing to do with the contents of your table. We need something we can copy'n'paste and use as is without having to add anything. Here we would have to guess your preamble. – daleif Jan 24 '14 at 14:12
  • You could replace \captionof with \stepcounter{table} \begin{center} \textbf{Table \thetable:} \emph{some text} \end{center} – John Kormylo Jan 24 '14 at 17:54
  • 1
    That is hardly minimal, move the counterwithout after \mainmatter – daleif Jan 24 '14 at 22:31
4

\mainmatter does a few things

  • resets secnumdepth to mxsecnumdepth
  • reset the page counter to start from one and be normal numbers
  • reset the figure and table counters into .

So you have two choices

  1. move your \counterwithout stuff after \mainmatter, or
  2. use this

    \makeatletter
    \renewcommand\@memmain@floats{}
    \makeatother
    

This is the macro that resets the figure and table inside \mainmatter, so now it does nothing.

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.