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, rightlines, align and valign in this case.
208 void ci2special(ColInfo & ci)
210 if (ci.width.empty() && ci.align == 'n')
211 // The alignment setting is already in special, since
212 // handle_colalign() never stores ci with these settings
213 // and ensures that leftlines == 0 and rightlines == 0 in
217 if (!ci.width.empty()) {
220 ci.special += ">{\\raggedright}";
223 ci.special += ">{\\raggedleft}";
226 ci.special += ">{\\centering}";
229 if (ci.valign == 'n')
232 ci.special += ci.valign;
233 ci.special += '{' + ci.width + '}';
236 ci.special += ci.align;
238 for (int i = 0; i < ci.leftlines; ++i)
239 ci.special.insert(0, "|");
240 for (int i = 0; i < ci.rightlines; ++i)
250 * Handle column specifications for tabulars and multicolumns.
251 * The next token of the parser \p p must be an opening brace, and we read
252 * everything until the matching closing brace.
253 * The resulting column specifications are filled into \p colinfo. This is
254 * in an intermediate form. fix_colalign() makes it suitable for LyX output.
256 void handle_colalign(Parser & p, vector<ColInfo> & colinfo,
257 ColInfo const & start)
259 if (p.get_token().cat() != catBegin)
260 cerr << "Wrong syntax for table column alignment.\n"
261 "Expected '{', got '" << p.curr_token().asInput()
264 ColInfo next = start;
265 for (Token t = p.get_token(); p.good() && t.cat() != catEnd;
268 cerr << "t: " << t << " c: '" << t.character() << "'\n";
271 // We cannot handle comments here
272 if (t.cat() == catComment) {
273 if (t.cs().empty()) {
277 cerr << "Ignoring comment: " << t.asInput();
281 switch (t.character()) {
285 // new column, horizontal aligned
286 next.align = t.character();
287 if (!next.special.empty())
289 colinfo.push_back(next);
295 // new column, vertical aligned box
296 next.valign = t.character();
297 next.width = p.verbatim_item();
298 if (!next.special.empty())
300 colinfo.push_back(next);
305 if (colinfo.empty()) {
306 if (next.special.empty())
310 } else if (colinfo.back().special.empty())
311 ++colinfo.back().rightlines;
312 else if (next.special.empty())
315 colinfo.back().special += '|';
318 // text before the next column
319 string const s = trim(p.verbatim_item());
320 if (next.special.empty() &&
322 // Maybe this can be converted to a
323 // horizontal alignment setting for
324 // fixed width columns
325 if (s == "\\raggedleft")
327 else if (s == "\\raggedright")
329 else if (s == "\\centering")
332 next.special = ">{" + s + '}';
334 next.special += ">{" + s + '}';
338 // text after the last column
339 string const s = trim(p.verbatim_item());
341 // This is not possible in LaTeX.
342 cerr << "Ignoring separator '<{"
343 << s << "}'." << endl;
345 ColInfo & ci = colinfo.back();
347 ci.special += "<{" + s + '}';
352 // *{n}{arg} means 'n' columns of type 'arg'
353 string const num = p.verbatim_item();
354 string const arg = p.verbatim_item();
355 size_t const n = convert<unsigned int>(num);
356 if (!arg.empty() && n > 0) {
358 for (size_t i = 0; i < n; ++i)
362 handle_colalign(p2, colinfo, next);
365 cerr << "Ignoring column specification"
366 " '*{" << num << "}{"
367 << arg << "}'." << endl;
372 // text instead of the column spacing
374 // text in addition to the column spacing
375 next.special += t.character();
376 next.special += '{' + p.verbatim_item() + '}';
379 // try user defined column types
380 if (special_columns.find(t.character()) !=
381 special_columns.end()) {
383 next.special += t.character();
385 special_columns[t.character()];
386 for (int i = 0; i < nargs; ++i)
387 next.special += '{' +
390 colinfo.push_back(next);
393 cerr << "Ignoring column specification"
394 " '" << t << "'." << endl;
399 // Maybe we have some column separators that need to be added to the
402 if (!next.special.empty()) {
403 ColInfo & ci = colinfo.back();
405 ci.special += next.special;
406 next.special.erase();
412 * Move the left and right lines and alignment settings of the column \p ci
413 * to the special field if necessary.
415 void fix_colalign(ColInfo & ci)
417 if (ci.leftlines > 1 || ci.rightlines > 1)
423 * LyX can't handle more than one vertical line at the left or right side
425 * This function moves the left and right lines and alignment settings of all
426 * columns in \p colinfo to the special field if necessary.
428 void fix_colalign(vector<ColInfo> & colinfo)
430 // Try to move extra leftlines to the previous column.
431 // We do this only if both special fields are empty, otherwise we
432 // can't tell wether the result will be the same.
433 for (size_t col = 0; col < colinfo.size(); ++col) {
434 if (colinfo[col].leftlines > 1 &&
435 colinfo[col].special.empty() && col > 0 &&
436 colinfo[col - 1].rightlines == 0 &&
437 colinfo[col - 1].special.empty()) {
438 ++colinfo[col - 1].rightlines;
439 --colinfo[col].leftlines;
442 // Try to move extra rightlines to the next column
443 for (size_t col = 0; col < colinfo.size(); ++col) {
444 if (colinfo[col].rightlines > 1 &&
445 colinfo[col].special.empty() &&
446 col < colinfo.size() - 1 &&
447 colinfo[col + 1].leftlines == 0 &&
448 colinfo[col + 1].special.empty()) {
449 ++colinfo[col + 1].leftlines;
450 --colinfo[col].rightlines;
453 // Move the lines and alignment settings to the special field if
455 for (size_t col = 0; col < colinfo.size(); ++col)
456 fix_colalign(colinfo[col]);
461 * Parse hlines and similar stuff.
462 * \returns wether the token \p t was parsed
464 bool parse_hlines(Parser & p, Token const & t, string & hlines,
465 bool is_long_tabular)
467 LASSERT(t.cat() == catEscape, return false);
469 if (t.cs() == "hline")
472 else if (t.cs() == "cline")
473 hlines += "\\cline{" + p.verbatim_item() + '}';
475 else if (is_long_tabular && t.cs() == "newpage")
476 hlines += "\\newpage";
485 /// Position in a row
487 /// At the very beginning, before the first token
489 /// After the first token and before any column token
491 /// After the first column token. Comments and whitespace are only
492 /// treated as tokens in this position
494 /// After the first non-column token at the end
500 * Parse table structure.
501 * We parse tables in a two-pass process: This function extracts the table
502 * structure (rows, columns, hlines etc.), but does not change the cell
503 * content. The cell content is parsed in a second step in handle_tabular().
505 void parse_table(Parser & p, ostream & os, bool is_long_tabular,
506 RowPosition & pos, unsigned flags)
508 // table structure commands such as \hline
511 // comments that occur at places where we can't handle them
515 Token const & t = p.get_token();
518 cerr << "t: " << t << " flags: " << flags << "\n";
521 // comments and whitespace in hlines
524 case IN_HLINES_START:
526 if (t.cat() == catComment) {
531 // We can't handle comments here,
532 // store them for later use
533 comments += t.asInput();
535 } else if (t.cat() == catSpace ||
536 t.cat() == catNewline) {
537 // whitespace is irrelevant here, we
538 // need to recognize hline stuff
547 // We need to handle structure stuff first in order to
548 // determine wether we need to output a HLINE separator
549 // before the row or not.
550 if (t.cat() == catEscape) {
551 if (parse_hlines(p, t, hlines, is_long_tabular)) {
554 pos = IN_HLINES_START;
559 case IN_HLINES_START:
566 else if (t.cs() == "tabularnewline" ||
570 cerr << "Warning: Converting TeX "
571 "'\\cr' to LaTeX '\\\\'."
573 // stuff before the line break
574 os << comments << HLINE << hlines << HLINE
576 //cerr << "hlines: " << hlines << endl;
583 else if (is_long_tabular &&
584 (t.cs() == "endhead" ||
585 t.cs() == "endfirsthead" ||
586 t.cs() == "endfoot" ||
587 t.cs() == "endlastfoot")) {
588 hlines += t.asInput();
592 // these commands are implicit line
594 os << comments << HLINE << hlines
601 pos = IN_HLINES_START;
603 case IN_HLINES_START:
611 // We need a HLINE separator if we either have no hline
612 // stuff at all and are just starting a row or if we just
613 // got the first non-hline token.
616 // no hline tokens exist, first token at row start
617 case IN_HLINES_START:
618 // hline tokens exist, first non-hline token at row
620 os << hlines << HLINE << comments;
626 // Oops, there is still cell content after hline
627 // stuff. This does not work in LaTeX, so we ignore
629 cerr << "Ignoring '" << hlines << "' in a cell"
640 // If we come here we have normal cell content
644 if (t.cat() == catMath) {
645 // we are inside some text mode thingy, so opening new math is allowed
646 Token const & n = p.get_token();
647 if (n.cat() == catMath) {
648 // TeX's $$...$$ syntax for displayed math
650 // This does only work because parse_math outputs TeX
651 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
653 p.get_token(); // skip the second '$' token
655 // simple $...$ stuff
658 // This does only work because parse_math outputs TeX
659 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
664 else if (t.cat() == catSpace
665 || t.cat() == catNewline
666 || t.cat() == catLetter
667 || t.cat() == catSuper
669 || t.cat() == catOther
670 || t.cat() == catActive
671 || t.cat() == catParameter)
674 else if (t.cat() == catBegin) {
676 parse_table(p, os, is_long_tabular, pos,
681 else if (t.cat() == catEnd) {
682 if (flags & FLAG_BRACE_LAST)
684 cerr << "unexpected '}'\n";
687 else if (t.cat() == catAlign) {
692 else if (t.cat() == catComment)
695 else if (t.cs() == "(") {
697 // This does only work because parse_math outputs TeX
698 parse_math(p, os, FLAG_SIMPLE2, MATH_MODE);
702 else if (t.cs() == "[") {
704 // This does only work because parse_math outputs TeX
705 parse_math(p, os, FLAG_EQUATION, MATH_MODE);
709 else if (t.cs() == "begin") {
710 string const name = p.getArg('{', '}');
711 active_environments.push_back(name);
712 os << "\\begin{" << name << '}';
713 // treat the nested environment as a block, don't
714 // parse &, \\ etc, because they don't belong to our
715 // table if they appear.
716 os << p.verbatimEnvironment(name);
717 os << "\\end{" << name << '}';
718 active_environments.pop_back();
721 else if (t.cs() == "end") {
722 if (flags & FLAG_END) {
723 // eat environment name
724 string const name = p.getArg('{', '}');
725 if (name != active_environment())
726 p.error("\\end{" + name + "} does not match \\begin{"
727 + active_environment() + "}");
730 p.error("found 'end' unexpectedly");
737 // We can have comments if the last line is incomplete
740 // We can have hline stuff if the last line is incomplete
741 if (!hlines.empty()) {
742 // this does not work in LaTeX, so we ignore it
743 cerr << "Ignoring '" << hlines << "' at end of tabular"
749 void handle_hline_above(RowInfo & ri, vector<CellInfo> & ci)
752 for (size_t col = 0; col < ci.size(); ++col)
753 ci[col].topline = true;
757 void handle_hline_below(RowInfo & ri, vector<CellInfo> & ci)
759 ri.bottomline = true;
760 for (size_t col = 0; col < ci.size(); ++col)
761 ci[col].bottomline = true;
765 } // anonymous namespace
768 void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
771 string posopts = p.getOpt();
772 if (!posopts.empty()) {
773 // FIXME: Convert this to ERT
775 cerr << "horizontal longtable";
777 cerr << "vertical tabular";
778 cerr << " positioning '" << posopts << "' ignored\n";
781 vector<ColInfo> colinfo;
783 // handle column formatting
784 handle_colalign(p, colinfo, ColInfo());
785 fix_colalign(colinfo);
787 // first scan of cells
788 // use table mode to keep it minimal-invasive
789 // not exactly what's TeX doing...
790 vector<string> lines;
792 RowPosition rowpos = ROW_START;
793 parse_table(p, ss, is_long_tabular, rowpos, FLAG_END);
794 split(ss.str(), lines, LINE);
796 vector< vector<CellInfo> > cellinfo(lines.size());
797 vector<RowInfo> rowinfo(lines.size());
800 //cerr << "// split into rows\n";
801 for (size_t row = 0; row < rowinfo.size(); ++row) {
804 cellinfo[row].resize(colinfo.size());
807 vector<string> dummy;
808 //cerr << "\n########### LINE: " << lines[row] << "########\n";
809 split(lines[row], dummy, HLINE);
811 // handle horizontal line fragments
812 // we do only expect this for a last line without '\\'
813 if (dummy.size() != 3) {
814 if ((dummy.size() != 1 && dummy.size() != 2) ||
815 row != rowinfo.size() - 1)
816 cerr << "unexpected dummy size: " << dummy.size()
817 << " content: " << lines[row] << "\n";
820 lines[row] = dummy[1];
822 //cerr << "line: " << row << " above 0: " << dummy[0] << "\n";
823 //cerr << "line: " << row << " below 2: " << dummy[2] << "\n";
824 //cerr << "line: " << row << " cells 1: " << dummy[1] << "\n";
826 for (int i = 0; i <= 2; i += 2) {
827 //cerr << " reading from line string '" << dummy[i] << "'\n";
830 Token t = p1.get_token();
831 //cerr << "read token: " << t << "\n";
832 if (t.cs() == "hline") {
834 if (rowinfo[row].topline) {
835 if (row > 0) // extra bottomline above
836 handle_hline_below(rowinfo[row - 1], cellinfo[row - 1]);
838 cerr << "dropping extra hline\n";
839 //cerr << "below row: " << row-1 << endl;
841 handle_hline_above(rowinfo[row], cellinfo[row]);
842 //cerr << "above row: " << row << endl;
845 //cerr << "below row: " << row << endl;
846 handle_hline_below(rowinfo[row], cellinfo[row]);
848 } else if (t.cs() == "cline") {
849 string arg = p1.verbatim_item();
850 //cerr << "read cline arg: '" << arg << "'\n";
854 size_t from = convert<unsigned int>(t[0]);
856 cerr << "Could not parse "
857 "cline start column."
860 // 1 based index -> 0 based
862 if (from >= colinfo.size()) {
863 cerr << "cline starts at non "
865 << (from + 1) << endl;
866 from = colinfo.size() - 1;
868 size_t to = convert<unsigned int>(t[1]);
870 cerr << "Could not parse "
874 // 1 based index -> 0 based
876 if (to >= colinfo.size()) {
877 cerr << "cline ends at non "
880 to = colinfo.size() - 1;
882 for (size_t col = from; col <= to; ++col) {
883 //cerr << "row: " << row << " col: " << col << " i: " << i << endl;
885 rowinfo[row].topline = true;
886 cellinfo[row][col].topline = true;
888 rowinfo[row].bottomline = true;
889 cellinfo[row][col].bottomline = true;
892 } else if (t.cs() == "endhead") {
894 rowinfo[row].type = LT_HEAD;
895 for (int r = row - 1; r >= 0; --r) {
896 if (rowinfo[r].type != LT_NORMAL)
898 rowinfo[r].type = LT_HEAD;
900 } else if (t.cs() == "endfirsthead") {
902 rowinfo[row].type = LT_FIRSTHEAD;
903 for (int r = row - 1; r >= 0; --r) {
904 if (rowinfo[r].type != LT_NORMAL)
906 rowinfo[r].type = LT_FIRSTHEAD;
908 } else if (t.cs() == "endfoot") {
910 rowinfo[row].type = LT_FOOT;
911 for (int r = row - 1; r >= 0; --r) {
912 if (rowinfo[r].type != LT_NORMAL)
914 rowinfo[r].type = LT_FOOT;
916 } else if (t.cs() == "endlastfoot") {
918 rowinfo[row].type = LT_LASTFOOT;
919 for (int r = row - 1; r >= 0; --r) {
920 if (rowinfo[r].type != LT_NORMAL)
922 rowinfo[r].type = LT_LASTFOOT;
924 } else if (t.cs() == "newpage") {
927 rowinfo[row - 1].newpage = true;
929 // This does not work in LaTeX
935 rowinfo[row].newpage = true;
937 cerr << "unexpected line token: " << t << endl;
943 vector<string> cells;
944 split(lines[row], cells, TAB);
945 for (size_t col = 0, cell = 0; cell < cells.size();
947 //cerr << "cell content: '" << cells[cell] << "'\n";
948 if (col >= colinfo.size()) {
949 // This does not work in LaTeX
950 cerr << "Ignoring extra cell '"
951 << cells[cell] << "'." << endl;
954 Parser p(cells[cell]);
956 //cells[cell] << "'\n";
957 if (p.next_token().cs() == "multicolumn") {
960 size_t const ncells =
961 convert<unsigned int>(p.verbatim_item());
963 // special cell properties alignment
965 handle_colalign(p, t, ColInfo());
966 ColInfo & ci = t.front();
968 // The logic of LyX for multicolumn vertical
969 // lines is too complicated to reproduce it
970 // here (see LyXTabular::TeXCellPreamble()).
971 // Therefore we simply put everything in the
975 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
976 cellinfo[row][col].align = ci.align;
977 cellinfo[row][col].special = ci.special;
978 cellinfo[row][col].leftlines = ci.leftlines;
979 cellinfo[row][col].rightlines = ci.rightlines;
981 parse_text_in_inset(p, os, FLAG_ITEM, false, context);
982 if (!cellinfo[row][col].content.empty()) {
983 // This may or may not work in LaTeX,
984 // but it does not work in LyX.
985 // FIXME: Handle it correctly!
986 cerr << "Moving cell content '"
988 << "' into a multicolumn cell. "
989 "This will probably not work."
992 cellinfo[row][col].content += os.str();
994 // add dummy cells for multicol
995 for (size_t i = 0; i < ncells - 1 && col < colinfo.size(); ++i) {
997 cellinfo[row][col].multi = CELL_PART_OF_MULTICOLUMN;
998 cellinfo[row][col].align = 'c';
1002 cellinfo[row][col].leftlines = colinfo[col].leftlines;
1003 cellinfo[row][col].rightlines = colinfo[col].rightlines;
1004 cellinfo[row][col].align = colinfo[col].align;
1006 parse_text_in_inset(p, os, FLAG_CELL, false, context);
1007 cellinfo[row][col].content += os.str();
1011 //cerr << "// handle almost empty last row what we have\n";
1012 // handle almost empty last row
1013 if (row && lines[row].empty() && row + 1 == rowinfo.size()) {
1014 //cerr << "remove empty last line\n";
1015 if (rowinfo[row].topline)
1016 rowinfo[row - 1].bottomline = true;
1017 for (size_t col = 0; col < colinfo.size(); ++col)
1018 if (cellinfo[row][col].topline)
1019 cellinfo[row - 1][col].bottomline = true;
1024 // Now we have the table structure and content in rowinfo, colinfo
1026 // Unfortunately LyX has some limitations that we need to work around.
1028 // Convert cells with special content to multicolumn cells
1029 // (LyX ignores the special field for non-multicolumn cells).
1030 for (size_t row = 0; row < rowinfo.size(); ++row) {
1031 for (size_t col = 0; col < cellinfo[row].size(); ++col) {
1032 if (cellinfo[row][col].multi == CELL_NORMAL &&
1033 !cellinfo[row][col].special.empty())
1034 cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
1038 //cerr << "// output what we have\n";
1039 // output what we have
1040 os << "\n<lyxtabular version=\"3\" rows=\"" << rowinfo.size()
1041 << "\" columns=\"" << colinfo.size() << "\">\n";
1043 << write_attribute("rotate", false)
1044 << write_attribute("islongtable", is_long_tabular)
1047 //cerr << "// after header\n";
1048 for (size_t col = 0; col < colinfo.size(); ++col) {
1049 os << "<column alignment=\""
1050 << verbose_align(colinfo[col].align) << "\""
1052 << verbose_valign(colinfo[col].valign) << "\""
1053 << write_attribute("leftline", colinfo[col].leftlines > 0)
1054 << write_attribute("rightline", colinfo[col].rightlines > 0)
1055 << write_attribute("width", translate_len(colinfo[col].width))
1056 << write_attribute("special", colinfo[col].special)
1059 //cerr << "// after cols\n";
1061 for (size_t row = 0; row < rowinfo.size(); ++row) {
1063 << write_attribute("topline", rowinfo[row].topline)
1064 << write_attribute("bottomline", rowinfo[row].bottomline)
1065 << write_attribute("endhead",
1066 rowinfo[row].type == LT_HEAD)
1067 << write_attribute("endfirsthead",
1068 rowinfo[row].type == LT_FIRSTHEAD)
1069 << write_attribute("endfoot",
1070 rowinfo[row].type == LT_FOOT)
1071 << write_attribute("endlastfoot",
1072 rowinfo[row].type == LT_LASTFOOT)
1073 << write_attribute("newpage", rowinfo[row].newpage)
1075 for (size_t col = 0; col < colinfo.size(); ++col) {
1076 CellInfo const & cell = cellinfo[row][col];
1078 if (cell.multi != CELL_NORMAL)
1079 os << " multicolumn=\"" << cell.multi << "\"";
1080 os << " alignment=\"" << verbose_align(cell.align)
1082 << " valignment=\"" << verbose_valign(cell.valign)
1084 << write_attribute("topline", cell.topline)
1085 << write_attribute("bottomline", cell.bottomline)
1086 << write_attribute("leftline", cell.leftlines > 0)
1087 << write_attribute("rightline", cell.rightlines > 0)
1088 << write_attribute("rotate", cell.rotate);
1089 //cerr << "\nrow: " << row << " col: " << col;
1091 // cerr << " topline=\"true\"";
1092 //if (cell.bottomline)
1093 // cerr << " bottomline=\"true\"";
1094 os << " usebox=\"none\""
1095 << write_attribute("width", translate_len(cell.width));
1096 if (cell.multi != CELL_NORMAL)
1097 os << write_attribute("special", cell.special);
1099 << "\n\\begin_inset Text\n"
1101 << "\n\\end_inset\n"
1107 os << "</lyxtabular>\n";