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"
32 using std::istringstream;
34 using std::ostringstream;
39 // filled in preamble.cpp
40 std::map<char, int> special_columns;
47 ColInfo() : align('n'), valign('n'), rightlines(0), leftlines(0) {}
50 /// vertical alignment
54 /// special column alignment
56 /// number of lines on the right
58 /// number of lines on the left
63 /// row type for longtables
70 /// part of head on first page
74 /// part of foot on last page
81 RowInfo() : topline(false), bottomline(false), type(LT_NORMAL),
83 /// horizontal line above
85 /// horizontal line below
87 /// These are for longtabulars only
88 /// row type (head, foot, firsthead etc.)
90 /// row for a pagebreak
98 /// A multicolumn cell. The number of columns is <tt>1 + number
99 /// of CELL_PART_OF_MULTICOLUMN cells</tt> that follow directly
100 CELL_BEGIN_OF_MULTICOLUMN,
101 /// This is a dummy cell (part of a multicolumn cell)
102 CELL_PART_OF_MULTICOLUMN
108 CellInfo() : multi(CELL_NORMAL), align('n'), valign('n'),
109 leftlines(0), rightlines(0), topline(false),
110 bottomline(false), rotate(false) {}
117 /// vertical cell alignment
119 /// number of lines on the left
121 /// number of lines on the right
123 /// do we have a line above?
125 /// do we have a line below?
127 /// is the cell rotated?
129 /// width for multicolumn cells
131 /// special formatting for multicolumn cells
136 /// translate a horizontal alignment (as stored in ColInfo and CellInfo) to LyX
137 inline char const * verbose_align(char c)
152 /// translate a vertical alignment (as stored in ColInfo and CellInfo) to LyX
153 inline char const * verbose_valign(char c)
155 // The default value for no special alignment is "top".
168 // stripped down from tabluar.C. We use it currently only for bools and
170 string const write_attribute(string const & name, bool const & b)
172 // we write only true attribute values so we remove a bit of the
173 // file format bloat for tabulars.
174 return b ? ' ' + name + "=\"true\"" : string();
178 string const write_attribute(string const & name, string const & s)
180 return s.empty() ? string() : ' ' + name + "=\"" + s + '"';
184 /*! rather brutish way to code table structure in a string:
189 \multicolumn{2}{c}{4} & 5 //
195 gets "translated" to:
198 HLINE 1 TAB 2 TAB 3 HLINE HLINE LINE
199 \hline HLINE \multicolumn{2}{c}{4} TAB 5 HLINE HLINE LINE
200 HLINE 6 TAB 7 HLINE HLINE LINE
201 HLINE 8 HLINE \endhead HLINE LINE
205 char const TAB = '\001';
206 char const LINE = '\002';
207 char const HLINE = '\004';
211 * Move the information in leftlines, rightlines, align and valign to the
212 * special field. This is necessary if the special field is not empty,
213 * because LyX ignores leftlines, rightlines, align and valign in this case.
215 void ci2special(ColInfo & ci)
217 if (ci.width.empty() && ci.align == 'n')
218 // The alignment setting is already in special, since
219 // handle_colalign() never stores ci with these settings
220 // and ensures that leftlines == 0 and rightlines == 0 in
224 if (!ci.width.empty()) {
227 ci.special += ">{\\raggedright}";
230 ci.special += ">{\\raggedleft}";
233 ci.special += ">{\\centering}";
236 if (ci.valign == 'n')
239 ci.special += ci.valign;
240 ci.special += '{' + ci.width + '}';
243 ci.special += ci.align;
245 for (int i = 0; i < ci.leftlines; ++i)
246 ci.special.insert(0, "|");
247 for (int i = 0; i < ci.rightlines; ++i)
257 * Handle column specifications for tabulars and multicolumns.
258 * The next token of the parser \p p must be an opening brace, and we read
259 * everything until the matching closing brace.
260 * The resulting column specifications are filled into \p colinfo. This is
261 * in an intermediate form. fix_colalign() makes it suitable for LyX output.
263 void handle_colalign(Parser & p, vector<ColInfo> & colinfo,
264 ColInfo const & start)
266 if (p.get_token().cat() != catBegin)
267 cerr << "Wrong syntax for table column alignment.\n"
268 "Expected '{', got '" << p.curr_token().asInput()
271 ColInfo next = start;
272 for (Token t = p.get_token(); p.good() && t.cat() != catEnd;
275 cerr << "t: " << t << " c: '" << t.character() << "'\n";
278 // We cannot handle comments here
279 if (t.cat() == catComment) {
280 if (t.cs().empty()) {
284 cerr << "Ignoring comment: " << t.asInput();
288 switch (t.character()) {
292 // new column, horizontal aligned
293 next.align = t.character();
294 if (!next.special.empty())
296 colinfo.push_back(next);
302 // new column, vertical aligned box
303 next.valign = t.character();
304 next.width = p.verbatim_item();
305 if (!next.special.empty())
307 colinfo.push_back(next);
312 if (colinfo.empty()) {
313 if (next.special.empty())
317 } else if (colinfo.back().special.empty())
318 ++colinfo.back().rightlines;
319 else if (next.special.empty())
322 colinfo.back().special += '|';
325 // text before the next column
326 string const s = trim(p.verbatim_item());
327 if (next.special.empty() &&
329 // Maybe this can be converted to a
330 // horizontal alignment setting for
331 // fixed width columns
332 if (s == "\\raggedleft")
334 else if (s == "\\raggedright")
336 else if (s == "\\centering")
339 next.special = ">{" + s + '}';
341 next.special += ">{" + s + '}';
345 // text after the last column
346 string const s = trim(p.verbatim_item());
348 // This is not possible in LaTeX.
349 cerr << "Ignoring separator '<{"
350 << s << "}'." << endl;
352 ColInfo & ci = colinfo.back();
354 ci.special += "<{" + s + '}';
359 // *{n}{arg} means 'n' columns of type 'arg'
360 string const num = p.verbatim_item();
361 string const arg = p.verbatim_item();
362 size_t const n = convert<unsigned int>(num);
363 if (!arg.empty() && n > 0) {
365 for (size_t i = 0; i < n; ++i)
369 handle_colalign(p2, colinfo, next);
372 cerr << "Ignoring column specification"
373 " '*{" << num << "}{"
374 << arg << "}'." << endl;
379 // text instead of the column spacing
381 // text in addition to the column spacing
382 next.special += t.character();
383 next.special += '{' + p.verbatim_item() + '}';
386 // try user defined column types
387 if (special_columns.find(t.character()) !=
388 special_columns.end()) {
390 next.special += t.character();
392 special_columns[t.character()];
393 for (int i = 0; i < nargs; ++i)
394 next.special += '{' +
397 colinfo.push_back(next);
400 cerr << "Ignoring column specification"
401 " '" << t << "'." << endl;
406 // Maybe we have some column separators that need to be added to the
409 if (!next.special.empty()) {
410 ColInfo & ci = colinfo.back();
412 ci.special += next.special;
413 next.special.erase();
419 * Move the left and right lines and alignment settings of the column \p ci
420 * to the special field if necessary.
422 void fix_colalign(ColInfo & ci)
424 if (ci.leftlines > 1 || ci.rightlines > 1)
430 * LyX can't handle more than one vertical line at the left or right side
432 * This function moves the left and right lines and alignment settings of all
433 * columns in \p colinfo to the special field if necessary.
435 void fix_colalign(vector<ColInfo> & colinfo)
437 // Try to move extra leftlines to the previous column.
438 // We do this only if both special fields are empty, otherwise we
439 // can't tell wether the result will be the same.
440 for (size_t col = 0; col < colinfo.size(); ++col) {
441 if (colinfo[col].leftlines > 1 &&
442 colinfo[col].special.empty() && col > 0 &&
443 colinfo[col - 1].rightlines == 0 &&
444 colinfo[col - 1].special.empty()) {
445 ++colinfo[col - 1].rightlines;
446 --colinfo[col].leftlines;
449 // Try to move extra rightlines to the next column
450 for (size_t col = 0; col < colinfo.size(); ++col) {
451 if (colinfo[col].rightlines > 1 &&
452 colinfo[col].special.empty() &&
453 col < colinfo.size() - 1 &&
454 colinfo[col + 1].leftlines == 0 &&
455 colinfo[col + 1].special.empty()) {
456 ++colinfo[col + 1].leftlines;
457 --colinfo[col].rightlines;
460 // Move the lines and alignment settings to the special field if
462 for (size_t col = 0; col < colinfo.size(); ++col)
463 fix_colalign(colinfo[col]);
468 * Parse hlines and similar stuff.
469 * \returns wether the token \p t was parsed
471 bool parse_hlines(Parser & p, Token const & t, string & hlines,
472 bool is_long_tabular)
474 BOOST_ASSERT(t.cat() == catEscape);
476 if (t.cs() == "hline")
479 else if (t.cs() == "cline")
480 hlines += "\\cline{" + p.verbatim_item() + '}';
482 else if (is_long_tabular && t.cs() == "newpage")
483 hlines += "\\newpage";
492 /// Position in a row
494 /// At the very beginning, before the first token
496 /// After the first token and before any column token
498 /// After the first column token. Comments and whitespace are only
499 /// treated as tokens in this position
501 /// After the first non-column token at the end
507 * Parse table structure.
508 * We parse tables in a two-pass process: This function extracts the table
509 * structure (rows, columns, hlines etc.), but does not change the cell
510 * content. The cell content is parsed in a second step in handle_tabular().
512 void parse_table(Parser & p, ostream & os, bool is_long_tabular,
513 RowPosition & pos, unsigned flags)
515 // table structure commands such as \hline
518 // comments that occur at places where we can't handle them
522 Token const & t = p.get_token();
525 cerr << "t: " << t << " flags: " << flags << "\n";
528 // comments and whitespace in hlines
531 case IN_HLINES_START:
533 if (t.cat() == catComment) {
538 // We can't handle comments here,
539 // store them for later use
540 comments += t.asInput();
542 } else if (t.cat() == catSpace ||
543 t.cat() == catNewline) {
544 // whitespace is irrelevant here, we
545 // need to recognize hline stuff
554 // We need to handle structure stuff first in order to
555 // determine wether we need to output a HLINE separator
556 // before the row or not.
557 if (t.cat() == catEscape) {
558 if (parse_hlines(p, t, hlines, is_long_tabular)) {
561 pos = IN_HLINES_START;
566 case IN_HLINES_START:
573 else if (t.cs() == "tabularnewline" ||
577 cerr << "Warning: Converting TeX "
578 "'\\cr' to LaTeX '\\\\'."
580 // stuff before the line break
581 os << comments << HLINE << hlines << HLINE
583 //cerr << "hlines: " << hlines << endl;
590 else if (is_long_tabular &&
591 (t.cs() == "endhead" ||
592 t.cs() == "endfirsthead" ||
593 t.cs() == "endfoot" ||
594 t.cs() == "endlastfoot")) {
595 hlines += t.asInput();
599 // these commands are implicit line
601 os << comments << HLINE << hlines
608 pos = IN_HLINES_START;
610 case IN_HLINES_START:
618 // We need a HLINE separator if we either have no hline
619 // stuff at all and are just starting a row or if we just
620 // got the first non-hline token.
623 // no hline tokens exist, first token at row start
624 case IN_HLINES_START:
625 // hline tokens exist, first non-hline token at row
627 os << hlines << HLINE << comments;
633 // Oops, there is still cell content after hline
634 // stuff. This does not work in LaTeX, so we ignore
636 cerr << "Ignoring '" << hlines << "' in a cell"
647 // If we come here we have normal cell content
651 if (t.cat() == catMath) {
652 // we are inside some text mode thingy, so opening new math is allowed
653 Token const & n = p.get_token();
654 if (n.cat() == catMath) {
655 // TeX's $$...$$ syntax for displayed math
657 // This does only work because parse_math outputs TeX
658 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
660 p.get_token(); // skip the second '$' token
662 // simple $...$ stuff
665 // This does only work because parse_math outputs TeX
666 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
671 else if (t.cat() == catSpace || t.cat() == catNewline)
674 else if (t.cat() == catLetter ||
675 t.cat() == catSuper ||
677 t.cat() == catOther ||
678 t.cat() == catActive ||
679 t.cat() == catParameter)
682 else if (t.cat() == catBegin) {
684 parse_table(p, os, is_long_tabular, pos,
689 else if (t.cat() == catEnd) {
690 if (flags & FLAG_BRACE_LAST)
692 cerr << "unexpected '}'\n";
695 else if (t.cat() == catAlign) {
700 else if (t.cat() == catComment)
703 else if (t.cs() == "(") {
705 // This does only work because parse_math outputs TeX
706 parse_math(p, os, FLAG_SIMPLE2, MATH_MODE);
710 else if (t.cs() == "[") {
712 // This does only work because parse_math outputs TeX
713 parse_math(p, os, FLAG_EQUATION, MATH_MODE);
717 else if (t.cs() == "begin") {
718 string const name = p.getArg('{', '}');
719 active_environments.push_back(name);
720 os << "\\begin{" << name << '}';
721 // treat the nested environment as a block, don't
722 // parse &, \\ etc, because they don't belong to our
723 // table if they appear.
724 os << p.verbatimEnvironment(name);
725 os << "\\end{" << name << '}';
726 active_environments.pop_back();
729 else if (t.cs() == "end") {
730 if (flags & FLAG_END) {
731 // eat environment name
732 string const name = p.getArg('{', '}');
733 if (name != active_environment())
734 p.error("\\end{" + name + "} does not match \\begin{"
735 + active_environment() + "}");
738 p.error("found 'end' unexpectedly");
745 // We can have comments if the last line is incomplete
748 // We can have hline stuff if the last line is incomplete
749 if (!hlines.empty()) {
750 // this does not work in LaTeX, so we ignore it
751 cerr << "Ignoring '" << hlines << "' at end of tabular"
757 void handle_hline_above(RowInfo & ri, vector<CellInfo> & ci)
760 for (size_t col = 0; col < ci.size(); ++col)
761 ci[col].topline = true;
765 void handle_hline_below(RowInfo & ri, vector<CellInfo> & ci)
767 ri.bottomline = true;
768 for (size_t col = 0; col < ci.size(); ++col)
769 ci[col].bottomline = true;
773 } // anonymous namespace
776 void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
779 string posopts = p.getOpt();
780 if (!posopts.empty()) {
781 // FIXME: Convert this to ERT
783 cerr << "horizontal longtable";
785 cerr << "vertical tabular";
786 cerr << " positioning '" << posopts << "' ignored\n";
789 vector<ColInfo> colinfo;
791 // handle column formatting
792 handle_colalign(p, colinfo, ColInfo());
793 fix_colalign(colinfo);
795 // first scan of cells
796 // use table mode to keep it minimal-invasive
797 // not exactly what's TeX doing...
798 vector<string> lines;
800 RowPosition rowpos = ROW_START;
801 parse_table(p, ss, is_long_tabular, rowpos, FLAG_END);
802 split(ss.str(), lines, LINE);
804 vector< vector<CellInfo> > cellinfo(lines.size());
805 vector<RowInfo> rowinfo(lines.size());
808 //cerr << "// split into rows\n";
809 for (size_t row = 0; row < rowinfo.size(); ++row) {
812 cellinfo[row].resize(colinfo.size());
815 vector<string> dummy;
816 //cerr << "\n########### LINE: " << lines[row] << "########\n";
817 split(lines[row], dummy, HLINE);
819 // handle horizontal line fragments
820 // we do only expect this for a last line without '\\'
821 if (dummy.size() != 3) {
822 if ((dummy.size() != 1 && dummy.size() != 2) ||
823 row != rowinfo.size() - 1)
824 cerr << "unexpected dummy size: " << dummy.size()
825 << " content: " << lines[row] << "\n";
828 lines[row] = dummy[1];
830 //cerr << "line: " << row << " above 0: " << dummy[0] << "\n";
831 //cerr << "line: " << row << " below 2: " << dummy[2] << "\n";
832 //cerr << "line: " << row << " cells 1: " << dummy[1] << "\n";
834 for (int i = 0; i <= 2; i += 2) {
835 //cerr << " reading from line string '" << dummy[i] << "'\n";
838 Token t = p1.get_token();
839 //cerr << "read token: " << t << "\n";
840 if (t.cs() == "hline") {
842 if (rowinfo[row].topline) {
843 if (row > 0) // extra bottomline above
844 handle_hline_below(rowinfo[row - 1], cellinfo[row - 1]);
846 cerr << "dropping extra hline\n";
847 //cerr << "below row: " << row-1 << endl;
849 handle_hline_above(rowinfo[row], cellinfo[row]);
850 //cerr << "above row: " << row << endl;
853 //cerr << "below row: " << row << endl;
854 handle_hline_below(rowinfo[row], cellinfo[row]);
856 } else if (t.cs() == "cline") {
857 string arg = p1.verbatim_item();
858 //cerr << "read cline arg: '" << arg << "'\n";
862 size_t from = convert<unsigned int>(t[0]);
864 cerr << "Could not parse "
865 "cline start column."
868 // 1 based index -> 0 based
870 if (from >= colinfo.size()) {
871 cerr << "cline starts at non "
873 << (from + 1) << endl;
874 from = colinfo.size() - 1;
876 size_t to = convert<unsigned int>(t[1]);
878 cerr << "Could not parse "
882 // 1 based index -> 0 based
884 if (to >= colinfo.size()) {
885 cerr << "cline ends at non "
888 to = colinfo.size() - 1;
890 for (size_t col = from; col <= to; ++col) {
891 //cerr << "row: " << row << " col: " << col << " i: " << i << endl;
893 rowinfo[row].topline = true;
894 cellinfo[row][col].topline = true;
896 rowinfo[row].bottomline = true;
897 cellinfo[row][col].bottomline = true;
900 } else if (t.cs() == "endhead") {
902 rowinfo[row].type = LT_HEAD;
903 for (int r = row - 1; r >= 0; --r) {
904 if (rowinfo[r].type != LT_NORMAL)
906 rowinfo[r].type = LT_HEAD;
908 } else if (t.cs() == "endfirsthead") {
910 rowinfo[row].type = LT_FIRSTHEAD;
911 for (int r = row - 1; r >= 0; --r) {
912 if (rowinfo[r].type != LT_NORMAL)
914 rowinfo[r].type = LT_FIRSTHEAD;
916 } else if (t.cs() == "endfoot") {
918 rowinfo[row].type = LT_FOOT;
919 for (int r = row - 1; r >= 0; --r) {
920 if (rowinfo[r].type != LT_NORMAL)
922 rowinfo[r].type = LT_FOOT;
924 } else if (t.cs() == "endlastfoot") {
926 rowinfo[row].type = LT_LASTFOOT;
927 for (int r = row - 1; r >= 0; --r) {
928 if (rowinfo[r].type != LT_NORMAL)
930 rowinfo[r].type = LT_LASTFOOT;
932 } else if (t.cs() == "newpage") {
935 rowinfo[row - 1].newpage = true;
937 // This does not work in LaTeX
943 rowinfo[row].newpage = true;
945 cerr << "unexpected line token: " << t << endl;
951 vector<string> cells;
952 split(lines[row], cells, TAB);
953 for (size_t col = 0, cell = 0; cell < cells.size();
955 //cerr << "cell content: '" << cells[cell] << "'\n";
956 if (col >= colinfo.size()) {
957 // This does not work in LaTeX
958 cerr << "Ignoring extra cell '"
959 << cells[cell] << "'." << endl;
962 Parser p(cells[cell]);
964 //cells[cell] << "'\n";
965 if (p.next_token().cs() == "multicolumn") {
968 size_t const ncells =
969 convert<unsigned int>(p.verbatim_item());
971 // special cell properties alignment
973 handle_colalign(p, t, ColInfo());
974 ColInfo & ci = t.front();
976 // The logic of LyX for multicolumn vertical
977 // lines is too complicated to reproduce it
978 // here (see LyXTabular::TeXCellPreamble()).
979 // Therefore we simply put everything in the
983 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
984 cellinfo[row][col].align = ci.align;
985 cellinfo[row][col].special = ci.special;
986 cellinfo[row][col].leftlines = ci.leftlines;
987 cellinfo[row][col].rightlines = ci.rightlines;
989 parse_text_in_inset(p, os, FLAG_ITEM, false, context);
990 if (!cellinfo[row][col].content.empty()) {
991 // This may or may not work in LaTeX,
992 // but it does not work in LyX.
993 // FIXME: Handle it correctly!
994 cerr << "Moving cell content '"
996 << "' into a multicolumn cell. "
997 "This will probably not work."
1000 cellinfo[row][col].content += os.str();
1002 // add dummy cells for multicol
1003 for (size_t i = 0; i < ncells - 1 && col < colinfo.size(); ++i) {
1005 cellinfo[row][col].multi = CELL_PART_OF_MULTICOLUMN;
1006 cellinfo[row][col].align = 'c';
1010 cellinfo[row][col].leftlines = colinfo[col].leftlines;
1011 cellinfo[row][col].rightlines = colinfo[col].rightlines;
1012 cellinfo[row][col].align = colinfo[col].align;
1014 parse_text_in_inset(p, os, FLAG_CELL, false, context);
1015 cellinfo[row][col].content += os.str();
1019 //cerr << "// handle almost empty last row what we have\n";
1020 // handle almost empty last row
1021 if (row && lines[row].empty() && row + 1 == rowinfo.size()) {
1022 //cerr << "remove empty last line\n";
1023 if (rowinfo[row].topline)
1024 rowinfo[row - 1].bottomline = true;
1025 for (size_t col = 0; col < colinfo.size(); ++col)
1026 if (cellinfo[row][col].topline)
1027 cellinfo[row - 1][col].bottomline = true;
1032 // Now we have the table structure and content in rowinfo, colinfo
1034 // Unfortunately LyX has some limitations that we need to work around.
1036 // Convert cells with special content to multicolumn cells
1037 // (LyX ignores the special field for non-multicolumn cells).
1038 for (size_t row = 0; row < rowinfo.size(); ++row) {
1039 for (size_t col = 0; col < cellinfo[row].size(); ++col) {
1040 if (cellinfo[row][col].multi == CELL_NORMAL &&
1041 !cellinfo[row][col].special.empty())
1042 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
1046 //cerr << "// output what we have\n";
1047 // output what we have
1048 os << "\n<lyxtabular version=\"3\" rows=\"" << rowinfo.size()
1049 << "\" columns=\"" << colinfo.size() << "\">\n";
1051 << write_attribute("rotate", false)
1052 << write_attribute("islongtable", is_long_tabular)
1055 //cerr << "// after header\n";
1056 for (size_t col = 0; col < colinfo.size(); ++col) {
1057 os << "<column alignment=\""
1058 << verbose_align(colinfo[col].align) << "\""
1060 << verbose_valign(colinfo[col].valign) << "\""
1061 << write_attribute("leftline", colinfo[col].leftlines > 0)
1062 << write_attribute("rightline", colinfo[col].rightlines > 0)
1063 << write_attribute("width", translate_len(colinfo[col].width))
1064 << write_attribute("special", colinfo[col].special)
1067 //cerr << "// after cols\n";
1069 for (size_t row = 0; row < rowinfo.size(); ++row) {
1071 << write_attribute("topline", rowinfo[row].topline)
1072 << write_attribute("bottomline", rowinfo[row].bottomline)
1073 << write_attribute("endhead",
1074 rowinfo[row].type == LT_HEAD)
1075 << write_attribute("endfirsthead",
1076 rowinfo[row].type == LT_FIRSTHEAD)
1077 << write_attribute("endfoot",
1078 rowinfo[row].type == LT_FOOT)
1079 << write_attribute("endlastfoot",
1080 rowinfo[row].type == LT_LASTFOOT)
1081 << write_attribute("newpage", rowinfo[row].newpage)
1083 for (size_t col = 0; col < colinfo.size(); ++col) {
1084 CellInfo const & cell = cellinfo[row][col];
1086 if (cell.multi != CELL_NORMAL)
1087 os << " multicolumn=\"" << cell.multi << "\"";
1088 os << " alignment=\"" << verbose_align(cell.align)
1090 << " valignment=\"" << verbose_valign(cell.valign)
1092 << write_attribute("topline", cell.topline)
1093 << write_attribute("bottomline", cell.bottomline)
1094 << write_attribute("leftline", cell.leftlines > 0)
1095 << write_attribute("rightline", cell.rightlines > 0)
1096 << write_attribute("rotate", cell.rotate);
1097 //cerr << "\nrow: " << row << " col: " << col;
1099 // cerr << " topline=\"true\"";
1100 //if (cell.bottomline)
1101 // cerr << " bottomline=\"true\"";
1102 os << " usebox=\"none\""
1103 << write_attribute("width", translate_len(cell.width));
1104 if (cell.multi != CELL_NORMAL)
1105 os << write_attribute("special", cell.special);
1107 << "\n\\begin_inset Text\n"
1109 << "\n\\end_inset\n"
1115 os << "</lyxtabular>\n";