정의의 끝 표시

정의의 끝 표시

패키지를 사용하여 다음과 같이 환경을 amsthm정의하고 있습니다 .definition

\theoremstyle{definition}
\newtheorem{definition}{Definition}

놀랍게도 이것은 정의가 끝나고 다음 텍스트가 시작되는 위치에 대한 인쇄상의 표시를 거의 제공하지 않습니다(새 단락이 있지만 이것만으로는 충분하지 않습니다. 특히 정의가 방정식으로 끝나는 경우 더욱 그렇습니다).

이것을 더 명확하게 하려면 어떻게 해야 합니까? 정의 텍스트가 일반 텍스트와 다른 글꼴로 표시되는 것을 원하지 않습니다. 아마도 증명과 같은 정의는 다음으로 끝나야 할 것입니다 \qedsymbol. 이것을 어떻게 추가할 수 있습니까?

답변1

그만큼amsthm그 자체로는 최고가 아닙니다. 하지만,thmtoolsamsthm및 기타 정리 패키지에 대해 정말 깔끔한 '프론트 엔드'를 제공합니다 .

특히 필요에 따라 사용할 수 있는 및 가 thmtools포함되어 있습니다 . 다음은 간단한 수평선으로 예제를 마무리하는 작은 사용 사례입니다 . 이를 필요에 맞게 쉽게 조정할 수 있습니다. 예를 들어, 이것을 다음과 결합할 수 있습니다.prefoothookpostfoothookthmtoolsamsthmtcolorbox정말 멋진 상자의 경우 또는 "예제 끝"이라는 텍스트를 바로 플러시할 수 있습니다.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}

\declaretheoremstyle[
  headfont=\normalfont\scshape,
  numbered=unless unique,
  bodyfont=\normalfont,
  spaceabove=1em plus 0.75em minus 0.25em,
  prefoothook=\newline\rule{\linewidth}{1pt},
  spacebelow=1em plus 0.75em minus 0.25em,
]{exmpstyle}

\declaretheorem[
  style=exmpstyle,
  title=Example,
  refname={example,examples},
  Refname={Example,Examples}
]{exmp}

\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pustibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum uris. Nam arcu libero,
nonummy eget, consectetuer id, vulputate a, nec vehicula augue eu
neque. Pellentesque habitant morbi tristique t netus et malesuada fames ac
turpis egestas. Mauris ut leo.
\begin{exmp}
  \lipsum*[1]
\end{exmp}
\lipsum[2-3]
\begin{exmp}
  \lipsum*[4]
\end{exmp}
\end{document}

출력은 다음과 같습니다.

산출

부록

Caramdir이 언급하고 Barbara Beeton이 의견에서 요청한 대로 다음은 방정식으로 작동하고 옵션을 사용하는 예입니다 qed.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}

\declaretheoremstyle[
  headfont=\normalfont\bfseries\itshape,
  numbered=unless unique,
  bodyfont=\normalfont,
  spaceabove=1em plus 0.75em minus 0.25em,
  spacebelow=1em plus 0.75em minus 0.25em,
  qed={\itshape That's All Folks!},
]{exmpstyle2}

\declaretheorem[
  style=exmpstyle2,
  title=Example,
  refname={example,examples},
  Refname={Example,Examples}
]{exmp2}

\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pustibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum uris. Nam arcu libero,
nonummy eget, consectetuer id, vulputate a, nec vehicula augue eu
neque. Pellentesque habitant morbi tristique t netus et malesuada fames ac
turpis egestas. Mauris ut leo.
\begin{exmp2}
  \lipsum*[1]
\end{exmp2}
\lipsum[2-3]
\begin{exmp2}
  \lipsum*[4]
  \begin{equation*}
    \mathcal{L} = \overline \psi (i \gamma \cdot \partial - m) \psi
    \qedhere
  \end{equation*}
\end{exmp2}
\end{document}

이는 다음을 생성합니다.

출력2

답변2

나는 정말로 그것이 필요하다고 볼 수 없다. 하지만 당신이 묻고 있으니,

\documentclass{article}
\usepackage{amsthm}

\usepackage{lipsum}

\theoremstyle{definition}
\newtheorem{defi/}{Definition}

\newenvironment{defi}
  {\renewcommand{\qedsymbol}{$\heartsuit$}%
   \pushQED{\qed}\begin{defi/}}
  {\popQED\end{defi/}}

\begin{document}

\lipsum[2]

\begin{defi}
This is the definition of \emph{definition}.
\end{defi}

\lipsum[3]

\begin{defi}
This is the definition of recursion,
\[
x\gets x+1 \qedhere
\]
\end{defi}

\lipsum[2]

\end{document}

여기에 이미지 설명을 입력하세요

나는 단지 정의 중간에 증거가 없다고 가정합니다.

답변3

그만큼thmbox패키지유사한 환경을 표시하는 좋은 방법을 제공합니다 theorem.

예를 들어 미리 정의된 세 가지 스타일을 사용하면 다음과 같은 결과를 얻을 수 있습니다.

\documentclass{article}
\usepackage{mathtools}
\usepackage{thmbox} % Overrides \newtheorem command! See [nothm] to disable this feature.
\usepackage{lipsum} % Useless, just for the demo.

\newtheorem[S, bodystyle=\normalfont\noindent]{defiS}{Definition}[section]
\newtheorem[M]{defiM}{Definition}[section]
\newtheorem[L]{defiL}{Definition}[section]

\begin{document}

\section{My nice demo}

\begin{defiS}[Inverse of a relation]
  Let \(R\) be a relation, \emph{the inverse of \(R\)} is
  \[R^{-1} = \{(x,y) \mid (y, x) \in R\}\]
\end{defiS}

\lipsum[2] % Just for the demo

\begin{defiM}[Union]
  Let \(R\) and \(S\) be relations, the \emph{union of \(R\) and \(S\)} is defined as
  \[
  R \cup S = \{(x, y) \mid (x,y) \in R \text{ or } (x,y) \in S\}
  \]
\end{defiM}

\lipsum[1] % Just for the demo

\begin{defiL}[Graph of a function]
  Let \(f\) be a fuction, the \emph{graph of \(f\)}  is
  \[
  \langle f \rangle = \{(x, y) \mid f x = y\}
  \]
\end{defiL}

\end{document}

여기에 이미지 설명을 입력하세요

다음 사항에 유의하시기 바랍니다:

  • 첫 번째 예(environment ) normalfont에 대해서만 글꼴을 (즉, 기울어지지 않음)로 설정했습니다 .defiS
  • defiS세 가지 다른 환경(예: , defiM및 ) 을 사용했기 때문에 세 가지 경우의 번호는 1.1이지만 defiL, 하나의 환경을 고수하면 번호가 정확합니다(예: 1.1, 1.2, 1.3 등).
  • 저는 미리 정의된 스타일을 사용했지만, 이를 사용자 정의할 수 있는 경우가 많습니다.

답변4

한 가지 해결책은 전체 증거를 (주어진 양만큼) 들여쓰기하고 글꼴 크기를 약간 조정하는 것입니다. 다음과 같은 환경 재정의를 고려할 수 있습니다 proof.

\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont\small\topsep6\p@\@plus6\p@\relax
%\trivlist %%%% old
\list{}{\leftmargin=\parindent
   \rightmargin=0pt
   \settowidth{\itemindent}{\itshape#1}%
   \labelwidth=\itemindent}  
\item[\hskip\labelsep\itshape#1\@addpunct{.}]\ignorespaces
}{%
 \popQED
 %\endtrivlist %%OLD
 \endlist %%NEW
 \@endpefalse
}
\makeatother

관련 정보