  In this work, we present new catalogs of M giant and M dwarf stars from the
LAMOST DR5. In total, 39,796 M giants and 501,152 M dwarfs are identified from
the classification pipeline. The template-fitting results contain M giants with
7 temperature subtypes from M0 to M6, M dwarfs with 18 temperature subtypes
from K7.0 to M8.5 and 12 metallicity subclasses from dMr to usdMp. We
cross-matched our M-type catalog with the 2MASS and WISE catalog to obtain
infrared magnitude and colors. Adopting the distances derived from the
parallaxes in \gaia{} DR2, the M_G vs. (G_bp-G_rp)_0 diagram shows that there
are also early-type stars and white dwarf-M dwarf binaries included in our M
type stars sample, with a contamination rate of about 4.6% for M giants and
0.48% for M dwarfs. We found that CaH spectral indices are an efficient
selection criteria for carbon stars. A total of 289 carbon stars were
identified from the M giants sample, and further confirmed by LAMOST spectra.

Astrophysics of Galaxies;Solar and Stellar Astrophysics