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.)
88 /// the numeric values are part of the file format!
92 /// A multicolumn cell. The number of columns is <tt>1 + number
93 /// of CELL_PART_OF_MULTICOLUMN cells</tt> that follow directly
94 CELL_BEGIN_OF_MULTICOLUMN = 1,
95 /// This is a dummy cell (part of a multicolumn cell)
96 CELL_PART_OF_MULTICOLUMN = 2
102 CellInfo() : multi(CELL_NORMAL), align('n'), valign('n'),
103 leftlines(0), rightlines(0), topline(false),
104 bottomline(false), rotate(false) {}
111 /// vertical cell alignment
113 /// number of lines on the left
115 /// number of lines on the right
117 /// do we have a line above?
119 /// do we have a line below?
121 /// is the cell rotated?
123 /// width for multicolumn cells
125 /// special formatting for multicolumn cells
130 /// translate a horizontal alignment (as stored in ColInfo and CellInfo) to LyX
131 inline char const * verbose_align(char c)
146 /// translate a vertical alignment (as stored in ColInfo and CellInfo) to LyX
147 inline char const * verbose_valign(char c)
149 // The default value for no special alignment is "top".
162 // stripped down from tabluar.C. We use it currently only for bools and
164 string const write_attribute(string const & name, bool const & b)
166 // we write only true attribute values so we remove a bit of the
167 // file format bloat for tabulars.
168 return b ? ' ' + name + "=\"true\"" : string();
172 string const write_attribute(string const & name, string const & s)
174 return s.empty() ? string() : ' ' + name + "=\"" + s + '"';
178 /*! rather brutish way to code table structure in a string:
183 \multicolumn{2}{c}{4} & 5 //
189 gets "translated" to:
192 HLINE 1 TAB 2 TAB 3 HLINE HLINE LINE
193 \hline HLINE \multicolumn{2}{c}{4} TAB 5 HLINE HLINE LINE
194 HLINE 6 TAB 7 HLINE HLINE LINE
195 HLINE 8 HLINE \endhead HLINE LINE
199 char const TAB = '\001';
200 char const LINE = '\002';
201 char const HLINE = '\004';
205 * Move the information in leftlines, rightlines, align and valign to the
206 * special field. This is necessary if the special field is not empty,
207 * because LyX ignores leftlines > 1, rightlines > 1, align and valign in
210 void ci2special(ColInfo & ci)
212 if (ci.width.empty() && ci.align == 'n')
213 // The alignment setting is already in special, since
214 // handle_colalign() never stores ci with these settings
215 // and ensures that leftlines == 0 and rightlines == 0 in
219 if (!ci.width.empty()) {
222 ci.special += ">{\\raggedright}";
225 ci.special += ">{\\raggedleft}";
228 ci.special += ">{\\centering}";
231 if (ci.valign == 'n')
234 ci.special += ci.valign;
235 ci.special += '{' + ci.width + '}';
238 ci.special += ci.align;
240 // LyX can only have one left and one right line.
241 for (int i = 1; i < ci.leftlines; ++i)
242 ci.special.insert(0, "|");
243 for (int i = 1; i < ci.rightlines; ++i)
245 ci.leftlines = min(ci.leftlines, 1);
246 ci.rightlines = min(ci.rightlines, 1);
253 * Handle column specifications for tabulars and multicolumns.
254 * The next token of the parser \p p must be an opening brace, and we read
255 * everything until the matching closing brace.
256 * The resulting column specifications are filled into \p colinfo. This is
257 * in an intermediate form. fix_colalign() makes it suitable for LyX output.
259 void handle_colalign(Parser & p, vector<ColInfo> & colinfo,
260 ColInfo const & start)
262 if (p.get_token().cat() != catBegin)
263 cerr << "Wrong syntax for table column alignment.\n"
264 "Expected '{', got '" << p.curr_token().asInput()
267 ColInfo next = start;
268 for (Token t = p.get_token(); p.good() && t.cat() != catEnd;
271 cerr << "t: " << t << " c: '" << t.character() << "'\n";
274 // We cannot handle comments here
275 if (t.cat() == catComment) {
276 if (t.cs().empty()) {
280 cerr << "Ignoring comment: " << t.asInput();
284 switch (t.character()) {
288 // new column, horizontal aligned
289 next.align = t.character();
290 if (!next.special.empty())
292 colinfo.push_back(next);
298 // new column, vertical aligned box
299 next.valign = t.character();
300 next.width = p.verbatim_item();
301 if (!next.special.empty())
303 colinfo.push_back(next);
308 if (colinfo.empty()) {
309 if (next.special.empty())
313 } else if (colinfo.back().special.empty())
314 ++colinfo.back().rightlines;
315 else if (next.special.empty())
318 colinfo.back().special += '|';
321 // text before the next column
322 string const s = trim(p.verbatim_item());
323 if (next.special.empty() &&
325 // Maybe this can be converted to a
326 // horizontal alignment setting for
327 // fixed width columns
328 if (s == "\\raggedleft")
330 else if (s == "\\raggedright")
332 else if (s == "\\centering")
335 next.special = ">{" + s + '}';
337 next.special += ">{" + s + '}';
341 // text after the last column
342 string const s = trim(p.verbatim_item());
344 // This is not possible in LaTeX.
345 cerr << "Ignoring separator '<{"
346 << s << "}'." << endl;
348 ColInfo & ci = colinfo.back();
350 ci.special += "<{" + s + '}';
355 // *{n}{arg} means 'n' columns of type 'arg'
356 string const num = p.verbatim_item();
357 string const arg = p.verbatim_item();
358 size_t const n = convert<unsigned int>(num);
359 if (!arg.empty() && n > 0) {
361 for (size_t i = 0; i < n; ++i)
365 handle_colalign(p2, colinfo, next);
368 cerr << "Ignoring column specification"
369 " '*{" << num << "}{"
370 << arg << "}'." << endl;
375 // text instead of the column spacing
377 // text in addition to the column spacing
378 next.special += t.character();
379 next.special += '{' + p.verbatim_item() + '}';
382 // try user defined column types
383 if (special_columns.find(t.character()) !=
384 special_columns.end()) {
386 next.special += t.character();
388 special_columns[t.character()];
389 for (int i = 0; i < nargs; ++i)
390 next.special += '{' +
393 colinfo.push_back(next);
396 cerr << "Ignoring column specification"
397 " '" << t << "'." << endl;
402 // Maybe we have some column separators that need to be added to the
405 if (!next.special.empty()) {
406 ColInfo & ci = colinfo.back();
408 ci.special += next.special;
409 next.special.erase();
415 * Move the left and right lines and alignment settings of the column \p ci
416 * to the special field if necessary.
418 void fix_colalign(ColInfo & ci)
420 if (ci.leftlines > 1 || ci.rightlines > 1)
426 * LyX can't handle more than one vertical line at the left or right side
428 * This function moves the left and right lines and alignment settings of all
429 * columns in \p colinfo to the special field if necessary.
431 void fix_colalign(vector<ColInfo> & colinfo)
433 // Try to move extra leftlines to the previous column.
434 // We do this only if both special fields are empty, otherwise we
435 // can't tell wether the result will be the same.
436 for (size_t col = 0; col < colinfo.size(); ++col) {
437 if (colinfo[col].leftlines > 1 &&
438 colinfo[col].special.empty() && col > 0 &&
439 colinfo[col - 1].rightlines == 0 &&
440 colinfo[col - 1].special.empty()) {
441 ++colinfo[col - 1].rightlines;
442 --colinfo[col].leftlines;
445 // Try to move extra rightlines to the next column
446 for (size_t col = 0; col < colinfo.size(); ++col) {
447 if (colinfo[col].rightlines > 1 &&
448 colinfo[col].special.empty() &&
449 col < colinfo.size() - 1 &&
450 colinfo[col + 1].leftlines == 0 &&
451 colinfo[col + 1].special.empty()) {
452 ++colinfo[col + 1].leftlines;
453 --colinfo[col].rightlines;
456 // Move the lines and alignment settings to the special field if
458 for (size_t col = 0; col < colinfo.size(); ++col)
459 fix_colalign(colinfo[col]);
464 * Parse hlines and similar stuff.
465 * \returns wether the token \p t was parsed
467 bool parse_hlines(Parser & p, Token const & t, string & hlines,
468 bool is_long_tabular)
470 LASSERT(t.cat() == catEscape, return false);
472 if (t.cs() == "hline")
475 else if (t.cs() == "cline")
476 hlines += "\\cline{" + p.verbatim_item() + '}';
478 else if (is_long_tabular && t.cs() == "newpage")
479 hlines += "\\newpage";
488 /// Position in a row
490 /// At the very beginning, before the first token
492 /// After the first token and before any column token
494 /// After the first column token. Comments and whitespace are only
495 /// treated as tokens in this position
497 /// After the first non-column token at the end
503 * Parse table structure.
504 * We parse tables in a two-pass process: This function extracts the table
505 * structure (rows, columns, hlines etc.), but does not change the cell
506 * content. The cell content is parsed in a second step in handle_tabular().
508 void parse_table(Parser & p, ostream & os, bool is_long_tabular,
509 RowPosition & pos, unsigned flags)
511 // table structure commands such as \hline
514 // comments that occur at places where we can't handle them
518 Token const & t = p.get_token();
521 cerr << "t: " << t << " flags: " << flags << "\n";
524 // comments and whitespace in hlines
527 case IN_HLINES_START:
529 if (t.cat() == catComment) {
534 // We can't handle comments here,
535 // store them for later use
536 comments += t.asInput();
538 } else if (t.cat() == catSpace ||
539 t.cat() == catNewline) {
540 // whitespace is irrelevant here, we
541 // need to recognize hline stuff
550 // We need to handle structure stuff first in order to
551 // determine wether we need to output a HLINE separator
552 // before the row or not.
553 if (t.cat() == catEscape) {
554 if (parse_hlines(p, t, hlines, is_long_tabular)) {
557 pos = IN_HLINES_START;
562 case IN_HLINES_START:
569 else if (t.cs() == "tabularnewline" ||
573 cerr << "Warning: Converting TeX "
574 "'\\cr' to LaTeX '\\\\'."
576 // stuff before the line break
577 os << comments << HLINE << hlines << HLINE
579 //cerr << "hlines: " << hlines << endl;
586 else if (is_long_tabular &&
587 (t.cs() == "endhead" ||
588 t.cs() == "endfirsthead" ||
589 t.cs() == "endfoot" ||
590 t.cs() == "endlastfoot")) {
591 hlines += t.asInput();
595 // these commands are implicit line
597 os << comments << HLINE << hlines
604 pos = IN_HLINES_START;
606 case IN_HLINES_START:
614 // We need a HLINE separator if we either have no hline
615 // stuff at all and are just starting a row or if we just
616 // got the first non-hline token.
619 // no hline tokens exist, first token at row start
620 case IN_HLINES_START:
621 // hline tokens exist, first non-hline token at row
623 os << hlines << HLINE << comments;
629 // Oops, there is still cell content after hline
630 // stuff. This does not work in LaTeX, so we ignore
632 cerr << "Ignoring '" << hlines << "' in a cell"
643 // If we come here we have normal cell content
647 if (t.cat() == catMath) {
648 // we are inside some text mode thingy, so opening new math is allowed
649 Token const & n = p.get_token();
650 if (n.cat() == catMath) {
651 // TeX's $$...$$ syntax for displayed math
653 // This does only work because parse_math outputs TeX
654 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
656 p.get_token(); // skip the second '$' token
658 // simple $...$ stuff
661 // This does only work because parse_math outputs TeX
662 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
667 else if (t.cat() == catSpace
668 || t.cat() == catNewline
669 || t.cat() == catLetter
670 || t.cat() == catSuper
672 || t.cat() == catOther
673 || t.cat() == catActive
674 || t.cat() == catParameter)
677 else if (t.cat() == catBegin) {
679 parse_table(p, os, is_long_tabular, pos,
684 else if (t.cat() == catEnd) {
685 if (flags & FLAG_BRACE_LAST)
687 cerr << "unexpected '}'\n";
690 else if (t.cat() == catAlign) {
695 else if (t.cat() == catComment)
698 else if (t.cs() == "(") {
700 // This does only work because parse_math outputs TeX
701 parse_math(p, os, FLAG_SIMPLE2, MATH_MODE);
705 else if (t.cs() == "[") {
707 // This does only work because parse_math outputs TeX
708 parse_math(p, os, FLAG_EQUATION, MATH_MODE);
712 else if (t.cs() == "begin") {
713 string const name = p.getArg('{', '}');
714 active_environments.push_back(name);
715 os << "\\begin{" << name << '}';
716 // treat the nested environment as a block, don't
717 // parse &, \\ etc, because they don't belong to our
718 // table if they appear.
719 os << p.verbatimEnvironment(name);
720 os << "\\end{" << name << '}';
721 active_environments.pop_back();
724 else if (t.cs() == "end") {
725 if (flags & FLAG_END) {
726 // eat environment name
727 string const name = p.getArg('{', '}');
728 if (name != active_environment())
729 p.error("\\end{" + name + "} does not match \\begin{"
730 + active_environment() + "}");
733 p.error("found 'end' unexpectedly");
740 // We can have comments if the last line is incomplete
743 // We can have hline stuff if the last line is incomplete
744 if (!hlines.empty()) {
745 // this does not work in LaTeX, so we ignore it
746 cerr << "Ignoring '" << hlines << "' at end of tabular"
752 void handle_hline_above(RowInfo & ri, vector<CellInfo> & ci)
755 for (size_t col = 0; col < ci.size(); ++col)
756 ci[col].topline = true;
760 void handle_hline_below(RowInfo & ri, vector<CellInfo> & ci)
762 ri.bottomline = true;
763 for (size_t col = 0; col < ci.size(); ++col)
764 ci[col].bottomline = true;
768 } // anonymous namespace
771 void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
774 string posopts = p.getOpt();
775 if (!posopts.empty()) {
776 // FIXME: Convert this to ERT
778 cerr << "horizontal longtable";
780 cerr << "vertical tabular";
781 cerr << " positioning '" << posopts << "' ignored\n";
784 vector<ColInfo> colinfo;
786 // handle column formatting
787 handle_colalign(p, colinfo, ColInfo());
788 fix_colalign(colinfo);
790 // first scan of cells
791 // use table mode to keep it minimal-invasive
792 // not exactly what's TeX doing...
793 vector<string> lines;
795 RowPosition rowpos = ROW_START;
796 parse_table(p, ss, is_long_tabular, rowpos, FLAG_END);
797 split(ss.str(), lines, LINE);
799 vector< vector<CellInfo> > cellinfo(lines.size());
800 vector<RowInfo> rowinfo(lines.size());
803 //cerr << "// split into rows\n";
804 for (size_t row = 0; row < rowinfo.size(); ++row) {
807 cellinfo[row].resize(colinfo.size());
810 vector<string> dummy;
811 //cerr << "\n########### LINE: " << lines[row] << "########\n";
812 split(lines[row], dummy, HLINE);
814 // handle horizontal line fragments
815 // we do only expect this for a last line without '\\'
816 if (dummy.size() != 3) {
817 if ((dummy.size() != 1 && dummy.size() != 2) ||
818 row != rowinfo.size() - 1)
819 cerr << "unexpected dummy size: " << dummy.size()
820 << " content: " << lines[row] << "\n";
823 lines[row] = dummy[1];
825 //cerr << "line: " << row << " above 0: " << dummy[0] << "\n";
826 //cerr << "line: " << row << " below 2: " << dummy[2] << "\n";
827 //cerr << "line: " << row << " cells 1: " << dummy[1] << "\n";
829 for (int i = 0; i <= 2; i += 2) {
830 //cerr << " reading from line string '" << dummy[i] << "'\n";
833 Token t = p1.get_token();
834 //cerr << "read token: " << t << "\n";
835 if (t.cs() == "hline") {
837 if (rowinfo[row].topline) {
838 if (row > 0) // extra bottomline above
839 handle_hline_below(rowinfo[row - 1], cellinfo[row - 1]);
841 cerr << "dropping extra hline\n";
842 //cerr << "below row: " << row-1 << endl;
844 handle_hline_above(rowinfo[row], cellinfo[row]);
845 //cerr << "above row: " << row << endl;
848 //cerr << "below row: " << row << endl;
849 handle_hline_below(rowinfo[row], cellinfo[row]);
851 } else if (t.cs() == "cline") {
852 string arg = p1.verbatim_item();
853 //cerr << "read cline arg: '" << arg << "'\n";
857 size_t from = convert<unsigned int>(t[0]);
859 cerr << "Could not parse "
860 "cline start column."
863 // 1 based index -> 0 based
865 if (from >= colinfo.size()) {
866 cerr << "cline starts at non "
868 << (from + 1) << endl;
869 from = colinfo.size() - 1;
871 size_t to = convert<unsigned int>(t[1]);
873 cerr << "Could not parse "
877 // 1 based index -> 0 based
879 if (to >= colinfo.size()) {
880 cerr << "cline ends at non "
883 to = colinfo.size() - 1;
885 for (size_t col = from; col <= to; ++col) {
886 //cerr << "row: " << row << " col: " << col << " i: " << i << endl;
888 rowinfo[row].topline = true;
889 cellinfo[row][col].topline = true;
891 rowinfo[row].bottomline = true;
892 cellinfo[row][col].bottomline = true;
895 } else if (t.cs() == "endhead") {
897 rowinfo[row].type = LT_HEAD;
898 for (int r = row - 1; r >= 0; --r) {
899 if (rowinfo[r].type != LT_NORMAL)
901 rowinfo[r].type = LT_HEAD;
903 } else if (t.cs() == "endfirsthead") {
905 rowinfo[row].type = LT_FIRSTHEAD;
906 for (int r = row - 1; r >= 0; --r) {
907 if (rowinfo[r].type != LT_NORMAL)
909 rowinfo[r].type = LT_FIRSTHEAD;
911 } else if (t.cs() == "endfoot") {
913 rowinfo[row].type = LT_FOOT;
914 for (int r = row - 1; r >= 0; --r) {
915 if (rowinfo[r].type != LT_NORMAL)
917 rowinfo[r].type = LT_FOOT;
919 } else if (t.cs() == "endlastfoot") {
921 rowinfo[row].type = LT_LASTFOOT;
922 for (int r = row - 1; r >= 0; --r) {
923 if (rowinfo[r].type != LT_NORMAL)
925 rowinfo[r].type = LT_LASTFOOT;
927 } else if (t.cs() == "newpage") {
930 rowinfo[row - 1].newpage = true;
932 // This does not work in LaTeX
938 rowinfo[row].newpage = true;
940 cerr << "unexpected line token: " << t << endl;
946 vector<string> cells;
947 split(lines[row], cells, TAB);
948 for (size_t col = 0, cell = 0; cell < cells.size();
950 //cerr << "cell content: '" << cells[cell] << "'\n";
951 if (col >= colinfo.size()) {
952 // This does not work in LaTeX
953 cerr << "Ignoring extra cell '"
954 << cells[cell] << "'." << endl;
957 Parser p(cells[cell]);
959 //cells[cell] << "'\n";
960 if (p.next_token().cs() == "multicolumn") {
963 size_t const ncells =
964 convert<unsigned int>(p.verbatim_item());
966 // special cell properties alignment
968 handle_colalign(p, t, ColInfo());
969 ColInfo & ci = t.front();
971 // The logic of LyX for multicolumn vertical
972 // lines is too complicated to reproduce it
973 // here (see LyXTabular::TeXCellPreamble()).
974 // Therefore we simply put everything in the
978 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
979 cellinfo[row][col].align = ci.align;
980 cellinfo[row][col].special = ci.special;
981 cellinfo[row][col].leftlines = ci.leftlines;
982 cellinfo[row][col].rightlines = ci.rightlines;
984 parse_text_in_inset(p, os, FLAG_ITEM, false, context);
985 if (!cellinfo[row][col].content.empty()) {
986 // This may or may not work in LaTeX,
987 // but it does not work in LyX.
988 // FIXME: Handle it correctly!
989 cerr << "Moving cell content '"
991 << "' into a multicolumn cell. "
992 "This will probably not work."
995 cellinfo[row][col].content += os.str();
997 // add dummy cells for multicol
998 for (size_t i = 0; i < ncells - 1 && col < colinfo.size(); ++i) {
1000 cellinfo[row][col].multi = CELL_PART_OF_MULTICOLUMN;
1001 cellinfo[row][col].align = 'c';
1005 cellinfo[row][col].leftlines = colinfo[col].leftlines;
1006 cellinfo[row][col].rightlines = colinfo[col].rightlines;
1007 cellinfo[row][col].align = colinfo[col].align;
1009 parse_text_in_inset(p, os, FLAG_CELL, false, context);
1010 cellinfo[row][col].content += os.str();
1014 //cerr << "// handle almost empty last row what we have\n";
1015 // handle almost empty last row
1016 if (row && lines[row].empty() && row + 1 == rowinfo.size()) {
1017 //cerr << "remove empty last line\n";
1018 if (rowinfo[row].topline)
1019 rowinfo[row - 1].bottomline = true;
1020 for (size_t col = 0; col < colinfo.size(); ++col)
1021 if (cellinfo[row][col].topline)
1022 cellinfo[row - 1][col].bottomline = true;
1027 // Now we have the table structure and content in rowinfo, colinfo
1029 // Unfortunately LyX has some limitations that we need to work around.
1031 // Convert cells with special content to multicolumn cells
1032 // (LyX ignores the special field for non-multicolumn cells).
1033 for (size_t row = 0; row < rowinfo.size(); ++row) {
1034 for (size_t col = 0; col < cellinfo[row].size(); ++col) {
1035 if (cellinfo[row][col].multi == CELL_NORMAL &&
1036 !cellinfo[row][col].special.empty())
1037 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
1041 //cerr << "// output what we have\n";
1042 // output what we have
1043 os << "\n<lyxtabular version=\"3\" rows=\"" << rowinfo.size()
1044 << "\" columns=\"" << colinfo.size() << "\">\n";
1046 << write_attribute("rotate", false)
1047 << write_attribute("islongtable", is_long_tabular)
1050 //cerr << "// after header\n";
1051 for (size_t col = 0; col < colinfo.size(); ++col) {
1052 os << "<column alignment=\""
1053 << verbose_align(colinfo[col].align) << "\""
1055 << verbose_valign(colinfo[col].valign) << "\""
1056 << write_attribute("leftline", colinfo[col].leftlines > 0)
1057 << write_attribute("rightline", colinfo[col].rightlines > 0)
1058 << write_attribute("width", translate_len(colinfo[col].width))
1059 << write_attribute("special", colinfo[col].special)
1062 //cerr << "// after cols\n";
1064 for (size_t row = 0; row < rowinfo.size(); ++row) {
1066 << write_attribute("topline", rowinfo[row].topline)
1067 << write_attribute("bottomline", rowinfo[row].bottomline)
1068 << write_attribute("endhead",
1069 rowinfo[row].type == LT_HEAD)
1070 << write_attribute("endfirsthead",
1071 rowinfo[row].type == LT_FIRSTHEAD)
1072 << write_attribute("endfoot",
1073 rowinfo[row].type == LT_FOOT)
1074 << write_attribute("endlastfoot",
1075 rowinfo[row].type == LT_LASTFOOT)
1076 << write_attribute("newpage", rowinfo[row].newpage)
1078 for (size_t col = 0; col < colinfo.size(); ++col) {
1079 CellInfo const & cell = cellinfo[row][col];
1081 if (cell.multi != CELL_NORMAL)
1082 os << " multicolumn=\"" << cell.multi << "\"";
1083 os << " alignment=\"" << verbose_align(cell.align)
1085 << " valignment=\"" << verbose_valign(cell.valign)
1087 << write_attribute("topline", cell.topline)
1088 << write_attribute("bottomline", cell.bottomline)
1089 << write_attribute("leftline", cell.leftlines > 0)
1090 << write_attribute("rightline", cell.rightlines > 0)
1091 << write_attribute("rotate", cell.rotate);
1092 //cerr << "\nrow: " << row << " col: " << col;
1094 // cerr << " topline=\"true\"";
1095 //if (cell.bottomline)
1096 // cerr << " bottomline=\"true\"";
1097 os << " usebox=\"none\""
1098 << write_attribute("width", translate_len(cell.width));
1099 if (cell.multi != CELL_NORMAL)
1100 os << write_attribute("special", cell.special);
1102 << "\n\\begin_inset Text\n"
1104 << "\n\\end_inset\n"
1110 os << "</lyxtabular>\n";