I would like to write the complexity classes P, NP, NP-complete and NP-hard in LaTex with the mathematical format as follows:
\mathcal
The answer is:
$\mathcal{N}$ $\mathcal{NP}$ $\mathcal{NP}$-complete $\mathcal{NP}$-full
\mathcal. See the comprehensive list of LaTeX symbols to find which one is closest. – Andrew Swann May 11 '19 at 11:08