I would like to make inline code more distinguishable from the text surrounding it, and I thought that using a background might work (like it is done on the stackexchange pages.)
Since I use the listings package for my other code samples, I tried the inline version of listings, but the key=value pairs seem not to work in the inline version (although the documentation seems to indicate that they should).
Full example:
\documentclass{article}
\usepackage{color}
\usepackage{listings}
\begin{document}
This is a test where \lstinline[backgroundcolor=\color{yellow}]{A=1} should have a yellow background.
This, on the other hand, actually works:
\begin{lstlisting}[backgroundcolor=\color{yellow}]
A = 1
\end{lstlisting}
\end{document}
Questions:
- Can it be done with listings? And how?
- What other ways to increase the distinguishability of inline verbatim do you use?
\lstinline
as they work in thelstlisting
environment.