  We develop a fundamental theory of the long-range electrostatic interactions
in two-dimensional crystals by performing a rigorous study of the
nonanalyticities of the Coulomb kernel. We find that the dielectric functions
are best represented by $2\times 2$ matrices, with nonuniform macroscopic
potentials that are two-component hyperbolic functions of the out-of-plane
coordinate, $z$. We demonstrate our arguments by deriving the long-range
interatomic forces in the adiabatic regime, where we identify a formerly
overlooked dipolar coupling involving the out-of-plane components of the
dynamical charges. The resulting formula is exact up to an arbitrary multipolar
order, which we illustrate in practice via the explicit inclusion of dynamical
quadrupoles. By performing numerical tests on monolayer BN, SnS$_2$ and
BaTiO$_3$ membranes, we show that our method allows for a drastic improvement
in the description of the long-range electrostatic interactions, with
comparable benefits to the quality of the interpolated phonon band structure.
