# How can I write an exercise with numbering without the solution?

I am currently writing my project and I want to write exercises in it with auto numbering. For example, I want the format to be like this.

Exercise 1: Prove the uniqueness of the Empty set Axiom

Pairing Axiom This axiom is also called Axiom of the Unordered Pair [2] and states that we can create a new set A that contains x and y from any two sets x and y. Aisexpressedas{x,y}. this is formally written as, ∀ x ∀ y ∃ ! A ∀ z [ z ∈ A ⇔ ( z= x ∨ z= b)

Exercise 2: Show that there is exactly one such set.

• You can either use a theorem-like environment with displayed name Exercise, or a special enumerate-like environment with a prefix (Exercise) via the enumitem package. Nov 27 '20 at 14:48
• Welcome to the site :) It's really important that you show us what you've tried, and at least what you intend to achieve. As stated, your question is very open and could reasonably be answered in a variety of different ways. Please help the community to help you. As a possible starting point: tex.stackexchange.com/questions/383744/… Nov 27 '20 at 14:59
• Apologies i didn't realise this. I have edited it now and hopefully, the example I used explains it. Nov 27 '20 at 17:03

## 1 Answer

Add \newtheorem{exercise}{Exercise} to your preamble and use it as \begin{exercise}Text of exercise.\end{exercise}.

\documentclass{article}
\newtheorem{exercise}{Exercise}
\begin{document}
I am currently writing my project and I want to write exercises in it with auto numbering. For example, I want the format to be like this.
\begin{exercise}
Prove the uniqueness of the Empty set Axiom.
\end{exercise}

Pairing Axiom. This axiom is also called Axiom of the Unordered Pair' and states that we can create a new set $A$ that contains $x$ and $y$, for any two sets $x$ and $y$. $A$ is written as $\{x,y\}$. This is formally written as
$\forall x,y\, \exists! A\, \forall z \big( z \in A \Leftrightarrow (z=x \lor z=y)\big)$

\begin{exercise}
Show that there is exactly one such set.
\end{exercise}

\end{document}
`
• thank you very much for your help Nov 28 '20 at 8:51