  We study direct and indirect magnetoexcitons in Rydberg states in monolayers
and heterostructures of transition-metal dichalcogenices (TMDCs) in an external
magnetic field, applied perpendicular to the monolayer or heterostructures. We
calculate binding energies of magnetoexcitons for the Rydberg states 1$s$,
2$s$, 3$s$, and 4$s$ by numerical integration of the Schr\"{o}dinger equation
using the Rytova-Keldysh potential for direct magnetoexcitons and both the
Rytova-Keldysh and Coulomb potentials for indirect magnetoexcitons. Latter
allows understanding the role of screening in TMDCs heterostructures. We report
the magnetic field energy contribution to the binding energies and diamagnetic
coefficients (DMCs) for direct and indirect magnetoexcitons. The tunability of
the energy contribution of direct and indirect magnetoexcitons by the magnetic
field is demonstrated. It is shown that binding energies and DMCs of indirect
magnetoexcitons can be manipulated by the number of hBN layers. Therefore, our
study raises the possibility of controlling the binding energies of direct and
indirect magnetostrictions in TMDC monolayers, bilayers and heterostructures
using magnetic field and opens an additional degree of freedom to tailor the
binding energies and DMCs for heterostructures by varying the number of hBN
sheets between TMDC layers. The calculations of the binding energies and DMCs
of indirect magnetoexcitons in TMDC heterostructures are novel and can be
compared with the experimental results when they will be available.
