1

I want to use several types of text sections/theorem-like environments in my document (e.g. axioms, definitions and lemmas), which should be automatically numbered independently by LaTeX, and to which I also want to set references in the same text. This should look like this (bold texts are headings, ideally generated by LaTeX from a \begin{}-command, and text in italics are references to these environments.)

Axiom 1: Fjon is a Shrud

Axiom 2: Every Shrud has exactly one Gob that is also a Shrud.

Definiton 1: Ruficiousity
Every Shrud is ruficious only to himself, never to any other Shrud.

Axiom 3: No Shrud is ruficious to his own Gob.

Axiom 4: If two Shruds have Gobs that are ruficious to each other, then these Shruds are ruficious too.

Lemma 1: Shruds exist
This is a trivial consequence of Axiom 1.

Lemma 2: There are other Shruds than Fjon
Fjon exists (Axiom 1) and he has a Gob due to Axiom 2, but Fjon's Gob can't be Fjon himsel as a consequence of Definition 1 and Axiom 3, so Fjon's Gob must be another Shrud.

Defintion 2: Muna, Obaji
Muna is the Gob of Fjon, Obaji is the Gob of Muna

Axiom 5: Fjon is not the Gob of any Shrud

Lemma 3: Every other Shrud than Fjon is Gob of a Shrud
(Proof)

Here's how I hope to accomplish this:

\begin{axiom} % shall print "Axiom 1:", where 1 is a sequential number that is increased for each axiom
\label{ax:Fjon_is_Shrud}
Fjon is a Shrud
\end{axiom}

\begin{axiom} % shall print "Axiom 2:"
\label{ax:Gob}
Every Shrud has exactly one Gob that is also a Shrud.
\end{axiom}

\begin{definition}{Ruficiousity} % shall print "Definition 1: Ruficiousity" followed by a line break
\label{def:Ruficiousity}
\textbf{Ruficiousity}
Every Shrud is ruficious only to himself, never to any other Shrud.
\end{definition}

...

\begin{lemma} % shall print "Lemma 1:"
\label{lem:Shruds}
\textbf{Shruds exist}
This is a trivial consequence of \ref{ax:Fjon_is_Shrud}.
\end{lemma}

But that's obviously not enough. I think I need to additionally define somewhere that axioms, definitions, and lemmas are things that can be used in a begin-end pair, and I think I need to somehow tell LaTeX to assign numbers to these elements, and that each of them has its own list of numbers that is independent of any other numbered element.

What do I need to do (and where) in my document to accomplish this?

1 Answer 1

2

This is what Theorems are for. Here I use amsthm. I did not write everything down, but I think you can imagine how to go on.

Result

\documentclass{article}

\usepackage{amsthm} % for defining theorem-like environments
   \newtheorem{axiom}{Axiom} % first argument: what you have to write in "\begin{...}"; second argument is the displayed name
   \newtheorem{definition}{Definition}
   \newtheorem{lemma}{Lemma}
\usepackage{cleveref} % for nice references
   \crefname{axiom}{axiom}{axioms} % first argument: name of environment; second argument: singular form of how it should be referenced; third argument: plural form of how it should be referenced
   \crefname{definition}{definition}{definitions}
   \crefname{lemma}{lemma}{lemmata}

\begin{document}
    \begin{axiom}\label{ax:Fjon}
        Fjon is a Shrud.
    \end{axiom}
    \begin{axiom}
        Every Shrud has exactly one Gob that is also a Shrud.
    \end{axiom}
    \begin{definition}[Ruficiousity]
        Every \ldots
    \end{definition}
    \begin{axiom}
        No Shrud \ldots
    \end{axiom}
    \begin{lemma}
        Shruds exist.
    \end{lemma}
    \begin{proof}
        This is a trivial consequence of \cref{ax:Fjon}.
    \end{proof}
    \begin{lemma}
        There are other Shruds than Fjon.
    \end{lemma}
    \begin{proof}
        Fjon exists (\cref{ax:Fjon}) and he has\ldots
    \end{proof}
\end{document}

Note that the above theorem-like environments can be further customized, e.g. you can achieve Axiom 1: instead of Axiom 1. by defining a \newtheoremstyle, see amsthm documentation.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .