]> git.lyx.org Git - features.git/commitdiff
tabular*
authorGeorg Baum <georg.baum@post.rwth-aachen.de>
Sat, 12 Nov 2011 17:54:50 +0000 (17:54 +0000)
committerGeorg Baum <georg.baum@post.rwth-aachen.de>
Sat, 12 Nov 2011 17:54:50 +0000 (17:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40176 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/TODO.txt
src/tex2lyx/table.cpp
src/tex2lyx/test/test-insets.tex
src/tex2lyx/tex2lyx.1in
src/tex2lyx/tex2lyx.h
src/tex2lyx/text.cpp

index d0ca661dfd89d6f8373767952963a119456c54fa..2e53ac9ad2d72d2dc99e662e55270ea57c75d9fa 100644 (file)
@@ -65,6 +65,5 @@ Format LaTeX feature                        LyX feature
 407    vertical offset for multirows        InsetTabular
 409    XeTeX                                \use_non_tex_fonts
 411    support for polyglossia              \language_package  (the cases of no package, of babel and of custom package is supported)
-412    tabular*                             InsetTabular
 415    undertilde.sty                       fonts
 
index a16aeeb6a29bd3ee227774ca3048a08d09a56872..d23da08a73557e693648627615557da48350b2cb 100644 (file)
@@ -770,9 +770,10 @@ void handle_hline_below(RowInfo & ri, vector<CellInfo> & ci)
 } // anonymous namespace
 
 
-void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
-                   Context & context)
+void handle_tabular(Parser & p, ostream & os, string const & name,
+                    string const & tabularwidth, Context & context)
 {
+       bool const is_long_tabular(name == "longtable");
        string tabularvalignment("middle");
        string posopts = p.getOpt();
        if (!posopts.empty()) {
@@ -1114,7 +1115,8 @@ void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
           << write_attribute("rotate", false)
           << write_attribute("islongtable", is_long_tabular);
        if (!is_long_tabular)
-               os << write_attribute("tabularvalignment", tabularvalignment);
+               os << write_attribute("tabularvalignment", tabularvalignment)
+                  << write_attribute("tabularwidth", tabularwidth);
        os << ">\n";
 
        //cerr << "// after header\n";
index f6b09391ccca2b491f7dc5422a8465f8d575fa16..ffeb426865aa622fcd3767b49ef0397f24677bf6 100644 (file)
@@ -258,6 +258,13 @@ Lots of lines& like this.\\
 Lots of lines& like this.
 \end{longtable}
 
+\begin{tabular*} % some comment
+{0.8\columnwidth}[b]{lr}
+two\\
+lonely&lines
+\end{tabular*}
+
+
 \section{Macros}
 
 LyX supports several kinds of macros:
index 316ec0ce2021de1e14251b097612f0014c5ce8a5..028f10c9068ac58aceac9fdff22b8bb0cd45045a 100644 (file)
@@ -206,8 +206,6 @@ should thus be conserved in printed documents, although it will not of
 course show up in the LyX window. Check Document->Settings->LaTeX Preamble to see the result.
 .SS "What tex2lyx Can't Handle --- But it's \s-1OK\s0"
 .IP "\(bu" 4
-tabular* tables
-.IP "\(bu" 4
 some spacing commands (\f(CW\ehspace\fR, \f(CW\epagebreak\fR and \f(CW\elinebreak\fR)
 .IP "\(bu" 4
 \f(CW\ecentering\fR, \f(CW\eraggedleft\fR, \f(CW\eraggedright\fR
index 76ebee69d91f0835b2cc87f3ee65ac5d93771273..e1d779a115dbcc229a52e0f228c6167810ab5942 100644 (file)
@@ -71,8 +71,8 @@ void parse_math(Parser & p, std::ostream & os, unsigned flags, mode_type mode);
 
 
 /// in table.cpp
-void handle_tabular(Parser & p, std::ostream & os, bool is_long_tabular,
-                   Context & context);
+void handle_tabular(Parser & p, std::ostream & os, std::string const & name,
+                    std::string const & width, Context & context);
 
 
 /// in tex2lyx.cpp
index 33bd530bb03110c9b9c760c8d28f4dd3cc4739c7..9aec03e949b11565ee65868bde3190084ac536df 100644 (file)
@@ -1152,11 +1152,16 @@ void parse_environment(Parser & p, ostream & os, bool outer,
                end_inset(os);
        }
 
-       else if (name == "tabular" || name == "longtable") {
+       else if (unstarred_name == "tabular" || name == "longtable") {
                eat_whitespace(p, os, parent_context, false);
+               string width = "0pt";
+               if (name == "tabular*") {
+                       width = lyx::translate_len(p.getArg('{', '}'));
+                       eat_whitespace(p, os, parent_context, false);
+               }
                parent_context.check_layout(os);
                begin_inset(os, "Tabular ");
-               handle_tabular(p, os, name == "longtable", parent_context);
+               handle_tabular(p, os, name, width, parent_context);
                end_inset(os);
                p.skip_spaces();
        }