Does there exist \begin{definition} in latex? And how can I construct one? Is everything derived from \newtheorem command.
2 Answers
There is no predefined theorem environment, nor corollary.
There are perhaps packages providing them, but you give no information about the packages you load.
Since the repertoire of such statements is really vast and every user will have their own preferences (language for the headers, names and so on), LaTeX just provides the generic \newtheorem facility.
I recommend loading amsthm that adds flexibility, still keeping the same syntax.
In your preamble you will have something like
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{definition} % the body will be in upright type
\newtheorem{definition}[theorem]{Definition}
Several variations are possible, check with any good LaTeX guide.
- 1,121,712
From my understanding, there is no predefined theorem environments. Latex only offer the command \newtheorem to define one by user. If you can use \begin{theorem}...\end{theorem} or \begin{corollary}...\end{corollary}. Those must be defined in your class file or some packages. Correct me if I was wrong.
If you want deeply understand how the \newtheorem command defined in basic Latex code. Here is the section which define \newtheorem in latex.ltx file.
%%% From File: ltthm.dtx
\def\newtheorem#1{%
\@ifnextchar[{\@othm{#1}}{\@nthm{#1}}}
\def\@nthm#1#2{%
\@ifnextchar[{\@xnthm{#1}{#2}}{\@ynthm{#1}{#2}}}
\def\@xnthm#1#2[#3]{%
\expandafter\@ifdefinable\csname #1\endcsname
{\@definecounter{#1}\@newctr{#1}[#3]%
\expandafter\xdef\csname the#1\endcsname{%
\expandafter\noexpand\csname the#3\endcsname \@thmcountersep
\@thmcounter{#1}}%
\global\@namedef{#1}{\@thm{#1}{#2}}%
\global\@namedef{end#1}{\@endtheorem}}}
\def\@ynthm#1#2{%
\expandafter\@ifdefinable\csname #1\endcsname
{\@definecounter{#1}%
\expandafter\xdef\csname the#1\endcsname{\@thmcounter{#1}}%
\global\@namedef{#1}{\@thm{#1}{#2}}%
\global\@namedef{end#1}{\@endtheorem}}}
\def\@othm#1[#2]#3{%
\@ifundefined{c@#2}{\@nocounterr{#2}}%
{\expandafter\@ifdefinable\csname #1\endcsname
{\global\@namedef{the#1}{\@nameuse{the#2}}%
\global\@namedef{#1}{\@thm{#2}{#3}}%
\global\@namedef{end#1}{\@endtheorem}}}}
\def\@thm#1#2{%
\refstepcounter{#1}%
\@ifnextchar[{\@ythm{#1}{#2}}{\@xthm{#1}{#2}}}
\def\@xthm#1#2{%
\@begintheorem{#2}{\csname the#1\endcsname}\ignorespaces}
\def\@ythm#1#2[#3]{%
\@opargbegintheorem{#2}{\csname the#1\endcsname}{#3}\ignorespaces}
\def\@thmcounter#1{\noexpand\arabic{#1}}
\def\@thmcountersep{.}
\def\@begintheorem#1#2{\trivlist
\item[\hskip \labelsep{\bfseries #1\ #2}]\itshape}
\def\@opargbegintheorem#1#2#3{\trivlist
\item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]\itshape}
\def\@endtheorem{\endtrivlist}
- 7,318
- 4
- 21
\newcommand{\definition}[1]{\textbf{Definition: } #1}or perhaps clarify what you mean by "definition". --- GOM – Peter Wilson Apr 24 '22 at 16:54\begin{theorem}. And it seems there is also\begin{corollary}. What else is there? – Veak Apr 24 '22 at 18:22\newtheoremto define one by user. If you can use\begin{theorem}or\begin{corollary}. Those must be defined in yourclassfile or some packages. Correct me if I was wrong. – Tom Apr 24 '22 at 18:36quote,verse,alignand so on. It seems that you are after a complete list of LaTeX environments whether they are in basic LaTeX or any of the multitude of packages. --- GOM – Peter Wilson Apr 24 '22 at 19:10\newtheoremthen the remaining can be defined from there. And thus answer my question. – Veak Apr 24 '22 at 19:15amsthmprovides ddefinitionenvironment. See Non italic text in theorems, definitions, examples for details. (This is the style used in publications of the American Math Society; I was a member of the AMS publications technical support team before retirement, so I should be considered biased.) – barbara beeton Apr 24 '22 at 20:30