[Tex/LaTex] How organize definitions in a thesis document

theoremsthesis

I am writing my master thesis and I would like to define each new term with a sentence starting with keyword Definition followed by a counter and corresponding meaning of the term. for instance:

Definition 1 (Operating System).

An operating system (OS) is system
software that manages computer hardware and software resources and
provides common services for computer programs. All computer programs,
excluding firmware, require an operating system to function.

As there are many definitions in the documents, how can I organize them in a way that (ordered in level of importance for me) :

  1. An automatic numbering for each definition is generated (more interesting if more complex format like section number followed by a counter can be used)

  2. Easily generate "list of definitions" similar to "List of figures" and "List of tables" at the beginning of document

  3. Making a glossary. i.e. having all definitions together with corresponding meanings at the end of document"

    It can be nice if someone can also share a document with a similar format.

Best Answer

Here is a tcolorbox version with nice boxes for definitions etc. There are \newtcbtheorem versions but \newtcolorbox is more flexible, in my point of view.

\documentclass{book}

\usepackage[most]{tcolorbox}

\newtcolorbox[auto counter,list inside=defs,number within=section]{definition}[2][]{title={Definition~\thetcbcounter},colback={white!30!yellow},colbacktitle={gray},coltitle=black,#1}

\newcommand{\listofdefinitions}{%
  \tcblistof[\section*]{defs}{List of Definitions}
}
\begin{document}
\listofdefinitions

\chapter{Foo}

\section{Foobar}

\begin{definition}[label=latex]{On \LaTeXe}
  \LaTeXe is very nice!
\end{definition}

\begin{definition}[label=MWE]{On MWE}
  Providing a MWE helps
\end{definition}


\end{document}

enter image description here

Update with other list entry.

\documentclass{book}

\usepackage[most]{tcolorbox}

\newtcolorbox[auto counter,
list inside=defs,
number within=section]{definition}[2][]{
  list entry={{\bfseries\thetcbcounter~#2}},
  title={Definition~\thetcbcounter},
  colback={white!30!yellow},
  colbacktitle={gray},
  coltitle=black,
  #1
}

\newcommand{\listofdefinitions}{%
  \tcblistof[\section*]{defs}{List of Definitions}
}
\begin{document}
\listofdefinitions

\chapter{Foo}

\section{Foobar}

\begin{definition}[label=latex]{\LaTeXe}
  \LaTeXe is very nice!
\end{definition}

\begin{definition}[label=MWE]{MWE}
  Providing a MWE helps
\end{definition}


\end{document}

Screenshot of the list: enter image description here

Related Question