git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40176 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2011-11-12 17:54:50 +00:00
parent 3643777d0f
commit f441663600
6 changed files with 21 additions and 10 deletions

View 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

View 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";

View 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:

View 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

View 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

View 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();
}