
Eu gostaria de escrever alguns teoremas assim:
\begin{theorem}
\begin{preconditions}
$A := \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$\\
$B := \begin{pmatrix} 2 & 2 \\ 3 & 4 \end{pmatrix}$\\
$n \in \mathbb{N}$
\end{preconditions}
\begin{claim}
$\sqrt{2} \notin \mathbb{Q}$
\end{claim}
\begin{proof}{directly}
[... the proof ...]
\end{proof}
\end{theorem}
Deveria ficar assim:
**Theorem 123**
**Preconditions**:
$A := \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$\\
$B := \begin{pmatrix} 2 & 2 \\ 3 & 4 \end{pmatrix}$\\
$n \in \mathbb{N}$
**Claim**: √2 ∉ Q
**Proof**: directly
[... the proof ...]
[.. the end] ■
( Theorem 123
, Preconditions
, Claim
e Proof
devem estar em negrito)
Lógica por trás do meio ambiente:
- os teoremas devem obter automaticamente um número que começa em um e conta em um para cada teorema
- dentro do ambiente do teorema, apenas os ambientes
preconditions
,claim
eproof
são permitidos - dentro do ambiente do teorema, o
claim
ambienteproof
e deve ser exatamente uma vez. - o conteúdo da prova e o conteúdo das pré-condições devem ter a mesma intenção.
O que descobri até agora:
Eu pensei\novo ambientepode ser o que estou procurando:
\newenvironment{name}[num]{before}{after}
mas não consegui descobrir como marcar os ambientes internos como necessários.
O pacote amsthm parece ter ambientes para prova (fonte), mas não consigo ver a possibilidade de aninhar os diferentes ambientes e fazê-los parecer como eu quero que pareçam
teoremaparece oferecer muitas possibilidades. Eu criei 4 novos ambientes de teoremas:
\newtheorem{theorem}{Theorem}
\newtheorem{preconditions}{Preconditions}
\newtheorem{proof}{Proof}
\newtheorem{claim}{Claim}
Eu usei o código latex acima e consegui isso:
Este não tem intenção de ambientes internos, os ambientes internos são numerados embora não devam ser numerados e nãolápideestá no fim
Responder1
Eu usei othmtools
pacote como front-end para amsthm
definir um novo Proof
ambiente; os outros dois ambientes foram criados usando \newenvironment
. Os ambientes Proof
, claim
e precondition
usam adjustwidth
dochangepage
pacote para aumentar a margem esquerda. Claro, fique à vontade para fazer os ajustes necessários de acordo com a sua necessidade:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{changepage}
\usepackage[nopar]{lipsum}% just to generate some text
\newlength\Thmindent
\setlength\Thmindent{20pt}
\newenvironment{precondition}
{\par\medskip\adjustwidth{\Thmindent}{}\normalfont\textbf{Preconditions:}\par\nobreak}
{\endadjustwidth}
\newenvironment{claim}
{\par\medskip\adjustwidth{\Thmindent}{}\normalfont\textbf{Claim:}}
{\endadjustwidth}
\declaretheoremstyle[
spaceabove=0pt,spacebelow=0pt,
preheadhook=\adjustwidth{\Thmindent}{},
prefoothook=\endadjustwidth,
headpunct=:,
numbered=no,
qed=\qedsymbol
]{proof}
\declaretheorem[style=proof]{Proof}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
\lipsum[2]
\begin{precondition}
\begin{itemize}
\item $A := \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$
\item $B := \begin{pmatrix} 2 & 2 \\ 3 & 4 \end{pmatrix}$
\item $n \in \mathbb{N}$
\end{itemize}
\end{precondition}
\begin{claim}
$\sqrt{2}\notin\mathbb{Q}$
\end{claim}
\begin{Proof}
\lipsum[2]
\end{Proof}
\end{theorem}
\end{document}