0

Does there exist \begin{definition} in latex? And how can I construct one? Is everything derived from \newtheorem command.

8
  • 1
    Not an answer, but I suggest that you read something listed here to get started: getting started with latex.
    – mickep
    Apr 24, 2022 at 16:39
  • 1
    How about \newcommand{\definition}[1]{\textbf{Definition: } #1} or perhaps clarify what you mean by "definition". --- GOM Apr 24, 2022 at 16:54
  • I want to understand what is already available. There exists \begin{theorem}. And it seems there is also \begin{corollary}. What else is there?
    – Veak
    Apr 24, 2022 at 18:22
  • From what I have seen, definitions, lemmas, and corollaries are customarily defined using a theorem style.
    – Veak
    Apr 24, 2022 at 18:27
  • 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} or \begin{corollary}. Those must be defined in your class file or some packages. Correct me if I was wrong.
    – Tom
    Apr 24, 2022 at 18:36

2 Answers 2

0

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}
3

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.

You must log in to answer this question.

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