I have some Java and C source codes and I want to include them in my
.tex document. I can't simply copy and paste them into my document: In fact, doing this way, the code won't appear with the right spacings and indentations. I'd like that the source code does appear the same way it looks when opened in any text editor.
Is there a simple way to do it? Is there a macro (for the plain format) that takes care of that automatically?