<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>LaTeX Matters</title>
	<atom:link href="http://texblog.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://texblog.org</link>
	<description>Reporting without troubles</description>
	<lastBuildDate>Fri, 27 Jan 2012 18:30:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='texblog.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/622f5463c2708cc7510d4781bd38b677?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>LaTeX Matters</title>
		<link>http://texblog.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://texblog.org/osd.xml" title="LaTeX Matters" />
	<atom:link rel='hub' href='http://texblog.org/?pushpress=hub'/>
		<item>
		<title>Adding additional structure to the list of figures/tables</title>
		<link>http://texblog.org/2012/01/18/adding-additional-structure-to-the-list-of-figurestables/</link>
		<comments>http://texblog.org/2012/01/18/adding-additional-structure-to-the-list-of-figurestables/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 07:09:55 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Figure & table]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Package]]></category>
		<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[addcontentsline]]></category>
		<category><![CDATA[addtocontents]]></category>
		<category><![CDATA[caption]]></category>
		<category><![CDATA[chapter]]></category>
		<category><![CDATA[contentsline]]></category>
		<category><![CDATA[etoolbox]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[listoffigures]]></category>
		<category><![CDATA[listoftables]]></category>
		<category><![CDATA[newcommand]]></category>
		<category><![CDATA[renewcommand]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[thechapter]]></category>
		<category><![CDATA[usepackage]]></category>

		<guid isPermaLink="false">http://texblog.org/?p=922</guid>
		<description><![CDATA[In large documents, you may end up with a pretty long list of figures or tables. In this post, I will show how to nicely structure these lists by adding subtitles. The whole thing turned out to be more tricky than I first thought, but more on that later. The my examples, I will show [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=922&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In large documents, you may end up with a pretty long list of figures or tables. In this post, I will show how to nicely structure these lists by adding subtitles. The whole thing turned out to be more tricky than I first thought, but more on that later. The my examples, I will show how to organize the list of figures by chapters. However, the code can be adapted and extended with little effort, including doing the same for the list of tables, organizing the lists by different levels (<code>part</code>, <code>section</code>) for the various <code>documentclasses</code>, the actual subtitle format (with/without name, page number), etc.</p>
<p>The main idea is to add a line to the list of figures whenever a new chapter is created. That&#8217;s relatively straight forward, we extend the <code>chapter</code> command by defining a custom command.</p>
<p><pre class="brush: latex; gutter: false; highlight: [3,4,5];">\newcommand{\newchapter}[1]{%
	\chapter{#1}
	\addcontentsline{lof}{chapter}{%
		Chapter \thechapter: #1 \vspace{10pt}
	}
}</pre></p>
<p>The lines highlighted add a full entry to the list of figures. In order to omit the page number, use <code>addtocontents</code> as follows instead.</p>
<p><pre class="brush: latex; gutter: false;">\addtocontents{lot}{\contentsline{chapter}{%
	Chapter \thechapter \vspace{10pt}}{}
}</pre></p>
<p>This is all great and easy. The problem starts, however, when individual chapters have no figures. Then, the subtitle will still be printed, however, that there is no content. This is not exactly what we want. Therefore, we add a condition on when to print the subtitle and when not. The <code>etoolbox</code> package comes in handy here, it provides &#8220;if-then-else-like&#8221; statements. Here is the <a href="http://mirror.ctan.org/macros/latex/contrib/etoolbox/etoolbox.pdf" title="Etoolbox package documentation" target="_blank">documentation</a>. Briefly, whenever a new chapter starts, we set the parameter <code>newchap</code> to true. The subtitle is printed along with the first caption added to the list of figures. Therefore, if a chapter has no figure, the subtitle will not show up in the list.</p>
<p>First, we define the boolean parameter <code>newchap</code>:</p>
<p><pre class="brush: latex; gutter: false;">\providebool{newchap}</pre></p>
<p>Next, we define an alternative chapter command <code>newchapter</code>. This time, however, instead of directly adding the subtitle to the list, we only set the boolean parameter to <code>true</code>:</p>
<p><pre class="brush: latex; gutter: false;">\newcommand{\newchapter}[1]{%
	\chapter{#1}
	\global\setbool{newchap}{true}
}</pre></p>
<p>And finally, we redefine the <code>caption</code> command. The additional definition of <code>shortcaption</code> is necessary to support the optional caption argument, the alternative short caption for the list of figures. </p>
<p><pre class="brush: latex; gutter: false;">\let\oldcaption\caption
\renewcommand{\caption}[2][\shortcaption]{%
\def\shortcaption{#2}
\ifbool{newchap}{%
	\addtocontents{lof}{\protect\contentsline{chapter}{%
		Chapter \thechapter \vspace{10pt}
	}{}}}{}
	\global\boolfalse{newchap}
	\oldcaption[#1]{#2}
}</pre></p>
<p>If you never use the optional argument of the <code>chapter</code> command (<code>chapter[alternative toc name]{real chapter name}</code>) throughout your document, this is basically it, we are done. </p>
<p>In case you use the optional augment, however, we are not quite done yet, since we redefined <code>chapter</code> and by doing so omitted some of the functionality. We can fix this issue by redefining <code>chapter</code> in a different way, similarly to what we did for <code>caption</code> which brings additional advantages. On one hand, the code becomes more consistent and on the other hand, you won&#8217;t have to change <code>chapter</code> to <code>newchapter</code> throughout your document, since we just redefine the command rather than replace it. And here is the code:</p>
<p><pre class="brush: latex; gutter: false;">\makeatletter
\newcommand{\saved@chapter}{} 
\let\saved@chapter\chapter 
\renewcommand{\chapter}{% 
  \@ifstar {\saved@chapter*}{\@dblarg\my@chapter}% 
} 
\newcommand*{\my@chapter}[2][]{% 
  \saved@chapter[#1]{#2}%
  \global\setbool{newchap}{true}
} 
\makeatother</pre></p>
<p>I got this piece of code from this <a href="http://groups.google.com/group/de.comp.text.tex/browse_thread/thread/9a3956b262a12490" target="_blank">google group</a>.</p>
<p>And here is what the final result looks like. Pretty cool, huh <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<div id="attachment_929" class="wp-caption aligncenter" style="width: 500px"><a href="http://texblog.files.wordpress.com/2012/01/lofsubtitles.png"><img src="http://texblog.files.wordpress.com/2012/01/lofsubtitles.png?w=490&#038;h=375" alt="" title="lofsubtitles" width="490" height="375" class="size-full wp-image-929" /></a><p class="wp-caption-text">List of figures with subtitles</p></div>
<p>The whole story only makes sense and works with numbered chapters, (i.e. when using the starred version: <code>\chapter*{}</code> you may run into problems or get undesired results, but you would have to try).</p>
<p>I am pretty sure there is an alternative, maybe simpler way to do the same thing. Maybe the <a href="http://mirror.ctan.org/macros/latex/contrib/tocloft/tocloft.pdf" title="Tocloft package documentation" target="_blank">tocloft package</a> has a solution. Feel free to drop a comment and let me know about it. Thanks.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/922/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=922&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2012/01/18/adding-additional-structure-to-the-list-of-figurestables/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2012/01/lofsubtitles.png" medium="image">
			<media:title type="html">lofsubtitles</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting PDF meta information</title>
		<link>http://texblog.org/2012/01/13/setting-pdf-meta-information/</link>
		<comments>http://texblog.org/2012/01/13/setting-pdf-meta-information/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 13:33:57 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Package]]></category>
		<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[hyperref]]></category>
		<category><![CDATA[pdfauthor]]></category>
		<category><![CDATA[pdfcreator]]></category>
		<category><![CDATA[pdfkeywords]]></category>
		<category><![CDATA[pdfproducer]]></category>
		<category><![CDATA[pdfsubject]]></category>
		<category><![CDATA[pdftitle]]></category>
		<category><![CDATA[usepackage]]></category>

		<guid isPermaLink="false">http://texblog.org/?p=911</guid>
		<description><![CDATA[PDFs have meta document information which usually can be read and modified using standard PDF viewers such as Acrobat Reader or Preview (Mac). In Acrobat Reader search for &#8220;Properties&#8221; in the file-menu. When creating a document using LaTeX, the hyperref package helps setting some of these information, including: Title Author Subject Creator Producer Keywords and many [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=911&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>PDFs have meta document information which usually can be read and modified using standard PDF viewers such as Acrobat Reader or Preview (Mac). In Acrobat Reader search for &#8220;Properties&#8221; in the file-menu. When creating a document using LaTeX, the <a title="hyperref package page" href="http://ctan.org/pkg/hyperref" target="_blank">hyperref</a> package helps setting some of these information, including:</p>
<ul>
<li>Title</li>
<li>Author</li>
<li>Subject</li>
<li>Creator</li>
<li>Producer</li>
<li>Keywords</li>
<li>and many other display and information options (see section 3.6 of the <a title="hyperref package documentation" href="http://mirror.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf" target="_blank">documentation</a>)</li>
</ul>
<p>&nbsp;</p>
<p><strong>Here is how:</strong></p>
<p>While loading the package, the meta information is set by specifying key-value pairs in the optional arguments field, i.e.:</p>
<p><pre class="brush: latex; light: true;">\usepackage[key1=value1, key2=value2]{hyperref}</pre></p>
<p>A complete code example:</p>
<p><pre class="brush: latex; gutter: false;">\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[pdftex,
 pdfauthor=Tom,
 pdftitle={PDF meta information},
 pdfsubject={Sample document with blind text},
 pdfkeywords={hyperref, PDF meta information},
 pdfproducer=TeXShop,
 pdfcreator=pdflatex]{hyperref}
\begin{document}
\blindtext
\end{document}</pre></p>
<p>Using the Acrobat Reader, the meta information can be read and changed through the menu item &#8220;file -&gt; properties&#8221; (or similar):</p>
<div id="attachment_919" class="wp-caption aligncenter" style="width: 500px"><a href="http://texblog.files.wordpress.com/2012/01/pdf_meta_info.png"><img class="size-full wp-image-919" title="pdf_meta_info" src="http://texblog.files.wordpress.com/2012/01/pdf_meta_info.png?w=490&#038;h=250" alt="pdf meta information" width="490" height="250" /></a><p class="wp-caption-text">PDF meta information example</p></div>
<p>A comprehensive list of options is provided in section 3.6 of the <a title="hyperref package documentation" href="http://mirror.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf" target="_blank">hyperref package documentation</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/911/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=911&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2012/01/13/setting-pdf-meta-information/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2012/01/pdf_meta_info.png" medium="image">
			<media:title type="html">pdf_meta_info</media:title>
		</media:content>
	</item>
		<item>
		<title>Strict inequalities (greater/less than) in text-mode</title>
		<link>http://texblog.org/2012/01/10/strict-inequalities-greaterless-than-in-text-mode/</link>
		<comments>http://texblog.org/2012/01/10/strict-inequalities-greaterless-than-in-text-mode/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 11:37:54 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[>]]></category>
		<category><![CDATA[<]]></category>
		<category><![CDATA[ge]]></category>
		<category><![CDATA[geq]]></category>
		<category><![CDATA[greater than]]></category>
		<category><![CDATA[le]]></category>
		<category><![CDATA[leq]]></category>
		<category><![CDATA[less than]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[textgreater]]></category>
		<category><![CDATA[textless]]></category>

		<guid isPermaLink="false">http://texblog.org/?p=851</guid>
		<description><![CDATA[Strict inequalities are widely used in math equations as well as within text for comparisons. They can be produced using the ordinary (inline) math-mode ($...$) without loading a specific package. In order to omit the math-mode within a text-paragraph, LaTeX knows text-mode commands for these symbols. Greater than (&#62;): Less than (&#60;): Non-strict inequalities ( [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=851&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Strict inequalities are widely used in math equations as well as within text for comparisons. They can be produced using the ordinary (inline) math-mode (<code>$...$</code>) without loading a specific package.</p>
<p><img src='http://s0.wp.com/latex.php?latex=c+%3E+d&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='c &gt; d' title='c &gt; d' class='latex' /></p>
<p><pre class="brush: plain; light: true;">$c &gt; d$</pre></p>
<p><img src='http://s0.wp.com/latex.php?latex=d+%3C+c&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='d &lt; c' title='d &lt; c' class='latex' /></p>
<p><pre class="brush: plain; light: true;">$d &lt; c$</pre></p>
<p>In order to omit the math-mode within a text-paragraph, LaTeX knows text-mode commands for these symbols.</p>
<p><strong>Greater than (&gt;):</strong></p>
<p><pre class="brush: latex; light: true;">\textgreater</pre></p>
<p><strong>Less than (&lt;):</strong></p>
<p><pre class="brush: latex; light: true;">\textless</pre></p>
<p>Non-strict inequalities (<img src='http://s0.wp.com/latex.php?latex=%5Cle&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='&#92;le' title='&#92;le' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cge&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='&#92;ge' title='&#92;ge' class='latex' />), however, can only be produced using the inline math mode.</p>
<p><img src='http://s0.wp.com/latex.php?latex=a+%5Cle+b&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='a &#92;le b' title='a &#92;le b' class='latex' /></p>
<p><pre class="brush: latex; light: true;">$a \le b$</pre></p>
<p><img src='http://s0.wp.com/latex.php?latex=b+%5Cge+a&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='b &#92;ge a' title='b &#92;ge a' class='latex' /></p>
<p><pre class="brush: latex; light: true;">$b \ge a$</pre></p>
<p>Finally, the equal symbol (=) is available in both text- and math-mode.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/851/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=851&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2012/01/10/strict-inequalities-greaterless-than-in-text-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>
	</item>
		<item>
		<title>bib2tex: Converting bibtex to bibitems</title>
		<link>http://texblog.org/2011/12/12/bib2tex-converting-bibtex-to-bibitems/</link>
		<comments>http://texblog.org/2011/12/12/bib2tex-converting-bibtex-to-bibitems/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 13:24:28 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Bibtex]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[bibitem]]></category>
		<category><![CDATA[citation]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[usepackage]]></category>

		<guid isPermaLink="false">http://texblog.org/?p=807</guid>
		<description><![CDATA[A friend asked me today to help him convert a bibtex-file to a bibliography (\bibitem{}), since the journal he submits his paper to doesn&#8217;t accept bibtex-files (*.bib). So what we were trying to do is to convert a set of bibtex-references of the following form (from cell): to a format that understands, e.g.: There is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=807&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A friend asked me today to help him convert a bibtex-file to a <img src='http://s0.wp.com/latex.php?latex=%5CLaTeX&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='&#92;LaTeX' title='&#92;LaTeX' class='latex' /> bibliography (<code>\bibitem{}</code>), since the journal he submits his paper to doesn&#8217;t accept bibtex-files (*.bib). So what we were trying to do is to convert a set of bibtex-references of the following form (from <a href="http://www.cell.com/abstract/S0092-8674(09)00008-7#" target="_blank">cell</a>):</p>
<p><pre class="brush: latex; gutter: false;">@article{bartel2009,
	Author = {Bartel, David P. },
	Date = {2009/01/23},
	Journal = {Cell},
	Month = {01},
	Number = {2},
	Pages = {215--233},
	Title = {Micro{RNA}s: Target Recognition and Regulatory Functions},
	Volume = {136},
	Year = {2009}}</pre></p>
<p>to a format that <img src='http://s0.wp.com/latex.php?latex=%5CLaTeX&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='&#92;LaTeX' title='&#92;LaTeX' class='latex' /> understands, e.g.:</p>
<p><pre class="brush: latex; gutter: false;">\bibitem[Bartel(2009)]{bartel2009}
David~P. Bartel.
\newblock Micro{RNA}s: Target recognition and regulatory functions.
\newblock \emph{Cell}, 136\penalty0 (2):\penalty0 215--233, 01 2009.</pre></p>
<p>There is an easy way of converting references by making use of the bibtex-command. It does exactly what we needed in the background. Typesetting the document once (latex) and generating the references with the bibtex-command will create a metafile called &#8220;document.bbl&#8221;, containing all the referenced bibitems in <img src='http://s0.wp.com/latex.php?latex=%5CLaTeX&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='&#92;LaTeX' title='&#92;LaTeX' class='latex' />-format.</p>
<p><pre class="brush: bash; gutter: false;">tom@texblog:~$ latex document
tom@texblog:~$ bibtex document</pre></p>
<p>Finally, just copy and paste the content of the *.bbl file into the <img src='http://s0.wp.com/latex.php?latex=%5CLaTeX&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='&#92;LaTeX' title='&#92;LaTeX' class='latex' /> document, overwriting <code>\bibliography{&lt;document&gt;}</code>.</p>
<p>Note: The <code>bibitem</code> above was created using:</p>
<p><pre class="brush: latex; gutter: false;">\usepackage[numbers, square, comma, sort&amp;compress]{natbib}</pre></p>
<p>Source: <a href="http://fundamentalthinking.blogspot.com/2009/12/convert-bibtex-entries-to-bibitem-in.html">fundamentalthinking</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/807/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=807&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2011/12/12/bib2tex-converting-bibtex-to-bibitems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>
	</item>
		<item>
		<title>R: Controlling size and placement (subfig) of Sweave-generated figures</title>
		<link>http://texblog.org/2011/12/01/sweave-subfig-controlling-figure-size-and-placement/</link>
		<comments>http://texblog.org/2011/12/01/sweave-subfig-controlling-figure-size-and-placement/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 08:47:55 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Figure & table]]></category>
		<category><![CDATA[Introduction]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Package]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Sweave]]></category>
		<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[eps]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[graphicx]]></category>
		<category><![CDATA[includegraphics]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[r]]></category>
		<category><![CDATA[subfig]]></category>
		<category><![CDATA[subfloat]]></category>
		<category><![CDATA[SweaveOpts]]></category>
		<category><![CDATA[usepackage]]></category>

		<guid isPermaLink="false">http://texblog.wordpress.com/?p=760</guid>
		<description><![CDATA[I&#8217;ve been writing quite a bit of R code recently for my gene expression analysis. Also, I use Sweave (manual) which allows embedding R code &#8220;chunks&#8221; into TeX documents. When the code is being evaluated, the output (code, calculation results, plots, tables, etc.) will automatically integrated into the document as TeX syntax, making it an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=760&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been writing quite a bit of R code recently for my gene expression analysis. Also, I use <a title="Sweave homepage" href="http://www.stat.uni-muenchen.de/~leisch/Sweave/">Sweave</a> (<a title="Sweave manual" href="http://www.stat.uni-muenchen.de/~leisch/Sweave/Sweave-manual.pdf">manual</a>) which allows embedding R code &#8220;chunks&#8221; into TeX documents. When the code is being evaluated, the output (code, calculation results, plots, tables, etc.) will automatically integrated into the document as TeX syntax, making it an extremely handy tool for presentation and documentation purposes.<br />
That said, I will now show how to get a better control of the size and placement of figures generated by Sweave code chunks by manually inserting them into a TeX document.</p>
<p>Let me first give a general Sweave example with a single plot and later extend it with a second, placing them side-by-side. The following code chunk defines a vector x and a function f.</p>
<p><pre class="brush: r;">&lt;&lt;echo=F, results=hide&gt;&gt;=
x &lt;- seq(-2, 2, by=0.1)
f &lt;- function(x) { x^3 }
@</pre></p>
<p>Now we use Sweave to plot the function f and integrate the result into the TeX document:</p>
<p><pre class="brush: r;">\begin{figure}
\begin{center}
&lt;&lt;fig=TRUE, echo=FALSE&gt;&gt;=
plot(x, f(x), cex=0.3)
@
\caption{Function plot of $x^3$ between $-2$ and $2$.}
\end{center}
\end{figure}</pre></p>
<p>And here is the result:<br />
<a href="http://texblog.files.wordpress.com/2011/11/sweave1.png"><img src="http://texblog.files.wordpress.com/2011/11/sweave1.png?w=490&#038;h=466" alt="Sweave1" title="Sweave1" width="490" height="466" class="aligncenter size-full wp-image-765" /></a></p>
<p>Imagine now that we want to place plots of two functions, <img src='http://s0.wp.com/latex.php?latex=f%28x%29%3Dx%5E2&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='f(x)=x^2' title='f(x)=x^2' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=f%28x%29%3Dx%5E3&amp;bg=f9fbf9&amp;fg=666666&amp;s=0' alt='f(x)=x^3' title='f(x)=x^3' class='latex' />, side-by-side using the <code>subfig</code> package. This cannot be done automatically, since there is no way to control the figure size in the final pdf directly from within the Sweave chunk. Therefore, we generate the figures and add them manually, giving us complete control of size, angle and trimming of the figure (see <a href="http://www.ctan.org/pkg/graphicx" title="The graphicx package">graphicx</a>). </p>
<p>Here is the complete code:</p>
<p><pre class="brush: r; highlight: [15,19,24,28];">\documentclass[11pt]{article}
\usepackage{graphicx, subfig}
\begin{document}

&lt;&lt;echo=FALSE, results=hide&gt;&gt;=
x &lt;- seq(-2, 2, by=0.1)
f2 &lt;- function(x) { x^2 }
f3 &lt;- function(x) { x^3 }
@

\begin{figure}[ht]
\begin{center}
\subfloat[Function plot of $x^2$ between $-2$ and $2$.]{

&lt;&lt;label=xsquare, fig=TRUE, echo=FALSE, include=FALSE&gt;&gt;=
plot(x, f2(x), cex=0.3)
@

\includegraphics[width=0.4\textwidth]{sweave-xsquare}
}
\qquad
\subfloat[Function plot of $x^3$ between $-2$ and $2$.]{

&lt;&lt;label=xcube, fig=TRUE, echo=FALSE, include=FALSE&gt;&gt;=
plot(x, f3(x), cex=0.3)
@

\includegraphics[width=0.4\textwidth]{sweave-xcube}}
\end{center}
\end{figure}
\end{document}</pre></p>
<p>Basically, the code generates the plots (pdfs). We don&#8217;t want them to be automatically included into the document, which is achieved through the <code>include=FALSE</code> option. Labeling the chunk gives us control the plot&#8217;s filename, which turns out to be &#8220;<code>Rnw-filename-label.pdf</code>&#8221; (Rnw is a Sweave file extension). In case you prefer the figures not to have the filename of your source-file, there is a Sweave option that globally controls the figure-filename-prefix and the directory to which they are saved:</p>
<p><pre class="brush: plain;">\SweaveOpts{prefix.string=&lt;directory&gt;/&lt;filename-prefix&gt;}</pre></p>
<p>Finally, we manually add our plots using the standard LaTeX <code>\includegraphics</code>-command and the <code>subfig</code>-package (<a href="http://texblog.wordpress.com/2011/05/24/placing-figures-side-by-side-subfig/" title="Placing figures side-by-side with subfig">see this post for more details</a>). In case you prefer png and/or eps figures, use the <code>pdf, png, eps</code> options:</p>
<p><pre class="brush: r;">&lt;&lt;label=xcube, fig=TRUE, echo=FALSE, pdf=FALSE, eps=TRUE, png=TRUE, include=FALSE&gt;&gt;=</pre></p>
<p><a href="http://texblog.files.wordpress.com/2011/11/sweave2.png"><img src="http://texblog.files.wordpress.com/2011/11/sweave2.png?w=490&#038;h=243" alt="Sweave2" title="Sweave2" width="490" height="243" class="aligncenter size-full wp-image-766" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/760/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=760&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2011/12/01/sweave-subfig-controlling-figure-size-and-placement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/11/sweave1.png" medium="image">
			<media:title type="html">Sweave1</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/11/sweave2.png" medium="image">
			<media:title type="html">Sweave2</media:title>
		</media:content>
	</item>
		<item>
		<title>Reverse enumerate or etaremune</title>
		<link>http://texblog.org/2011/11/29/reverse-enumerate-or-etaremune/</link>
		<comments>http://texblog.org/2011/11/29/reverse-enumerate-or-etaremune/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 11:45:03 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Introduction]]></category>
		<category><![CDATA[Package]]></category>
		<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[decreasing]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[etaremune]]></category>
		<category><![CDATA[inverse]]></category>
		<category><![CDATA[item]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[usepackage]]></category>

		<guid isPermaLink="false">http://texblog.wordpress.com/?p=748</guid>
		<description><![CDATA[I stumbled across this package recently thanks to a comment by ofer. Basically, the etaremune package inverses the enumerate counter, making the indices decreasing rather than increasing. Basic example: Furthermore, to make the package more flexible, it offers different customizations. Starting number: The start option, lets you begin with an arbitrary number. In case the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=748&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I stumbled across this package recently thanks to a <a href="http://texblog.wordpress.com/2008/10/16/lists-enumerate-itemize-description-and-how-to-change-them/#comment-3626">comment by ofer</a>.</p>
<p>Basically, the <a href="http://mirrors.ctan.org/macros/latex/contrib/etaremune/etaremune.pdf" title="Etaremune package documentation">etaremune package</a> inverses the enumerate counter, making the indices decreasing rather than increasing.</p>
<p><strong>Basic example:</strong></p>
<p><pre class="brush: latex;">\documentclass{article}
\usepackage{etaremune}
\begin{document}
\begin{etaremune}
	\item Third item
	\item Second item
	\item First item
\end{etaremune}
\end{document}</pre></p>
<div id="attachment_754" class="wp-caption aligncenter" style="width: 166px"><a href="http://texblog.files.wordpress.com/2011/11/basic_etaremune.png"><img src="http://texblog.files.wordpress.com/2011/11/basic_etaremune.png?w=490" alt="basic_etaremune" title="basic_etaremune"   class="size-full wp-image-754" /></a><p class="wp-caption-text">Basic etaremune example.</p></div>
<p>Furthermore, to make the package more flexible, it offers different customizations.</p>
<p><strong>Starting number:</strong></p>
<p>The <code>start</code> option, lets you begin with an arbitrary number. In case the starting number is smaller than the number of items, the counter won&#8217;t further decrease once it reaches zero.</p>
<p><pre class="brush: latex;">\usepackage{etaremune}[start=7]</pre></p>
<p><strong>Nesting (with <code>enumerate</code>):</strong></p>
<p>Normal lists can be nested and so can <code>etaremune</code> lists. The lists can also be mixed with normal, <code>enumerate</code> lists. The <a href="http://mirrors.ctan.org/macros/latex/contrib/etaremune/etaremune.pdf" title="etaremune documentation">documentation</a> has a very nice example which I will just reuse here:</p>
<p><pre class="brush: latex;">\renewcommand{\labelenumi}{\theenumi)}
\renewcommand{\theenumii}{\roman{enumii}}
\begin{enumerate}
	\item First.
	\begin{etaremune}
		\item third.\label{notice}
		\item second.
		\item first.
	\end{etaremune}
	\item Second.
	\item Third.
\end{enumerate}
Notice item~\ref{notice}.</pre></p>
<p><strong>Controlling the style:</strong></p>
<p>Finally, the package allows the usage of some options for both, global and local style control.</p>
<p>Global options:<br />
<pre class="brush: plain;">\usepackage[&lt;options&gt;]{etaremune}</pre><br />
Local options:<br />
<pre class="brush: plain;">\begin{etaremune}[&lt;options&gt;]</pre></p>
<p><strong>Available options:</strong></p>
<p>Vertical lengths control:<br />
<code>\topsep</code>, <code>\partopsep</code>, <code>\itemsep</code> and <code>\parsep</code>.</p>
<p>Horizontal lengths control:<br />
<code>\leftmargin</code>, <code>\rightmargin</code>, <code>\listparindent</code>, <code>\itemindent</code>, <code>\labelwidth</code> and <code>\labelsep</code>.</p>
<p>Here is the example from above slightly extended with the options <code>itemsep</code> and <code>parsep</code> set to zero. The first reduces the space <strong>between items</strong> of the same level to a minimum, whereas the latter <strong>between levels</strong>.</p>
<p><pre class="brush: latex;">\documentclass{article}
\usepackage{etaremune}
\begin{document}
\renewcommand{\labelenumi}{\theenumi)}
\renewcommand{\theenumii}{\roman{enumii}}
\renewcommand{\theenumiii}{\Alph{enumiii}}
\begin{enumerate}
	\item First
	\item Second
	\begin{etaremune}[itemsep=0pt,parsep=0pt]
		\item third.\label{notice}
		\item second.
		\begin{etaremune}
			\item subsecond
			\item subfirst
		\end{etaremune}
		\item first.
	\end{etaremune}
	\item Third
\end{enumerate}
Notice item~\ref{notice}.
\end{document}</pre></p>
<div id="attachment_750" class="wp-caption aligncenter" style="width: 268px"><a href="http://texblog.files.wordpress.com/2011/11/etaremune.png"><img src="http://texblog.files.wordpress.com/2011/11/etaremune.png?w=490" alt="etaremune example" title="etaremune example"   class="size-full wp-image-750" /></a><p class="wp-caption-text">etaremune example</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/748/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=748&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2011/11/29/reverse-enumerate-or-etaremune/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/11/basic_etaremune.png" medium="image">
			<media:title type="html">basic_etaremune</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/11/etaremune.png" medium="image">
			<media:title type="html">etaremune example</media:title>
		</media:content>
	</item>
		<item>
		<title>Including pages from PDF documents</title>
		<link>http://texblog.org/2011/10/26/including-pages-from-pdf-documents/</link>
		<comments>http://texblog.org/2011/10/26/including-pages-from-pdf-documents/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 09:08:15 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Introduction]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Package]]></category>
		<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[includepdf]]></category>
		<category><![CDATA[logical page]]></category>
		<category><![CDATA[nup]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdfpages]]></category>
		<category><![CDATA[physical page]]></category>
		<category><![CDATA[usepackage]]></category>

		<guid isPermaLink="false">http://texblog.wordpress.com/?p=720</guid>
		<description><![CDATA[The package pdfpages let&#8217;s you include a complete PDF or any combination of pages into a LaTeX document. First load the package in the preamble. Now use any of the possible options below to include pages from a PDF. Include the first page The whole document A forward or backward range You never know when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=720&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The package <code>pdfpages</code> let&#8217;s you include a complete PDF or any combination of pages into a LaTeX document.</p>
<p>First load the package in the preamble.<br />
<pre class="brush: latex; gutter: false;">\usepackage{pdfpages}</pre></p>
<p>Now use any of the possible options below to include pages from a PDF.</p>
<p><strong>Include the first page</strong><br />
<pre class="brush: latex; gutter: false;">\includepdf{file}</pre></p>
<p><strong>The whole document</strong><br />
<pre class="brush: latex; gutter: false;">\includepdf[pages=-]{file}</pre></p>
<p><strong>A forward or backward range</strong><br />
<pre class="brush: latex; gutter: false;">\includepdf[pages=2-8]{file}
\includepdf[pages=8-2]{file}
\includepdf[pages=last-1]{file}</pre></p>
<p>You never know when that may come in handy. However, the keyword <code>last</code> actually can be quite useful in case the number of pages in the document may change.</p>
<p><strong>Several single pages with/without blanks</strong><br />
<pre class="brush: latex; gutter: false;">\includepdf[pages={3, 6, 1}]{file}
\includepdf[pages={3, {}, 9}]{file}</pre></p>
<p><strong>Copies of the same page</strong><br />
<pre class="brush: latex; gutter: false;">\includepdf[pages={5, 5, 5}]{file}</pre></p>
<p><strong>And finally, a bit of everything</strong><br />
<pre class="brush: latex; gutter: false;">\includepdf[pages={3-6, {}, 1, 7}]{file}</pre></p>
<p>The package also provides the option <code>nup=axb</code> to print several logical pages on a single physical page (the parameter <code>a</code> being the number of columns and <code>b</code> the number of rows). LaTeX scales the logical pages to fit within the margin of the physical page. In the example below the first 4 logical pages will be placed on the first physical page and the rest on the next.</p>
<p><pre class="brush: latex; gutter: false;">\includepdf[nup=2x2, pages=1-7]{file}</pre></p>
<p><a title="Pdfpages package documentation" href="http://mirrors.ctan.org/macros/latex/contrib/pdfpages/pdfpages.pdf" target="_blank">Pdfpages package documentation</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/720/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=720&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2011/10/26/including-pages-from-pdf-documents/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>
	</item>
		<item>
		<title>Increase enumerate &amp; itemize depth with enumitem</title>
		<link>http://texblog.org/2011/10/10/increase-enumerate-itemize-depth-with-enumitem/</link>
		<comments>http://texblog.org/2011/10/10/increase-enumerate-itemize-depth-with-enumitem/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 08:14:24 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Introduction]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Package]]></category>
		<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[alph]]></category>
		<category><![CDATA[arabic]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[enumitem]]></category>
		<category><![CDATA[itemize]]></category>
		<category><![CDATA[list depth]]></category>
		<category><![CDATA[newlist]]></category>
		<category><![CDATA[roman]]></category>
		<category><![CDATA[setlist]]></category>
		<category><![CDATA[setlistdepth]]></category>

		<guid isPermaLink="false">http://texblog.wordpress.com/?p=695</guid>
		<description><![CDATA[The default maximum depth for the list environments enumerate and itemize is four. Using more than four nested levels will lead to the error: &#8220;Too deeply nested&#8221;. One way to increase the depth of a list is using a mix of enumerate and itemize. However, obviously, some levels will be a bulleted rather than enumerated. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=695&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The default maximum depth for the list environments <code>enumerate</code> and <code>itemize</code> is four. Using more than four nested levels will lead to the error: &#8220;Too deeply nested&#8221;.</p>
<p>One way to increase the depth of a list is using a mix of <code>enumerate</code> and <code>itemize</code>. However, obviously, some levels will be a bulleted rather than enumerated.</p>
<p>The <code>enumitem</code> <a href="http://mirror.ctan.org/macros/latex/contrib/enumitem/enumitem.pdf" title="Enumitem package documentation" target="_blank">package</a> allows you to define new lists with an arbitrary number of levels. For example, let&#8217;s create nested lists with up to five levels.<br />
Define a new list <code>longenum</code> of type <code>enumerate</code> which has 5 levels. Set the label style for each level they way you like. I used <code>roman</code>, <code>alph</code> and <code>arabic</code>.</p>
<p><pre class="brush: plain;">\usepackage{enumitem}
\newlist{longenum}{enumerate}{5}
\setlist[longenum,1]{label=\roman*)}
\setlist[longenum,2]{label=\alph*)}
\setlist[longenum,3]{label=\arabic*)}
\setlist[longenum,4]{label=(\roman*)}
\setlist[longenum,5]{label=(\alph*)}</pre></p>
<p>That&#8217;s all you need to know. The rest is straight forward, just use <code>longenum</code> instead of <code>enumerate</code> for each level and create a nested lists with up to 5 levels.</p>
<p><strong>Here is the complete sample code with the output below:</strong></p>
<p><pre class="brush: plain;">\documentclass[11pt]{article}
\usepackage{enumitem}
\newlist{longenum}{enumerate}{5}
\setlist[longenum,1]{label=\roman*)}
\setlist[longenum,2]{label=\alph*)}
\setlist[longenum,3]{label=\arabic*)}
\setlist[longenum,4]{label=(\roman*)}
\setlist[longenum,5]{label=(\alph*)}
\begin{document}
\section*{Enumerated list with 5 levels}
\begin{longenum}
	\item Level 1 first
	\item Level 1 second
	\begin{longenum}
		\item Level 2 first
		\item Level 2 second
		\begin{longenum}
			\item Level 3 first
			\item Level 3 second
			\begin{longenum}
				\item Level 4 first
				\item Level 4 second
				\begin{longenum}
					\item Level 5 first
					\item Level 5 second
				\end{longenum}
			\end{longenum}
		\end{longenum}
	\end{longenum}
\end{longenum}
\end{document}</pre></p>
<p><a href="http://texblog.files.wordpress.com/2011/10/enumitem-5-levels-example.png"><img src="http://texblog.files.wordpress.com/2011/10/enumitem-5-levels-example.png?w=490" alt="" title="Enumitem 5 levels example"   class="aligncenter size-full wp-image-704" /></a></p>
<p><a href="http://mirror.ctan.org/macros/latex/contrib/enumitem/enumitem.pdf" title="Enumitem package documentation">Enumitem package documentation.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/695/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=695&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2011/10/10/increase-enumerate-itemize-depth-with-enumitem/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/10/enumitem-5-levels-example.png" medium="image">
			<media:title type="html">Enumitem 5 levels example</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick note on line spacing</title>
		<link>http://texblog.org/2011/09/30/quick-note-on-line-spacing/</link>
		<comments>http://texblog.org/2011/09/30/quick-note-on-line-spacing/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 12:02:33 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Introduction]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Package]]></category>
		<category><![CDATA[doublespace]]></category>
		<category><![CDATA[doublespacing]]></category>
		<category><![CDATA[linespread]]></category>
		<category><![CDATA[onehalfspace]]></category>
		<category><![CDATA[onehalfspacing]]></category>
		<category><![CDATA[setspace]]></category>
		<category><![CDATA[singlespace]]></category>
		<category><![CDATA[singlespacing]]></category>
		<category><![CDATA[spacing]]></category>

		<guid isPermaLink="false">http://texblog.wordpress.com/?p=673</guid>
		<description><![CDATA[There are two different ways to change line spacing in LaTeX. One is simpler, the other requires a package, but is more flexible. Let&#8217;s start easy. The linespread-command: To change the line spacing for the entire document, you can use the linespread command in your preamble: The factor is somewhat confusing. For double-spacing you have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=673&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are two different ways to change line spacing in LaTeX. One is simpler, the other requires a package, but is more flexible.</p>
<p>Let&#8217;s start easy.</p>
<p><strong>The linespread-command:</strong></p>
<p>To change the line spacing for the entire document, you can use the <code>linespread</code> command in your preamble:</p>
<p><pre class="brush: plain;">\linespread{&lt;factor&gt;}</pre></p>
<p>The <code>factor</code> is somewhat confusing. For double-spacing you have to use <code>1.6</code> and for one-and-a-half spacing </code>1.3</code>. Not very intuitive, but I'm sure there is a reason for it.</p>
<p><strong>The setspace-package:</strong></p>
<p>Personally, I prefer the <code>setspace</code> package, which is more straight forward in usage, provides more flexibility and is easy to use as well:</p>
<p><pre class="brush: plain;">\usepackage{setspace}
\singlespacing
\onehalfspacing
\doublespacing
\setstretch{&lt;factor&gt;} % for custom spacing</pre></p>
<p>You can change spacing back and forth within your document using the commands above.<br />
However, in order to stay on top of things, it's usually better using an environment to change vertical spacing locally.</p>
<p><pre class="brush: plain;">\begin{doublespace}
...
\end{doublespace}</pre></p>
<p>or</p>
<p><pre class="brush: plain;">\begin{spacing}{2.0}
...
\end{spacing}</pre></p>
<p>Finally, the package provides improved vertical spacing on top and below of <code>itemize</code> and <code>quote</code> environments, for any other than single-space content:</p>
<p><pre class="brush: plain;">
\usepackage{setspace}
\doublespacing
...
\begin{singlespace*}
\begin{quote}
Quote
\end{quote}
\end{singlespace*}</pre></p>
<p><strong>And that's the difference:</strong></p>
<div style="text-align:center;">
<div style="display:inline-block;margin-right:5px;">
<div id="attachment_689" class="wp-caption aligncenter" style="width: 141px"><a href="http://texblog.files.wordpress.com/2011/09/screen-shot-2011-09-30-at-7-35-43-pm1.png"><img class="size-full wp-image-689" title="Default vertical spacing" src="http://texblog.files.wordpress.com/2011/09/screen-shot-2011-09-30-at-7-35-43-pm1.png?w=490" alt="Single space quote with default vertical spacing"   /></a><p class="wp-caption-text">Default vertical spacing</p></div>
</div>
<div style="display:inline-block;">
<div id="attachment_682" class="wp-caption aligncenter" style="width: 141px"><a href="http://texblog.files.wordpress.com/2011/09/screen-shot-2011-09-30-at-7-35-21-pm.png"><img class="size-full wp-image-682" title="Improved vertical spacing" src="http://texblog.files.wordpress.com/2011/09/screen-shot-2011-09-30-at-7-35-21-pm.png?w=490" alt="Single space quote with improved vertical spacing"   /></a><p class="wp-caption-text">Improved vertical spacing</p></div>
</div>
</div>
<p>The package is documented within the <a title="Setspace.sty" href="http://mirrors.ctan.org/macros/latex/contrib/setspace/setspace.sty">style-file</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/673/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=673&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2011/09/30/quick-note-on-line-spacing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/09/screen-shot-2011-09-30-at-7-35-43-pm1.png" medium="image">
			<media:title type="html">Default vertical spacing</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/09/screen-shot-2011-09-30-at-7-35-21-pm.png" medium="image">
			<media:title type="html">Improved vertical spacing</media:title>
		</media:content>
	</item>
		<item>
		<title>10 ways to customize toc/lof/lot</title>
		<link>http://texblog.org/2011/09/09/10-ways-to-customize-tocloflot/</link>
		<comments>http://texblog.org/2011/09/09/10-ways-to-customize-tocloflot/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 02:51:52 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Figure & table]]></category>
		<category><![CDATA[Introduction]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Package]]></category>
		<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[addcontentsline]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[hyperref]]></category>
		<category><![CDATA[listoffigures]]></category>
		<category><![CDATA[listoftables]]></category>
		<category><![CDATA[lof]]></category>
		<category><![CDATA[lot]]></category>
		<category><![CDATA[minitoc]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tableofcontent]]></category>
		<category><![CDATA[toc]]></category>
		<category><![CDATA[tocloft]]></category>
		<category><![CDATA[usepackage]]></category>

		<guid isPermaLink="false">http://texblog.wordpress.com/?p=640</guid>
		<description><![CDATA[I put together this list of 10 ways to customize the Table of Contents, List of Figures and List of Tables. Some of them are pretty common, some may be new to you. Hope you enjoy the list&#8230; Some pieces of code below require the tocloft package which provides extensive customization functionality for table of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=640&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I put together this list of 10 ways to customize the Table of Contents, List of Figures and List of Tables. Some of them are pretty common, some may be new to you. Hope you enjoy the list&#8230;</p>
<p>Some pieces of code below require the <a title="Package documentation tocloft" href="http://www.ctex.org/documents/packages/contents/tocloft.pdf" target="_blank">tocloft</a> package which provides extensive customization functionality for table of contents, list of figures and list of tables. It will be indicated wherever the tocloft or any other package needs to be loaded in the preamble.</p>
<p>Note: I will use the abbreviations <strong>toc</strong> for table-of-contents, <strong>lof</strong> for list-of-figures and <strong>lot</strong> for list-of-tables in the article below.</p>
<p><strong>1. Change the lists headings</strong></p>
<p>Change the heading can be done without loading any specific package. Obviously, the name has to be changed before creating the list.</p>
<p><pre class="brush: plain;">\renewcommand\contentsname{}
\tableofcontents
\renewcommand\listfigurename{}
\listoffigures
\renewcommand\listtablename{}
\listoftables</pre></p>
<p><strong>2. Add &#8220;Page&#8221; above page numbers</strong></p>
<p>Several people asked me how to place the word &#8220;Page&#8221; on top of the page numbers in toc/lof/lot. Here is how you do it:</p>
<p><pre class="brush: plain;">\tableofcontents
\addtocontents{toc}{~\hfill\textbf{Page}\par}
\chapter{...}</pre></p>
<div id="attachment_646" class="wp-caption aligncenter" style="width: 500px"><a href="http://texblog.files.wordpress.com/2011/09/tocpageabovenumber.png"><img class="size-full wp-image-646" title="tocpage" src="http://texblog.files.wordpress.com/2011/09/tocpageabovenumber.png?w=490&#038;h=254" alt="" width="490" height="254" /></a><p class="wp-caption-text">&quot;Page&quot; above page numbers</p></div>
<p>It works the same way with lof and lot. The code was taken from <a href="http://tex.stackexchange.com/questions/8296/add-page-above-page-numbers-in-table-of-contents">here</a>.</p>
<p><strong>3. Change depth of entries</strong></p>
<p>You can change the depth, i.e. how many levels shall be printed using the respective counter:</p>
<p><pre class="brush: plain;">\setcounter{tocdepth}{1}
\tableofcontents</pre></p>
<p>0: chapter (not available for <code>\documentclass{article</code>),<br />
1: section,<br />
2: subsection, etc.<br />
The default depth is 3, subsubsection.<br />
Similarly, including subfigures and subtables can be achieved using:</p>
<p><pre class="brush: plain;">\setcounter{lofdepth}{2}
\setcounter{lotdepth}{2}</pre></p>
<p><strong>4. Roman page numbers for toc/lof/lot</strong></p>
<p>To get a different page number style for toc/lof/lot, use:</p>
<p><pre class="brush: plain;">\pagenumbering{}</pre></p>
<p>and change it back to <code>arabic</code> before the first chapter starts.</p>
<p>Available styles are <code>arabic</code>, <code>roman</code>, <code>Roman</code>, <code>alph</code> and <code>Alph</code>.</p>
<p>Complete code example:</p>
<p><pre class="brush: plain;">...
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\clearpage
\pagenumbering{arabic}
\chapter{...}
...</pre></p>
<p><strong>5. Hyperlinks to content</strong></p>
<p>Loading the <code>hyperref</code> package will let you navigate from toc/lof/lot entries directly to the respective content:</p>
<p><pre class="brush: plain;">\usepackage{hyperref}</pre></p>
<p>If you only want the page number to be clickable, you&#8217;ll need to load the package with the following option:</p>
<p><pre class="brush: plain;">\usepackage[linktocpage=true]{hyperref}</pre></p>
<p><strong>6. Adding the lists to toc</strong></p>
<p>Adding entries to toc/lof/lot can be done manually with a single command. Usually, to be sure the page number is correct, it&#8217;s advisable to add entries directly before or after the actual content to list. And here is how:</p>
<p><pre class="brush: plain;">\addcontentsline{}{}{}</pre></p>
<p>The <strong>file</strong> line(s) shall be added (<code>toc</code>, <code>lof</code> or <code>lot</code>), the <strong>type</strong> of the entry (<code>chapter</code>, <code>figure</code>, etc.) and the <strong>entry</strong> text itself.</p>
<p>To add the three lists to the toc use:</p>
<p><pre class="brush: plain;">\tableofcontents
\addcontentsline{toc}{chapter}{Contents}
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}</pre></p>
<div id="attachment_649" class="wp-caption aligncenter" style="width: 500px"><a href="http://texblog.files.wordpress.com/2011/09/toctocloflot.png"><img class="size-full wp-image-649" title="toc Adding Toc Lof Lot" src="http://texblog.files.wordpress.com/2011/09/toctocloflot.png?w=490&#038;h=231" alt="" width="490" height="231" /></a><p class="wp-caption-text">Adding toc/lof/lot to contents</p></div>
<p><strong>7. Changing the font of entries</strong></p>
<p>To change the way the actual entries look, you can make use of a command provided by the <code>tocloft</code> package. The command will affect the number as well as the text. However, it will not change the page number and the separator (if there are any). The nice thing here is that since it&#8217;s placed just in front of the sequence number, you can also use it to add words such as &#8220;<strong>Chapter</strong> 1: Biology &#8230; Here are a few examples for illustration:</p>
<p><pre class="brush: plain;">\usepackage{tocloft}
\renewcommand{\cftchapfont}{\scshape}
\renewcommand{\cftsecfont}{\bfseries}
\renewcommand{\cftfigfont}{Figure }
\renewcommand{\cfttabfont}{Table }</pre></p>
<p>Try it and make sure you don&#8217;t forget the space behind <code>Figure_</code> and <code>Table_</code>, otherwise it will be glued to the number.</p>
<p><strong>8. Creating you own list of &#8230;</strong></p>
<p>Again, the <code>tocloft</code> package has to be loaded. First, define a new list environment as well as the item which are later being listed. In this case, we are defining <strong>lemmas</strong>, but it could also be proofs, equations, a special list of figures, footnotes, anything. The last line of the lemma command defines how lemmas should be numbered, here &#8220;chapter.lemma&#8221;.</p>
<p><pre class="brush: plain;">\usepackage{tocloft}
...
\newcommand{\listoflemmas}{List of Lemmas}
\newlistof{lemma}{lem}{\listoflemmas}
\newcommand{\lemma}[1]{%
  \refstepcounter{lemma}
  \par\noindent\textbf{Lemma \thelemma. #1}
  \addcontentsline{lem}{lemma}
  {\protect\numberline{\thechapter.\thelemma}#1}\par
}
...
\listoflemmas
...
\lemma{My first lemma}
\label{lem:lemma1}</pre></p>
<p>You can find a <a title="Define your own list of ..." href="http://texblog.wordpress.com/2008/07/13/define-your-own-list-of/">complete code example here</a>.</p>
<p><strong>9. Alternative text in toc/lof/lot for headings and captions</strong></p>
<p>In case your caption is too long for the lof/lot, you can give it an alternative text. Similarly, the headings can be given an alternative name in the toc:</p>
<p><pre class="brush: plain;">\caption[]{}
\chapter[]{}</pre></p>
<p><strong>10. Chapter specific tocs with minitoc</strong></p>
<p>Finally, <code>minitoc</code> produces beautiful tocs at the beginning of every chapter (or any other heading) and therefore, I will dedicate this 10th and last entry to that package:</p>
<p><pre class="brush: plain;">\usepackage{minitoc}
...
\dominitoc
\tableofcontents
...
\chapter{...}
\minitoc</pre></p>
<div id="attachment_658" class="wp-caption aligncenter" style="width: 500px"><a href="http://texblog.files.wordpress.com/2011/09/minitoc.png"><img class="size-full wp-image-658" title="minitoc" src="http://texblog.files.wordpress.com/2011/09/minitoc.png?w=490&#038;h=344" alt="" width="490" height="344" /></a><p class="wp-caption-text">A minitoc example</p></div>
<p>Here is an <a title="Minitoc post" href="http://texblog.wordpress.com/2008/09/15/create-small-tocslofslots-using-minitoc/">earlier post</a> I wrote about the package as well as the <a title="Package documentation minitoc" href="http://mirror.ctan.org/macros/latex/contrib/minitoc/minitoc.pdf">complete documentation</a>.</p>
<p>Wow, that&#8217;s the longest post I ever wrote. Hope you&#8217;ve enjoyed my list, have fun customizing <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/texblog.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/texblog.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/texblog.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/texblog.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/texblog.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/texblog.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/texblog.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/texblog.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/texblog.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/texblog.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/texblog.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/texblog.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/texblog.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/texblog.wordpress.com/640/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=texblog.org&amp;blog=1106511&amp;post=640&amp;subd=texblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://texblog.org/2011/09/09/10-ways-to-customize-tocloflot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/45435628abb56dd1acc9ac2ef104a2b1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tom</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/09/tocpageabovenumber.png" medium="image">
			<media:title type="html">tocpage</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/09/toctocloflot.png" medium="image">
			<media:title type="html">toc Adding Toc Lof Lot</media:title>
		</media:content>

		<media:content url="http://texblog.files.wordpress.com/2011/09/minitoc.png" medium="image">
			<media:title type="html">minitoc</media:title>
		</media:content>
	</item>
	</channel>
</rss>
