Permalink
Browse files

Fixed problem with footnotes in LaTeX tables

The tabular environment doesn't support footnotes in LaTeX tables.
Therefore tables are now set using the longtable environment.
  • Loading branch information...
1 parent 33d0759 commit 09b538a79b8074dfd6b1e31bf0390b5906c1da0e @gettalong committed Apr 30, 2011
@@ -28,9 +28,9 @@ encmap = {
<% end %>
\usepackage[T1]{fontenc}
\usepackage{listings}
-\usepackage{hyperref}
<% @converter.data[:packages].each {|pkg| %>\usepackage{<%= pkg %>}
<% } %>
+\usepackage{hyperref}
<% if @converter.data[:packages].include?('fancyvrb') %>
\VerbatimFootnotes
@@ -10,7 +10,7 @@ modified_at: 2011-02-21 18:01:00 +02:00
## Changes
-* 6 bug fixes:
+* 7 bug fixes:
- Table line `` |a|`b` `` was parsed as `` |a`b` `` (patch by Masahiro Kitajima)
- Table line `` |`a` `` lead to error condition (patch by Masahiro Kitajima)
@@ -20,6 +20,8 @@ modified_at: 2011-02-21 18:01:00 +02:00
- Fixed bug in LaTeX image element converter that was introduced in a former release (reported by
Michael Franzl)
- Fixed problem with block HTML tag being treated as header text
+ - Fixed problem with footnotes in LaTeX tables -- now using `longtable` instead of `tabular`
+ environment (reported by Michael Franzl)
* 1 documentation fix:
@@ -180,9 +180,10 @@ def convert_xml_pi(el, opts)
TABLE_ALIGNMENT_CHAR = {:default => 'l', :left => 'l', :center => 'c', :right => 'r'} # :nodoc:
def convert_table(el, opts)
+ @data[:packages] << 'longtable'
align = el.options[:alignment].map {|a| TABLE_ALIGNMENT_CHAR[a]}.join('|')
attrs = attribute_list(el)
- "#{latex_link_target(el)}\\begin{tabular}{|#{align}|}#{attrs}\n\\hline\n#{inner(el, opts)}\\hline\n\\end{tabular}#{attrs}\n\n"
+ "#{latex_link_target(el)}\\begin{longtable}{|#{align}|}#{attrs}\n\\hline\n#{inner(el, opts)}\\hline\n\\end{longtable}#{attrs}\n\n"
end
def convert_thead(el, opts)
@@ -0,0 +1,25 @@
+<table>
+ <tbody>
+ <tr>
+ <td>this is <sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></td>
+ <td>a table</td>
+ </tr>
+ <tr>
+ <td>with a</td>
+ <td>footnote</td>
+ </tr>
+ </tbody>
+</table>
+
+<div class="footnotes">
+ <ol>
+ <li id="fn:1">
+ <p>Something</p>
+
+ <blockquote>
+ <p>special here</p>
+ </blockquote>
+ <p><a href="#fnref:1" rev="footnote">&#8617;</a></p>
+ </li>
+ </ol>
+</div>
@@ -0,0 +1,11 @@
+\begin{longtable}{|l|l|}
+\hline
+this is \footnote{Something
+
+\begin{quote}
+special here
+\end{quote}} & a table\\
+with a & footnote\\
+\hline
+\end{longtable}
+
@@ -0,0 +1,6 @@
+| this is [^1] | a table
+| with a | footnote
+
+[^1]: Something
+
+ > special here

0 comments on commit 09b538a

Please sign in to comment.