
Quiero cambiar la fuente del número a \itshape
, por ejemplo, quiero obtener el Teorema {\itshape 1.1}. ¿Hay alguna forma de hacerlo en el entorno del teorema?
Respuesta1
Suponiendo que sólo esté utilizando el amsthm
paquete en su documento, así es como se puede hacer.
Si desea este comportamiento sólo para el estilo de teorema "simple", agregue las siguientes líneas en su preámbulo para redefinir el estilo simple:
\makeatletter
\renewcommand{\th@plain}{%
\renewcommand\@upn{\textit}%
\itshape%
}
\makeatother
y tu estas listo.
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}
Producción
En cambio, si desea este comportamiento para todos los estilos de teoremas, reemplace el código anterior con
\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}
Producción
Respuesta2
Aquí hay una forma con ntheorem
el paquete. Redefino el plain
estilo:
\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}
Respuesta3
Si no estás utilizando ningún paquete especializado en teoremas, puedes hacer
\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}