I have this command that makes gray boxes around text. How do I make sure that eveything I put as an argument there is treated as a string and gets rendered like an inline gray box?
\documentclass{article}
\usepackage{verbatim}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{color}
\newcommand*{\g}[1]{\colorbox{black!13}{\texttt{{#1}}}}
\begin{document}
\g{length(vector)}
\end{document}
\verb
? – egreg Oct 27 '20 at 15:49