\def\havemjoalgebra{1}
-% Needed for \operatorname.
-\usepackage{amsopn}
+\ifx\operatorname\undefined
+ \usepackage{amsopn}
+\fi
% The fraction field of its argument, an integral domain. The name
% "Frac" was chosen here instead of "Quot" because the latter
% This just gives us the floating ``algorithm'' environment.
\usepackage{algorithm}
+% Use "//" for comments instead of the default.
\algrenewcommand{\algorithmiccomment}[1]{/\!/ {#1}}
\def\havemjoarrow{1}
-\input{mjo-common}
+\input{mjo-common} % for \of, at least.
+
+\ifx\operatorname\undefined
+ \usepackage{amsopn}
+\fi
% The identity operator/arrow on its argument.
\newcommand*{\identity}[1]{ \operatorname{id}_{{#1}} }
+%
+% Standard calculus operations.
+%
\ifx\havemjocalculus\undefined
\def\havemjocalculus{1}
\def\havemjocommon{1}
-% Needed for \mathbb.
-\usepackage{amsfonts}
+\ifx\mathbb\undefined
+ \usepackage{amsfonts}
+\fi
-% Needed for \bigtimes.
-\usepackage{mathtools}
+\ifx\bigtimes\undefined
+ \usepackage{mathtools}
+\fi
% Place the argument in matching left/right parentheses.
\newcommand*{\of}[1]{ \left({#1}\right) }
\def\havemjocone{1}
-\usepackage{amssymb} % \succcurlyeq and friends
+\ifx\succcurlyeq\undefined
+ \usepackage{amssymb} % \succcurlyeq, \preccurlyeq
+\fi
\input{mjo-common}
\def\havemjoconvex{1}
-% Needed for \operatorname.
-\usepackage{amsopn}
+\ifx\operatorname\undefined
+ \usepackage{amsopn}
+\fi
\input{mjo-common}
\usepackage[utf8]{inputenc}
% Grab the AMS fonts, too, for things like \mathbb.
-\usepackage{amsfonts}
-
+\ifx\mathbb\undefined
+ \usepackage{amsfonts}
+\fi
\fi
\def\havemjolinearalgebra{1}
-% Needed for \lvert, \rVert, etc. and \operatorname.
-\usepackage{amsmath}
+\ifx\lvert\undefined
+ \usepackage{amsmath} % \lvert, \rVert, etc. and \operatorname.
+\fi
-% Wasysym contains the \ocircle that we use in \directsumperp.
-\usepackage{wasysym}
+\ifx\ocircle\undefined
+ \usepackage{wasysym}
+\fi
-% Part of the adjustbox package; needed to clip the \perp sign.
-\usepackage{trimclip}
+\ifx\clipbox\undefined
+ % Part of the adjustbox package; needed to clip the \perp sign.
+ \usepackage{trimclip}
+\fi
\input{mjo-common}
\def\havemjolisting{1}
-\usepackage{listings}
-\usepackage{tcolorbox}
+\ifx\lstset\undefined
+ \usepackage{listings}
+\fi
+
+\ifx\tcbuselibrary\undefined
+ \usepackage{tcolorbox}
+\fi
% Tell tcolorbox to use ``listings'' within the boxes.
\tcbuselibrary{listings}
\def\havemjomisc{1}
-\usepackage{amsmath}
+\ifx\operatorname\undefined
+ \usepackage{amsopn}
+\fi
% The cardinality of a set. The |X| notation conflicts with the
% absolute value, and the meaning of card(X) is clear at once, so we
\def\havemjotheoremstar{1}
-\usepackage{amsthm}
+\ifx\theoremstyle\undefined
+ \usepackage{amsthm}
+\fi
\theoremstyle{plain}
\newtheorem*{corollary*}{Corollary}
\ifx\havemjotheorem\undefined
\def\havemjotheorem{1}
-
-\usepackage{amsthm}
+\ifx\theoremstyle\undefined
+ \usepackage{amsthm}
+\fi
\theoremstyle{plain}
\newtheorem{corollary}{Corollary}
\def\havemjotopology{1}
-% Needed for \operatorname.
-\usepackage{amsopn}
+\ifx\operatorname\undefined
+ \usepackage{amsopn}
+\fi
\input{mjo-common}