I normally use \verb|\LaTeXe| to typeset the command \LaTeXe in my document. But now I want to frame or/and colorize the command \LaTeXe. How can we do that?
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\textcolor{blue}{text}\\ % without \verb is ok
\textcolor{blue}{\verb|\LaTeXe|}\\ % this is illegal, but I want to colorize the command \LaTeX2e
\fbox{text}\\ % without \verb is ok
\fbox{\verb|\LaTeXe|} % this is illegal too, but I want to frame around the command \LaTeXe. So how can I do that?
\end{document}
\textcolor{blue}{\texttt{\string\LaTeX2e}}and/or\fbox{\texttt{\string\LaTeX2e}}, as suggested in How to put\verbcommand inside of\textbfblock? There is also the option of usingfancyvrb, orlistings, or ... – Werner Jan 30 '15 at 04:33listingspackage but use it whenever I need to include long code. However, I like your solution\textcolor{blue}{\texttt{\string\LaTeX2e}}and\fbox{\texttt{\string\LaTeX2e}}. It does not require additional packages (y) – Say OL Jan 30 '15 at 15:32verbatimboxpackage. You can search the site, yielding things like http://tex.stackexchange.com/questions/141100/getting-verbatim-with-soft-grey-background-as-in-tex-stackexchange/141101#141101 or this: http://tex.stackexchange.com/questions/174455/typeset-source-code-with-tcolorbox/174472#174472 – Steven B. Segletes Jan 31 '15 at 12:10