  We discuss in detail level/rank duality in three-dimensional Chern-Simons
theories and various related dualities in three-dimensional Chern-Simons-matter
theories. We couple the dual Lagrangians to appropriate background fields
(including gauge fields, spin$_c$ connections and the metric). The non-trivial
maps between the currents and the line operators in the dual theories is
accounted for by mixing of these fields. In order for the duality to be valid
we must add finite counterterms depending on these background fields. This
analysis allows us to resolve a number of puzzles with these dualities, to
provide derivations of some of them, and to find new consistency conditions and
relations between them. In addition, we find new level/rank dualities of
topological Chern-Simons theories and new dualities of Chern-Simons-matter
theories, including new boson/boson and fermion/fermion dualities.
