我试图从证明中删除编号,但做不到。当我使用amsthm
包时,我遇到了几个错误。如何在不使用amsthm
包的情况下删除证明的编号?
\documentclass[11pt]{article}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
\usepackage{amsfonts,amssymb,amsmath,microtype}
\usepackage{enumitem}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\usepackage{algorithmicx}
\usepackage{algorithm}
\usepackage{algpseudocode}
\def\NoNumber#1{{\def\alglinenumber##1{}\State #1}\addtocounter{ALG@line}{-1}}
%\usepackage{mymacro}
\usepackage[usenames,dvipsnames]{color}
\usepackage{epsfig}
\newtheorem{definition}{Definition}
\newtheorem{thm}{Theorem}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{Corollary}[thm]{Corollary}
\newtheorem{pro}[thm]{Proof}
\newtheorem{example}{Example}[section]
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\begin{document}
\begin{thm}
A
\end{thm}
\begin{pro}
B
\end{pro}
\end{document}
答案1
这个怎么样? 下面的 tex 文件是根据您的文件内容修改的,其中有三行注释:
\documentclass[11pt]{article}
\usepackage{amsthm} % <---- added this line
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
\usepackage{amsfonts,amssymb,amsmath,microtype}
\usepackage{enumitem}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\usepackage{algorithmicx}
\usepackage{algorithm}
\usepackage{algpseudocode}
\def\NoNumber#1{{\def\alglinenumber##1{}\State #1}\addtocounter{ALG@line}{-1}}
%\usepackage{mymacro}
\usepackage[usenames,dvipsnames]{color}
\usepackage{epsfig}
\newtheorem{definition}{Definition}
\newtheorem{thm}{Theorem}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{Corollary}[thm]{Corollary}
%\newtheorem{pro}[thm]{Proof} % <--- commented out this line
\newenvironment{pro}{\begin{proof}}{\end{proof}} % <-- added this line
\newtheorem{example}{Example}[section]
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\begin{document}
\begin{thm}
A
\end{thm}
\begin{pro}
B
\end{pro}
\end{document}