# How to insert inline code in Lyx

I want to add an inline text formatted as code in Lyx. For example:

"The gradient is calculated via math::gradient(v)"

I am aware of the Insert List command, but it is not what I'm looking for since the code listing is not inserted inline. I have searched everywhere, but I can't find the way to do it.

• The most common options are \verb from the LaTeX base classes, \lstinline from the listings package, or \mintinline from the minted package. I suggest using the listings package because it provides some basic highlighting customization but doesn't require an external program to be run during compilation. – siracusa Nov 8 '18 at 15:42