<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d14090986\x26blogName\x3dThe+OneManArmy+blog\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLACK\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://asemh.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://asemh.blogspot.com/\x26vt\x3d6568046555716421046', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Wednesday, February 15, 2006

LaTeX tip of the day


If you want to want to include source code into your tex document you can always use the listings package. Listings can do all kind of fancy stuff to source code including pretty printing and boxing (see screenshot below) .



To be able to use listings, add \usepackage{listings} to the document's preample. Then at the place where you need to add the source code do:

\lstset{language=HTML,backgroundcolor=\color{yellow}}
\begin{lstlisting}
Insert HTML source code here
\end{lstlisting}

Check out the documentation here (pdf).