<?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>David Underhill &#187; caption</title>
	<atom:link href="http://dound.com/tag/caption/feed/" rel="self" type="application/rss+xml" />
	<link>http://dound.com</link>
	<description>dound&#039;s space on the web</description>
	<lastBuildDate>Tue, 31 Jan 2012 10:57:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>LaTeX: adding footnotes in tables (or other floats)</title>
		<link>http://dound.com/2009/06/latex-adding-footnotes-in-tables-or-other-floats/</link>
		<comments>http://dound.com/2009/06/latex-adding-footnotes-in-tables-or-other-floats/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 04:10:48 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[caption]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[footnote]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tabular]]></category>

		<guid isPermaLink="false">http://dound.com/?p=184</guid>
		<description><![CDATA[I recently wanted to put a footnote reference inside a table. Unfortunately, LaTeX makes it somewhat difficult to add footnotes inside floats (e.g., tabular). If you try to put a footnote inside a tabular, then pdflatex will show the reference but not the footnote itself! I came across several suggestions for fixing this: One idea [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to put a footnote reference inside a table.  Unfortunately, <a href="http://www.latex-project.org/">LaTeX</a> makes it somewhat difficult to add footnotes inside floats (e.g., <code><a href="http://www.andy-roberts.net/misc/latex/latextutorial4.html">tabular</a></code>).  If you try to put a footnote inside a <code>tabular</code>, then <code>pdflatex</code> will show the reference but not the footnote itself!  I came across several suggestions for fixing this:</p>
<p><a href="http://www.hep.man.ac.uk/u/jenny/jcwdocs/latex/latex.html">One idea</a> is to put the table in a <code><a href="http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-267.html">minipage</a></code>.  This causes the footnote to show up at the bottom of the table (in its own numbering system) &#8212; but I wanted the footnote to show up at the bottom of the page like other footnotes!</p>
<p>Another idea was to manually specify the footnote number inside the text and then use the <code><a href="http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-234.html">\footnotetext</a></code> command (outside the <code>tabular</code>) to manually add the footer.  Unfortunately, this is not a robust solution since it forces you to manually maintain this footnote number inside the tabular.</p>
<p>Building on the previous idea, I discovered a way to make footnotes appear inside <code>tabular</code>s <i>without</i> breaking the automatic numbering of footnotes.  Here is my approach:</p>
<ol>
<li>Include the &#8220;<a href="http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=fmtcount">fmtcount</a>&#8221; package so that you can display the values of counters (e.g., the footnote counter):

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">fmtcount</span><span style="color: #E02020; ">}</span></pre></div></div>

</li>
<li>Immediately before your tabular, increment the footnote counter:

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\addtocounter</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">footnote</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">1</span><span style="color: #E02020; ">}</span></pre></div></div>

</li>
<li>Next, specify the contents of the footnote:

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\footnotetext</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\value</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">footnote</span><span style="color: #E02020; ">}</span></span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">your text here</span><span style="color: #E02020; ">}</span></pre></div></div>

</li>
<li>Finally, add a reference to the footnote inside the table:

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\decimal</span><span style="color: #E02020; ">{</span>footnote</span><span style="color: #E02020; ">}}</span>$</span></pre></div></div>

</li>
</ol>
<p>You can extend this idea to add multiple footnotes within a single <code>tabular</code> by adjusting the counters (using <code><a href="http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-195.html">\addtocounter</a></code>) appropriately.  Here is a complete example of how to add two footnotes inside a single <code>tabular</code> (you can see the <a href="http://dound.com/wp/files/footnote-in-tabular-example.pdf">PDF output here</a>):</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">documentclass</span></span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">12pt</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">article</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">fmtcount</span><span style="color: #E02020; ">}</span> <span style="color: #2C922C; font-style: italic;">% displaying latex counters</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span>
    <span style="color: #800000; font-weight: normal;">\title</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">An Example of Footnotes Inside a Tabular</span><span style="color: #E02020; ">}</span>
    <span style="color: #800000; font-weight: normal;">\author</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">David Gridley Underhill</span><span style="color: #E02020; ">}</span>
    <span style="color: #800000; font-weight: normal;">\maketitle</span>
&nbsp;
<span style="color: #2C922C; font-style: italic;">% manually add a footnote which exists inside the table</span>
<span style="color: #800000; font-weight: normal;">\addtocounter</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">footnote</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;">\footnotetext</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\value</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">footnote</span><span style="color: #E02020; ">}</span></span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">my first footnote</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #2C922C; font-style: italic;">% add another footnote</span>
<span style="color: #800000; font-weight: normal;">\addtocounter</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">footnote</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;">\footnotetext</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\value</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">footnote</span><span style="color: #E02020; ">}</span></span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">my second footnote</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #2C922C; font-style: italic;">% reset the counter to the first footnote's value</span>
<span style="color: #800000; font-weight: normal;">\addtocounter</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">footnote</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">-1</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tabular</span></span><span style="color: #E02020; ">}{</span><span style="color: #E02020; "><span style="color: #2020C0; font-weight: normal;">|l|l|</span></span><span style="color: #E02020; ">}</span>
  <span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">hline</span></span>
  <span style="color: #2C922C; font-style: italic;">% this next row references the first footnote I added above, and then</span>
  <span style="color: #2C922C; font-style: italic;">% advances the counter to the next footnote.</span>
  <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\bf</span> First Column</span><span style="color: #E02020; ">}</span> <span style="color: #E02020; ">&amp;</span> <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\bf</span> Second Column</span><span style="color: #E02020; ">}</span><span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\decimal</span><span style="color: #E02020; ">{</span>footnote</span><span style="color: #E02020; ">}}</span>$</span><span style="color: #800000; font-weight: normal;">\addtocounter</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">footnote</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">1</span><span style="color: #E02020; ">}</span> <span style="color: #E02020; ">\\</span>
&nbsp;
  <span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">hline</span></span>
  <span style="color: #2C922C; font-style: italic;">% now reference the second footnote from above -- don't increment the footnote </span>
  <span style="color: #2C922C; font-style: italic;">% counter beyond the last footnote!</span>
  X <span style="color: #E02020; ">&amp;</span> Y<span style="color: #8020E0; font-weight: normal;">$^{<span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\decimal</span><span style="color: #E02020; ">{</span>footnote</span><span style="color: #E02020; ">}}</span>$</span> <span style="color: #E02020; ">\\</span>
&nbsp;
  <span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">hline</span></span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tabular</span></span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://dound.com/2009/06/latex-adding-footnotes-in-tables-or-other-floats/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
	</channel>
</rss>

