0

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}
  • 1
    Do you mean something like \verb? – egreg Oct 27 '20 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.