3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Jean-Marc Lasgouttes
10 * Full author contact details are available in file CREDITS.
19 #include "support/convert.h"
20 #include "support/lstrings.h"
31 using std::istringstream;
33 using std::ostringstream;
38 // filled in preamble.C
39 std::map<char, int> special_columns;
46 ColInfo() : align('n'), valign('n'), rightlines(0), leftlines(0) {}
49 /// vertical alignment
53 /// special column alignment
55 /// number of lines on the right
57 /// number of lines on the left
62 /// row type for longtables
69 /// part of head on first page
73 /// part of foot on last page
80 RowInfo() : topline(false), bottomline(false), type(LT_NORMAL),
82 /// horizontal line above
84 /// horizontal line below
86 /// These are for longtabulars only
87 /// row type (head, foot, firsthead etc.)
89 /// row for a pagebreak
97 /// A multicolumn cell. The number of columns is <tt>1 + number
98 /// of CELL_PART_OF_MULTICOLUMN cells</tt> that follow directly
99 CELL_BEGIN_OF_MULTICOLUMN,
100 /// This is a dummy cell (part of a multicolumn cell)
101 CELL_PART_OF_MULTICOLUMN
107 CellInfo() : multi(CELL_NORMAL), align('n'), valign('n'),
108 leftlines(0), rightlines(0), topline(false),
109 bottomline(false), rotate(false) {}
116 /// vertical cell alignment
118 /// number of lines on the left
120 /// number of lines on the right
122 /// do we have a line above?
124 /// do we have a line below?
126 /// is the cell rotated?
128 /// width for multicolumn cells
130 /// special formatting for multicolumn cells
135 /// translate a horizontal alignment (as stored in ColInfo and CellInfo) to LyX
136 inline char const * verbose_align(char c)
151 /// translate a vertical alignment (as stored in ColInfo and CellInfo) to LyX
152 inline char const * verbose_valign(char c)
154 // The default value for no special alignment is "top".
167 // stripped down from tabluar.C. We use it currently only for bools and
169 string const write_attribute(string const & name, bool const & b)
171 // we write only true attribute values so we remove a bit of the
172 // file format bloat for tabulars.
173 return b ? ' ' + name + "=\"true\"" : string();
177 string const write_attribute(string const & name, string const & s)
179 return s.empty() ? string() : ' ' + name + "=\"" + s + '"';
183 /*! rather brutish way to code table structure in a string:
188 \multicolumn{2}{c}{4} & 5 //
194 gets "translated" to:
197 HLINE 1 TAB 2 TAB 3 HLINE HLINE LINE
198 \hline HLINE \multicolumn{2}{c}{4} TAB 5 HLINE HLINE LINE
199 HLINE 6 TAB 7 HLINE HLINE LINE
200 HLINE 8 HLINE \endhead HLINE LINE
204 char const TAB = '\001';
205 char const LINE = '\002';
206 char const HLINE = '\004';
210 * Move the information in leftlines, rightlines, align and valign to the
211 * special field. This is necessary if the special field is not empty,
212 * because LyX ignores leftlines, rightlines, align and valign in this case.
214 void ci2special(ColInfo & ci)
216 if (ci.width.empty() && ci.align == 'n')
217 // The alignment setting is already in special, since
218 // handle_colalign() never stores ci with these settings
219 // and ensures that leftlines == 0 and rightlines == 0 in
223 if (!ci.width.empty()) {
226 ci.special += ">{\\raggedright}";
229 ci.special += ">{\\raggedleft}";
232 ci.special += ">{\\centering}";
235 if (ci.valign == 'n')
238 ci.special += ci.valign;
239 ci.special += '{' + ci.width + '}';
242 ci.special += ci.align;
244 for (int i = 0; i < ci.leftlines; ++i)
245 ci.special.insert(0, "|");
246 for (int i = 0; i < ci.rightlines; ++i)
256 * Handle column specifications for tabulars and multicolumns.
257 * The next token of the parser \p p must be an opening brace, and we read
258 * everything until the matching closing brace.
259 * The resulting column specifications are filled into \p colinfo. This is
260 * in an intermediate form. fix_colalign() makes it suitable for LyX output.
262 void handle_colalign(Parser & p, vector<ColInfo> & colinfo,
263 ColInfo const & start)
265 if (p.get_token().cat() != catBegin)
266 cerr << "Wrong syntax for table column alignment.\n"
267 "Expected '{', got '" << p.curr_token().asInput()
270 ColInfo next = start;
271 for (Token t = p.get_token(); p.good() && t.cat() != catEnd;
274 cerr << "t: " << t << " c: '" << t.character() << "'\n";
277 // We cannot handle comments here
278 if (t.cat() == catComment) {
279 if (t.cs().empty()) {
283 cerr << "Ignoring comment: " << t.asInput();
287 switch (t.character()) {
291 // new column, horizontal aligned
292 next.align = t.character();
293 if (!next.special.empty())
295 colinfo.push_back(next);
301 // new column, vertical aligned box
302 next.valign = t.character();
303 next.width = p.verbatim_item();
304 if (!next.special.empty())
306 colinfo.push_back(next);
311 if (colinfo.empty()) {
312 if (next.special.empty())
316 } else if (colinfo.back().special.empty())
317 ++colinfo.back().rightlines;
318 else if (next.special.empty())
321 colinfo.back().special += '|';
324 // text before the next column
325 string const s = trim(p.verbatim_item());
326 if (next.special.empty() &&
328 // Maybe this can be converted to a
329 // horizontal alignment setting for
330 // fixed width columns
331 if (s == "\\raggedleft")
333 else if (s == "\\raggedright")
335 else if (s == "\\centering")
338 next.special = ">{" + s + '}';
340 next.special += ">{" + s + '}';
344 // text after the last column
345 string const s = trim(p.verbatim_item());
347 // This is not possible in LaTeX.
348 cerr << "Ignoring separator '<{"
349 << s << "}'." << endl;
351 ColInfo & ci = colinfo.back();
353 ci.special += "<{" + s + '}';
358 // *{n}{arg} means 'n' columns of type 'arg'
359 string const num = p.verbatim_item();
360 string const arg = p.verbatim_item();
361 size_t const n = convert<unsigned int>(num);
362 if (!arg.empty() && n > 0) {
364 for (size_t i = 0; i < n; ++i)
368 handle_colalign(p2, colinfo, next);
371 cerr << "Ignoring column specification"
372 " '*{" << num << "}{"
373 << arg << "}'." << endl;
378 // text instead of the column spacing
380 // text in addition to the column spacing
381 next.special += t.character();
382 next.special += '{' + p.verbatim_item() + '}';
385 // try user defined column types
386 if (special_columns.find(t.character()) !=
387 special_columns.end()) {
389 next.special += t.character();
391 special_columns[t.character()];
392 for (int i = 0; i < nargs; ++i)
393 next.special += '{' +
396 colinfo.push_back(next);
399 cerr << "Ignoring column specification"
400 " '" << t << "'." << endl;
405 // Maybe we have some column separators that need to be added to the
408 if (!next.special.empty()) {
409 ColInfo & ci = colinfo.back();
411 ci.special += next.special;
412 next.special.erase();
418 * Move the left and right lines and alignment settings of the column \p ci
419 * to the special field if necessary.
421 void fix_colalign(ColInfo & ci)
423 if (ci.leftlines > 1 || ci.rightlines > 1)
429 * LyX can't handle more than one vertical line at the left or right side
431 * This function moves the left and right lines and alignment settings of all
432 * columns in \p colinfo to the special field if necessary.
434 void fix_colalign(vector<ColInfo> & colinfo)
436 // Try to move extra leftlines to the previous column.
437 // We do this only if both special fields are empty, otherwise we
438 // can't tell wether the result will be the same.
439 for (size_t col = 0; col < colinfo.size(); ++col) {
440 if (colinfo[col].leftlines > 1 &&
441 colinfo[col].special.empty() && col > 0 &&
442 colinfo[col - 1].rightlines == 0 &&
443 colinfo[col - 1].special.empty()) {
444 ++colinfo[col - 1].rightlines;
445 --colinfo[col].leftlines;
448 // Try to move extra rightlines to the next column
449 for (size_t col = 0; col < colinfo.size(); ++col) {
450 if (colinfo[col].rightlines > 1 &&
451 colinfo[col].special.empty() &&
452 col < colinfo.size() - 1 &&
453 colinfo[col + 1].leftlines == 0 &&
454 colinfo[col + 1].special.empty()) {
455 ++colinfo[col + 1].leftlines;
456 --colinfo[col].rightlines;
459 // Move the lines and alignment settings to the special field if
461 for (size_t col = 0; col < colinfo.size(); ++col)
462 fix_colalign(colinfo[col]);
467 * Parse hlines and similar stuff.
468 * \returns wether the token \p t was parsed
470 bool parse_hlines(Parser & p, Token const & t, string & hlines,
471 bool is_long_tabular)
473 BOOST_ASSERT(t.cat() == catEscape);
475 if (t.cs() == "hline")
478 else if (t.cs() == "cline")
479 hlines += "\\cline{" + p.verbatim_item() + '}';
481 else if (is_long_tabular && t.cs() == "newpage")
482 hlines += "\\newpage";
491 /// Position in a row
493 /// At the very beginning, before the first token
495 /// After the first token and before any column token
497 /// After the first column token. Comments and whitespace are only
498 /// treated as tokens in this position
500 /// After the first non-column token at the end
506 * Parse table structure.
507 * We parse tables in a two-pass process: This function extracts the table
508 * structure (rows, columns, hlines etc.), but does not change the cell
509 * content. The cell content is parsed in a second step in handle_tabular().
511 void parse_table(Parser & p, ostream & os, bool is_long_tabular,
512 RowPosition & pos, unsigned flags)
514 // table structure commands such as \hline
517 // comments that occur at places where we can't handle them
521 Token const & t = p.get_token();
524 cerr << "t: " << t << " flags: " << flags << "\n";
527 // comments and whitespace in hlines
530 case IN_HLINES_START:
532 if (t.cat() == catComment) {
537 // We can't handle comments here,
538 // store them for later use
539 comments += t.asInput();
541 } else if (t.cat() == catSpace ||
542 t.cat() == catNewline) {
543 // whitespace is irrelevant here, we
544 // need to recognize hline stuff
553 // We need to handle structure stuff first in order to
554 // determine wether we need to output a HLINE separator
555 // before the row or not.
556 if (t.cat() == catEscape) {
557 if (parse_hlines(p, t, hlines, is_long_tabular)) {
560 pos = IN_HLINES_START;
565 case IN_HLINES_START:
572 else if (t.cs() == "tabularnewline" ||
576 cerr << "Warning: Converting TeX "
577 "'\\cr' to LaTeX '\\\\'."
579 // stuff before the line break
580 os << comments << HLINE << hlines << HLINE
582 //cerr << "hlines: " << hlines << endl;
589 else if (is_long_tabular &&
590 (t.cs() == "endhead" ||
591 t.cs() == "endfirsthead" ||
592 t.cs() == "endfoot" ||
593 t.cs() == "endlastfoot")) {
594 hlines += t.asInput();
598 // these commands are implicit line
600 os << comments << HLINE << hlines
607 pos = IN_HLINES_START;
609 case IN_HLINES_START:
617 // We need a HLINE separator if we either have no hline
618 // stuff at all and are just starting a row or if we just
619 // got the first non-hline token.
622 // no hline tokens exist, first token at row start
623 case IN_HLINES_START:
624 // hline tokens exist, first non-hline token at row
626 os << hlines << HLINE << comments;
632 // Oops, there is still cell content after hline
633 // stuff. This does not work in LaTeX, so we ignore
635 cerr << "Ignoring '" << hlines << "' in a cell"
646 // If we come here we have normal cell content
650 if (t.cat() == catMath) {
651 // we are inside some text mode thingy, so opening new math is allowed
652 Token const & n = p.get_token();
653 if (n.cat() == catMath) {
654 // TeX's $$...$$ syntax for displayed math
656 // This does only work because parse_math outputs TeX
657 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
659 p.get_token(); // skip the second '$' token
661 // simple $...$ stuff
664 // This does only work because parse_math outputs TeX
665 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
670 else if (t.cat() == catSpace || t.cat() == catNewline)
673 else if (t.cat() == catLetter ||
674 t.cat() == catSuper ||
676 t.cat() == catOther ||
677 t.cat() == catActive ||
678 t.cat() == catParameter)
681 else if (t.cat() == catBegin) {
683 parse_table(p, os, is_long_tabular, pos,
688 else if (t.cat() == catEnd) {
689 if (flags & FLAG_BRACE_LAST)
691 cerr << "unexpected '}'\n";
694 else if (t.cat() == catAlign) {
699 else if (t.cat() == catComment)
702 else if (t.cs() == "(") {
704 // This does only work because parse_math outputs TeX
705 parse_math(p, os, FLAG_SIMPLE2, MATH_MODE);
709 else if (t.cs() == "[") {
711 // This does only work because parse_math outputs TeX
712 parse_math(p, os, FLAG_EQUATION, MATH_MODE);
716 else if (t.cs() == "begin") {
717 string const name = p.getArg('{', '}');
718 active_environments.push_back(name);
719 os << "\\begin{" << name << '}';
720 // treat the nested environment as a block, don't
721 // parse &, \\ etc, because they don't belong to our
722 // table if they appear.
723 os << p.verbatimEnvironment(name);
724 os << "\\end{" << name << '}';
725 active_environments.pop_back();
728 else if (t.cs() == "end") {
729 if (flags & FLAG_END) {
730 // eat environment name
731 string const name = p.getArg('{', '}');
732 if (name != active_environment())
733 p.error("\\end{" + name + "} does not match \\begin{"
734 + active_environment() + "}");
737 p.error("found 'end' unexpectedly");
744 // We can have comments if the last line is incomplete
747 // We can have hline stuff if the last line is incomplete
748 if (!hlines.empty()) {
749 // this does not work in LaTeX, so we ignore it
750 cerr << "Ignoring '" << hlines << "' at end of tabular"
756 void handle_hline_above(RowInfo & ri, vector<CellInfo> & ci)
759 for (size_t col = 0; col < ci.size(); ++col)
760 ci[col].topline = true;
764 void handle_hline_below(RowInfo & ri, vector<CellInfo> & ci)
766 ri.bottomline = true;
767 for (size_t col = 0; col < ci.size(); ++col)
768 ci[col].bottomline = true;
772 } // anonymous namespace
775 void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
778 string posopts = p.getOpt();
779 if (!posopts.empty()) {
780 // FIXME: Convert this to ERT
782 cerr << "horizontal longtable";
784 cerr << "vertical tabular";
785 cerr << " positioning '" << posopts << "' ignored\n";
788 vector<ColInfo> colinfo;
790 // handle column formatting
791 handle_colalign(p, colinfo, ColInfo());
792 fix_colalign(colinfo);
794 // first scan of cells
795 // use table mode to keep it minimal-invasive
796 // not exactly what's TeX doing...
797 vector<string> lines;
799 RowPosition rowpos = ROW_START;
800 parse_table(p, ss, is_long_tabular, rowpos, FLAG_END);
801 split(ss.str(), lines, LINE);
803 vector< vector<CellInfo> > cellinfo(lines.size());
804 vector<RowInfo> rowinfo(lines.size());
807 //cerr << "// split into rows\n";
808 for (size_t row = 0; row < rowinfo.size(); ++row) {
811 cellinfo[row].resize(colinfo.size());
814 vector<string> dummy;
815 //cerr << "\n########### LINE: " << lines[row] << "########\n";
816 split(lines[row], dummy, HLINE);
818 // handle horizontal line fragments
819 // we do only expect this for a last line without '\\'
820 if (dummy.size() != 3) {
821 if ((dummy.size() != 1 && dummy.size() != 2) ||
822 row != rowinfo.size() - 1)
823 cerr << "unexpected dummy size: " << dummy.size()
824 << " content: " << lines[row] << "\n";
827 lines[row] = dummy[1];
829 //cerr << "line: " << row << " above 0: " << dummy[0] << "\n";
830 //cerr << "line: " << row << " below 2: " << dummy[2] << "\n";
831 //cerr << "line: " << row << " cells 1: " << dummy[1] << "\n";
833 for (int i = 0; i <= 2; i += 2) {
834 //cerr << " reading from line string '" << dummy[i] << "'\n";
837 Token t = p1.get_token();
838 //cerr << "read token: " << t << "\n";
839 if (t.cs() == "hline") {
841 if (rowinfo[row].topline) {
842 if (row > 0) // extra bottomline above
843 handle_hline_below(rowinfo[row - 1], cellinfo[row - 1]);
845 cerr << "dropping extra hline\n";
846 //cerr << "below row: " << row-1 << endl;
848 handle_hline_above(rowinfo[row], cellinfo[row]);
849 //cerr << "above row: " << row << endl;
852 //cerr << "below row: " << row << endl;
853 handle_hline_below(rowinfo[row], cellinfo[row]);
855 } else if (t.cs() == "cline") {
856 string arg = p1.verbatim_item();
857 //cerr << "read cline arg: '" << arg << "'\n";
861 size_t from = convert<unsigned int>(t[0]);
863 cerr << "Could not parse "
864 "cline start column."
867 // 1 based index -> 0 based
869 if (from >= colinfo.size()) {
870 cerr << "cline starts at non "
872 << (from + 1) << endl;
873 from = colinfo.size() - 1;
875 size_t to = convert<unsigned int>(t[1]);
877 cerr << "Could not parse "
881 // 1 based index -> 0 based
883 if (to >= colinfo.size()) {
884 cerr << "cline ends at non "
887 to = colinfo.size() - 1;
889 for (size_t col = from; col <= to; ++col) {
890 //cerr << "row: " << row << " col: " << col << " i: " << i << endl;
892 rowinfo[row].topline = true;
893 cellinfo[row][col].topline = true;
895 rowinfo[row].bottomline = true;
896 cellinfo[row][col].bottomline = true;
899 } else if (t.cs() == "endhead") {
901 rowinfo[row].type = LT_HEAD;
902 for (int r = row - 1; r >= 0; --r) {
903 if (rowinfo[r].type != LT_NORMAL)
905 rowinfo[r].type = LT_HEAD;
907 } else if (t.cs() == "endfirsthead") {
909 rowinfo[row].type = LT_FIRSTHEAD;
910 for (int r = row - 1; r >= 0; --r) {
911 if (rowinfo[r].type != LT_NORMAL)
913 rowinfo[r].type = LT_FIRSTHEAD;
915 } else if (t.cs() == "endfoot") {
917 rowinfo[row].type = LT_FOOT;
918 for (int r = row - 1; r >= 0; --r) {
919 if (rowinfo[r].type != LT_NORMAL)
921 rowinfo[r].type = LT_FOOT;
923 } else if (t.cs() == "endlastfoot") {
925 rowinfo[row].type = LT_LASTFOOT;
926 for (int r = row - 1; r >= 0; --r) {
927 if (rowinfo[r].type != LT_NORMAL)
929 rowinfo[r].type = LT_LASTFOOT;
931 } else if (t.cs() == "newpage") {
934 rowinfo[row - 1].newpage = true;
936 // This does not work in LaTeX
942 rowinfo[row].newpage = true;
944 cerr << "unexpected line token: " << t << endl;
950 vector<string> cells;
951 split(lines[row], cells, TAB);
952 for (size_t col = 0, cell = 0; cell < cells.size();
954 //cerr << "cell content: '" << cells[cell] << "'\n";
955 if (col >= colinfo.size()) {
956 // This does not work in LaTeX
957 cerr << "Ignoring extra cell '"
958 << cells[cell] << "'." << endl;
961 Parser p(cells[cell]);
963 //cells[cell] << "'\n";
964 if (p.next_token().cs() == "multicolumn") {
967 size_t const ncells =
968 convert<unsigned int>(p.verbatim_item());
970 // special cell properties alignment
972 handle_colalign(p, t, ColInfo());
973 ColInfo & ci = t.front();
975 // The logic of LyX for multicolumn vertical
976 // lines is too complicated to reproduce it
977 // here (see LyXTabular::TeXCellPreamble()).
978 // Therefore we simply put everything in the
982 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
983 cellinfo[row][col].align = ci.align;
984 cellinfo[row][col].special = ci.special;
985 cellinfo[row][col].leftlines = ci.leftlines;
986 cellinfo[row][col].rightlines = ci.rightlines;
988 parse_text_in_inset(p, os, FLAG_ITEM, false, context);
989 if (!cellinfo[row][col].content.empty()) {
990 // This may or may not work in LaTeX,
991 // but it does not work in LyX.
992 // FIXME: Handle it correctly!
993 cerr << "Moving cell content '"
995 << "' into a multicolumn cell. "
996 "This will probably not work."
999 cellinfo[row][col].content += os.str();
1001 // add dummy cells for multicol
1002 for (size_t i = 0; i < ncells - 1 && col < colinfo.size(); ++i) {
1004 cellinfo[row][col].multi = CELL_PART_OF_MULTICOLUMN;
1005 cellinfo[row][col].align = 'c';
1009 cellinfo[row][col].leftlines = colinfo[col].leftlines;
1010 cellinfo[row][col].rightlines = colinfo[col].rightlines;
1011 cellinfo[row][col].align = colinfo[col].align;
1013 parse_text_in_inset(p, os, FLAG_CELL, false, context);
1014 cellinfo[row][col].content += os.str();
1018 //cerr << "// handle almost empty last row what we have\n";
1019 // handle almost empty last row
1020 if (row && lines[row].empty() && row + 1 == rowinfo.size()) {
1021 //cerr << "remove empty last line\n";
1022 if (rowinfo[row].topline)
1023 rowinfo[row - 1].bottomline = true;
1024 for (size_t col = 0; col < colinfo.size(); ++col)
1025 if (cellinfo[row][col].topline)
1026 cellinfo[row - 1][col].bottomline = true;
1031 // Now we have the table structure and content in rowinfo, colinfo
1033 // Unfortunately LyX has some limitations that we need to work around.
1035 // Convert cells with special content to multicolumn cells
1036 // (LyX ignores the special field for non-multicolumn cells).
1037 for (size_t row = 0; row < rowinfo.size(); ++row) {
1038 for (size_t col = 0; col < cellinfo[row].size(); ++col) {
1039 if (cellinfo[row][col].multi == CELL_NORMAL &&
1040 !cellinfo[row][col].special.empty())
1041 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
1045 //cerr << "// output what we have\n";
1046 // output what we have
1047 os << "\n<lyxtabular version=\"3\" rows=\"" << rowinfo.size()
1048 << "\" columns=\"" << colinfo.size() << "\">\n";
1050 << write_attribute("rotate", false)
1051 << write_attribute("islongtable", is_long_tabular)
1054 //cerr << "// after header\n";
1055 for (size_t col = 0; col < colinfo.size(); ++col) {
1056 os << "<column alignment=\""
1057 << verbose_align(colinfo[col].align) << "\""
1059 << verbose_valign(colinfo[col].valign) << "\""
1060 << write_attribute("leftline", colinfo[col].leftlines > 0)
1061 << write_attribute("rightline", colinfo[col].rightlines > 0)
1062 << write_attribute("width", colinfo[col].width)
1063 << write_attribute("special", colinfo[col].special)
1066 //cerr << "// after cols\n";
1068 for (size_t row = 0; row < rowinfo.size(); ++row) {
1070 << write_attribute("topline", rowinfo[row].topline)
1071 << write_attribute("bottomline", rowinfo[row].bottomline)
1072 << write_attribute("endhead",
1073 rowinfo[row].type == LT_HEAD)
1074 << write_attribute("endfirsthead",
1075 rowinfo[row].type == LT_FIRSTHEAD)
1076 << write_attribute("endfoot",
1077 rowinfo[row].type == LT_FOOT)
1078 << write_attribute("endlastfoot",
1079 rowinfo[row].type == LT_LASTFOOT)
1080 << write_attribute("newpage", rowinfo[row].newpage)
1082 for (size_t col = 0; col < colinfo.size(); ++col) {
1083 CellInfo const & cell = cellinfo[row][col];
1085 if (cell.multi != CELL_NORMAL)
1086 os << " multicolumn=\"" << cell.multi << "\"";
1087 os << " alignment=\"" << verbose_align(cell.align)
1089 << " valignment=\"" << verbose_valign(cell.valign)
1091 << write_attribute("topline", cell.topline)
1092 << write_attribute("bottomline", cell.bottomline)
1093 << write_attribute("leftline", cell.leftlines > 0)
1094 << write_attribute("rightline", cell.rightlines > 0)
1095 << write_attribute("rotate", cell.rotate);
1096 //cerr << "\nrow: " << row << " col: " << col;
1098 // cerr << " topline=\"true\"";
1099 //if (cell.bottomline)
1100 // cerr << " bottomline=\"true\"";
1101 os << " usebox=\"none\""
1102 << write_attribute("width", cell.width);
1103 if (cell.multi != CELL_NORMAL)
1104 os << write_attribute("special", cell.special);
1106 << "\n\\begin_inset Text\n"
1108 << "\n\\end_inset\n"
1114 os << "</lyxtabular>\n";