3

I am writing a simple equation in my thesis:

\begin{equation}
\begin{align}
y &= x^{k}\\
\log(y) &= \log(x^{y})\\
\log(y) &= y\log(x)\\
\frac{\log(y)}{\log(x)} &= y
\end{align}
\end{equation}

It works perfectly. However, LaTeX numbers it as 1.1 instead of 1. How could I easily correct it? Thank you!

6
  • 1
    What documentclass are you using? By the way, remove the outer equation environment, which does nothing good.
    – egreg
    Jun 30 '15 at 19:28
  • @Johnathan: The numbering is 'driven' by the documentclass here, most likely. You could kick out, however, for example, using chngcntr package
    – user31729
    Jun 30 '15 at 19:36
  • 1
    What's the \documentclass line in your document?
    – egreg
    Jun 30 '15 at 19:42
  • @egreg Hi! It is "report" However, I realized that 1.1 is better than 1 because it indicate the chapter number as well. :)
    – Johnathan
    Jun 30 '15 at 19:46
  • 1
    @Johnathan: Your calculation is either wrong or they are typos ;-)
    – user31729
    Jun 30 '15 at 19:57
7

The report class uses chapter.equation numbering, enclosed by parentheses.

If the equation number should be used alone without referring to the chapter number, then \counterwithout{equation}{chapter} can be used. It requires chngcntr package, however.

\documentclass{report}

\usepackage{amsmath}
\usepackage{chngcntr}

\begin{document}

\chapter{First}
\section{First section}
\subsection{First subsection}



\begin{align}
y &= x^{k}\\
\log(y) &= \log(x^{k})\\
\log(y) &= k\log(x)\\
\frac{\log(y)}{\log(x)} &= k
\end{align}


% Now kick out the chapter number
\counterwithout{equation}{chapter}


\begin{align}
y &= x^{k}\\
\log(y) &= \log(x^{k})\\
\log(y) &= k\log(x)\\
\frac{\log(y)}{\log(x)} &= k
\end{align}

\end{document}

enter image description here

1

I am writing this answer based on another answer on this site and upon Christian Hupfer's answer here. There are many other useful points on that question too.

enter image description here

%pdfLaTeX
\documentclass{book}
\usepackage{amsmath}

\renewcommand\theequation{\arabic{equation}}

\begin{document}
\chapter{First}
\section{First section}
\subsection{First subsection}

\begin{align}
y &= x^{k}\\
\log(y) &= \log(x^{y})\\
\log(y) &= y\log(x)\\
\frac{\log(y)}{\log(x)} &= y
\end{align}

\end{document}
1
  • 3
    This method breaks down starting at chapter 2, since the equation numbers will continue to be reset (to zero!) at the start of each chapter. Presumably, though, the OP would like the equation numbers not to be reset.
    – Mico
    Jun 30 '15 at 21:25

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.