2

I want to have numbering for mathematical condition but I can't find any environment for this. I mean something like this:

\begin{condition}
    a should be posotive
\end{condition}
\begin{condition}
    b should be Negative
\end{condition}

and have this output:

condition 1.1: a should be positive
condition 1.2: b should be Negative

any help will be appreciated.

SirSaleh
  • 255

1 Answers1

6

You can achieve something like this with the \newtheorem command, which is part of LaTeX. If you want to have more flexibility (e.g. for adjusting the font chosen for the label and the text), load the amsthm package in the preamble. The advantage of viewing your conditions as 'theorems' is that you can use the \label and the \ref command to refer to the conditions later on. For more information on the command \newtheorem see WikiBooks: LaTeX/Theorems.

\documentclass{article}
\newtheorem{condition}{Condition}[section]
\begin{document}
\section{My conditions}
\begin{condition}\label{cond for a}
  $a$ should be positive.
\end{condition}
\begin{condition}\label{cond for b}
  $b$ should be negative.
\end{condition}
Note that condition~\ref{cond for a} implies condition~\ref{cond for b}.
\end{document}

enter image description here

gernot
  • 49,614
  • In my next project I'll use this! You learned my a valuable command :) thanks :) – SirSaleh Oct 16 '16 at 21:10
  • In a serious text I recommend writing "Condition 1.1 implies Condition 1.2'', since they are proper names. – Noir Jun 02 '18 at 06:05