I am using the
listings package to insert code from files into my .tex document like shown here - https://stackoverflow.com/a/21344989/4647107
I have instances in my .tex document where I am inserting code from files using
\lstinputlisting and also ones where I am inserting handwritten snippets of code using
I want the inserted code (inserted in any/both of the above ways) to have a grey background.
I found this answer - https://tex.stackexchange.com/a/177019/193728 which offers a solution, but there seems to be additional grey space(as border?) around the code, especially at the top and bottom.
How do I avoid this?
Or is there a better way to do this?