use the pygementize output the tex code and use the Verbatim environment to output a very fancy code style and support almost every program language and also suport the utf-8 and support the xetex .