I have a project in Java and I need to make a code listing in part of my LaTeX documentation with all my classes and code. What is the best way to export the code? Is it simply just copy and paste, or is there a way to export the code properly to keep all the formatting?
It's easy enough to do:
for d in `find <projectdir> -name '*.java'; do
echo "$d" >> output.txt
cat "$d" >> output.txt
done
...but what possible purpose could dumping all the code into a document serve?
If LaTeX is the target, I'd search for some formatting templates for code. It's easy enough to get text into LaTeX, but the formatting will be a different matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With