  We systematically study thermoelectric properties of layered MoS$_2$ by
doping, based on Boltzmann transport theory and first-principles calculations.
We obtain optimal doping region (around 10$^{19}$ cm$^{-3}$) by looking closely
to the temperature and doping level dependent thermopower, electrical
conductivity, power factor (PF) and ultimately figure of merit (ZT) coefficient
along in-plane and cross-plane directions. MoS$_2$ has a vanishingly small
anisotropy of thermopower but a big anisotropy of electrical conductivity and
electronic thermal conductivity in optimal doping region. $\kappa_e$ is
comparable to $\kappa_l$ in the plane while $\kappa_l$ dominates over
$\kappa_e$ across the plane. ZT can reach as high as 0.3 at around 700 K.
In-plane direction is demonstrated to be more preferable for thermoelectric
applications of MoS$_2$ by doping.
