案中案证明

案中案证明

我有以下 MWE:

\documentclass{article}

\usepackage{mathtools,amsthm}
\newtheoremstyle{case}{}{}{}{}{}{:}{ }{}
\theoremstyle{casep}
\newtheorem{casep}{Case}

\begin{document}
    \begin{proof}
        \begin{casep}
            case 1
            \begin{casep}
                case 1.i
            \end{casep}
            \begin{casep}
                case 1.ii
            \end{casep}
        \end{casep}
    \begin{casep}
        case 2
    \end{casep}
    \end{proof}
\end{document}

现在,我希望将案件内的案件视为子案件。但是,正如您从此屏幕截图中看到的那样,案件内案件被视为单独的案件。如何解决这个问题?

答案1

我实际上只是在研究 Bernard 关于使用枚举环境而不是定理环境的评论。您可以使用该enumitem包创建一个新的枚举环境,该环境可以嵌套并且看起来像您想要的那样。

我认为以下内容或多或少满足了您的要求:

\documentclass{article}

%\usepackage{parskip} %% To test compatibility with different parskip/parindent values

\usepackage{amsthm}

\usepackage{enumitem}
\newlist{casesp}{enumerate}{3} %% new list environment based on enumerate with a max depth of 3
%% Setting parameters for this list environment
\setlist[casesp]{align=left, %% alignment of labels
                 listparindent=\parindent, %% same indentation as in normal text
                 parsep=\parskip, %% same parskip as in normal text
                 font=\normalfont\bfseries, %% font used for labels
                 leftmargin=0pt, %% total amount by which text is indented
                 labelwidth=0pt, %% width of labels (=how much they stick out on the left because align=left)
                 itemindent=.4em,labelsep=.4em, %% space between label and text
%                 topsep=??, %% vertical space above and below list
                 partopsep=0pt, %% extra vertical space above and below if separate paragraph
%                 itemsep=??, %% vertical space after each item
                 }
%% Setting labels (and reference formats) for each depth separately
%% N.B. ref is needed even if you don't want to refer to cases because \thecasespi(i) uses it
\setlist[casesp,1]{label=Case~\arabic*:,ref=\arabic*}
\setlist[casesp,2]{label=Case~\thecasespi.\roman*:,ref=\thecasespi.\roman*}
\setlist[casesp,3]{label=Case~\thecasespii.\alph*:,ref=\thecasespii.\alph*}

\begin{document}

\begin{proof}
    One of several things must hold, and we can perform this proof by considering each of these cases separately.

    \begin{casesp}
    \item
        This is the first case. 
        It consists of two subcases that have the same number with an additional roman number added to them.
        \begin{casesp}
        \item
            \label{similarcase}
            This is the first subcase and it is labelled so we can refer to it later. 
            It also spans more than one paragraph.

            This is the second paragraph of this subcase. 
            Notice how it is indented just like it would be if it weren't part of an item in an enumeration?
        \item By some symmetry, this subcase is in fact completely analogous to case~\ref{similarcase}.
        \end{casesp}
    \item
        The second case is relatively straightforward.
        I added some extra words to it to ensure that it would span at least two lines.
    \end{casesp}

    This paragraph wraps up the proof by noting that some conclusion holds in each of the cases that were considered.
\end{proof}

\end{document}

结果如下:

在此处输入图片描述

\setlist[casesp]{...}如果你不喜欢这个外观,你可以调整很多旋钮。请参阅enumitem 文档了解更多信息。

相关内容