I am currently producing a new edition of an old book of mine; this new book will incorporate code samples from several different computing environments. I can using the listings package quite happily for this.
My question - and it's more a general typesetting/layout question than a TeX/LaTeX question - is how do you best differentiate the two codes in your document? I can of course say so in the text:
This is how it's done in foogle:
\begin{lstlisting}[style=foogle]
\end{lstlisting}
and this is how it's done in scronk:
\begin{lstlisting}[style=scronk]
\end{lstlisting}
assuming I've defined the styles foogle and scronk. And I can set up the styles so that they have different borders, backgrounds, etc. The idea is that glancing over the page it should be immediate to see what code sample relates to which language.
Is there a "best practice" for this sort of thing? Most texts concentrate on just one language, so this is rarely an issue.
Note: the book will be printed in black and white, with only a few pages in color.
Following from Jubobs' comments, what would be nice is a sort of gray box with a title indicating the system being used in the bottom left of the frame, with an appearance (except for position) of How to insert title in mdframed?, and that frame containing the code. I don't need all the functionality of listings; in fact something like fancyvrb would do fine, if it allowed colored backgrounds.
And in fact it turns out that the tcolorbox does provide an easy way to put a title on a frame, as shown here: Combining `tikzpicture` and `lstlisting` and in fact I can make this work. I need to do some more fiddling to work out the best way of doing it, though.
Foogle Listing nandScronk Listing k. – Sean Allred Apr 29 '14 at 03:19tcolorboxes, but use tints of complementary colours (e.g. aquamarine and red-orange) for the two languages in question. That way, your readers should be able to differentiate the two immediately. Hmmm... perhaps your question would fit better on GraphicDesign.SX... – jub0bs Apr 29 '14 at 07:11