如何在TeX的lem定理环境中将圆括号替换为方括号
如何将LaTeX定理环境的标题括号从圆括号改为方括号
下面提供两种可行的解决方法,都能实现你想要的Lem 1 [Yoneda, 1996]格式效果:
方法1:使用amsthm包自定义定理样式
amsthm包提供了更灵活的定理格式控制能力,你可以通过自定义样式指定备注的括号类型:
\documentclass{article} \usepackage{amsthm} % 定义新定理样式,将备注的圆括号替换为方括号 \newtheoremstyle{mythmstyle} {3pt}% 定理内容上方间距 {3pt}% 定理内容下方间距 {\itshape}% 定理内容字体样式 {}% 内容缩进(无) {\bfseries}% 定理标题字体样式 {.}% 标题后的标点 {.5em}% 标题与内容的间距 {\thmname{#1}\thmnumber{ #2}\thmnote{ [#3]}}% 标题格式,这里把括号改为[] % 应用自定义样式创建lem环境 \theoremstyle{mythmstyle} \newtheorem{lem}{Lem} \begin{document} \begin{lem}[Yoneda, 1996] Let $F$ be a functor from a locally small category $\mathcal{C}$ to $\mathbf{Set}$. Then for each object $A$ of $\mathcal{C}$, the natural transformations $\mathrm{Nat}(h_{A},F) = \mathrm{Hom} (\mathrm{Hom}(A,-),F)$ from $h_{A}$ to $F$ are in one-to-one correspondence with the elements of $F(A)$. That is, $\mathrm{Nat}(h_{A},F) \cong F(A)$. Moreover, this isomorphism is natural in $A$ and $F$ when both sides are regarded as functors from $\mathcal{C} \times \mathbf{Set}^{\mathcal{C}}$ to $\mathbf{Set}$. \end{lem} \end{document}
方法2:不依赖额外包,重定义\thmnote命令
如果你不想引入新包,直接修改LaTeX默认定理环境的\thmnote命令即可:
\documentclass{article} \newtheorem{lem}{Lem} % 重定义\thmnote,将默认的圆括号替换为方括号 \renewcommand{\thmnote}[1]{ [#1]} \begin{document} \begin{lem}[Yoneda, 1996] Let $F$ be a functor from a locally small category $\mathcal{C}$ to $\mathbf{Set}$. Then for each object $A$ of $\mathcal{C}$, the natural transformations $\mathrm{Nat}(h_{A},F) = \mathrm{Hom} (\mathrm{Hom}(A,-),F)$ from $h_{A}$ to $F$ are in one-to-one correspondence with the elements of $F(A)$. That is, $\mathrm{Nat}(h_{A},F) \cong F(A)$. Moreover, this isomorphism is natural in $A$ and $F$ when both sides are regarded as functors from $\mathcal{C} \times \mathbf{Set}^{\mathcal{C}}$ to $\mathbf{Set}$. \end{lem} \end{document}
内容的提问来源于stack exchange,提问作者innokentijglum
相关产品推荐
相关产品推荐

