From a30a1aa9ac37cd010a741825e204978d0b20c475 Mon Sep 17 00:00:00 2001 From: "Marian-Andrei RIZOIU (poseidon)" Date: Wed, 1 Feb 2023 11:49:29 +1100 Subject: [PATCH] added workaround for cleveref and ntheorem --- sample.tex | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sample.tex b/sample.tex index 3e5069c..9c1fb58 100644 --- a/sample.tex +++ b/sample.tex @@ -23,6 +23,34 @@ \usepackage{jmlr2e} +%%%% WORKAROUND FOR CLEVERREF AND NTHEOREM +% If you want to use modern packages such as `ntheorem` and `cleveref`, you'll need a workaround. +% We will undefine the theorems and redefine them after we loaded the packages. +\usepackage{ntheorem} +\usepackage[nameinlink,capitalize]{cleveref} + +% undefine theorems +\makeatletter +\def\cleartheorem#1{\expandafter\let\csname#1\endcsname\relax + \expandafter\let\csname c@#1\endcsname\relax +} +\makeatother +\cleartheorem{example} +\cleartheorem{theorem} +\cleartheorem{lemma} +\cleartheorem{proposition} +\cleartheorem{definition} +\cleartheorem{corollary} + +% redefine theorems +\newtheorem{example}{Example} +\newtheorem{theorem}{Theorem} +\newtheorem{lemma}[theorem]{Lemma} +\newtheorem{proposition}[theorem]{Proposition} +\newtheorem{corollary}[theorem]{Corollary} +\newtheorem{definition}[theorem]{Definition} +%%%% END WORKAROUND + % Definitions of handy macros can go here \newcommand{\dataset}{{\cal D}}