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"
33 using std::istringstream;
35 using std::ostringstream;
40 // filled in preamble.C
41 std::map<char, int> special_columns;
48 ColInfo() : align('n'), valign('n'), rightlines(0), leftlines(0) {}
51 /// vertical alignment
55 /// special column alignment
57 /// number of lines on the right
59 /// number of lines on the left
64 /// row type for longtables
71 /// part of head on first page
75 /// part of foot on last page
82 RowInfo() : topline(false), bottomline(false), type(LT_NORMAL),
84 /// horizontal line above
86 /// horizontal line below
88 /// These are for longtabulars only
89 /// row type (head, foot, firsthead etc.)
91 /// row for a pagebreak
99 /// A multicolumn cell. The number of columns is <tt>1 + number
100 /// of CELL_PART_OF_MULTICOLUMN cells</tt> that follow directly
101 CELL_BEGIN_OF_MULTICOLUMN,
102 /// This is a dummy cell (part of a multicolumn cell)
103 CELL_PART_OF_MULTICOLUMN
109 CellInfo() : multi(CELL_NORMAL), align('n'), valign('n'),
110 leftlines(0), rightlines(0), topline(false),
111 bottomline(false), rotate(false) {}
118 /// vertical cell alignment
120 /// number of lines on the left
122 /// number of lines on the right
124 /// do we have a line above?
126 /// do we have a line below?
128 /// is the cell rotated?
130 /// width for multicolumn cells
132 /// special formatting for multicolumn cells
137 /// translate a horizontal alignment (as stored in ColInfo and CellInfo) to LyX
138 inline char const * verbose_align(char c)
153 /// translate a vertical alignment (as stored in ColInfo and CellInfo) to LyX
154 inline char const * verbose_valign(char c)
156 // The default value for no special alignment is "top".
169 // stripped down from tabluar.C. We use it currently only for bools and
171 string const write_attribute(string const & name, bool const & b)
173 // we write only true attribute values so we remove a bit of the
174 // file format bloat for tabulars.
175 return b ? ' ' + name + "=\"true\"" : string();
179 string const write_attribute(string const & name, string const & s)
181 return s.empty() ? string() : ' ' + name + "=\"" + s + '"';
185 /*! rather brutish way to code table structure in a string:
190 \multicolumn{2}{c}{4} & 5 //
196 gets "translated" to:
199 HLINE 1 TAB 2 TAB 3 HLINE HLINE LINE
200 \hline HLINE \multicolumn{2}{c}{4} TAB 5 HLINE HLINE LINE
201 HLINE 6 TAB 7 HLINE HLINE LINE
202 HLINE 8 HLINE \endhead HLINE LINE
206 char const TAB = '\001';
207 char const LINE = '\002';
208 char const HLINE = '\004';
212 * Move the information in leftlines, rightlines, align and valign to the
213 * special field. This is necessary if the special field is not empty,
214 * because LyX ignores leftlines, rightlines, align and valign in this case.
216 void ci2special(ColInfo & ci)
218 if (ci.width.empty() && ci.align == 'n')
219 // The alignment setting is already in special, since
220 // handle_colalign() never stores ci with these settings
221 // and ensures that leftlines == 0 and rightlines == 0 in
225 if (!ci.width.empty()) {
228 ci.special += ">{\\raggedright}";
231 ci.special += ">{\\raggedleft}";
234 ci.special += ">{\\centering}";
237 if (ci.valign == 'n')
240 ci.special += ci.valign;
241 ci.special += '{' + ci.width + '}';
244 ci.special += ci.align;
246 for (int i = 0; i < ci.leftlines; ++i)
247 ci.special.insert(0, "|");
248 for (int i = 0; i < ci.rightlines; ++i)
258 * Handle column specifications for tabulars and multicolumns.
259 * The next token of the parser \p p must be an opening brace, and we read
260 * everything until the matching closing brace.
261 * The resulting column specifications are filled into \p colinfo. This is
262 * in an intermediate form. fix_colalign() makes it suitable for LyX output.
264 void handle_colalign(Parser & p, vector<ColInfo> & colinfo,
265 ColInfo const & start)
267 if (p.get_token().cat() != catBegin)
268 cerr << "Wrong syntax for table column alignment.\n"
269 "Expected '{', got '" << p.curr_token().asInput()
272 ColInfo next = start;
273 for (Token t = p.get_token(); p.good() && t.cat() != catEnd;
276 cerr << "t: " << t << " c: '" << t.character() << "'\n";
279 // We cannot handle comments here
280 if (t.cat() == catComment) {
281 if (t.cs().empty()) {
285 cerr << "Ignoring comment: " << t.asInput();
289 switch (t.character()) {
293 // new column, horizontal aligned
294 next.align = t.character();
295 if (!next.special.empty())
297 colinfo.push_back(next);
303 // new column, vertical aligned box
304 next.valign = t.character();
305 next.width = p.verbatim_item();
306 if (!next.special.empty())
308 colinfo.push_back(next);
313 if (colinfo.empty()) {
314 if (next.special.empty())
318 } else if (colinfo.back().special.empty())
319 ++colinfo.back().rightlines;
320 else if (next.special.empty())
323 colinfo.back().special += '|';
326 // text before the next column
327 string const s = trim(p.verbatim_item());
328 if (next.special.empty() &&
330 // Maybe this can be converted to a
331 // horizontal alignment setting for
332 // fixed width columns
333 if (s == "\\raggedleft")
335 else if (s == "\\raggedright")
337 else if (s == "\\centering")
340 next.special = ">{" + s + '}';
342 next.special += ">{" + s + '}';
346 // text after the last column
347 string const s = trim(p.verbatim_item());
349 // This is not possible in LaTeX.
350 cerr << "Ignoring separator '<{"
351 << s << "}'." << endl;
353 ColInfo & ci = colinfo.back();
355 ci.special += "<{" + s + '}';
360 // *{n}{arg} means 'n' columns of type 'arg'
361 string const num = p.verbatim_item();
362 string const arg = p.verbatim_item();
363 size_t const n = convert<unsigned int>(num);
364 if (!arg.empty() && n > 0) {
366 for (size_t i = 0; i < n; ++i)
370 handle_colalign(p2, colinfo, next);
373 cerr << "Ignoring column specification"
374 " '*{" << num << "}{"
375 << arg << "}'." << endl;
380 // text instead of the column spacing
382 // text in addition to the column spacing
383 next.special += t.character();
384 next.special += '{' + p.verbatim_item() + '}';
387 // try user defined column types
388 if (special_columns.find(t.character()) !=
389 special_columns.end()) {
391 next.special += t.character();
393 special_columns[t.character()];
394 for (int i = 0; i < nargs; ++i)
395 next.special += '{' +
398 colinfo.push_back(next);
401 cerr << "Ignoring column specification"
402 " '" << t << "'." << endl;
407 // Maybe we have some column separators that need to be added to the
410 if (!next.special.empty()) {
411 ColInfo & ci = colinfo.back();
413 ci.special += next.special;
414 next.special.erase();
420 * Move the left and right lines and alignment settings of the column \p ci
421 * to the special field if necessary.
423 void fix_colalign(ColInfo & ci)
425 if (ci.leftlines > 1 || ci.rightlines > 1)
431 * LyX can't handle more than one vertical line at the left or right side
433 * This function moves the left and right lines and alignment settings of all
434 * columns in \p colinfo to the special field if necessary.
436 void fix_colalign(vector<ColInfo> & colinfo)
438 // Try to move extra leftlines to the previous column.
439 // We do this only if both special fields are empty, otherwise we
440 // can't tell wether the result will be the same.
441 for (size_t col = 0; col < colinfo.size(); ++col) {
442 if (colinfo[col].leftlines > 1 &&
443 colinfo[col].special.empty() && col > 0 &&
444 colinfo[col - 1].rightlines == 0 &&
445 colinfo[col - 1].special.empty()) {
446 ++colinfo[col - 1].rightlines;
447 --colinfo[col].leftlines;
450 // Try to move extra rightlines to the next column
451 for (size_t col = 0; col < colinfo.size(); ++col) {
452 if (colinfo[col].rightlines > 1 &&
453 colinfo[col].special.empty() &&
454 col < colinfo.size() - 1 &&
455 colinfo[col + 1].leftlines == 0 &&
456 colinfo[col + 1].special.empty()) {
457 ++colinfo[col + 1].leftlines;
458 --colinfo[col].rightlines;
461 // Move the lines and alignment settings to the special field if
463 for (size_t col = 0; col < colinfo.size(); ++col)
464 fix_colalign(colinfo[col]);
469 * Parse hlines and similar stuff.
470 * \returns wether the token \p t was parsed
472 bool parse_hlines(Parser & p, Token const & t, string & hlines,
473 bool is_long_tabular)
475 BOOST_ASSERT(t.cat() == catEscape);
477 if (t.cs() == "hline")
480 else if (t.cs() == "cline")
481 hlines += "\\cline{" + p.verbatim_item() + '}';
483 else if (is_long_tabular && t.cs() == "newpage")
484 hlines += "\\newpage";
493 /// Position in a row
495 /// At the very beginning, before the first token
497 /// After the first token and before any column token
499 /// After the first column token. Comments and whitespace are only
500 /// treated as tokens in this position
502 /// After the first non-column token at the end
508 * Parse table structure.
509 * We parse tables in a two-pass process: This function extracts the table
510 * structure (rows, columns, hlines etc.), but does not change the cell
511 * content. The cell content is parsed in a second step in handle_tabular().
513 void parse_table(Parser & p, ostream & os, bool is_long_tabular,
514 RowPosition & pos, unsigned flags)
516 // table structure commands such as \hline
519 // comments that occur at places where we can't handle them
523 Token const & t = p.get_token();
526 cerr << "t: " << t << " flags: " << flags << "\n";
529 // comments and whitespace in hlines
532 case IN_HLINES_START:
534 if (t.cat() == catComment) {
539 // We can't handle comments here,
540 // store them for later use
541 comments += t.asInput();
543 } else if (t.cat() == catSpace ||
544 t.cat() == catNewline) {
545 // whitespace is irrelevant here, we
546 // need to recognize hline stuff
555 // We need to handle structure stuff first in order to
556 // determine wether we need to output a HLINE separator
557 // before the row or not.
558 if (t.cat() == catEscape) {
559 if (parse_hlines(p, t, hlines, is_long_tabular)) {
562 pos = IN_HLINES_START;
567 case IN_HLINES_START:
574 else if (t.cs() == "tabularnewline" ||
578 cerr << "Warning: Converting TeX "
579 "'\\cr' to LaTeX '\\\\'."
581 // stuff before the line break
582 os << comments << HLINE << hlines << HLINE
584 //cerr << "hlines: " << hlines << endl;
591 else if (is_long_tabular &&
592 (t.cs() == "endhead" ||
593 t.cs() == "endfirsthead" ||
594 t.cs() == "endfoot" ||
595 t.cs() == "endlastfoot")) {
596 hlines += t.asInput();
600 // these commands are implicit line
602 os << comments << HLINE << hlines
609 pos = IN_HLINES_START;
611 case IN_HLINES_START:
619 // We need a HLINE separator if we either have no hline
620 // stuff at all and are just starting a row or if we just
621 // got the first non-hline token.
624 // no hline tokens exist, first token at row start
625 case IN_HLINES_START:
626 // hline tokens exist, first non-hline token at row
628 os << hlines << HLINE << comments;
634 // Oops, there is still cell content after hline
635 // stuff. This does not work in LaTeX, so we ignore
637 cerr << "Ignoring '" << hlines << "' in a cell"
648 // If we come here we have normal cell content
652 if (t.cat() == catMath) {
653 // we are inside some text mode thingy, so opening new math is allowed
654 Token const & n = p.get_token();
655 if (n.cat() == catMath) {
656 // TeX's $$...$$ syntax for displayed math
658 // This does only work because parse_math outputs TeX
659 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
661 p.get_token(); // skip the second '$' token
663 // simple $...$ stuff
666 // This does only work because parse_math outputs TeX
667 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
672 else if (t.cat() == catSpace || t.cat() == catNewline)
675 else if (t.cat() == catLetter ||
676 t.cat() == catSuper ||
678 t.cat() == catOther ||
679 t.cat() == catActive ||
680 t.cat() == catParameter)
683 else if (t.cat() == catBegin) {
685 parse_table(p, os, is_long_tabular, pos,
690 else if (t.cat() == catEnd) {
691 if (flags & FLAG_BRACE_LAST)
693 cerr << "unexpected '}'\n";
696 else if (t.cat() == catAlign) {
701 else if (t.cat() == catComment)
704 else if (t.cs() == "(") {
706 // This does only work because parse_math outputs TeX
707 parse_math(p, os, FLAG_SIMPLE2, MATH_MODE);
711 else if (t.cs() == "[") {
713 // This does only work because parse_math outputs TeX
714 parse_math(p, os, FLAG_EQUATION, MATH_MODE);
718 else if (t.cs() == "begin") {
719 string const name = p.getArg('{', '}');
720 active_environments.push_back(name);
721 os << "\\begin{" << name << '}';
722 // treat the nested environment as a block, don't
723 // parse &, \\ etc, because they don't belong to our
724 // table if they appear.
725 os << p.verbatimEnvironment(name);
726 os << "\\end{" << name << '}';
727 active_environments.pop_back();
730 else if (t.cs() == "end") {
731 if (flags & FLAG_END) {
732 // eat environment name
733 string const name = p.getArg('{', '}');
734 if (name != active_environment())
735 p.error("\\end{" + name + "} does not match \\begin{"
736 + active_environment() + "}");
739 p.error("found 'end' unexpectedly");
746 // We can have comments if the last line is incomplete
749 // We can have hline stuff if the last line is incomplete
750 if (!hlines.empty()) {
751 // this does not work in LaTeX, so we ignore it
752 cerr << "Ignoring '" << hlines << "' at end of tabular"
758 void handle_hline_above(RowInfo & ri, vector<CellInfo> & ci)
761 for (size_t col = 0; col < ci.size(); ++col)
762 ci[col].topline = true;
766 void handle_hline_below(RowInfo & ri, vector<CellInfo> & ci)
768 ri.bottomline = true;
769 for (size_t col = 0; col < ci.size(); ++col)
770 ci[col].bottomline = true;
774 } // anonymous namespace
777 void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
780 string posopts = p.getOpt();
781 if (!posopts.empty()) {
782 // FIXME: Convert this to ERT
784 cerr << "horizontal longtable";
786 cerr << "vertical tabular";
787 cerr << " positioning '" << posopts << "' ignored\n";
790 vector<ColInfo> colinfo;
792 // handle column formatting
793 handle_colalign(p, colinfo, ColInfo());
794 fix_colalign(colinfo);
796 // first scan of cells
797 // use table mode to keep it minimal-invasive
798 // not exactly what's TeX doing...
799 vector<string> lines;
801 RowPosition rowpos = ROW_START;
802 parse_table(p, ss, is_long_tabular, rowpos, FLAG_END);
803 split(ss.str(), lines, LINE);
805 vector< vector<CellInfo> > cellinfo(lines.size());
806 vector<RowInfo> rowinfo(lines.size());
809 //cerr << "// split into rows\n";
810 for (size_t row = 0; row < rowinfo.size(); ++row) {
813 cellinfo[row].resize(colinfo.size());
816 vector<string> dummy;
817 //cerr << "\n########### LINE: " << lines[row] << "########\n";
818 split(lines[row], dummy, HLINE);
820 // handle horizontal line fragments
821 // we do only expect this for a last line without '\\'
822 if (dummy.size() != 3) {
823 if ((dummy.size() != 1 && dummy.size() != 2) ||
824 row != rowinfo.size() - 1)
825 cerr << "unexpected dummy size: " << dummy.size()
826 << " content: " << lines[row] << "\n";
829 lines[row] = dummy[1];
831 //cerr << "line: " << row << " above 0: " << dummy[0] << "\n";
832 //cerr << "line: " << row << " below 2: " << dummy[2] << "\n";
833 //cerr << "line: " << row << " cells 1: " << dummy[1] << "\n";
835 for (int i = 0; i <= 2; i += 2) {
836 //cerr << " reading from line string '" << dummy[i] << "'\n";
839 Token t = p1.get_token();
840 //cerr << "read token: " << t << "\n";
841 if (t.cs() == "hline") {
843 if (rowinfo[row].topline) {
844 if (row > 0) // extra bottomline above
845 handle_hline_below(rowinfo[row - 1], cellinfo[row - 1]);
847 cerr << "dropping extra hline\n";
848 //cerr << "below row: " << row-1 << endl;
850 handle_hline_above(rowinfo[row], cellinfo[row]);
851 //cerr << "above row: " << row << endl;
854 //cerr << "below row: " << row << endl;
855 handle_hline_below(rowinfo[row], cellinfo[row]);
857 } else if (t.cs() == "cline") {
858 string arg = p1.verbatim_item();
859 //cerr << "read cline arg: '" << arg << "'\n";
863 size_t from = convert<unsigned int>(t[0]);
865 cerr << "Could not parse "
866 "cline start column."
869 // 1 based index -> 0 based
871 if (from >= colinfo.size()) {
872 cerr << "cline starts at non "
874 << (from + 1) << endl;
875 from = colinfo.size() - 1;
877 size_t to = convert<unsigned int>(t[1]);
879 cerr << "Could not parse "
883 // 1 based index -> 0 based
885 if (to >= colinfo.size()) {
886 cerr << "cline ends at non "
889 to = colinfo.size() - 1;
891 for (size_t col = from; col <= to; ++col) {
892 //cerr << "row: " << row << " col: " << col << " i: " << i << endl;
894 rowinfo[row].topline = true;
895 cellinfo[row][col].topline = true;
897 rowinfo[row].bottomline = true;
898 cellinfo[row][col].bottomline = true;
901 } else if (t.cs() == "endhead") {
903 rowinfo[row].type = LT_HEAD;
904 for (int r = row - 1; r >= 0; --r) {
905 if (rowinfo[r].type != LT_NORMAL)
907 rowinfo[r].type = LT_HEAD;
909 } else if (t.cs() == "endfirsthead") {
911 rowinfo[row].type = LT_FIRSTHEAD;
912 for (int r = row - 1; r >= 0; --r) {
913 if (rowinfo[r].type != LT_NORMAL)
915 rowinfo[r].type = LT_FIRSTHEAD;
917 } else if (t.cs() == "endfoot") {
919 rowinfo[row].type = LT_FOOT;
920 for (int r = row - 1; r >= 0; --r) {
921 if (rowinfo[r].type != LT_NORMAL)
923 rowinfo[r].type = LT_FOOT;
925 } else if (t.cs() == "endlastfoot") {
927 rowinfo[row].type = LT_LASTFOOT;
928 for (int r = row - 1; r >= 0; --r) {
929 if (rowinfo[r].type != LT_NORMAL)
931 rowinfo[r].type = LT_LASTFOOT;
933 } else if (t.cs() == "newpage") {
936 rowinfo[row - 1].newpage = true;
938 // This does not work in LaTeX
944 rowinfo[row].newpage = true;
946 cerr << "unexpected line token: " << t << endl;
952 vector<string> cells;
953 split(lines[row], cells, TAB);
954 for (size_t col = 0, cell = 0; cell < cells.size();
956 //cerr << "cell content: '" << cells[cell] << "'\n";
957 if (col >= colinfo.size()) {
958 // This does not work in LaTeX
959 cerr << "Ignoring extra cell '"
960 << cells[cell] << "'." << endl;
963 Parser p(cells[cell]);
965 //cells[cell] << "'\n";
966 if (p.next_token().cs() == "multicolumn") {
969 size_t const ncells =
970 convert<unsigned int>(p.verbatim_item());
972 // special cell properties alignment
974 handle_colalign(p, t, ColInfo());
975 ColInfo & ci = t.front();
977 // The logic of LyX for multicolumn vertical
978 // lines is too complicated to reproduce it
979 // here (see LyXTabular::TeXCellPreamble()).
980 // Therefore we simply put everything in the
984 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
985 cellinfo[row][col].align = ci.align;
986 cellinfo[row][col].special = ci.special;
987 cellinfo[row][col].leftlines = ci.leftlines;
988 cellinfo[row][col].rightlines = ci.rightlines;
990 parse_text_in_inset(p, os, FLAG_ITEM, false, context);
991 if (!cellinfo[row][col].content.empty()) {
992 // This may or may not work in LaTeX,
993 // but it does not work in LyX.
994 // FIXME: Handle it correctly!
995 cerr << "Moving cell content '"
997 << "' into a multicolumn cell. "
998 "This will probably not work."
1001 cellinfo[row][col].content += os.str();
1003 // add dummy cells for multicol
1004 for (size_t i = 0; i < ncells - 1 && col < colinfo.size(); ++i) {
1006 cellinfo[row][col].multi = CELL_PART_OF_MULTICOLUMN;
1007 cellinfo[row][col].align = 'c';
1011 cellinfo[row][col].leftlines = colinfo[col].leftlines;
1012 cellinfo[row][col].rightlines = colinfo[col].rightlines;
1013 cellinfo[row][col].align = colinfo[col].align;
1015 parse_text_in_inset(p, os, FLAG_CELL, false, context);
1016 cellinfo[row][col].content += os.str();
1020 //cerr << "// handle almost empty last row what we have\n";
1021 // handle almost empty last row
1022 if (row && lines[row].empty() && row + 1 == rowinfo.size()) {
1023 //cerr << "remove empty last line\n";
1024 if (rowinfo[row].topline)
1025 rowinfo[row - 1].bottomline = true;
1026 for (size_t col = 0; col < colinfo.size(); ++col)
1027 if (cellinfo[row][col].topline)
1028 cellinfo[row - 1][col].bottomline = true;
1033 // Now we have the table structure and content in rowinfo, colinfo
1035 // Unfortunately LyX has some limitations that we need to work around.
1037 // Convert cells with special content to multicolumn cells
1038 // (LyX ignores the special field for non-multicolumn cells).
1039 for (size_t row = 0; row < rowinfo.size(); ++row) {
1040 for (size_t col = 0; col < cellinfo[row].size(); ++col) {
1041 if (cellinfo[row][col].multi == CELL_NORMAL &&
1042 !cellinfo[row][col].special.empty())
1043 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
1047 //cerr << "// output what we have\n";
1048 // output what we have
1049 os << "\n<lyxtabular version=\"3\" rows=\"" << rowinfo.size()
1050 << "\" columns=\"" << colinfo.size() << "\">\n";
1052 << write_attribute("rotate", false)
1053 << write_attribute("islongtable", is_long_tabular)
1056 //cerr << "// after header\n";
1057 for (size_t col = 0; col < colinfo.size(); ++col) {
1058 os << "<column alignment=\""
1059 << verbose_align(colinfo[col].align) << "\""
1061 << verbose_valign(colinfo[col].valign) << "\""
1062 << write_attribute("leftline", colinfo[col].leftlines > 0)
1063 << write_attribute("rightline", colinfo[col].rightlines > 0)
1064 << write_attribute("width", translate_len(colinfo[col].width))
1065 << write_attribute("special", colinfo[col].special)
1068 //cerr << "// after cols\n";
1070 for (size_t row = 0; row < rowinfo.size(); ++row) {
1072 << write_attribute("topline", rowinfo[row].topline)
1073 << write_attribute("bottomline", rowinfo[row].bottomline)
1074 << write_attribute("endhead",
1075 rowinfo[row].type == LT_HEAD)
1076 << write_attribute("endfirsthead",
1077 rowinfo[row].type == LT_FIRSTHEAD)
1078 << write_attribute("endfoot",
1079 rowinfo[row].type == LT_FOOT)
1080 << write_attribute("endlastfoot",
1081 rowinfo[row].type == LT_LASTFOOT)
1082 << write_attribute("newpage", rowinfo[row].newpage)
1084 for (size_t col = 0; col < colinfo.size(); ++col) {
1085 CellInfo const & cell = cellinfo[row][col];
1087 if (cell.multi != CELL_NORMAL)
1088 os << " multicolumn=\"" << cell.multi << "\"";
1089 os << " alignment=\"" << verbose_align(cell.align)
1091 << " valignment=\"" << verbose_valign(cell.valign)
1093 << write_attribute("topline", cell.topline)
1094 << write_attribute("bottomline", cell.bottomline)
1095 << write_attribute("leftline", cell.leftlines > 0)
1096 << write_attribute("rightline", cell.rightlines > 0)
1097 << write_attribute("rotate", cell.rotate);
1098 //cerr << "\nrow: " << row << " col: " << col;
1100 // cerr << " topline=\"true\"";
1101 //if (cell.bottomline)
1102 // cerr << " bottomline=\"true\"";
1103 os << " usebox=\"none\""
1104 << write_attribute("width", translate_len(cell.width));
1105 if (cell.multi != CELL_NORMAL)
1106 os << write_attribute("special", cell.special);
1108 << "\n\\begin_inset Text\n"
1110 << "\n\\end_inset\n"
1116 os << "</lyxtabular>\n";