\newtheorem을 사용자 정의하는 방법

\newtheorem을 사용자 정의하는 방법

\newtheorem 명령으로 생성된 환경에서 기울임꼴 텍스트 형식을 제거하는 방법이 있는지 궁금합니다.

내 코드는 다음과 같습니다.

\newtheorem{teorema}{Teorema}[subsection]

안에 \begin{document}:

\begin{teorema}
    This is a new theorem.
\end{teorema}

결과는 다음과 같습니다.

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

문제는 텍스트를 이탤릭체로 표시하고 싶지 않다는 것입니다. 어떻게 이를 달성할 수 있나요?

답변1

를 사용하면 상당히 쉽습니다 amsthm.

\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{teorema}{Teorema}[subsection]

몇 가지 이유로 인해 하위 섹션에 따라 정리 번호 매기기를 권장할 수 없습니다. 첫째, 항상 필요한 것은 아니지만 하위 섹션을 사용해야 합니다. 둘째, 수업에 장이 있으면 다음과 같은 정리로 끝납니다.숫자.

기울임꼴은 문장을 더 쉽게 찾을 수 있는 시각적 단서를 제공하기 때문에 직립형 사용을 권장할 수 없습니다.

답변2

\newtheorem작업 방식과 정의된 환경을 패치할 수 있는 방식은 \newtheorem사용 중인 문서 클래스와 패키지에 따라 다릅니다.

패키지 없이 기사 클래스를 사용하면 다음과 같은 작업을 수행할 수 있습니다.

\documentclass{article}

\newtheorem{teorema}{Teorema}[subsection]
\makeatletter
\@ifdefinable\Oldteorema{\let\Oldteorema=\teorema}%
\renewcommand\teorema{\@ifnextchar[{\teoremaopt}{\Oldteorema\normalfont}}%
\newcommand\teoremaopt[1][]{\Oldteorema[{#1}]\normalfont}%
\makeatother

\begin{document}

\begin{teorema}
    This is a new theorem.
\end{teorema}

\begin{teorema}[someone]
    This is a new theorem.
\end{teorema}


\end{document}

나는 이것이 비머와 같은 다른 문서 클래스와 작동한다는 것을 보증하지 않습니다.

다음을 사용하는 것을 고려하셨나요?amsthm-패키지\newtheoremstyle/ -명령 으로 \theoremstyle?

관련 정보