%
% Abstract algebraic structures.
%
+\ifx\havemjoalgebra\undefined
+\def\havemjoalgebra{1}
+
% Needed for \operatorname.
\usepackage{amsopn}
% coefficients is the first argument and whose indeterminates (a
% comma-separated list) are the second argumnt.
\newcommand*{\polyring}[2]{{#1}\left[{#2}\right]}
+
+
+\fi
%
% Good looking algorithm environments.
%
+\ifx\havemjoalgorithm\undefined
+\def\havemjoalgorithm{1}
+
% algorithmicx, for the, uh, algorithms.
\usepackage{algpseudocode}
\usepackage{algorithm}
\algrenewcommand{\algorithmiccomment}[1]{/\!/ {#1}}
+
+
+\fi
%
% Things dealing with arrows in a category. Or functions, basically.
%
+\ifx\havemjoarrow\undefined
+\def\havemjoarrow{1}
+
\input{mjo-common}
% The preimage of the second argument (a set) under the first (a function).
\newcommand*{\preimage}[2]{ #1^{-1}\of{#2} }
+
+
+\fi
+\ifx\havemjocalculus\undefined
+\def\havemjocalculus{1}
+
+
% The gradient of its argument, which should be a function from R^n to
% R (or maybe some other field).
\newcommand*{\gradient}[1]{ \nabla{{#1}} }
+
+
+\fi
%
% Only the most commonly-used macros. Needed by everything else.
%
+\ifx\havemjocommon\undefined
+\def\havemjocommon{1}
+
% Needed for \mathbb.
\usepackage{amsfonts}
\providecommand*{\intervaloc}[2]{ \left({#1},{#2}\right] } % open-closed
\providecommand*{\intervalco}[2]{ \left[{#1},{#2}\right) } % closed-open
\providecommand*{\intervalcc}[2]{ \left[{#1},{#2}\right] } % closed-closed
+
+
+\fi
% Operations used when dealing with complex numbers.
+\ifx\havemjocomplex\undefined
+\def\havemjocomplex{1}
+
% The complex conjugate of its argument.
\providecommand*{\compconj}[1]{ \overline{#1} }
+
+
+\fi
% The operator families Z(K), LL(K), etc. can technically be defined on
% sets other than cones, but nobody cares.
%
+\ifx\havemjocone\undefined
+\def\havemjocone{1}
+
\usepackage{amssymb} % \succcurlyeq and friends
\newcommand*{\gtcone}{\succ}
\newcommand*{\lecone}{\preccurlyeq}
\newcommand*{\ltcone}{\prec}
+
+
+\fi
%
% Operations that usually appear in convex optimization.
%
+\ifx\havemjoconvex\undefined
+\def\havemjoconvex{1}
+
% Needed for \operatorname.
\usepackage{amsopn}
% The "is a face of" and "is a proper face of" relations.
\newcommand*{\faceof}{ \trianglelefteq }
\newcommand*{\properfaceof}{ \triangleleft }
+
+
+\fi
%
% Euclidean Jordan algebras.
%
+\ifx\havemjoeja\undefined
+\def\havemjoeja{1}
+
% The jordan product of its two arguments.
%
% into its own LaTeX file; we probably wouldn't want to use \circ as
% a (bilinear) algebra multiplication in any other context.
\newcommand*{\jp}[2]{{#1} \circ {#2}}
+
+
+\fi
%
% Font handling that you probably want to use everywhere.
%
+\ifx\havemjofont\undefined
+\def\havemjofont{1}
+
% Allow arbitrary font sizes (prevents pdflatex warnings).
\usepackage{lmodern}
% Grab the AMS fonts, too, for things like \mathbb.
\usepackage{amsfonts}
+
+
+\fi
%
% Standard operations from linear algebra.
%
+\ifx\havemjolinearalgebra\undefined
+\def\havemjolinearalgebra{1}
+
% Needed for \lvert, \rVert, etc. and \operatorname.
\usepackage{amsmath}
% Now declare an orthogonal direct sum in terms of \oplusperp.
\newcommand*{\directsumperp}[2]{ {#1}\oplusperp{#2} }
+
+
+\fi
% x
% \end{tcblisting}
%
+\ifx\havemjolisting\undefined
+\def\havemjolisting{1}
+
+
\usepackage{listings}
\usepackage{tcolorbox}
left=2em,%
listing options={language=sage,style=sage},%
listing file=sage_listings/#1.listing}}
+
+
+\fi
%
% Things that fit absolutely nowhere else.
%
+\ifx\havemjomisc\undefined
+\def\havemjomisc{1}
+
\usepackage{amsmath}
% absolute value, and the meaning of card(X) is clear at once, so we
% prefer the latter.
\newcommand*{\card}[1]{ \operatorname{card} \of{{#1}} }
+
+
+\fi
%
% Case 2 (x < 0): derp.
%
+\ifx\havemjoproofbycases\undefined
+\def\havemjoproofbycases{1}
+
% Used below to define pcases. The ``loadonly'' parameter prevents
% a very bad interaction with the beamer document class.
\def\thiscase{#1}%
\item \hfill\par\vspace{\singleblskip}
}
+
+
+\fi
%
% Unnumbered versions of the mjo-theorem environments.
%
+\ifx\havemjotheoremstar\undefined
+\def\havemjotheoremstar{1}
+
\usepackage{amsthm}
\theoremstyle{remark}
\newtheorem*{remark*}{Remark}
+
+
+\fi
% The standard corollary, definition, theorem, etc. that we all define
% in every single paper.
%
+\ifx\havemjotheorem\undefined
+\def\havemjotheorem{1}
+
\usepackage{amsthm}
\theoremstyle{remark}
\newtheorem{remark}{Remark}
+
+
+\fi
%
% Standard topological operations.
%
+\ifx\havemjotopology\undefined
+\def\havemjotopology{1}
+
% Needed for \operatorname.
\usepackage{amsopn}
% And the ``boundary of'' operator.
\newcommand*{\boundary}[1]{ \operatorname{bdy}\of{{#1}} }
+
+
+\fi