정리가 아닌 항목에 대해 "정리"와 같은 번호 매기기 사용

정리가 아닌 항목에 대해 "정리"와 같은 번호 매기기 사용

이것은 아마도 1) \begin{equation}에 내장된 것이 아니라 정리 카운터(및 관련 "스타일")를 사용하여 특정 방정식에 번호를 매기고 싶습니다. MWE에 따라 방정식(1.1)은 1.3(괄호 없이 굵은 글씨)으로 표시됩니다. 그리고 2) 방정식 번호 매기기에서 \split이 하는 것처럼 정리 번호 매기기 "분할"을 표시하거나 일련의 방정식을 중심으로 표시하는 것이 가능합니까? 적절한 번호 매기기(MWE에서 1.2로 표시됨)를 제공하기 위해 \newtheoremstyle을 해킹했지만 이 번호 매기기는 정렬된 방정식 외부에 있습니다. 무엇을/어디에서 조정해야 할지 잘 모르겠습니다. 어떤 아이디어라도 크게 감사하겠습니다.

    \documentclass[12pt,leqno]{book}

    \usepackage{amsmath, mathtools,amssymb,amscd,amsthm,amstext}
    \usepackage{indentfirst}
    \usepackage{changepage}

    % HACKING \adjustwidth so that it has equal vertical whitespace above/below
    \usepackage{etoolbox}
    \makeatletter
    \apptocmd\adjustwidth{\@inlabelfalse\@newlistfalse}
    \makeatother

    \setlength\parindent{1.2cm}

    % Indentation
    \def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
    \let\endchangemargin=\endlist 

    % \swapnumbers puts number ahead of heading - as in 3.4 Definition, rather than Definition 3.4
    \swapnumbers

    % Redefine theorem style
    \newtheoremstyle{mytheoremstyle} % name
        {\topsep}                    % Space above
        {\topsep}                    % Space below
        {\itshape}                   % Body font
        {5mm}                 % Indent amount
        {\bfseries}                  % Theorem head font
        {.}                          % Punctuation after theorem head
        {0.5em}                      % Space after theorem head
        {}                           % Theorem head spec (can be left empty, meaning ‘normal’)
    \theoremstyle{mytheoremstyle}
    \newtheorem{theorem}{Theorem}[chapter] 
    \newtheorem{corollary}[theorem]{Corollary}

    % Creates a theorem-numbered entry
    \newtheoremstyle{dotless}
       {}
       {}
       {}
       {}
       {\bfseries}
       {}
       { }
       {}
    \theoremstyle{dotless}
    \newtheorem{line_eq}[theorem]{}

    \begin{document}
    \chapter{}

    The next result is also an almost immediate consequence of the preceding theorem.

    % Corollary 2.5
    \begin{adjustwidth}{.6cm}{.6cm}
    \begin{corollary}
    The additive inverse of an element $a$ of a ring $R$, whose existence is
    asserted by Property \textup{\textbf{P}}$_4$, in unique.
    \end{corollary}

    \noindent\textsc{proof}. To prove this statement, suppose that $a+x= 0$ and that
    $a+y=0$. Then $a=x=a+y$, and one of the cancellation laws of addition shows
    at once that $x=y$.
    \end{adjustwidth}
    \vspace{5mm}

    \noindent Here's some statements:

    \begin{line_eq}
       \begin{align*}
          &(\textup{i})   &      -(-a) &= a,       \\
          &(\textup{ii})  &     -(a+b) &= -a-b,    \\
          &(\textup{iii}) &     -(a-b) &= -a+b,    \\
          &(\textup{iv})  &   (a-b)-c  &= a-(b+c). \\
       \end{align*}
    \end{line_eq}

    \noindent
    Let us prove the second of these ...
    \begin{equation}
       a = -(-a)
    \end{equation}
    \end{document}

답변1

