I previously wrote a computer professional book in which I showed what the user typed on the console and the computer's resultant output. The way I liked to do this was with everything in courier and with the user's input in bold. Something like this:
<tt>
$ <b>echo foo</b>
foo
$
</tt>
I typed this as HTML because I don't know how to do this in Markdown (what StackExchange uses) and I don't know how to easily do it in LaTeX. I can certainly do it with \texttt{\$ \textbf{echo foo}}
, but I would rather not have to quote everything.
I don't want to use lstlisting as recommended by Using bold/italic text inside listings?, because I don't want LaTeX deciding what's bold.
Any other recommendations?
listings
, and much easier than with plainverbatim
... – clemens May 18 '13 at 14:28listings
doc and can't figure out how to highlight a particular part of a line. I've also looked at the tex.stackexchange.com/q/8851/5049 and it does seem like a lot of overhead. I gather that there is no easier way? This is, unfortunately, something that LaTeX doesn't seem to make easy. – vy32 May 18 '13 at 14:34\lstset{moredelim=[is][\bfseries]{[}{]}}
(as in the answer to the second of the linked questions) does not seem too complicated to me... – clemens May 18 '13 at 14:38