  We give a complete classification of twists of supersymmetric Yang--Mills
theories in dimensions $2\leq n \leq 10$. We formulate supersymmetric
Yang--Mills theory classically using the BV formalism, and then we construct an
action of the supersymmetry algebra using the language of $L_\infty$ algebras.
For each orbit in the space of square-zero supercharges in the supersymmetry
algebra, under the action of the spin group and the group of R-symmetries, we
give a description of the corresponding twisted theory. These twists can be
described in terms of mixed holomorphic-topological versions of Chern--Simons
and BF theory.
