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/lassert.h"
20 #include "support/convert.h"
21 #include "support/lstrings.h"
32 // filled in preamble.cpp
33 map<char, int> special_columns;
40 ColInfo() : align('n'), valign('n'), rightlines(0), leftlines(0) {}
43 /// vertical alignment
47 /// special column alignment
49 /// number of lines on the right
51 /// number of lines on the left
56 /// row type for longtables
63 /// part of head on first page
67 /// part of foot on last page
74 RowInfo() : topline(false), bottomline(false), type(LT_NORMAL),
76 /// horizontal line above
78 /// horizontal line below
80 /// These are for longtabulars only
81 /// row type (head, foot, firsthead etc.)
91 /// A multicolumn cell. The number of columns is <tt>1 + number
92 /// of CELL_PART_OF_MULTICOLUMN cells</tt> that follow directly
93 CELL_BEGIN_OF_MULTICOLUMN,
94 /// This is a dummy cell (part of a multicolumn cell)
95 CELL_PART_OF_MULTICOLUMN
101 CellInfo() : multi(CELL_NORMAL), align('n'), valign('n'),
102 leftlines(0), rightlines(0), topline(false),
103 bottomline(false), rotate(false) {}
110 /// vertical cell alignment
112 /// number of lines on the left
114 /// number of lines on the right
116 /// do we have a line above?
118 /// do we have a line below?
120 /// is the cell rotated?
122 /// width for multicolumn cells
124 /// special formatting for multicolumn cells
129 /// translate a horizontal alignment (as stored in ColInfo and CellInfo) to LyX
130 inline char const * verbose_align(char c)
145 /// translate a vertical alignment (as stored in ColInfo and CellInfo) to LyX
146 inline char const * verbose_valign(char c)
148 // The default value for no special alignment is "top".
161 // stripped down from tabluar.C. We use it currently only for bools and
163 string const write_attribute(string const & name, bool const & b)
165 // we write only true attribute values so we remove a bit of the
166 // file format bloat for tabulars.
167 return b ? ' ' + name + "=\"true\"" : string();
171 string const write_attribute(string const & name, string const & s)
173 return s.empty() ? string() : ' ' + name + "=\"" + s + '"';
177 /*! rather brutish way to code table structure in a string:
182 \multicolumn{2}{c}{4} & 5 //
188 gets "translated" to:
191 HLINE 1 TAB 2 TAB 3 HLINE HLINE LINE
192 \hline HLINE \multicolumn{2}{c}{4} TAB 5 HLINE HLINE LINE
193 HLINE 6 TAB 7 HLINE HLINE LINE
194 HLINE 8 HLINE \endhead HLINE LINE
198 char const TAB = '\001';
199 char const LINE = '\002';
200 char const HLINE = '\004';
204 * Move the information in leftlines, rightlines, align and valign to the
205 * special field. This is necessary if the special field is not empty,
206 * because LyX ignores leftlines > 1, rightlines > 1, align and valign in
209 void ci2special(ColInfo & ci)
211 if (ci.width.empty() && ci.align == 'n')
212 // The alignment setting is already in special, since
213 // handle_colalign() never stores ci with these settings
214 // and ensures that leftlines == 0 and rightlines == 0 in
218 if (!ci.width.empty()) {
221 ci.special += ">{\\raggedright}";
224 ci.special += ">{\\raggedleft}";
227 ci.special += ">{\\centering}";
230 if (ci.valign == 'n')
233 ci.special += ci.valign;
234 ci.special += '{' + ci.width + '}';
237 ci.special += ci.align;
239 // LyX can only have one left and one right line.
240 for (int i = 1; i < ci.leftlines; ++i)
241 ci.special.insert(0, "|");
242 for (int i = 1; i < ci.rightlines; ++i)
244 ci.leftlines = min(ci.leftlines, 1);
245 ci.rightlines = min(ci.rightlines, 1);
252 * Handle column specifications for tabulars and multicolumns.
253 * The next token of the parser \p p must be an opening brace, and we read
254 * everything until the matching closing brace.
255 * The resulting column specifications are filled into \p colinfo. This is
256 * in an intermediate form. fix_colalign() makes it suitable for LyX output.
258 void handle_colalign(Parser & p, vector<ColInfo> & colinfo,
259 ColInfo const & start)
261 if (p.get_token().cat() != catBegin)
262 cerr << "Wrong syntax for table column alignment.\n"
263 "Expected '{', got '" << p.curr_token().asInput()
266 ColInfo next = start;
267 for (Token t = p.get_token(); p.good() && t.cat() != catEnd;
270 cerr << "t: " << t << " c: '" << t.character() << "'\n";
273 // We cannot handle comments here
274 if (t.cat() == catComment) {
275 if (t.cs().empty()) {
279 cerr << "Ignoring comment: " << t.asInput();
283 switch (t.character()) {
287 // new column, horizontal aligned
288 next.align = t.character();
289 if (!next.special.empty())
291 colinfo.push_back(next);
297 // new column, vertical aligned box
298 next.valign = t.character();
299 next.width = p.verbatim_item();
300 if (!next.special.empty())
302 colinfo.push_back(next);
307 if (colinfo.empty()) {
308 if (next.special.empty())
312 } else if (colinfo.back().special.empty())
313 ++colinfo.back().rightlines;
314 else if (next.special.empty())
317 colinfo.back().special += '|';
320 // text before the next column
321 string const s = trim(p.verbatim_item());
322 if (next.special.empty() &&
324 // Maybe this can be converted to a
325 // horizontal alignment setting for
326 // fixed width columns
327 if (s == "\\raggedleft")
329 else if (s == "\\raggedright")
331 else if (s == "\\centering")
334 next.special = ">{" + s + '}';
336 next.special += ">{" + s + '}';
340 // text after the last column
341 string const s = trim(p.verbatim_item());
343 // This is not possible in LaTeX.
344 cerr << "Ignoring separator '<{"
345 << s << "}'." << endl;
347 ColInfo & ci = colinfo.back();
349 ci.special += "<{" + s + '}';
354 // *{n}{arg} means 'n' columns of type 'arg'
355 string const num = p.verbatim_item();
356 string const arg = p.verbatim_item();
357 size_t const n = convert<unsigned int>(num);
358 if (!arg.empty() && n > 0) {
360 for (size_t i = 0; i < n; ++i)
364 handle_colalign(p2, colinfo, next);
367 cerr << "Ignoring column specification"
368 " '*{" << num << "}{"
369 << arg << "}'." << endl;
374 // text instead of the column spacing
376 // text in addition to the column spacing
377 next.special += t.character();
378 next.special += '{' + p.verbatim_item() + '}';
381 // try user defined column types
382 if (special_columns.find(t.character()) !=
383 special_columns.end()) {
385 next.special += t.character();
387 special_columns[t.character()];
388 for (int i = 0; i < nargs; ++i)
389 next.special += '{' +
392 colinfo.push_back(next);
395 cerr << "Ignoring column specification"
396 " '" << t << "'." << endl;
401 // Maybe we have some column separators that need to be added to the
404 if (!next.special.empty()) {
405 ColInfo & ci = colinfo.back();
407 ci.special += next.special;
408 next.special.erase();
414 * Move the left and right lines and alignment settings of the column \p ci
415 * to the special field if necessary.
417 void fix_colalign(ColInfo & ci)
419 if (ci.leftlines > 1 || ci.rightlines > 1)
425 * LyX can't handle more than one vertical line at the left or right side
427 * This function moves the left and right lines and alignment settings of all
428 * columns in \p colinfo to the special field if necessary.
430 void fix_colalign(vector<ColInfo> & colinfo)
432 // Try to move extra leftlines to the previous column.
433 // We do this only if both special fields are empty, otherwise we
434 // can't tell wether the result will be the same.
435 for (size_t col = 0; col < colinfo.size(); ++col) {
436 if (colinfo[col].leftlines > 1 &&
437 colinfo[col].special.empty() && col > 0 &&
438 colinfo[col - 1].rightlines == 0 &&
439 colinfo[col - 1].special.empty()) {
440 ++colinfo[col - 1].rightlines;
441 --colinfo[col].leftlines;
444 // Try to move extra rightlines to the next column
445 for (size_t col = 0; col < colinfo.size(); ++col) {
446 if (colinfo[col].rightlines > 1 &&
447 colinfo[col].special.empty() &&
448 col < colinfo.size() - 1 &&
449 colinfo[col + 1].leftlines == 0 &&
450 colinfo[col + 1].special.empty()) {
451 ++colinfo[col + 1].leftlines;
452 --colinfo[col].rightlines;
455 // Move the lines and alignment settings to the special field if
457 for (size_t col = 0; col < colinfo.size(); ++col)
458 fix_colalign(colinfo[col]);
463 * Parse hlines and similar stuff.
464 * \returns wether the token \p t was parsed
466 bool parse_hlines(Parser & p, Token const & t, string & hlines,
467 bool is_long_tabular)
469 LASSERT(t.cat() == catEscape, return false);
471 if (t.cs() == "hline")
474 else if (t.cs() == "cline")
475 hlines += "\\cline{" + p.verbatim_item() + '}';
477 else if (is_long_tabular && t.cs() == "newpage")
478 hlines += "\\newpage";
487 /// Position in a row
489 /// At the very beginning, before the first token
491 /// After the first token and before any column token
493 /// After the first column token. Comments and whitespace are only
494 /// treated as tokens in this position
496 /// After the first non-column token at the end
502 * Parse table structure.
503 * We parse tables in a two-pass process: This function extracts the table
504 * structure (rows, columns, hlines etc.), but does not change the cell
505 * content. The cell content is parsed in a second step in handle_tabular().
507 void parse_table(Parser & p, ostream & os, bool is_long_tabular,
508 RowPosition & pos, unsigned flags)
510 // table structure commands such as \hline
513 // comments that occur at places where we can't handle them
517 Token const & t = p.get_token();
520 cerr << "t: " << t << " flags: " << flags << "\n";
523 // comments and whitespace in hlines
526 case IN_HLINES_START:
528 if (t.cat() == catComment) {
533 // We can't handle comments here,
534 // store them for later use
535 comments += t.asInput();
537 } else if (t.cat() == catSpace ||
538 t.cat() == catNewline) {
539 // whitespace is irrelevant here, we
540 // need to recognize hline stuff
549 // We need to handle structure stuff first in order to
550 // determine wether we need to output a HLINE separator
551 // before the row or not.
552 if (t.cat() == catEscape) {
553 if (parse_hlines(p, t, hlines, is_long_tabular)) {
556 pos = IN_HLINES_START;
561 case IN_HLINES_START:
568 else if (t.cs() == "tabularnewline" ||
572 cerr << "Warning: Converting TeX "
573 "'\\cr' to LaTeX '\\\\'."
575 // stuff before the line break
576 os << comments << HLINE << hlines << HLINE
578 //cerr << "hlines: " << hlines << endl;
585 else if (is_long_tabular &&
586 (t.cs() == "endhead" ||
587 t.cs() == "endfirsthead" ||
588 t.cs() == "endfoot" ||
589 t.cs() == "endlastfoot")) {
590 hlines += t.asInput();
594 // these commands are implicit line
596 os << comments << HLINE << hlines
603 pos = IN_HLINES_START;
605 case IN_HLINES_START:
613 // We need a HLINE separator if we either have no hline
614 // stuff at all and are just starting a row or if we just
615 // got the first non-hline token.
618 // no hline tokens exist, first token at row start
619 case IN_HLINES_START:
620 // hline tokens exist, first non-hline token at row
622 os << hlines << HLINE << comments;
628 // Oops, there is still cell content after hline
629 // stuff. This does not work in LaTeX, so we ignore
631 cerr << "Ignoring '" << hlines << "' in a cell"
642 // If we come here we have normal cell content
646 if (t.cat() == catMath) {
647 // we are inside some text mode thingy, so opening new math is allowed
648 Token const & n = p.get_token();
649 if (n.cat() == catMath) {
650 // TeX's $$...$$ syntax for displayed math
652 // This does only work because parse_math outputs TeX
653 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
655 p.get_token(); // skip the second '$' token
657 // simple $...$ stuff
660 // This does only work because parse_math outputs TeX
661 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
666 else if (t.cat() == catSpace
667 || t.cat() == catNewline
668 || t.cat() == catLetter
669 || t.cat() == catSuper
671 || t.cat() == catOther
672 || t.cat() == catActive
673 || t.cat() == catParameter)
676 else if (t.cat() == catBegin) {
678 parse_table(p, os, is_long_tabular, pos,
683 else if (t.cat() == catEnd) {
684 if (flags & FLAG_BRACE_LAST)
686 cerr << "unexpected '}'\n";
689 else if (t.cat() == catAlign) {
694 else if (t.cat() == catComment)
697 else if (t.cs() == "(") {
699 // This does only work because parse_math outputs TeX
700 parse_math(p, os, FLAG_SIMPLE2, MATH_MODE);
704 else if (t.cs() == "[") {
706 // This does only work because parse_math outputs TeX
707 parse_math(p, os, FLAG_EQUATION, MATH_MODE);
711 else if (t.cs() == "begin") {
712 string const name = p.getArg('{', '}');
713 active_environments.push_back(name);
714 os << "\\begin{" << name << '}';
715 // treat the nested environment as a block, don't
716 // parse &, \\ etc, because they don't belong to our
717 // table if they appear.
718 os << p.verbatimEnvironment(name);
719 os << "\\end{" << name << '}';
720 active_environments.pop_back();
723 else if (t.cs() == "end") {
724 if (flags & FLAG_END) {
725 // eat environment name
726 string const name = p.getArg('{', '}');
727 if (name != active_environment())
728 p.error("\\end{" + name + "} does not match \\begin{"
729 + active_environment() + "}");
732 p.error("found 'end' unexpectedly");
739 // We can have comments if the last line is incomplete
742 // We can have hline stuff if the last line is incomplete
743 if (!hlines.empty()) {
744 // this does not work in LaTeX, so we ignore it
745 cerr << "Ignoring '" << hlines << "' at end of tabular"
751 void handle_hline_above(RowInfo & ri, vector<CellInfo> & ci)
754 for (size_t col = 0; col < ci.size(); ++col)
755 ci[col].topline = true;
759 void handle_hline_below(RowInfo & ri, vector<CellInfo> & ci)
761 ri.bottomline = true;
762 for (size_t col = 0; col < ci.size(); ++col)
763 ci[col].bottomline = true;
767 } // anonymous namespace
770 void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
773 string posopts = p.getOpt();
774 if (!posopts.empty()) {
775 // FIXME: Convert this to ERT
777 cerr << "horizontal longtable";
779 cerr << "vertical tabular";
780 cerr << " positioning '" << posopts << "' ignored\n";
783 vector<ColInfo> colinfo;
785 // handle column formatting
786 handle_colalign(p, colinfo, ColInfo());
787 fix_colalign(colinfo);
789 // first scan of cells
790 // use table mode to keep it minimal-invasive
791 // not exactly what's TeX doing...
792 vector<string> lines;
794 RowPosition rowpos = ROW_START;
795 parse_table(p, ss, is_long_tabular, rowpos, FLAG_END);
796 split(ss.str(), lines, LINE);
798 vector< vector<CellInfo> > cellinfo(lines.size());
799 vector<RowInfo> rowinfo(lines.size());
802 //cerr << "// split into rows\n";
803 for (size_t row = 0; row < rowinfo.size(); ++row) {
806 cellinfo[row].resize(colinfo.size());
809 vector<string> dummy;
810 //cerr << "\n########### LINE: " << lines[row] << "########\n";
811 split(lines[row], dummy, HLINE);
813 // handle horizontal line fragments
814 // we do only expect this for a last line without '\\'
815 if (dummy.size() != 3) {
816 if ((dummy.size() != 1 && dummy.size() != 2) ||
817 row != rowinfo.size() - 1)
818 cerr << "unexpected dummy size: " << dummy.size()
819 << " content: " << lines[row] << "\n";
822 lines[row] = dummy[1];
824 //cerr << "line: " << row << " above 0: " << dummy[0] << "\n";
825 //cerr << "line: " << row << " below 2: " << dummy[2] << "\n";
826 //cerr << "line: " << row << " cells 1: " << dummy[1] << "\n";
828 for (int i = 0; i <= 2; i += 2) {
829 //cerr << " reading from line string '" << dummy[i] << "'\n";
832 Token t = p1.get_token();
833 //cerr << "read token: " << t << "\n";
834 if (t.cs() == "hline") {
836 if (rowinfo[row].topline) {
837 if (row > 0) // extra bottomline above
838 handle_hline_below(rowinfo[row - 1], cellinfo[row - 1]);
840 cerr << "dropping extra hline\n";
841 //cerr << "below row: " << row-1 << endl;
843 handle_hline_above(rowinfo[row], cellinfo[row]);
844 //cerr << "above row: " << row << endl;
847 //cerr << "below row: " << row << endl;
848 handle_hline_below(rowinfo[row], cellinfo[row]);
850 } else if (t.cs() == "cline") {
851 string arg = p1.verbatim_item();
852 //cerr << "read cline arg: '" << arg << "'\n";
856 size_t from = convert<unsigned int>(t[0]);
858 cerr << "Could not parse "
859 "cline start column."
862 // 1 based index -> 0 based
864 if (from >= colinfo.size()) {
865 cerr << "cline starts at non "
867 << (from + 1) << endl;
868 from = colinfo.size() - 1;
870 size_t to = convert<unsigned int>(t[1]);
872 cerr << "Could not parse "
876 // 1 based index -> 0 based
878 if (to >= colinfo.size()) {
879 cerr << "cline ends at non "
882 to = colinfo.size() - 1;
884 for (size_t col = from; col <= to; ++col) {
885 //cerr << "row: " << row << " col: " << col << " i: " << i << endl;
887 rowinfo[row].topline = true;
888 cellinfo[row][col].topline = true;
890 rowinfo[row].bottomline = true;
891 cellinfo[row][col].bottomline = true;
894 } else if (t.cs() == "endhead") {
896 rowinfo[row].type = LT_HEAD;
897 for (int r = row - 1; r >= 0; --r) {
898 if (rowinfo[r].type != LT_NORMAL)
900 rowinfo[r].type = LT_HEAD;
902 } else if (t.cs() == "endfirsthead") {
904 rowinfo[row].type = LT_FIRSTHEAD;
905 for (int r = row - 1; r >= 0; --r) {
906 if (rowinfo[r].type != LT_NORMAL)
908 rowinfo[r].type = LT_FIRSTHEAD;
910 } else if (t.cs() == "endfoot") {
912 rowinfo[row].type = LT_FOOT;
913 for (int r = row - 1; r >= 0; --r) {
914 if (rowinfo[r].type != LT_NORMAL)
916 rowinfo[r].type = LT_FOOT;
918 } else if (t.cs() == "endlastfoot") {
920 rowinfo[row].type = LT_LASTFOOT;
921 for (int r = row - 1; r >= 0; --r) {
922 if (rowinfo[r].type != LT_NORMAL)
924 rowinfo[r].type = LT_LASTFOOT;
926 } else if (t.cs() == "newpage") {
929 rowinfo[row - 1].newpage = true;
931 // This does not work in LaTeX
937 rowinfo[row].newpage = true;
939 cerr << "unexpected line token: " << t << endl;
945 vector<string> cells;
946 split(lines[row], cells, TAB);
947 for (size_t col = 0, cell = 0; cell < cells.size();
949 //cerr << "cell content: '" << cells[cell] << "'\n";
950 if (col >= colinfo.size()) {
951 // This does not work in LaTeX
952 cerr << "Ignoring extra cell '"
953 << cells[cell] << "'." << endl;
956 Parser p(cells[cell]);
958 //cells[cell] << "'\n";
959 if (p.next_token().cs() == "multicolumn") {
962 size_t const ncells =
963 convert<unsigned int>(p.verbatim_item());
965 // special cell properties alignment
967 handle_colalign(p, t, ColInfo());
968 ColInfo & ci = t.front();
970 // The logic of LyX for multicolumn vertical
971 // lines is too complicated to reproduce it
972 // here (see LyXTabular::TeXCellPreamble()).
973 // Therefore we simply put everything in the
977 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
978 cellinfo[row][col].align = ci.align;
979 cellinfo[row][col].special = ci.special;
980 cellinfo[row][col].leftlines = ci.leftlines;
981 cellinfo[row][col].rightlines = ci.rightlines;
983 parse_text_in_inset(p, os, FLAG_ITEM, false, context);
984 if (!cellinfo[row][col].content.empty()) {
985 // This may or may not work in LaTeX,
986 // but it does not work in LyX.
987 // FIXME: Handle it correctly!
988 cerr << "Moving cell content '"
990 << "' into a multicolumn cell. "
991 "This will probably not work."
994 cellinfo[row][col].content += os.str();
996 // add dummy cells for multicol
997 for (size_t i = 0; i < ncells - 1 && col < colinfo.size(); ++i) {
999 cellinfo[row][col].multi = CELL_PART_OF_MULTICOLUMN;
1000 cellinfo[row][col].align = 'c';
1004 cellinfo[row][col].leftlines = colinfo[col].leftlines;
1005 cellinfo[row][col].rightlines = colinfo[col].rightlines;
1006 cellinfo[row][col].align = colinfo[col].align;
1008 parse_text_in_inset(p, os, FLAG_CELL, false, context);
1009 cellinfo[row][col].content += os.str();
1013 //cerr << "// handle almost empty last row what we have\n";
1014 // handle almost empty last row
1015 if (row && lines[row].empty() && row + 1 == rowinfo.size()) {
1016 //cerr << "remove empty last line\n";
1017 if (rowinfo[row].topline)
1018 rowinfo[row - 1].bottomline = true;
1019 for (size_t col = 0; col < colinfo.size(); ++col)
1020 if (cellinfo[row][col].topline)
1021 cellinfo[row - 1][col].bottomline = true;
1026 // Now we have the table structure and content in rowinfo, colinfo
1028 // Unfortunately LyX has some limitations that we need to work around.
1030 // Convert cells with special content to multicolumn cells
1031 // (LyX ignores the special field for non-multicolumn cells).
1032 for (size_t row = 0; row < rowinfo.size(); ++row) {
1033 for (size_t col = 0; col < cellinfo[row].size(); ++col) {
1034 if (cellinfo[row][col].multi == CELL_NORMAL &&
1035 !cellinfo[row][col].special.empty())
1036 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
1040 //cerr << "// output what we have\n";
1041 // output what we have
1042 os << "\n<lyxtabular version=\"3\" rows=\"" << rowinfo.size()
1043 << "\" columns=\"" << colinfo.size() << "\">\n";
1045 << write_attribute("rotate", false)
1046 << write_attribute("islongtable", is_long_tabular)
1049 //cerr << "// after header\n";
1050 for (size_t col = 0; col < colinfo.size(); ++col) {
1051 os << "<column alignment=\""
1052 << verbose_align(colinfo[col].align) << "\""
1054 << verbose_valign(colinfo[col].valign) << "\""
1055 << write_attribute("leftline", colinfo[col].leftlines > 0)
1056 << write_attribute("rightline", colinfo[col].rightlines > 0)
1057 << write_attribute("width", translate_len(colinfo[col].width))
1058 << write_attribute("special", colinfo[col].special)
1061 //cerr << "// after cols\n";
1063 for (size_t row = 0; row < rowinfo.size(); ++row) {
1065 << write_attribute("topline", rowinfo[row].topline)
1066 << write_attribute("bottomline", rowinfo[row].bottomline)
1067 << write_attribute("endhead",
1068 rowinfo[row].type == LT_HEAD)
1069 << write_attribute("endfirsthead",
1070 rowinfo[row].type == LT_FIRSTHEAD)
1071 << write_attribute("endfoot",
1072 rowinfo[row].type == LT_FOOT)
1073 << write_attribute("endlastfoot",
1074 rowinfo[row].type == LT_LASTFOOT)
1075 << write_attribute("newpage", rowinfo[row].newpage)
1077 for (size_t col = 0; col < colinfo.size(); ++col) {
1078 CellInfo const & cell = cellinfo[row][col];
1080 if (cell.multi != CELL_NORMAL)
1081 os << " multicolumn=\"" << cell.multi << "\"";
1082 os << " alignment=\"" << verbose_align(cell.align)
1084 << " valignment=\"" << verbose_valign(cell.valign)
1086 << write_attribute("topline", cell.topline)
1087 << write_attribute("bottomline", cell.bottomline)
1088 << write_attribute("leftline", cell.leftlines > 0)
1089 << write_attribute("rightline", cell.rightlines > 0)
1090 << write_attribute("rotate", cell.rotate);
1091 //cerr << "\nrow: " << row << " col: " << col;
1093 // cerr << " topline=\"true\"";
1094 //if (cell.bottomline)
1095 // cerr << " bottomline=\"true\"";
1096 os << " usebox=\"none\""
1097 << write_attribute("width", translate_len(cell.width));
1098 if (cell.multi != CELL_NORMAL)
1099 os << write_attribute("special", cell.special);
1101 << "\n\\begin_inset Text\n"
1103 << "\n\\end_inset\n"
1109 os << "</lyxtabular>\n";