Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added workaround for cleveref and ntheorem #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions sample.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down