This question already has an answer here:
Perhaps this is a dumb question.
I write a small
pdf-book on coding and use there many examples using
But the amount of code expands text too much, for every 5 lines of text there is 10-20 lines of listings.
I wish there was a way to show code on demand (like spoiler).
May be there is some format supported by latex which would allow to do such thing ?