new_layout_allowed(true), merging_hyphens_allowed(true),
textclass(textclass_),
layout(layout_), parent_layout(parent_layout_),
- font(font_), rotlongtable(false)
+ font(font_), tablerotation(0)
{
if (!layout)
layout = &textclass.defaultLayout();
TeXFont font;
/// font attributes of normal text
static TeXFont normalfont;
- /// A rotated longtable
- bool rotlongtable;
+ /// Table rotation angle
+ int tablerotation;
private:
void begin_layout(std::ostream & os, Layout const * const & l);
//cerr << "// output what we have\n";
// output what we have
- string rotate = "0";
- if (is_long_tabular && context.rotlongtable)
- rotate = "90";
os << "\n<lyxtabular version=\"3\" rows=\"" << rowinfo.size()
<< "\" columns=\"" << colinfo.size() << "\">\n";
os << "<features"
- << write_attribute("rotate", rotate)
+ << write_attribute("rotate", context.tablerotation)
<< write_attribute("booktabs", booktabs)
<< write_attribute("islongtable", is_long_tabular);
if (is_long_tabular) {
p.get_token();
p.get_token();
string envname = p.getArg('{', '}');
- if (envname == "longtable") {
+ if (envname == "longtable" || envname == "xltabular") {
// Now we check if the longtable is the only content
// of the landscape environment
+ string const ltenv = envname;
while (!found_end && !end_longtable && p.good()) {
envname = p.next_token().cat() == catBegin
? p.getArg('{', '}') : string();
Token const & t = p.get_token();
p.skip_spaces();
end_longtable = t.asInput() != "\\end"
- && envname == "longtable";
+ && envname == ltenv;
found_end = t.asInput() == "\\end"
&& envname == "landscape";
}
if (only_longtable) {
p.popPosition();
p.skip_spaces();
- bool const save_rotlongtable = parent_context.rotlongtable;
- parent_context.rotlongtable = true;
+ int const save_tablerotation = parent_context.tablerotation;
+ parent_context.tablerotation = 90;
parse_text(p, os, FLAG_END, outer, parent_context);
- parent_context.rotlongtable = save_rotlongtable;
+ parent_context.tablerotation = save_tablerotation;
p.skip_spaces();
break;
}