diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index 1066f1206c..fb38407842 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -36,7 +36,6 @@ Format LaTeX feature LyX feature 332 ? InsetGraphics groupId 336 ? \font_cjk 343 ? \use_default_options -347 tabular valign InsetTabular 350 ? \default_output_format 353 \printsubindex InsetIndex 354 \printindex*, \printsubindex* InsetIndex diff --git a/src/tex2lyx/table.cpp b/src/tex2lyx/table.cpp index e5862d0434..a16aeeb6a2 100644 --- a/src/tex2lyx/table.cpp +++ b/src/tex2lyx/table.cpp @@ -773,14 +773,20 @@ void handle_hline_below(RowInfo & ri, vector & ci) void handle_tabular(Parser & p, ostream & os, bool is_long_tabular, Context & context) { + string tabularvalignment("middle"); string posopts = p.getOpt(); if (!posopts.empty()) { // FIXME: Convert this to ERT if (is_long_tabular) - cerr << "horizontal longtable"; + cerr << "horizontal longtable positioning '" + << posopts << "' ignored\n"; + else if (posopts == "[t]") + tabularvalignment = "top"; + else if (posopts == "[b]") + tabularvalignment = "bottom"; else - cerr << "vertical tabular"; - cerr << " positioning '" << posopts << "' ignored\n"; + cerr << "vertical tabular positioning '" + << posopts << "' ignored\n"; } vector colinfo; @@ -1106,8 +1112,10 @@ void handle_tabular(Parser & p, ostream & os, bool is_long_tabular, << "\" columns=\"" << colinfo.size() << "\">\n"; os << "\n"; + << write_attribute("islongtable", is_long_tabular); + if (!is_long_tabular) + os << write_attribute("tabularvalignment", tabularvalignment); + os << ">\n"; //cerr << "// after header\n"; for (size_t col = 0; col < colinfo.size(); ++col) { diff --git a/src/tex2lyx/test/test-structure.tex b/src/tex2lyx/test/test-structure.tex index 4f394d6ea7..e19e002669 100644 --- a/src/tex2lyx/test/test-structure.tex +++ b/src/tex2lyx/test/test-structure.tex @@ -109,7 +109,7 @@ some parts remain \caption{rotated table, spanning all columns} \centering{}% -\begin{tabular}{|c|c|} +\begin{tabular}[b]{|c|c|} \hline a & b\tabularnewline \hline