我想将单词“Proof”改为\begin{proof}...\end{proof}
“Solution”。我发现这样做\begin{proof}[Solution]...\end{proof}
可以解决问题。但是有没有办法定义一个新环境\begin{solution}...\end{solution}
以使其自动化。我只需要更改单词“Proof -> Solution”。其他一切都应该保持不变。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
$A^2=B^2+C^2$
\end{theorem}
\begin{proof}
$A=1, B=1, C=0$
\end{proof}
\begin{theorem}
$D^2=E^2+F^2$
\end{theorem}
\begin{proof}[Solution]
$D=1, E=1, F=0$
\end{proof}
\end{document}
答案1
只是想知道你是否只寻找
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\newenvironment{solution}{\begin{proof}[Solution]}{\end{proof}}
\begin{document}
\begin{theorem}
$A^2=B^2+C^2$
\end{theorem}
\begin{proof}
$A=1, B=1, C=0$
\end{proof}
\begin{theorem}
$D^2=E^2+F^2$
\end{theorem}
\begin{solution}
$D=1, E=1, F=0$
\end{solution}