<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using listings to include code in LaTeX</title>
	<atom:link href="http://www.tjansson.dk/?feed=rss2&#038;p=419" rel="self" type="application/rss+xml" />
	<link>http://www.tjansson.dk/?p=419</link>
	<description>Computers and physics - does it get any better?</description>
	<lastBuildDate>Thu, 09 Sep 2010 13:58:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Hung</title>
		<link>http://www.tjansson.dk/?p=419&#038;cpage=1#comment-32593</link>
		<dc:creator>Hung</dc:creator>
		<pubDate>Fri, 27 Aug 2010 09:40:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.tjansson.dk/?p=419#comment-32593</guid>
		<description>Hey, thanks for the post!</description>
		<content:encoded><![CDATA[<p>Hey, thanks for the post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: programming blog</title>
		<link>http://www.tjansson.dk/?p=419&#038;cpage=1#comment-32575</link>
		<dc:creator>programming blog</dc:creator>
		<pubDate>Sat, 24 Jul 2010 20:08:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.tjansson.dk/?p=419#comment-32575</guid>
		<description>well done tutorial. I am looking for the same...</description>
		<content:encoded><![CDATA[<p>well done tutorial. I am looking for the same&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kasper Marstal</title>
		<link>http://www.tjansson.dk/?p=419&#038;cpage=1#comment-32356</link>
		<dc:creator>Kasper Marstal</dc:creator>
		<pubDate>Mon, 17 May 2010 15:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.tjansson.dk/?p=419#comment-32356</guid>
		<description>I&#039;m using to format loads of code a thesis of mine. Just want to say thank you!!</description>
		<content:encoded><![CDATA[<p>I&#8217;m using to format loads of code a thesis of mine. Just want to say thank you!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Raybould</title>
		<link>http://www.tjansson.dk/?p=419&#038;cpage=1#comment-32111</link>
		<dc:creator>James Raybould</dc:creator>
		<pubDate>Thu, 18 Feb 2010 00:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.tjansson.dk/?p=419#comment-32111</guid>
		<description>I stumbled across this while writing up an assignment and I just wanted to thank you, its saved me a lot of time!</description>
		<content:encoded><![CDATA[<p>I stumbled across this while writing up an assignment and I just wanted to thank you, its saved me a lot of time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rasmus</title>
		<link>http://www.tjansson.dk/?p=419&#038;cpage=1#comment-31191</link>
		<dc:creator>Rasmus</dc:creator>
		<pubDate>Mon, 09 Mar 2009 15:43:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.tjansson.dk/?p=419#comment-31191</guid>
		<description>I liked Ashis&#039; layout though i enabled the frame=single key. For my own documents I often do the following when including many files (My example uses Java where different packages are used):

&lt;pre lang=&quot;latex&quot;&gt;
\newcommand{\sourceRoot}{../Java/src/}
\newcommand{\myPackage}{}
\newcommand{\myJPackage}{}
\newcommand{\sourcePackage}[2]{\subsection*{Package: #2}\renewcommand{\myPackage}{#1}\renewcommand{\myJPackage}{#2}}
\newcommand{\sourceClass}[1]{\lstinputlisting[caption=\myJPackage.#1]{\sourceRoot\myPackage/#1}}
&lt;/pre&gt;

After this the following lines can be used to include files from directories:

&lt;pre lang=&quot;latex&quot;&gt;
\lstlistoflistings
\sourcePackage{edu/psp/proteins}{edu.psp.proteins}
\sourceClass{Protein.java}
\sourceClass{ProteinConfiguration.java}
\sourceClass{AuxPrediction.java}

\sourcePackage{edu/psp/model}{edu.psp.model}
\sourceClass{CaProteinStructure.java}
\sourceClass{CurveStructure.java}
\sourceClass{NativeStructure.java}
...
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>I liked Ashis&#8217; layout though i enabled the frame=single key. For my own documents I often do the following when including many files (My example uses Java where different packages are used):</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\newcommand</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\sourceRoot</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">../Java/src/</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\newcommand</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\myPackage</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\newcommand</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\myJPackage</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\newcommand</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\sourcePackage</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">2</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\subsection*</span><span style="color: #E02020; ">{</span><span style="color: #00008B; font-weight: bold;">Package: #2</span></span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\renewcommand</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\myPackage</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">#1</span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\renewcommand</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\myJPackage</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">#2</span><span style="color: #E02020; ">}}</span>
<span style="color: #800000; font-weight: normal;">\newcommand</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\sourceClass</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">1</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\lstinputlisting</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">caption=<span style="color: #800000; font-weight: normal;">\myJPackage</span>.#1</span><span style="color: #E02020; ">]{</span><span style="color: #800000; font-weight: normal;">\sourceRoot</span><span style="color: #800000; font-weight: normal;">\myPackage</span>/#1</span><span style="color: #E02020; ">}}</span></pre></div></div>

<p>After this the following lines can be used to include files from directories:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\lstlistoflistings</span>
<span style="color: #800000; font-weight: normal;">\sourcePackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">edu/psp/proteins</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">edu.psp.proteins</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\sourceClass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">Protein.java</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\sourceClass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">ProteinConfiguration.java</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\sourceClass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">AuxPrediction.java</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\sourcePackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">edu/psp/model</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">edu.psp.model</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\sourceClass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">CaProteinStructure.java</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\sourceClass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">CurveStructure.java</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\sourceClass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">NativeStructure.java</span><span style="color: #E02020; ">}</span>
...</pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Ashish Jain</title>
		<link>http://www.tjansson.dk/?p=419&#038;cpage=1#comment-31155</link>
		<dc:creator>Ashish Jain</dc:creator>
		<pubDate>Wed, 28 Jan 2009 22:56:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.tjansson.dk/?p=419#comment-31155</guid>
		<description>Thank you so very much. Finally I have included C++ code that looks really fine.
&lt;pre lang=&quot;latex&quot;&gt;
\lstset{
	language=[Visual]C++,
	keywordstyle=\bfseries\ttfamily\color[rgb]{0,0,1},
	identifierstyle=\ttfamily,
	commentstyle=\color[rgb]{0.133,0.545,0.133},
	stringstyle=\ttfamily\color[rgb]{0.627,0.126,0.941},
	showstringspaces=false,
	basicstyle=\small,
	numberstyle=\footnotesize,
	numbers=left,
	stepnumber=1,
	numbersep=10pt,
	tabsize=2,
	breaklines=true,
	prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
	breakatwhitespace=false,
	aboveskip={1.5\baselineskip},
  columns=fixed,
  upquote=true,
  extendedchars=true,
% frame=single,
% backgroundcolor=\color{lbcolor},
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Thank you so very much. Finally I have included C++ code that looks really fine.</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\lstset</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">
	language=<span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Visual</span><span style="color: #E02020; ">]</span>C++,
	keywordstyle=<span style="color: #800000; font-weight: normal;">\bfseries</span><span style="color: #800000; font-weight: normal;">\ttfamily</span><span style="color: #800000; font-weight: normal;">\color</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rgb</span><span style="color: #E02020; ">]{</span>0,0,1</span><span style="color: #E02020; ">}</span>,
	identifierstyle=<span style="color: #800000; font-weight: normal;">\ttfamily</span>,
	commentstyle=<span style="color: #800000; font-weight: normal;">\color</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rgb</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">0.133,0.545,0.133</span><span style="color: #E02020; ">}</span>,
	stringstyle=<span style="color: #800000; font-weight: normal;">\ttfamily</span><span style="color: #800000; font-weight: normal;">\color</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rgb</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">0.627,0.126,0.941</span><span style="color: #E02020; ">}</span>,
	showstringspaces=false,
	basicstyle=<span style="color: #800000; font-weight: normal;">\small</span>,
	numberstyle=<span style="color: #800000; font-weight: normal;">\footnotesize</span>,
	numbers=left,
	stepnumber=1,
	numbersep=10pt,
	tabsize=2,
	breaklines=true,
	prebreak = <span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">raisebox</span></span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">0ex</span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">0ex</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0ex</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\ensuremath</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\hookleftarrow</span></span><span style="color: #E02020; ">}}</span>,
	breakatwhitespace=false,
	aboveskip=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">1.5<span style="color: #800000; font-weight: normal;">\baselineskip</span></span><span style="color: #E02020; ">}</span>,
  columns=fixed,
  upquote=true,
  extendedchars=true,
<span style="color: #2C922C; font-style: italic;">% frame=single,</span>
<span style="color: #2C922C; font-style: italic;">% backgroundcolor=\color{lbcolor},</span>
<span style="color: #E02020; ">}</span></pre></div></div>

]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.534 seconds -->
