\usepackage{amsfonts, amsthm}
\usepackage[T1]{fontenc}
\usepackage{hyperref}

\newtheorem{theorem}{Theorem}
\newtheorem{xtheoreminner}{Theorem}
\newenvironment{xtheorem}[1]{%
  \renewcommand\thextheoreminner{#1}%
  \xtheoreminner
}{\endxtheoreminner}

\hypersetup{colorlinks=true, urlcolor=blue}

% https://tex.stackexchange.com/a/232188
\newcommand{\startunderscoreletter}{\catcode`_ 12\relax}
\newcommand{\stopunderscoreletter}{\catcode`_ 8\relax}

% The first argument refers to a relative path upward from a current file to
% the root of the workspace (i.e. where this `preamble.tex` file is located).
\newcommand{\lean}[3]{\href{#1/#2.html\##3}{
  \startunderscoreletter #3 \stopunderscoreletter}}
