]> git.lyx.org Git - features.git/commitdiff
Import optional argument of tabular (vertical alignment)
authorGeorg Baum <georg.baum@post.rwth-aachen.de>
Sun, 6 Nov 2011 18:56:26 +0000 (18:56 +0000)
committerGeorg Baum <georg.baum@post.rwth-aachen.de>
Sun, 6 Nov 2011 18:56:26 +0000 (18:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40148 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/TODO.txt
src/tex2lyx/table.cpp
src/tex2lyx/test/test-structure.tex
status.20x

index a3d5547bb612df723d533ee194e13d73e99c131d..eda127abe7956e2098710ac970de7df83d083bb4 100644 (file)
@@ -37,7 +37,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
index 436078339455e16a7ff308de6ef86718e897d4c5..37a74509b62b04de9b241ca0988e416821613c62 100644 (file)
@@ -773,14 +773,20 @@ void handle_hline_below(RowInfo & ri, vector<CellInfo> & 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> colinfo;
@@ -1106,8 +1112,10 @@ void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
           << "\" columns=\"" << colinfo.size() << "\">\n";
        os << "<features"
           << write_attribute("rotate", false)
-          << write_attribute("islongtable", is_long_tabular)
-          << ">\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) {
index ba4bbce72415ffd10e9f449c230ab01e59fb7181..d773dee15c64f8313a94fe31f26f1e60978cd46c 100644 (file)
@@ -101,7 +101,7 @@ An environment
 \caption{rotated table, spanning all columns}
 
 \centering{}%
-\begin{tabular}{|c|c|}
+\begin{tabular}[b]{|c|c|}
 \hline 
 a  & b\tabularnewline
 \hline 
index 0a5ba227405907e8dce64b336ccd9afd9b9fbed4..c54e73538cb7a3fd3ec6b48ba0f5ebee62feb5e0 100644 (file)
@@ -160,6 +160,8 @@ What's new
 
 - Fix LaTeX import of theorem environment with optional argument (bug 6834).
 
+- Fix LaTeX import of tabular environment with optional argument.
+
 - Store the autosave files of unnamed buffers in the correct directory
   and make sure they are not left behind after saving (bug 7793).