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"
22 #include <boost/assert.hpp>
33 // filled in preamble.cpp
34 map<char, int> special_columns;
41 ColInfo() : align('n'), valign('n'), rightlines(0), leftlines(0) {}
44 /// vertical alignment
48 /// special column alignment
50 /// number of lines on the right
52 /// number of lines on the left
57 /// row type for longtables
64 /// part of head on first page
68 /// part of foot on last page
75 RowInfo() : topline(false), bottomline(false), type(LT_NORMAL),
77 /// horizontal line above
79 /// horizontal line below
81 /// These are for longtabulars only
82 /// row type (head, foot, firsthead etc.)
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,
95 /// This is a dummy cell (part of a multicolumn cell)
96 CELL_PART_OF_MULTICOLUMN
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, rightlines, align and valign in this case.
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 for (int i = 0; i < ci.leftlines; ++i)
240 ci.special.insert(0, "|");
241 for (int i = 0; i < ci.rightlines; ++i)
251 * Handle column specifications for tabulars and multicolumns.
252 * The next token of the parser \p p must be an opening brace, and we read
253 * everything until the matching closing brace.
254 * The resulting column specifications are filled into \p colinfo. This is
255 * in an intermediate form. fix_colalign() makes it suitable for LyX output.
257 void handle_colalign(Parser & p, vector<ColInfo> & colinfo,
258 ColInfo const & start)
260 if (p.get_token().cat() != catBegin)
261 cerr << "Wrong syntax for table column alignment.\n"
262 "Expected '{', got '" << p.curr_token().asInput()
265 ColInfo next = start;
266 for (Token t = p.get_token(); p.good() && t.cat() != catEnd;
269 cerr << "t: " << t << " c: '" << t.character() << "'\n";
272 // We cannot handle comments here
273 if (t.cat() == catComment) {
274 if (t.cs().empty()) {
278 cerr << "Ignoring comment: " << t.asInput();
282 switch (t.character()) {
286 // new column, horizontal aligned
287 next.align = t.character();
288 if (!next.special.empty())
290 colinfo.push_back(next);
296 // new column, vertical aligned box
297 next.valign = t.character();
298 next.width = p.verbatim_item();
299 if (!next.special.empty())
301 colinfo.push_back(next);
306 if (colinfo.empty()) {
307 if (next.special.empty())
311 } else if (colinfo.back().special.empty())
312 ++colinfo.back().rightlines;
313 else if (next.special.empty())
316 colinfo.back().special += '|';
319 // text before the next column
320 string const s = trim(p.verbatim_item());
321 if (next.special.empty() &&
323 // Maybe this can be converted to a
324 // horizontal alignment setting for
325 // fixed width columns
326 if (s == "\\raggedleft")
328 else if (s == "\\raggedright")
330 else if (s == "\\centering")
333 next.special = ">{" + s + '}';
335 next.special += ">{" + s + '}';
339 // text after the last column
340 string const s = trim(p.verbatim_item());
342 // This is not possible in LaTeX.
343 cerr << "Ignoring separator '<{"
344 << s << "}'." << endl;
346 ColInfo & ci = colinfo.back();
348 ci.special += "<{" + s + '}';
353 // *{n}{arg} means 'n' columns of type 'arg'
354 string const num = p.verbatim_item();
355 string const arg = p.verbatim_item();
356 size_t const n = convert<unsigned int>(num);
357 if (!arg.empty() && n > 0) {
359 for (size_t i = 0; i < n; ++i)
363 handle_colalign(p2, colinfo, next);
366 cerr << "Ignoring column specification"
367 " '*{" << num << "}{"
368 << arg << "}'." << endl;
373 // text instead of the column spacing
375 // text in addition to the column spacing
376 next.special += t.character();
377 next.special += '{' + p.verbatim_item() + '}';
380 // try user defined column types
381 if (special_columns.find(t.character()) !=
382 special_columns.end()) {
384 next.special += t.character();
386 special_columns[t.character()];
387 for (int i = 0; i < nargs; ++i)
388 next.special += '{' +
391 colinfo.push_back(next);
394 cerr << "Ignoring column specification"
395 " '" << t << "'." << endl;
400 // Maybe we have some column separators that need to be added to the
403 if (!next.special.empty()) {
404 ColInfo & ci = colinfo.back();
406 ci.special += next.special;
407 next.special.erase();
413 * Move the left and right lines and alignment settings of the column \p ci
414 * to the special field if necessary.
416 void fix_colalign(ColInfo & ci)
418 if (ci.leftlines > 1 || ci.rightlines > 1)
424 * LyX can't handle more than one vertical line at the left or right side
426 * This function moves the left and right lines and alignment settings of all
427 * columns in \p colinfo to the special field if necessary.
429 void fix_colalign(vector<ColInfo> & colinfo)
431 // Try to move extra leftlines to the previous column.
432 // We do this only if both special fields are empty, otherwise we
433 // can't tell wether the result will be the same.
434 for (size_t col = 0; col < colinfo.size(); ++col) {
435 if (colinfo[col].leftlines > 1 &&
436 colinfo[col].special.empty() && col > 0 &&
437 colinfo[col - 1].rightlines == 0 &&
438 colinfo[col - 1].special.empty()) {
439 ++colinfo[col - 1].rightlines;
440 --colinfo[col].leftlines;
443 // Try to move extra rightlines to the next column
444 for (size_t col = 0; col < colinfo.size(); ++col) {
445 if (colinfo[col].rightlines > 1 &&
446 colinfo[col].special.empty() &&
447 col < colinfo.size() - 1 &&
448 colinfo[col + 1].leftlines == 0 &&
449 colinfo[col + 1].special.empty()) {
450 ++colinfo[col + 1].leftlines;
451 --colinfo[col].rightlines;
454 // Move the lines and alignment settings to the special field if
456 for (size_t col = 0; col < colinfo.size(); ++col)
457 fix_colalign(colinfo[col]);
462 * Parse hlines and similar stuff.
463 * \returns wether the token \p t was parsed
465 bool parse_hlines(Parser & p, Token const & t, string & hlines,
466 bool is_long_tabular)
468 BOOST_ASSERT(t.cat() == catEscape);
470 if (t.cs() == "hline")
473 else if (t.cs() == "cline")
474 hlines += "\\cline{" + p.verbatim_item() + '}';
476 else if (is_long_tabular && t.cs() == "newpage")
477 hlines += "\\newpage";
486 /// Position in a row
488 /// At the very beginning, before the first token
490 /// After the first token and before any column token
492 /// After the first column token. Comments and whitespace are only
493 /// treated as tokens in this position
495 /// After the first non-column token at the end
501 * Parse table structure.
502 * We parse tables in a two-pass process: This function extracts the table
503 * structure (rows, columns, hlines etc.), but does not change the cell
504 * content. The cell content is parsed in a second step in handle_tabular().
506 void parse_table(Parser & p, ostream & os, bool is_long_tabular,
507 RowPosition & pos, unsigned flags)
509 // table structure commands such as \hline
512 // comments that occur at places where we can't handle them
516 Token const & t = p.get_token();
519 cerr << "t: " << t << " flags: " << flags << "\n";
522 // comments and whitespace in hlines
525 case IN_HLINES_START:
527 if (t.cat() == catComment) {
532 // We can't handle comments here,
533 // store them for later use
534 comments += t.asInput();
536 } else if (t.cat() == catSpace ||
537 t.cat() == catNewline) {
538 // whitespace is irrelevant here, we
539 // need to recognize hline stuff
548 // We need to handle structure stuff first in order to
549 // determine wether we need to output a HLINE separator
550 // before the row or not.
551 if (t.cat() == catEscape) {
552 if (parse_hlines(p, t, hlines, is_long_tabular)) {
555 pos = IN_HLINES_START;
560 case IN_HLINES_START:
567 else if (t.cs() == "tabularnewline" ||
571 cerr << "Warning: Converting TeX "
572 "'\\cr' to LaTeX '\\\\'."
574 // stuff before the line break
575 os << comments << HLINE << hlines << HLINE
577 //cerr << "hlines: " << hlines << endl;
584 else if (is_long_tabular &&
585 (t.cs() == "endhead" ||
586 t.cs() == "endfirsthead" ||
587 t.cs() == "endfoot" ||
588 t.cs() == "endlastfoot")) {
589 hlines += t.asInput();
593 // these commands are implicit line
595 os << comments << HLINE << hlines
602 pos = IN_HLINES_START;
604 case IN_HLINES_START:
612 // We need a HLINE separator if we either have no hline
613 // stuff at all and are just starting a row or if we just
614 // got the first non-hline token.
617 // no hline tokens exist, first token at row start
618 case IN_HLINES_START:
619 // hline tokens exist, first non-hline token at row
621 os << hlines << HLINE << comments;
627 // Oops, there is still cell content after hline
628 // stuff. This does not work in LaTeX, so we ignore
630 cerr << "Ignoring '" << hlines << "' in a cell"
641 // If we come here we have normal cell content
645 if (t.cat() == catMath) {
646 // we are inside some text mode thingy, so opening new math is allowed
647 Token const & n = p.get_token();
648 if (n.cat() == catMath) {
649 // TeX's $$...$$ syntax for displayed math
651 // This does only work because parse_math outputs TeX
652 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
654 p.get_token(); // skip the second '$' token
656 // simple $...$ stuff
659 // This does only work because parse_math outputs TeX
660 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
665 else if (t.cat() == catSpace || t.cat() == catNewline)
668 else if (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";