# memoir chapter based figure numbering

when using \documentclass[12pt,article, a4paper, oneside, onecolumn]{memoir}. The article option addition interferes with the figure numbering. Removing it fixes the numbering but changes the look of the document and increases the page count. Any suggestions for keeping the look from article and retaining the numbering without it?

With the format x.n: 'x' being the chapter number in which the figure is in and 'n' as the figure number in the chapter?

I have tried \numberwithin{figure}{section} which changes 'n' to per section number with n being renewed for the new section but 'x' in missing.

code with continues figure numbers

\documentclass[12pt, article, a4paper, oneside, onecolumn]{memoir}
\usepackage{amsmath, amssymb, amsthm}
\usepackage[english]{babel}
\usepackage[pdftex]{graphicx}
\DeclareGraphicsExtensions{.pdf,.jpg,.png,.psv,.PNG}
\setsecnumdepth{section}
\maxtocdepth{subsection}
\setlrmarginsandblock{2.5cm}{2.5cm}{*} % Left and right margin
\setulmarginsandblock{3cm}{3cm}{*} % Upper and lower margin
\checkandfixthelayout
\setlength{\parindent}{4em}
\setlength{\parskip}{1em}
\usepackage[english]{babel}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{wrapfig}
\usepackage{gensymb}
\usepackage{ upgreek }
\setlength{\parindent}{0pt}
\usepackage{makeidx}
\makeindex

\begin{document}

\frontmatter
\pagenumbering{Roman}

\newpage
\chapter{Abstract}
stuff
\clearpage
\chapter{Acknowledgments}
stuff
\clearpage
\listoffigures
\newpage
\renewcommand{\cftchapterdotsep}{\cftdotsep}
\tableofcontents
\newpage
\mainmatter
\chapter {Introduction}
stuff
\chapter{Chapter One}
\section{Section One}
\begin{figure}[h]
Figure One
\caption{Figure One}
\end{figure}

\section{Section Two}
\begin{figure}[h]
Figure Two
\caption{Figure Two}
\end{figure}

\end{document}


this provides figure numbering as shown

by removing article the list of figure changes to the desired numbering

• – TeXnician May 15 '17 at 14:56
• By default memoir numbers figures by chapter.number, if you have something else, then please update your question with a full minimal example that we can copy and test. – daleif May 15 '17 at 15:12
• I found the issue, the suggestions on to the link don't work as intended if \documentclass[12pt,article, a4paper, oneside, onecolumn]{memoir} is being used. The 'article' addition interferes with the numbering. Removing it fixes the numbering but changes the looks of the document and increase the page count. Any suggestions for keeping the look from article and retaining the numbering without it? – reva May 15 '17 at 16:00
• Please add a minimal but working example (MWE) to your question that shows that the \counterwithin solution of the linked page does not work. – Schweinebacke May 15 '17 at 16:09
• You've not used \counterwithin as mentioned in the memoir note of the accepted answer to the linked question. And please read: How do I format my posts using Markdown or HTML? in the Help Center. And please reduce the example to the needed lines. – Schweinebacke May 15 '17 at 16:47

If you are using article option of memoir with \frontmatter and \mainmatter, \frontmatter still does a \counterwithout{figure}{chapter} but \mainmatter does not reactivate \counterwithin{figure}{chapter}. So you have to add the command after \mainmatter on your own:

\documentclass[12pt, article, a4paper, oneside, onecolumn]{memoir}
\usepackage[english]{babel}
\setsecnumdepth{section}
\maxtocdepth{subsection}
\setlrmarginsandblock{2.5cm}{2.5cm}{*} % Left and right margin
\setulmarginsandblock{3cm}{3cm}{*} % Upper and lower margin
\checkandfixthelayout
\usepackage[english]{babel}
\begin{document}

\frontmatter
\pagenumbering{Roman}

\chapter{Abstract}
\listoffigures
\tableofcontents

\newpage
\mainmatter
\counterwithin{figure}{chapter}
\chapter {Introduction}
stuff
\chapter{Chapter One}
\section{Section One}
\begin{figure}[h]
Figure One
\caption{Figure One}
\end{figure}

\section{Section Two}
\begin{figure}[h]
Figure Two
\caption{Figure Two}
\end{figure}

\end{document}


But note: If you add \newpage or \clearpage before every \chapter it would make more sense to not use option article and remove those \newpage and \clearpage. In this case you also would not need the \counterwithin.