Latex has the ability to include the contents of a file using the
lstinputlisting command. When exporting an org-mode file to latex
#+include: somefile inserts the file contents at that point in the document, this makes sense for org files, but for many files it would make more sense to use the listing command when exporting to latex. Is there a way to do this?
Edit: Here's some examples of what the org code and respective latex code would be. One file is a plain text file, the other is marked as a c file so that it gets syntax highlighting.
In the .org file:
#+INCLUDE: results.txt #+INCLUDE: main.cpp src C++
In the .tex file:
The main advantage with using the lstinputlisting over copy/pasting the file contents into the latex document is when the exported document will be edited further. The listing makes it more readable and allows easily incorporating changes made to the included files.
Edit: I've looked a little bit at exporter's source code, and I'm not sure this is possible at the moment.