I am writing a book containing tutorials and I need to show code:
Write this:
\begin{verbatim}
function doit() {
console.log("Hello");
}
\end{verbatim}
And then add these lines:
\begin{verbatim}
function doit() {
var s = "Hello";
console.log(s);
}
\end{verbatim}
I would like to highlight var s = "Hello"; so that it is clear it is the new code added. I would like to set a different color for this text so the new line appears black and the rest appears grey.
How do I achieve this?
This is with a very standard LaTeX document, so I did not include the whole file. fg


listingsand so on. – Sep 25 '19 at 15:55