3

I am using document class 'book'. I am using the following code

\documentclass{book}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\theoremstyle{definition}
\newtheorem{definition}{Def{i}nition}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{proposition}[definition]{Proposition}
\begin{document}
\mainmatter
\chapter{Quadratic Equation}
\section{Introduction}
\begin{definition}
\quad An equation $ax^2 + bx + c = 0,\ a\neq 0,\ a,\ b,\ c \in     \mathbb{R}$ is a called \textbf{quadratic equation}. The values of $x$ which satisfies it, is called its \textbf{roots}.
\end{definition}
\begin{proposition}
\quad Roots of the quadratic $ax^2 + bx + c = 0,\ (a\neq 0,\ a,\ b,\ c \in \mathbb{R}$) are given by\\
\begin{align}
    x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\end{align}
\end{proposition}
\end{document}

I want section numbering '1' instead of '1.1' also the equation number is '1' instead of '1.1'. And the numbering definition and propositions should be 1.1 and 1.2.

I tried much to get this effect I could not do. Please help me.

Typeset

Mico
  • 506,678

1 Answers1

2

Assuming your TeX distribution is reasonably up to date, you may achieve your formatting objectives by adding the instructions

\counterwithout{equation}{chapter}
\counterwithout{section}{chapter}

in the preamble. If your TeX distribution is somewhat out of date, you'll have to load the chngcntr package before executing the two preceding instructions.

Some additional comments:

  • No need to insert an explicit line break, \\, before the start of the align environment. In fact, I'd go further and say that it's poor practice to insert \\ at that location.

  • Since the displayed equation in the proposition consists of a single line, you should replace the align environment with an equation environment.

  • Instead of writing a single inline equation, $ax^2 + bx + c = 0,\ a\neq 0,\ a,\ b,\ c \in \mathbb{R}$, I'd write three [3!] separate inline equations: `$ax^2 + bx + c = 0$, $a\neq 0$, $a,\ b,\ c \in \mathbb{R}$. If nothing else, have three short equations rather than one long one will ease TeX's job of finding suitable line breaks.

    Similarly, I would replace $ax^2 + bx + c = 0,\ (a\neq 0,\ a,\ b,\ c \in \mathbb{R}$) with $ax^2 + bx + c = 0$, ($a\neq 0$, $a,b,c\in\mathbb{R}$).

  • I would assume that the purpose of {i} in \newtheorem{definition}{Def{i}nition}[section] is to break up the fi ligature. If that is the case, do be aware that using {} to break up ligatures works under pdfLaTeX but doesn't work under XeLaTeX and LuaLaTeX. Better to write \newtheorem{definition}{Def\kern0ptinition}[section].

enter image description here

\documentclass{book}
\usepackage{amsmath, amsthm, amssymb}

\theoremstyle{definition} \newtheorem{definition}{Def\kern0ptinition}[section] \newtheorem{lemma}{Lemma}[section] \newtheorem{proposition}[definition]{Proposition}

\counterwithout{equation}{chapter} \counterwithout{section}{chapter}

\begin{document} \mainmatter \chapter{Quadratic Equation} \section{Introduction} \begin{definition} An equation $ax^2 + bx + c = 0$, $a\neq 0$, $a, b, c \in\mathbb{R}$ is a called a \textbf{quadratic equation}. The values of $x$ which satisfies it are called its \textbf{roots}. \end{definition} \begin{proposition} The roots of the quadratic $ax^2 + bx + c = 0$, ($a\neq 0$, $a,b,c\in\mathbb{R}$) are given by \begin{equation} x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} ,. \end{equation} \end{proposition} \end{document}

Mico
  • 506,678
  • Will not \counterwithout result in a continuous numbering throughout the book? – Bernard Aug 11 '19 at 10:23
  • Worked, thanks. I just want to ask one more thing, I want to use colon after the word 'definition 1.1' and similarly after 'proposition 1.2' instead of dot. How can I achieve this effect ? – prashant sharma Aug 11 '19 at 10:23
  • @Bernard - The OP said nothing about restarting the equation numbering when a new chapter starts. I therefore assumed that he/she wants to have the equations numbered consecutively (continuously?) throughout the book. – Mico Aug 11 '19 at 10:33
  • @Mico yes, I want restarting the equation numbering when a new chapter starts. – prashant sharma Aug 11 '19 at 10:35
  • @prashantsharma - So, basically, you want equations numbered (1), (2), (3), etc in Chapter 1 as well as in Chapters 2, 3, etc? – Mico Aug 11 '19 at 10:37
  • @prashantsharma - To reset the counters equation and section at the start of each chapter, add the instructions \makeatletter \@addtoreset{equation}{chapter} \@addtoreset{section}{chapter} \makeatother after running the two counterwithout instructions. – Mico Aug 11 '19 at 10:42
  • @prashantsharma - Please post a new query for your question I want to use colon after the word 'definition 1.1' and similarly after 'proposition 1.2' instead of dot. How can I achieve this effect ? – Mico Aug 11 '19 at 10:42