2

I almost always use the following environments: equation, eqnarray and environments that are defined in the preamble with the command \newtheorem (i.e. definition, theme, Theorema, proposition etc ...) for my dissertation.

But I would like to customize these environments as follows:

  1. having a unified numbering all these environments of the type X.Y.Z where x = "chapter number" y = "section number" z = "number of the subsection"

  2. numbering stay to the left of the right environment and not the name I mentioned these environments. Exemple:

**"X.Y.Z Theorem " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

(X.Y.(Z+1)) equation = equation

X.Y.(Z+2) Definition XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX**

  1. do not lose the automatic spacing before or after the environments defined by the command \newtheorem (i.e. definition, theme, Theorema, proposition etc ...)

  2. Did not lose the italic font environments defined by the command \newtheorem (i.e. definition, theme, Theorema, proposition etc ...)

  3. What did not come in with the environment comflito enumerate.

  4. That I could set the font in the preamble to these environments.

MathOverview
  • 2,921

3 Answers3

9

You can get sequential numbers by defining the theorem-like environments sharing the equation counter; the number on the left of the theorem header can be obtained by \swapnumbers (package amsthm):

\documentclass[a4paper]{book}
\usepackage[leqno]{amsmath}
\usepackage{amsthm}
\swapnumbers

\numberwithin{equation}{section}
\newtheorem{theorem}[equation]{Theorem}
\newtheorem{definition}[equation]{Definition}

\begin{document}
\mainmatter
\chapter{Title}

\section{Title}

Some text.

\begin{theorem}
A theorem
\end{theorem}

Some text and an equation
\begin{equation}
1+1=2
\end{equation}

\begin{definition}
A definition.
\end{definition}

Some final text.

\end{document}

enter image description here

egreg
  • 1,121,712
4

As mentioned in the comments, you should avoid eqnarray and use something from the amsmath package such as align; see eqnarray vs align for details on how to get started.

The numbering convention you requested can be achieved by combining \numberwithin from the amsmath package (which hopefully you'll be loading now so that you can avoid eqnarray!) and \swapnumbers from the amsthm package.

enter image description here

You can customize the fonts for your theorem-like environments using the format specified in the amsthm package, as detailed in section 4.3 of the documentation

enter image description here

Here's a complete MWE for your reference- note that other theorem packages are available such as ntheorem.

\documentclass{report}

\usepackage{lipsum} % sample text
\usepackage{amsthm} % for theorems
\usepackage{amsmath}% for mathematical environments

\swapnumbers
\newtheorem{definition}{Definition}
\numberwithin{definition}{section}

\begin{document}

\chapter{}
\section{Section}
\begin{definition}
\lipsum[1]
\end{definition}

\end{document}
cmhughes
  • 100,947
2
  1. Definitely do not use eqnarray. Check the amsmath package.

  2. As for theorems: you might want to check the amsthm package or the ntheorem package (also look here: http://ctan.org/keyword/theorems).

mbork
  • 13,385