정리 후 숫자의 글꼴을 변경하는 방법

정리 후 숫자의 글꼴을 변경하는 방법

숫자의 글꼴을 로 변경하고 싶습니다 \itshape. 예를 들어 Theorem {\itshape 1.1}을 얻고 싶습니다. 정리 환경에서 할 수 있는 방법이 있나요?

답변1

amsthm문서에서 패키지 만 사용한다고 가정하면 다음과 같이 할 수 있습니다.

"일반" 정리 스타일에 대해서만 이 동작을 원하는 경우 프리앰블에 다음 행을 추가하여 일반 스타일을 다시 정의하십시오.

\makeatletter
\renewcommand{\th@plain}{%
  \renewcommand\@upn{\textit}%
  \itshape%
}
\makeatother

이제 끝났습니다.

MWE

\documentclass{article}
\usepackage{amsthm}

\makeatletter
\renewcommand{\th@plain}{%
  \renewcommand\@upn{\textit}%
  \itshape%
}
\makeatother

\newtheorem{thm}{Theorem}[section]

\begin{document}

\section{Test}

\begin{thm}
This is a theorem.
\end{thm}

\end{document} 

산출

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

대신, 모든 정리 스타일에 대해 이 동작을 원하면 위 코드를 다음으로 바꾸십시오.

\makeatletter
  \renewcommand\@upn{\textit}
\makeatother

MWE

\documentclass{article}
\usepackage{amsthm}

\makeatletter
  \renewcommand\@upn{\textit}
\makeatother

\newtheorem{thm}{Theorem}[section]
\theoremstyle{remark}
\newtheorem{rmk}[thm]{Remark}

\begin{document}

\section{Test}

\begin{thm}
This is a theorem.
\end{thm}

\begin{rmk}
And this is a remark.
\end{rmk}

\end{document} 

산출

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

답변2

패키지를 사용하는 방법은 다음과 같습니다 ntheorem. 스타일 을 재정의합니다 plain.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage[amsthm, thmmarks, thref]{ntheorem}
\usepackage{cleveref}

\makeatletter
\renewtheoremstyle{plain}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ \textit{##2}\theorem@separator]}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ \textit{##2}\ (##3)\theorem@separator]}
\makeatother
\newtheorem{thm}{Theorem}[section]

\begin{document}

\section{A first section}
\begin{thm}\label{testthm}
This is a test theorem.
\end{thm}
We see in \cref{testthm}…

\end{document} 

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

답변3

정리에 특화된 패키지를 사용하지 않는 경우 다음을 수행할 수 있습니다.

\documentclass{article}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\@opargbegintheorem}{#2}{\textit{#2}}{}{}
\patchcmd{\@begintheorem}{#2}{\textit{#2}}{}{}
\makeatother

\newtheorem{thm}{Theorem}

\begin{document}
\begin{thm}
Something
\end{thm}
\end{document}

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

관련 정보