# Using color and background color together

I'm trying to use color and background color together. But, for example, the following is not working - showing only a black box. What I may be missing here and how can it be fixed.?

Remark: I'm using MikTeX (with default installation) on my Windows-10

\documentclass{article}
\usepackage{amsmath}
\title{\LaTeX}

\begin{document}
$\colorbox{black}{\color{white}\LaTeX}$

\end{document}

Desired output: Something like the following:

• After loading xcolor package, it works on texlive. Does it make any difference by loading it in MikTeX? – Alan Xiang Jan 15 at 5:06
• The same is at MikTeX. – Zarko Jan 15 at 6:26
• @AlanXiang Your suggestion worked on MikTeX, as well. It also worked with color package. – nam Jan 15 at 15:05
• your example does not produce a black box, it will give an undefined command error for \colorbox so your question is very misleading. – David Carlisle Jan 15 at 15:39
• @DavidCarlisle When I use color package, following works on my MikTeX installation on Windows-10. Am I not be doing something right here?: \documentclass{article} \usepackage{amsmath} \usepackage{color} \begin{document} $\colorbox{black}{\color{white}\LaTeX}$ \end{document} – nam Jan 15 at 15:54

$\colorbox{black}{\color{white}\textit{\LaTeX}} % <---$