12

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 04 '13 at 21:43
  • 1
    \makeatletter \renewcommand{\theequation}{\thechapter.\arabic{equation}} \@addtoreset{equation}{chapter} \makeatother – Gonzalo Medina Apr 04 '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. – shashashamti2008 Apr 04 '13 at 21:49
  • 2
    Then please add to your question a simple, yet complete, document allowing us to reproduce the problem. – Gonzalo Medina Apr 04 '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. – shashashamti2008 Apr 04 '13 at 22:01

2 Answers2

18

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

enter image description here

\documentclass{report}
\usepackage{classicthesis}
\usepackage{amsmath}
\numberwithin{equation}{chapter}
\begin{document}
\chapter{First chapter}
\begin{equation}  \label{eq:pyth}
a^2+b^2=c^2
\end{equation}
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:

enter image description here

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

\begin{document}
\setcounter{chapter}{2}
\chapter{Third chapter}
\begin{equation}  \label{eq:albert}
E=mc^2
\end{equation}
Here's a cross-reference to equation \eqref{eq:albert}.
\end{document}
Mico
  • 506,678
  • 1
    I'd consider also the dedicated chngcntr package – egreg Apr 04 '13 at 22:07
  • 1
    Isn't \renewcommand{\theequation}{\thechapter--\arabic{equation}} after \numberwithin{equation}{chapter} simpler than redefining \numberwithin? – egreg Apr 04 '13 at 22:28
  • @egreg - you're absolutely right. I'll modify the code accordingly. – Mico Apr 04 '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
0

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

Lei
  • 11