최소한이 아닌 MWE에 대해 유감스럽게 생각하지만 다소 포괄적인 예를 보여주고 싶었습니다. 나의 바람은 정리, 추론, 정의, 그리고특정한방정식은 한 장의 모든 섹션에 걸쳐 동일한 카운터에서 작동하고 다음 장에서 재설정됩니다. 나는 코드의 중요한 부분을 보여주기 위해 예제를 자체적으로 문서화하려고 시도했습니다. 아마도 Latex의 세부 사항을 설명하는 마지막 사람일 것이기 때문입니다. 원래 게시물에서 앞서 언급한 두 가지 질문이 모두 여기에서 해결되었습니다. 내가 구상한 대로 이 작업을 수행할 수 있도록 의견을 주신 분들께 감사드립니다.

  \documentclass[12pt, leqno]{book}
  \usepackage{mathtools,amsthm} 
  \usepackage{changepage} % Use the \adjustwidth environment
  \usepackage{enumerate}
  \usepackage[shortlabels]{enumitem}

  %% Set equation numbering to chapter, resetting
  %% on next chapter
  \numberwithin{equation}{chapter} 

  % Define theorem style - indentation + italics
  \newtheoremstyle{mytheoremstyle}
      {\topsep}
      {\topsep}                    
      {\itshape}                   
      {5mm}                      
      {\bfseries}                  
      {.}                          
      {0.5em}                      
      {}                           
  \theoremstyle{mytheoremstyle}
  \newtheorem{theorem}[equation]{Theorem}      %% Theorems and Corollaries are 
  \newtheorem{corollary}[equation]{Corollary}  %% now tied to equation numbering

  % Define definition style - indentation only
  \newtheoremstyle{mydefinitionstyle} 
      {\topsep}                       
      {\topsep}                       
      {}                              
      {5mm}                           
      {\bfseries}                     
      {.}                             
      {0.5em}                         
      {}                              
   \theoremstyle{mydefinitionstyle}
   \newtheorem{definition}[equation]{Definition}  %% Defn tied to equation numbering

  %% Define tagform to remove brackets/braces around equation tag
  \newtagform{nobrackets}[\textbf]{}{}

  %% Apply tagform to document
  \usetagform{nobrackets}

  %% Inserts spaces, as in "\blank{3cm}"
  \newcommand{\blank}[1]{\hspace*{#1}}  

  \begin{document}
  \chapter{Fundamentals}
  \section{Basic Concepts}

  Start with an equation:
  \begin{equation} %% Equation 1.1
     1 = 1 + 0
  \end{equation}
  We next prove the following theorem.

  \begin{adjustwidth}{.6cm}{.6cm} %% Theorem 1.2
  \begin{theorem} 
     \textsc{(Cancellation Laws of Addition)}. If $a$, $b$, and $c$ are elements of a ring $R$, 
             the following are true:
  \begin{enumerate}[label=\textup{(}\roman*\textup{)}]
     \item If $a+c = b+c$, then $a=b$,
     \item If $c+a=c+b$, then $a=b$.
  \end{enumerate}
  \end{theorem}
  \noindent \textsc{proof}. We proceed to prove the first statement of this theorem. Let us therefore assume that 

  \usetagform{default} %% Reset equation numbering to "default" behavior
  \begin{equation}
     a + c = b + c. \tag{1} %% Tag should be generated autom. but for now hard-coded
  \end{equation}
  By \textbf{P}$_4$, there exists an element $t$ of $R$ such that 
  \begin{equation}
     c + t = 0. \tag{2}
  \end{equation}
  Now if follows from Equation (1) that ...
  \end{adjustwidth}
  \vspace{5mm}
  \noindent This leads to the following corollary.

  \usetagform{nobrackets} %% Future equations now will follow "modified" behavior

  \begin{adjustwidth}{.6cm}{.6cm} %% Corollary 1.3
  \begin{corollary} 
     Given ring $R$, then for all $a,b,c \in R$, then we have the following:
  \end{corollary}
  \begin{equation}
     \begin{aligned}
        &\text{(i)}   & \blank{1cm} -(-a)    &= a, \blank{6cm}  \\
        &\text{(ii)}  & \blank{1cm} -(a+b)   &= -a-b,           \\ 
        &\text{(iii)} & \blank{1cm} -(a-b)   &= -a+b,           \\ 
        &\text{(iv)}  & \blank{1cm} (a-b)-c  &= a-(b+c).        \\
     \end{aligned}
  \end{equation}
  \end{adjustwidth}

  \begin{adjustwidth}{.6cm}{.6cm} % Definition 1.5
  \begin{definition} 
     Let $a$ be an element of a ring $R$ with unity $e$. If there exists an element
     $s$ of $R$ such that 
     \begin{equation*}
        as = sa = e,
     \end{equation*}
     then $s$ is called the \textit{multiplicative inverse} of $a$.
  \end{definition}
  \end{adjustwidth}
  \end{document}

관련 정보