Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to show terminal commands as well as command prompt commands (windows) and was wondering what is the best way to format these in latex.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

enter image description here

\documentclass{article}

\usepackage{xcolor}
\usepackage{listings}


\lstdefinestyle{DOS}
{
    backgroundcolor=\color{black},
    basicstyle=\scriptsize\color{white}\ttfamily
}

\begin{document}
Hi, I am Garbage Collector!
\begin{lstlisting}[style=DOS]
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

c:\User\Garbage Collector>
\end{lstlisting}
\end{document}
share|improve this answer
    
Nice. I trust the listings package lets the user change the color scheme (as you can do in windows) for printing something other than white text on black. –  Ethan Bolker Aug 6 '12 at 20:01
1  
@GarbageCollector: Also the c above is lower case...it is actually upper case in cmd's window. –  Matthew Kemnetz Aug 16 '12 at 16:49
1  
@MatthewKemnetz: You are correct. Thanks. –  In PSTricks we trust Aug 16 '12 at 16:56
1  
@GarbageCollector; I was just saying that to again point out that your post isn't a screen shot. It's further proof! –  Matthew Kemnetz Aug 16 '12 at 18:12
1  
@MatthewKemnetz: Yes. I understood. Thanks. –  In PSTricks we trust Aug 17 '12 at 8:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.