0

I have the following template which uses memoir:

\documentclass[a4paper, 10pt, onecolumn, openany]{memoir}

\usepackage[T1]{fontenc} 
\usepackage[english]{babel}
\usepackage[final]{microtype}
\usepackage{amsmath,amssymb,mathtools} % Math
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[hidelinks]{hyperref}
\usepackage{textcomp}
\usepackage[svgnames]{xcolor}
\usepackage{amsthm}
\usepackage{thmtools}


\setlrmarginsandblock{0.15\paperwidth}{*}{1} % Left and right margin
\setulmarginsandblock{0.2\paperwidth}{*}{1}  % Upper and lower margin
\checkandfixthelayout


\maxsecnumdepth{subsection} % Subsections (and higher) are numbered
\setsecnumdepth{subsection}

\makeatletter



\makechapterstyle{standard}
{
  \setlength{\beforechapskip}{0\baselineskip}
  \setlength{\midchapskip}{1\baselineskip}
  \setlength{\afterchapskip}{3\baselineskip}
  \renewcommand{\chapterheadstart}{\vspace*{\beforechapskip}}
  \renewcommand{\chapnamefont}{\centering\normalfont\Large}
  \renewcommand{\printchaptername}{\chapnamefont \@chapapp}
  \renewcommand{\chapternamenum}{\space}
  \renewcommand{\chapnumfont}{\normalfont\Large}
  \renewcommand{\printchapternum}{\chapnumfont \thechapter}
  \renewcommand{\afterchapternum}{\par\nobreak\vskip \midchapskip}
  \renewcommand{\printchapternonum}{\vspace*{\midchapskip}\vspace*{5mm}}
  \renewcommand{\chaptitlefont}{\centering\bfseries\LARGE}
  \renewcommand{\printchaptertitle}[1]{\chaptitlefont ##1}
  \renewcommand{\afterchaptertitle}{\par\nobreak\vskip \afterchapskip}
}
\makeatother

\chapterstyle{standard}

\setsecheadstyle{\normalfont\large\bfseries}
\setsubsecheadstyle{\normalfont\normalsize\bfseries}
\setparaheadstyle{\normalfont\normalsize\bfseries}
\setparaindent{0pt}\setafterparaskip{0pt}

\makeatletter                
\renewcommand\fps@figure{htbp} 
\renewcommand\fps@table{htbp}  
\makeatother                   

\captiondelim{\space } 
\captionnamefont{\small\bfseries}
\captiontitlefont{\small\normalfont}

\changecaptionwidth      
\captionwidth{1\textwidth}


\renewcommand{\abstractnamefont}{\normalfont\small\bfseries} 
\setlength{\absleftindent}{0.1\textwidth} 
\setlength{\absrightindent}{\absleftindent}

\makepagestyle{standard} 

\makeatletter       
\makeevenfoot{standard}{}{}{}
\makeoddfoot{standard}{}{}{} 
\makeevenhead{standard}{\bfseries\thepage\normalfont\qquad\small\leftmark}{}{}
\makeoddhead{standard}{}{}{\small\rightmark\qquad\bfseries\thepage}

\makeatother                  

\makeatletter
\makepsmarks{standard}{
\createmark{chapter}{both}{shownumber}{\@chapapp\ }{ \quad }
\createmark{section}{right}{shownumber}{}{ \quad }
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}
}
\makeatother                              

\makepagestyle{chap} 

\makeatletter
\makeevenfoot{chap}{}{\small\bfseries\thepage}{} 
\makeoddfoot{chap}{}{\small\bfseries\thepage}{} 
\makeevenhead{chap}{}{}{}  
\makeoddhead{chap}{}{}{}   

\makeatother

\nouppercaseheads
\pagestyle{standard}            
\aliaspagestyle{chapter}{chap}


\maxtocdepth{subsection} % Only parts, chapters and sections in the table of contents
\settocdepth{subsection}

\AtEndDocument{\addtocontents{toc}{\par}} % Add a \par to the end of the TOC

\author{author name}
\title{Title}
\date{June}%delete date


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\renewcommand{\thedefinition}{\thesection$\text{.}$\arabic{definition}}


\theoremstyle{theorem}
\newtheorem{theorem}[definition]{Theorem}

\begin{document}

\frontmatter

\maketitle

\newpage
\pagenumbering{arabic}

\begin{abstract}
test
\end{abstract}
\clearpage

\tableofcontents*
\clearpage

\setsecnumdepth{subsection}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Title of chapter}

This is a text

\begin{theorem}
this is a theorem.
\end{theorem}

\appendix
\backmatter
\end{document}

My problem with it is the Theorem numbering. The theorem numbering should have three parts: chapter number, section number and theorem number. But, it seem the chapter number ans section number is zero.

How can I fix it?

enter image description here

  • 1
    Where is the \mainmatter command? – juanuni Aug 26 '16 at 5:00
  • @juanuni I'm not so familiar with the template. However, I tested adding \mainmatter. It seems it fixes chapter numbering. where is the correct position for adding \mainmatter? – nano Aug 26 '16 at 5:09
  • Yes, add \mainmatter before \chapter command ... you need add a section before a first theorem – juanuni Aug 26 '16 at 5:12
  • Also this isn't really related to the memoir class, you would have the same results in the book class. – daleif Aug 26 '16 at 7:00
  • 2
    You want \mainmatter instead of \newpage\pagenumbering{arabic}. You also need a \section if you want the middle number to increase. – egreg Aug 26 '16 at 10:30

Your Answer

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

Browse other questions tagged or ask your own question.