我第一次尝试这个\newenvironment{axioma}[2]{\newtheorem*{#1}{#2} \begin{#1}}{\end{#1}}
。没有用。
然后我尝试\newenvironment{axioma}[1]{\newcommand{\axiomhead}{\newtheorem*{kkk}{#1}} \axiomhead \begin{kkk}}{\end{kkk}}
它只能工作一次。当我使用第二次调用时,它说kkk is already defined
。我该如何修复它?
答案1
将标签定义为变量。您只需要一个定理环境。
\documentclass{article}
\usepackage{amsthm}
\newcommand{\axiomname}{}
\newtheorem*{axiominner}{\axiomname}
\newenvironment{axioma}[1]
{\renewcommand{\axiomname}{#1}\axiominner}
{\endaxiominner}
\begin{document}
\begin{axioma}{Extensionality}
$A=B$ if and only if ...
\end{axioma}
\begin{axioma}{Choice}
This is complicated.
\end{axioma}
\end{document}