# How to include chapter number in equation numbers

I am trying to change the equation number style in classicthesis package. I followed the answers given in here but it does not affect the equation style. I want to include the chapter number in the equation number. Could someone help me?

• \renewcommand\theequation{\thechapter.\arabic{equation}} – David Carlisle Apr 4 '13 at 21:43
• \makeatletter \renewcommand{\theequation}{\thechapter.\arabic{equation}} \@addtoreset{equation}{chapter} \makeatother – Gonzalo Medina Apr 4 '13 at 21:44
• I had tried those but it does not include the chapter number. The numbering is in the format: (1), (2), ....The numbering increases from chapter to chapter and the first equation in each chapter (except the first chapter) does not start from 1. – AFP Apr 4 '13 at 21:49
• Then please add to your question a simple, yet complete, document allowing us to reproduce the problem. – Gonzalo Medina Apr 4 '13 at 21:51
• I found out what the problem is. I should change the style after I declared \usepackage{classicthesis} in the file classicthesis-config.tex. With this in mind, changing the style works just great. – AFP Apr 4 '13 at 22:01

You could load the amsmath package and use its \numberwithin command to achieve your objective:

\documentclass{report}
\usepackage{classicthesis}
\usepackage{amsmath}
\numberwithin{equation}{chapter}
\begin{document}
\chapter{First chapter}
$$\label{eq:pyth} a^2+b^2=c^2$$
Here's a cross-reference to equation \eqref{eq:pyth}.
\end{document}


Addendum: If you want to have the equation numbers look like (1--1) rather than like (1.1), the \theequation macro needs to modified as well:

\documentclass{report}
\usepackage{classicthesis}
\usepackage{amsmath}
\numberwithin{equation}{chapter}
\renewcommand{\theequation}{\thechapter--\arabic{equation}}

\begin{document}
\setcounter{chapter}{2}
\chapter{Third chapter}
$$\label{eq:albert} E=mc^2$$
Here's a cross-reference to equation \eqref{eq:albert}.
\end{document}

• I'd consider also the dedicated chngcntr package – egreg Apr 4 '13 at 22:07
• Isn't \renewcommand{\theequation}{\thechapter--\arabic{equation}} after \numberwithin{equation}{chapter} simpler than redefining \numberwithin? – egreg Apr 4 '13 at 22:28
• @egreg - you're absolutely right. I'll modify the code accordingly. – Mico Apr 4 '13 at 22:32
• If you are using the LyX version, it is enough to add the \numberwithin command in the Document>Settings>LaTeX Preamble menu path – georgebrindeiro Feb 21 '14 at 20:36
• @georgebrindeiro - I didn't mention LyX mainly because the OP didn't mention LyX... – Mico Sep 6 '14 at 11:14

add “floatperchapter” at the option of \documentclass[]{}

• Welcome to TeX.SE. Please be a bit more specific as to whether your proposed method works for arbitrary document classes or only specific ones. – Mico Jul 7 '15 at 9:43
• Welcome to TeX.SX! This doesn't affect the equations though, does it? – Torbjørn T. Jul 7 '15 at 9:43
• @Mico I guess it should rather be an option to classicthesis, it is listed in the manual at least. – Torbjørn T. Jul 7 '15 at 9:44