Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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
2  
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. –  Elias Feb 26 '12 at 23:50
    
@Werner, I edit may question. See exemple. –  Elias Feb 26 '12 at 23:51
add comment

3 Answers

up vote 9 down vote accepted

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

share|improve this answer
    
Thank you. His reply was simple and elegant. –  Elias Feb 27 '12 at 0:23
add comment

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}
share|improve this answer
    
Thank you. His reply was simple and elegant. –  Elias Feb 27 '12 at 0:24
add comment
  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).

share|improve this answer
    
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. –  Elias Feb 26 '12 at 23:57
    
@mbork. Thanks for your answer. Your link's been very helpful. –  Elias Feb 27 '12 at 0:26
1  
@MarkS.Everitt: thanks, obviously yes. Corrected. –  mbork Feb 27 '12 at 8:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.