diff --git a/data/kramdown/document.latex b/data/kramdown/document.latex index 5bdbbcd1..14934e12 100644 --- a/data/kramdown/document.latex +++ b/data/kramdown/document.latex @@ -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 diff --git a/doc/news/release_0_X_X.page b/doc/news/release_0_X_X.page index b7d1887e..be1a8c57 100644 --- a/doc/news/release_0_X_X.page +++ b/doc/news/release_0_X_X.page @@ -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: diff --git a/lib/kramdown/converter/latex.rb b/lib/kramdown/converter/latex.rb index 417fa641..238b8080 100644 --- a/lib/kramdown/converter/latex.rb +++ b/lib/kramdown/converter/latex.rb @@ -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) diff --git a/test/testcases/block/14_table/table_with_footnote.html b/test/testcases/block/14_table/table_with_footnote.html new file mode 100644 index 00000000..caebef5d --- /dev/null +++ b/test/testcases/block/14_table/table_with_footnote.html @@ -0,0 +1,25 @@ + + + + + + + + + + + +
this is 1a table
with afootnote
+ +
+
    +
  1. +

    Something

    + +
    +

    special here

    +
    +

    +
  2. +
+
diff --git a/test/testcases/block/14_table/table_with_footnote.latex b/test/testcases/block/14_table/table_with_footnote.latex new file mode 100644 index 00000000..99b5312f --- /dev/null +++ b/test/testcases/block/14_table/table_with_footnote.latex @@ -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} + diff --git a/test/testcases/block/14_table/table_with_footnote.text b/test/testcases/block/14_table/table_with_footnote.text new file mode 100644 index 00000000..345fc5d3 --- /dev/null +++ b/test/testcases/block/14_table/table_with_footnote.text @@ -0,0 +1,6 @@ +| this is [^1] | a table +| with a | footnote + +[^1]: Something + + > special here