# Customizing theorem environments, eqnarray, and equation

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.

-
Please elaborate: (2) Does this specifically refer to equations? (3) Have something like X.Y.Z.n Theorem or keep the traditional Theorem X.Y.Z.n? (5) What does this mean? –  Werner Feb 26 '12 at 23:22
I changed the wording of your first point a little, hope it reflects what you meant. Also, you should Avoid eqnarray! –  Torbjørn T. Feb 26 '12 at 23:24
Are you thinking to a numbering similar to Dieudonné's "Treatise on Analysis"? –  egreg Feb 26 '12 at 23:25
@egreg, yes similar to Dieudonné's "Treatise on Analysis". But not a list of paragraphs. The abientes must be specified. –  MathOverview Feb 26 '12 at 23:50
@Werner, I edit may question. See exemple. –  MathOverview Feb 26 '12 at 23:51

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
$$1+1=2$$

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

Some final text.

\end{document}


-
Thank you. His reply was simple and elegant. –  MathOverview Feb 27 '12 at 0:23

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.

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

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}

-
Thank you. His reply was simple and elegant. –  MathOverview Feb 27 '12 at 0:24
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).

-
Do you mean amsmath? –  qubyte Feb 26 '12 at 23:56
@mbork. Thank1's. I'll look at these packages in your answer. But I would be grateful if he had somewhere ready commands. But for many exorcise "eqnarry"? I need my dissertation on the numbering of the equations remain to the left of the equation as the eqnarray. –  MathOverview Feb 26 '12 at 23:57