카운터가 없는 정리(모든 TeX)

카운터가 없는 정리(모든 TeX)

나는 종종 LaTeX에서 정리를 사용하고 다양한 종류의 정리를 정의했습니다. 그러나 때로는 "대수학의 기본 정리"나 "털이 공 정리"와 같이 한 번만 사용되는 특정 정리를 정의하지 않는 것이 가장 좋습니다. . 인터넷에서 찾은 PDF는 다음 코드를 제안합니다.

\makeatletter
\newtheorem{@thmattr}[thm]{\theorem@attr}
\newenvironment{thmattr}[1]
{\def\theorem@attr{#1}\begin{@thmattr}}
{\end{@thmattr}}
\makeatother

유일한 문제는 카운터 정의가 필요하다는 것 thm(을 제거하여 쉽게 해결할 수 있음 [thm]) 외에도 이러한 정리에 카운터가 제공된다는 것입니다. 그래서 나는 "대수학의 기본 정리 1"을 얻었는데, 그 이름을 가진 정리가 단 하나뿐이기 때문에 말이 되지 않습니다. 그래서 질문은: 카운터 없이 어떻게 정리를 만들 수 있을까요?

답변1

단일 명명 정리가 있는 경우 가장 쉬운 방법은 다음과 같습니다.

\usepackage{amsthm}

\newtheorem*{HBT}{Hairy Ball Theorem}

~하도록 하다

\begin{HBT}
There is no nonvanishing continuous tangent vector field on 
even dimensional $n$-spheres.
\end{HBT}

당신이 원하는 것을 생산할 것입니다.

명명된 정리가 여러 개 있는 경우 찾은 것과 유사한 전략이 작동합니다.

\newtheorem*{namedthm*}{\thistheoremname}
\newcommand{\thistheoremname}{} % initialization
\newenvironment{namedthm}[1]
  {\renewcommand{\thistheoremname}{#1}\begin{namedthm*}}
  {\end{namedthm*}}

입력은 다음과 같습니다.

\begin{namedthm}{Hairy Ball Theorem}
There is no nonvanishing continuous tangent vector field on 
even dimensional $n$-spheres.
\end{namedthm}

일반적인 방법으로 속성을 부여할 수도 있습니다.

\begin{namedthm}{Hairy Ball Theorem}[Brouwer]
There is no nonvanishing continuous tangent vector field on 
even dimensional $n$-spheres.
\end{namedthm}

완전한 예; 원하는 전략을 선택하세요.

\documentclass{article}
\usepackage{amsthm}

\newtheorem*{HBT}{Hairy Ball Theorem}

\newtheorem*{namedthm*}{\thistheoremname}
\newcommand{\thistheoremname}{} % initialization
\newenvironment{namedthm}[1]
  {\renewcommand{\thistheoremname}{#1}\begin{namedthm*}}
  {\end{namedthm*}}

\begin{document}

\begin{HBT}
There is no nonvanishing continuous tangent vector field on 
even dimensional $n$-spheres.
\end{HBT}

\begin{namedthm}{Hairy Ball Theorem}
There is no nonvanishing continuous tangent vector field on 
even dimensional $n$-spheres.
\end{namedthm}

\begin{namedthm}{Hairy Ball Theorem}[Brouwer]
There is no nonvanishing continuous tangent vector field on 
even dimensional $n$-spheres.
\end{namedthm}

\end{document}

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

답변2

를 사용하면 및 정리 스타일이 ntheorem있습니다 . 이름은 선택적 인수입니다. 다음은 4가지 가능성입니다(a를 허용하지 않기 때문에 빈 스타일을 패치해야 했습니다 ).emptyemptybreaklabel separator

        \documentclass[12pt,a4paper]{article}

        \usepackage[utf8]{inputenc}
        \usepackage[T1]{fontenc}
        \usepackage{MinionPro}
        \usepackage{amsmath}
        \usepackage[svgnames, x11names]{xcolor}
        \usepackage{framed}
        \usepackage[framed, amsmath, thmmarks]{ntheorem}%
        \newcommand*\C{\mathbf C}

        \makeatletter
        \renewtheoremstyle{empty}%
          {\item[]}%
          {\item[\theorem@headerfont \hskip\labelsep\relax ##3\theorem@separator]}
        \makeatother

        \theoremheaderfont{\upshape\scshape}
        \theorembodyfont{\itshape}

        \theoremstyle{empty}
        \theoremseparator{.\,—}
        \newtheorem{namedthm}{}
        \newframedtheorem{namedfrthm}{}
        \theoremstyle{emptybreak}
        \theoremheaderfont{\bfseries\scshape}
        \theorembodyfont{\upshape\color{DarkSeaGreen4}}
        \theoremseparator{\smallskip}
        \newtheorem{NamedThm}{}
        \newframedtheorem{NamedfrThm}{}
        %\newframedtheorem{namedfrthm}}
        \begin{document}


        \begin{namedthm}[Fundamental Theorem of Algebra]
        Every polynomial with coefficients in  $ \C $ has a root in  $ \C $.  In other words,  the field of complex numbers is algebraically closed.
        \end{namedthm}

        \begin{namedfrthm}[Fundamental Theorem of Algebra]
        Every polynomial with coefficients in  $ \C $ has a root in  $ \C $.  In other words,  the field of complex numbers is algebraically closed.
        \end{namedfrthm}

        \begin{NamedThm}[Fundamental Theorem of Algebra]
        Every polynomial with coefficients in  $ \C $ has a root in  $ \C $.  In other words,  the field of complex numbers is algebraically closed.
        \end{NamedThm}

        \begin{NamedfrThm}[Fundamental Theorem of Algebra]
        Every polynomial with coefficients in  $ \C $ has a root in  $ \C $.  In other words,  the field of complex numbers is algebraically closed.
        \end{NamedfrThm}

        \end{document}

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

관련 정보