<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rob Golding &#187; latex</title>
	<atom:link href="http://www.robgolding.com/blog/category/latex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robgolding.com</link>
	<description>Technology Consultant</description>
	<lastBuildDate>Mon, 07 Jun 2010 22:04:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Custom Section Numbering in LaTeX</title>
		<link>http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/</link>
		<comments>http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 22:54:16 +0000</pubDate>
		<dc:creator>Rob Golding</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://www.robgolding.com/?p=183</guid>
		<description><![CDATA[For our last coursework (which was for a really interesting compilers module), I chose to present my answers in LaTeX. It's been a very steep learning curve, but I'm extremely happy with the results. I don't even mind the slight drop in productivity that's caused by my uncontrollable urge to stop and admire my document [...]]]></description>
			<content:encoded><![CDATA[<p>For our last coursework (which was for a really interesting <a title="G52CMP" href="http://www.cs.nott.ac.uk/~nhn/G52CMP/" target="_blank">compilers</a> module), I chose to present my answers in <a title="LaTeX" href="http://www.latex-project.org/" target="_blank">LaTeX</a>. It's been a very steep learning curve, but I'm extremely happy with the results. I don't even mind the slight drop in productivity that's caused by my uncontrollable urge to stop and admire my document every so often! One thing that had me stuck for a while, however, was the automatic section numbering system.</p>
<p>To answer the questions for the compilers coursework, I wanted my <em>section</em>s to be numbered (1, 2, 3), my <em>subsection</em>s to be numbered (a, b, c), and my <em>subsubsection</em>s to be numbered (i, ii, iii). This numbering pattern matches that which is given in the question paper, whereby a number of nested <em>enumerate</em>s were used. The default LaTeX section numbering however is (1, 1.1, 1.1.1). I finally found a way to alter this default behaviour by using the following code in the preamble:</p>
<pre class="latex"> <span style="color: #800000; font-weight: normal;">\renewcommand</span>{<span style="color: #2222D0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\thesubsection</span>}{(<span style="color: #800000; font-weight: normal;">\alph</span>{subsection})</span>}
&nbsp;
<span style="color: #800000; font-weight: normal;">\renewcommand</span>{<span style="color: #2222D0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\thesubsubsection</span>}{<span style="color: #800000; font-weight: normal;">\roman</span>{subsection}.</span>}</pre>
<p>This code modifies the way that the counters for subsections and subsubsections are printed (section counters are correct when left at the default).</p>
<p>I hope this saves someone even the few minutes it took me to work this out, once I'd applied some logic! It's very useful to know that LaTeX has a counter for <strong>everything</strong>. <a title="Counters in LaTeX" href="http://texblog.wordpress.com/2007/07/25/counters-in-latex/">This particular post</a> was very helpful in working out which ones to alter, and how.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://delicious.com/post?url=http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/&amp;title=Custom+Section+Numbering+in+LaTeX" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/&amp;title=Custom+Section+Numbering+in+LaTeX" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/&amp;title=Custom+Section+Numbering+in+LaTeX" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/&amp;title=Custom+Section+Numbering+in+LaTeX" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/&amp;t=Custom+Section+Numbering+in+LaTeX" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Custom+Section+Numbering+in+LaTeX+-+http://tinyurl.com/yc26pbq+&amp;source=shareaholic" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/&amp;n=Custom+Section+Numbering+in+LaTeX&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<img src="http://www.robgolding.com/?ak_action=api_record_view&id=183&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.robgolding.com/blog/2010/02/28/custom-section-numbering-in-latex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
