![自定义定理环境中的粗体倾斜数字](https://linux22.com/image/408547/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%9A%E7%90%86%E7%8E%AF%E5%A2%83%E4%B8%AD%E7%9A%84%E7%B2%97%E4%BD%93%E5%80%BE%E6%96%9C%E6%95%B0%E5%AD%97.png)
使用 amsthm 包,我为我的笔记定制了一个定理环境。定理标题是粗体和倾斜的。但我还希望数字倾斜。(它已经是粗体了,但它是直立的。)在代码中,标题应该是这样的:
\textbf{\textsl{Theorem 1}.}.
答案1
您必须覆盖头部规范。
\documentclass{article}
\usepackage{amsthm}
% see https://tex.stackexchange.com/a/17555/4427
\newtheoremstyle{boldslanted}
{\topsep} % ABOVESPACE
{\topsep} % BELOWSPACE
{\itshape} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\bfseries\slshape} % HEADFONT
{.} % HEADPUNCT
{5pt plus 1pt minus 1pt} % HEADSPACE
{\thmname{#1}\ \thmnumber{#2}{\thmnote{\normalfont\ (#3)}}} % CUSTOM-HEAD-SPEC
\theoremstyle{boldslanted}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
This is a difficult theorem.
\end{theorem}
\begin{theorem}[Easy]
This is an easy theorem.
\end{theorem}
\end{document}