例を定理/補題/系のように見せる

例を定理/補題/系のように見せる

LaTeX ドキュメントで、定理/補題/系の場合と同じ太字の書体で例を表示するにはどうすればよいですか?

答え1

一般的なステートメントは好きなように定義できます。人々はこれについてさまざまな期待を持つ傾向があるため、事前に定義された定理のような環境はありません。

\documentclass{article}
\usepackage{amsthm} % for \theoremstyle and proof

\newtheorem{thm}{Theorem}[section] % theorems will be numbered according to section
\newtheorem{lem}[thm]{Lemma} % lemmas share the counter with theorems
\newtheorem{cor}[thm]{Corollary} % ditto

\theoremstyle{definition} % body text will be upright
\newtheorem{defn}[thm]{Definition}
\newtheorem{exa}[thm]{Example}

\begin{document}

\section{A title}

\begin{lem}
This is a lemma.
\end{lem}

\begin{thm}
This is a theorem.
\end{thm}
\begin{proof}
Here's its proof.
\end{proof}

\begin{exa}
An example to illustrate the theorem.
\end{exa}

\end{document}

ここに画像の説明を入力してください

答え2

選択肢はいくつかあります。良い選択肢の 1 つは amsthm です。次に例を示します。

\documentclass{minimal}
\usepackage{amsthm}
\theoremstyle{plain}  
\newtheorem{thm}{Theorem}
\newtheorem{lem}{Lemma}
\newtheorem{cor}{Corollary}
\newtheorem{exm}{Example}

\usepackage{lipsum}
\begin{document}
\lipsum[1]

\begin{thm} \lipsum[2] \end{thm}
\begin{lem} \lipsum[3] \end{lem}
\begin{cor} \lipsum[4] \end{cor}
\begin{exm} \lipsum[5] \end{exm}

\lipsum[6]
\end{document}

CTANにはさらに多くのパッケージがありますhttp://www.ctan.org/topic/maths-theorem

関連情報