I'm participating in a programming contest and we are allowed to prepare a team reference document which must not exceed 25 pages. Typically we will prepare many code templates and this year I'm trying to use latex to typeset these C++ codes and I want to know what's the best way to do that.
Some requirements:
- Since there is a page length limit I want to typeset my codes as compact as possible.
- I want to have the C++ codes syntax highlighted.
- If it is possible to generate a compact table of content in front, it would be best.