Thursday, July 14, 2011

Adding Source Code in Latex

One of my favorite sites for quick Latex reference is Wikibook. Today I got a new package listings which can insert directly form a source code file and generate necessary formatting in Latex document. Just use the package in your Latex document file :

\usepackage{listings}


And then use the following command where you want to place code :

\lstinputlisting{myfile.cpp}


For more details see the link :
http://en.wikibooks.org/wiki/LaTeX/Packages/Listings

Also take a look in the following link for writing pseudo-code and algorithms in Latex.
http://en.wikibooks.org/wiki/LaTeX/Algorithms_and_Pseudocode

1 comment:

  1. Wow greater software for us and also good idea. Now you need another good pdf editor download for pc? and If you need another software such as free antivirus, editr, zip, best antivirus free download and another free software. Please click here for visit this website.

    ReplyDelete