答案1
这是一个可供thmtools
您入门的示例。
\documentclass{article}
\usepackage{lipsum} % for dummy text
\usepackage{amsthm,thmtools}
\declaretheoremstyle[%
spaceabove = \topsep,
spacebelow = \topsep,
bodyfont = \itshape,
headpunct = ,
postheadspace = 1em]%
{definition}
\declaretheoremstyle[%
spaceabove = \topsep,
spacebelow = \topsep,
headpunct = ,
postheadspace = \newline,
postheadhook = {\hspace*{\parindent}}]%
{example}
\declaretheoremstyle[%
spaceabove = \topsep,
spacebelow = \topsep,
headpunct = ,
postheadspace = \newline,
postheadhook = {\hspace*{\parindent}}]%
{solution}
\declaretheorem[style=definition,name=Definition]{defn}
\declaretheorem[style=example,numberlike=defn,name=Example]{ex}
\declaretheorem[style=solution,numbered=no,name=Solution]{sol}
\begin{document}
\begin{defn}
\lipsum*[2]
\end{defn}
\begin{ex}
\lipsum*[2]
\end{ex}
\begin{sol}
\lipsum*[2]
\end{sol}
\end{document}
输出:
以及一个没有定理的例子......
\documentclass{article}
\usepackage{lipsum} % for dummy text
\newcounter{defn}
\newcommand{\Def}{\refstepcounter{defn}\vspace*{\topsep}\noindent\textbf{Definition \thedefn}\hspace*{1em}}
\newcommand{\Ex}{\refstepcounter{defn}\vspace*{\topsep}\noindent\textbf{Example \thedefn}\par}
\newcommand{\Sol}{\vspace*{\topsep}\noindent\textbf{Solution}\par}
\begin{document}
\Def{\itshape\lipsum*[2]}
\Ex\lipsum*[2]
\Sol\lipsum*[2]
\end{document}
输出:
答案2
如果这是一篇关于 LaTeX 的介绍,那么原作者可能正在寻找一些手册和基础知识,例如
\noindent\textbf{Example}\par
\indent text text text
?
答案3
带有 的简单代码ntheorem
。我认为第一段缩进不太好,所以我没有设置它。它可以插入 由 ntheorem 定义的break
和定理样式的小补丁。nonumberbreak
\documentclass{report}%]
\usepackage[utf8]{inputenc}%
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage[thmmarks, amsmath]{ntheorem}%
\theoremstyle{break}
\theoremheaderfont{\bfseries\upshape}
\theorembodyfont{\mdseries\hspace*{1em}}
\theoremseparator{\smallskip}
\newtheorem{example}{Example}[section]
\renewcommand\theexample{\arabic{example}}
\theoremstyle{nonumberbreak}
\newtheorem{solution}{Solution}
\begin{document}
\begin{example} \label{ex-1}
Some example%
\end{example}
\begin{solution}
Some solution for example \ref{ex-1}.
\end{solution}
\end{document}