break;
case '>': {
// text before the next column
- string const s = trim(p.verbatim_item());
+ string const s = trimSpaceAndEol(p.verbatim_item());
if (next.special.empty() &&
next.align == 'n') {
// Maybe this can be converted to a
}
case '<': {
// text after the last column
- string const s = trim(p.verbatim_item());
+ string const s = trimSpaceAndEol(p.verbatim_item());
if (colinfo.empty())
// This is not possible in LaTeX.
cerr << "Ignoring separator '<{"
Token const & t = p.get_token();
#ifdef FILEDEBUG
- cerr << "t: " << t << " flags: " << flags << "\n";
+ debugToken(cerr, t, flags);
#endif
// comments and whitespace in hlines
} // 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()) {
// 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;
<< "\" 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)
+ << write_attribute("tabularwidth", tabularwidth);
+ os << ">\n";
//cerr << "// after header\n";
for (size_t col = 0; col < colinfo.size(); ++col) {