mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
tex2lyx: Add support for horizontal longtabular alignment
This commit is contained in:
parent
bc55ae0220
commit
b1e5663333
@ -25,7 +25,6 @@ Format LaTeX feature LyX feature
|
||||
% !BIB program =
|
||||
comment understood by some TeX editors
|
||||
358 custom makeindex command \index_command
|
||||
363 horizontal longtable alignment InsetTabular
|
||||
364 branch file name suffix \filename_suffix
|
||||
371 automatic mhchem loading \use_mhchem
|
||||
390 forward/reverse search \forward_search, \forward_macro
|
||||
|
@ -847,7 +847,8 @@ void handle_hline_below(RowInfo & ri, vector<CellInfo> & ci)
|
||||
|
||||
|
||||
void handle_tabular(Parser & p, ostream & os, string const & name,
|
||||
string const & tabularwidth, Context & context)
|
||||
string const & tabularwidth, string const & halign,
|
||||
Context & context)
|
||||
{
|
||||
bool const is_long_tabular(name == "longtable");
|
||||
bool booktabs = false;
|
||||
@ -1417,6 +1418,8 @@ void handle_tabular(Parser & p, ostream & os, string const & name,
|
||||
<< write_attribute("lastFootTopDL", endlastfoot.topDL)
|
||||
<< write_attribute("lastFootBottomDL", endlastfoot.bottomDL)
|
||||
<< write_attribute("lastFootEmpty", endlastfoot.empty);
|
||||
if (!halign.empty())
|
||||
os << write_attribute("longtabularalignment", halign);
|
||||
} else
|
||||
os << write_attribute("tabularvalignment", tabularvalignment)
|
||||
<< write_attribute("tabularwidth", tabularwidth);
|
||||
|
@ -81,7 +81,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, std::string const & name,
|
||||
std::string const & width, Context & context);
|
||||
std::string const & width, std::string const & halign,
|
||||
Context & context);
|
||||
|
||||
|
||||
/// in tex2lyx.cpp
|
||||
|
@ -1638,13 +1638,23 @@ void parse_environment(Parser & p, ostream & os, bool outer,
|
||||
else if (unstarred_name == "tabular" || name == "longtable") {
|
||||
eat_whitespace(p, os, parent_context, false);
|
||||
string width = "0pt";
|
||||
string halign;
|
||||
if (name == "longtable" && p.hasOpt()) {
|
||||
string const opt = p.getArg('[', ']');
|
||||
if (opt == "c")
|
||||
halign = "center";
|
||||
else if (opt == "l")
|
||||
halign = "left";
|
||||
else if (opt == "r")
|
||||
halign = "right";
|
||||
}
|
||||
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, width, parent_context);
|
||||
handle_tabular(p, os, name, width, halign, parent_context);
|
||||
end_inset(os);
|
||||
p.skip_spaces();
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ What's new
|
||||
|
||||
- Improve import of titling commands other than \maketitle (bug 6461).
|
||||
|
||||
- Add support for horizontal longtabular alignment.
|
||||
|
||||
|
||||
|
||||
* USER INTERFACE
|
||||
|
Loading…
Reference in New Issue
Block a user