0

I am trying to remove the number from proof, but I could not. When I used amsthm package I got several errors. How to remove numbering of proofs without using amsthm package?

\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}
14
  • 2
    Welcome to TeX SX! You can use the ntheorem package, which defines an unnumbered theorem style. But probably you should post a minimal (yet complete) code reproducing your problem.
    – Bernard
    Jul 28, 2021 at 21:14
  • How to use ntheorem package?
    – memo
    Jul 28, 2021 at 21:22
  • With \usepackage in the preamble. However, I'm very surprised that amsthm numbers proofs. There must be something in your preamble that induces this behaviour.
    – Bernard
    Jul 28, 2021 at 21:25
  • 1
    Amsthm comes with a proof env, in ntheorem you have to make the proof environment yourself using a suitable theorem style. Both packages have manuals you can consult.
    – daleif
    Jul 28, 2021 at 21:35
  • 2
    Perhaps I'm blind, but the code doesn't show any \usepackage{amsthm}, so the question doesn't make any sense. As already noted, the amsthm environment proof doesn't number anything. This question should thus be a candidate for deletion. Jul 28, 2021 at 22:10

1 Answer 1

3

How about this? enter image description here The following tex file was modified from yours at those three commented lines:

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.