如何用矩形包围定理和定义?

如何用矩形包围定理和定义?

下面的代码

\documentclass{article}


\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{mathtools}

\usepackage[left=1.5in, right=1.5in, top=0.5in]{geometry}



\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}


\begin{document}
    \title{Extra Credit}
    \maketitle

    \begin{definition}
        If f is analytic at $z_0$, then the series

        \begin{equation}
            f(z_0) + f'(z_0)(z-z_0) + \frac{f''(z_0)}{2!}(z-z_0)^2 + \cdots = \sum_{n=0}^{\infty} \frac{f^{(n)}(z_0)}{n!}(z-z_0)^n
        \end{equation}

        is called the Taylor series for f around $z_0$.
    \end{definition}

    \begin{theorem}
        If f is analytic inside and on the simple closed positively oriented contour $\Gamma$ and if $z_0$ is any point inside $\Gamma$, then
        \begin{equation}
            f^{(n)}(z_0) = \frac{n!}{2\pi i} \int_{\Gamma} \frac{f(\zeta)}{(\zeta - z_0)^{n+1}}d\zeta \hspace{1cm} (n=1,2,3, \cdots )
        \end{equation}
    \end{theorem}

\begin{theorem}
(Cauchy's Integral Formula) Let $\Gamma$ be a simple closed positively oriented contour. If $f$ is analytic in some simply connected domain $D$ containing $\Gamma$ and $z_0$ is any point inside $\Gamma$, then
\begin{equation}
f(z_0)= \frac{1}{2\pi i} \int_{\Gamma} \frac{f(z)}{z-z_0} dz
\end{equation}
\end{theorem}
\noindent \hrulefill

\begin{theorem}
If f is analytic in the disk $|z-z_0|<R'$, then the Taylor series $(1)$ converges to $f(z)$ for all $z$ in this disk. 
\end{theorem}

生成以下图像 在此处输入图片描述

如何将定义 1、定理 1 和定理 2 括在单独的矩形中。 并让这些矩形之间用空格隔开?

答案1

您可以尝试使用shadethm包,它可以完成您想要的所有事情,甚至更多。在您的示例中,您需要的是:

\documentclass{article}
\usepackage{shadethm}
\usepackage{mathtools}

\newshadetheorem{boxdef}{Definition}[section]
\newshadetheorem{boxtheorem}[boxdef]{Theorem}
\newtheorem{theorem}[boxdef]{Theorem}

\setlength{\shadeboxsep}{2pt}  
\setlength{\shadeboxrule}{.4pt}  
\setlength{\shadedtextwidth}{\textwidth}
\addtolength{\shadedtextwidth}{-2\shadeboxsep}
\addtolength{\shadedtextwidth}{-2\shadeboxrule}
\setlength{\shadeleftshift}{0pt} 
\setlength{\shaderightshift}{0pt}
\definecolor{shadethmcolor}{cmyk}{0,0,0,0}
\definecolor{shaderulecolor}{cmyk}{0,0,0,1}

\begin{document}

\section{Boxed theorems}

\begin{boxdef}
        If f is analytic at $z_0$, then the series

        \begin{equation}
            f(z_0) + f'(z_0)(z-z_0) + \frac{f''(z_0)}{2!}(z-z_0)^2 + \cdots = \sum_{n=0}^{\infty} \frac{f^{(n)}(z_0)}{n!}(z-z_0)^n
        \end{equation}

        is called the Taylor series for f around $z_0$.
\end{boxdef}

\begin{boxtheorem}
        If f is analytic inside and on the simple closed positively oriented contour $\Gamma$ and if $z_0$ is any point inside $\Gamma$, then
        \begin{equation}
            f^{(n)}(z_0) = \frac{n!}{2\pi i} \int_{\Gamma} \frac{f(\zeta)}{(\zeta - z_0)^{n+1}}d\zeta \hspace{1cm} (n=1,2,3, \cdots )
        \end{equation}
\end{boxtheorem}

\begin{boxtheorem}
(Cauchy's Integral Formula) Let $\Gamma$ be a simple closed positively oriented contour. If $f$ is analytic in some simply connected domain $D$ containing $\Gamma$ and $z_0$ is any point inside $\Gamma$, then
\begin{equation}
f(z_0)= \frac{1}{2\pi i} \int_{\Gamma} \frac{f(z)}{z-z_0} dz
\end{equation}
\end{boxtheorem}
\noindent \hrulefill

\begin{theorem}
If f is analytic in the disk $|z-z_0|<R'$, then the Taylor series $(1)$ converges to $f(z)$ for all $z$ in this disk. 
\end{theorem}

\end{document}

其结果如下:

在此处输入图片描述

答案2

thmtools以下是与配合使用 的解决方案。无关:如果您加载,amsthm则无需加载,因为后者会为您完成此操作:amsmathmathtools

\documentclass{article}
\usepackage{amsthm, thmtools}
\usepackage{mathtools}

\usepackage[left=1.5in, right=1.5in, top=0.5in]{geometry}

\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}

\declaretheorem[sibling=definition, shaded={rulecolor=black, rulewidth=0.6pt, bgcolor={rgb}{1,1,1}},name=Definition]{boxeddef}
\declaretheorem[sibling=theorem, shaded={rulecolor=black, rulewidth=0.6pt, bgcolor={rgb}{1,1,1}},name=Theorem]{boxedthm}

\begin{document}
\title{Extra Credit}
\author{}
\maketitle

\begin{boxeddef}
    If f is analytic at $z_0$, then the series

    \begin{equation}
        f(z_0) + f'(z_0)(z-z_0) + \frac{f''(z_0)}{2!}(z-z_0)^2 + \cdots = \sum_{n=0}^{\infty} \frac{f^{(n)}(z_0)}{n!}(z-z_0)^n
    \end{equation}

    is called the Taylor series for f around $z_0$.
\end{boxeddef}

\begin{boxedthm}
    If f is analytic inside and on the simple closed positively oriented contour $\Gamma$ and if $z_0$ is any point inside $\Gamma$, then
    \begin{equation}
        f^{(n)}(z_0) = \frac{n!}{2\pi i} \int_{\Gamma} \frac{f(\zeta)}{(\zeta - z_0)^{n+1}}d\zeta \hspace{1cm} (n=1,2,3, \cdots )
    \end{equation}
\end{boxedthm}

\begin{boxedthm}
(Cauchy's Integral Formula) Let $\Gamma$ be a simple closed positively oriented contour. If $f$ is analytic in some simply connected domain $D$ containing $\Gamma$ and $z_0$ is any point inside $\Gamma$, then
\begin{equation}
f(z_0)= \frac{1}{2\pi i} \int_{\Gamma} \frac{f(z)}{z-z_0} dz
\end{equation}
\end{boxedthm}

\noindent \hrulefill

\begin{theorem}
If f is analytic in the disk $|z-z_0|<R'$, then the Taylor series $(1)$ converges to $f(z)$ for all $z$ in this disk.
\end{theorem}

\end{document} 

在此处输入图片描述

相关内容