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"
31 // filled in preamble.cpp
32 map<char, int> special_columns;
39 ColInfo() : align('n'), valign('n'), rightlines(0), leftlines(0) {}
42 /// vertical alignment
46 /// special column alignment
48 /// number of lines on the right
50 /// number of lines on the left
55 /// row type for longtables
62 /// part of head on first page
66 /// part of foot on last page
73 RowInfo() : topline(false), bottomline(false), type(LT_NORMAL),
75 /// horizontal line above
77 /// horizontal line below
79 /// These are for longtabulars only
80 /// row type (head, foot, firsthead etc.)
90 /// A multicolumn cell. The number of columns is <tt>1 + number
91 /// of CELL_PART_OF_MULTICOLUMN cells</tt> that follow directly
92 CELL_BEGIN_OF_MULTICOLUMN,
93 /// This is a dummy cell (part of a multicolumn cell)
94 CELL_PART_OF_MULTICOLUMN
100 CellInfo() : multi(CELL_NORMAL), align('n'), valign('n'),
101 leftlines(0), rightlines(0), topline(false),
102 bottomline(false), rotate(false) {}
109 /// vertical cell alignment
111 /// number of lines on the left
113 /// number of lines on the right
115 /// do we have a line above?
117 /// do we have a line below?
119 /// is the cell rotated?
121 /// width for multicolumn cells
123 /// special formatting for multicolumn cells
128 /// translate a horizontal alignment (as stored in ColInfo and CellInfo) to LyX
129 inline char const * verbose_align(char c)
144 /// translate a vertical alignment (as stored in ColInfo and CellInfo) to LyX
145 inline char const * verbose_valign(char c)
147 // The default value for no special alignment is "top".
160 // stripped down from tabluar.C. We use it currently only for bools and
162 string const write_attribute(string const & name, bool const & b)
164 // we write only true attribute values so we remove a bit of the
165 // file format bloat for tabulars.
166 return b ? ' ' + name + "=\"true\"" : string();
170 string const write_attribute(string const & name, string const & s)
172 return s.empty() ? string() : ' ' + name + "=\"" + s + '"';
176 /*! rather brutish way to code table structure in a string:
181 \multicolumn{2}{c}{4} & 5 //
187 gets "translated" to:
190 HLINE 1 TAB 2 TAB 3 HLINE HLINE LINE
191 \hline HLINE \multicolumn{2}{c}{4} TAB 5 HLINE HLINE LINE
192 HLINE 6 TAB 7 HLINE HLINE LINE
193 HLINE 8 HLINE \endhead HLINE LINE
197 char const TAB = '\001';
198 char const LINE = '\002';
199 char const HLINE = '\004';
203 * Move the information in leftlines, rightlines, align and valign to the
204 * special field. This is necessary if the special field is not empty,
205 * because LyX ignores leftlines, rightlines, align and valign in this case.
207 void ci2special(ColInfo & ci)
209 if (ci.width.empty() && ci.align == 'n')
210 // The alignment setting is already in special, since
211 // handle_colalign() never stores ci with these settings
212 // and ensures that leftlines == 0 and rightlines == 0 in
216 if (!ci.width.empty()) {
219 ci.special += ">{\\raggedright}";
222 ci.special += ">{\\raggedleft}";
225 ci.special += ">{\\centering}";
228 if (ci.valign == 'n')
231 ci.special += ci.valign;
232 ci.special += '{' + ci.width + '}';
235 ci.special += ci.align;
237 for (int i = 0; i < ci.leftlines; ++i)
238 ci.special.insert(0, "|");
239 for (int i = 0; i < ci.rightlines; ++i)
249 * Handle column specifications for tabulars and multicolumns.
250 * The next token of the parser \p p must be an opening brace, and we read
251 * everything until the matching closing brace.
252 * The resulting column specifications are filled into \p colinfo. This is
253 * in an intermediate form. fix_colalign() makes it suitable for LyX output.
255 void handle_colalign(Parser & p, vector<ColInfo> & colinfo,
256 ColInfo const & start)
258 if (p.get_token().cat() != catBegin)
259 cerr << "Wrong syntax for table column alignment.\n"
260 "Expected '{', got '" << p.curr_token().asInput()
263 ColInfo next = start;
264 for (Token t = p.get_token(); p.good() && t.cat() != catEnd;
267 cerr << "t: " << t << " c: '" << t.character() << "'\n";
270 // We cannot handle comments here
271 if (t.cat() == catComment) {
272 if (t.cs().empty()) {
276 cerr << "Ignoring comment: " << t.asInput();
280 switch (t.character()) {
284 // new column, horizontal aligned
285 next.align = t.character();
286 if (!next.special.empty())
288 colinfo.push_back(next);
294 // new column, vertical aligned box
295 next.valign = t.character();
296 next.width = p.verbatim_item();
297 if (!next.special.empty())
299 colinfo.push_back(next);
304 if (colinfo.empty()) {
305 if (next.special.empty())
309 } else if (colinfo.back().special.empty())
310 ++colinfo.back().rightlines;
311 else if (next.special.empty())
314 colinfo.back().special += '|';
317 // text before the next column
318 string const s = trim(p.verbatim_item());
319 if (next.special.empty() &&
321 // Maybe this can be converted to a
322 // horizontal alignment setting for
323 // fixed width columns
324 if (s == "\\raggedleft")
326 else if (s == "\\raggedright")
328 else if (s == "\\centering")
331 next.special = ">{" + s + '}';
333 next.special += ">{" + s + '}';
337 // text after the last column
338 string const s = trim(p.verbatim_item());
340 // This is not possible in LaTeX.
341 cerr << "Ignoring separator '<{"
342 << s << "}'." << endl;
344 ColInfo & ci = colinfo.back();
346 ci.special += "<{" + s + '}';
351 // *{n}{arg} means 'n' columns of type 'arg'
352 string const num = p.verbatim_item();
353 string const arg = p.verbatim_item();
354 size_t const n = convert<unsigned int>(num);
355 if (!arg.empty() && n > 0) {
357 for (size_t i = 0; i < n; ++i)
361 handle_colalign(p2, colinfo, next);
364 cerr << "Ignoring column specification"
365 " '*{" << num << "}{"
366 << arg << "}'." << endl;
371 // text instead of the column spacing
373 // text in addition to the column spacing
374 next.special += t.character();
375 next.special += '{' + p.verbatim_item() + '}';
378 // try user defined column types
379 if (special_columns.find(t.character()) !=
380 special_columns.end()) {
382 next.special += t.character();
384 special_columns[t.character()];
385 for (int i = 0; i < nargs; ++i)
386 next.special += '{' +
389 colinfo.push_back(next);
392 cerr << "Ignoring column specification"
393 " '" << t << "'." << endl;
398 // Maybe we have some column separators that need to be added to the
401 if (!next.special.empty()) {
402 ColInfo & ci = colinfo.back();
404 ci.special += next.special;
405 next.special.erase();
411 * Move the left and right lines and alignment settings of the column \p ci
412 * to the special field if necessary.
414 void fix_colalign(ColInfo & ci)
416 if (ci.leftlines > 1 || ci.rightlines > 1)
422 * LyX can't handle more than one vertical line at the left or right side
424 * This function moves the left and right lines and alignment settings of all
425 * columns in \p colinfo to the special field if necessary.
427 void fix_colalign(vector<ColInfo> & colinfo)
429 // Try to move extra leftlines to the previous column.
430 // We do this only if both special fields are empty, otherwise we
431 // can't tell wether the result will be the same.
432 for (size_t col = 0; col < colinfo.size(); ++col) {
433 if (colinfo[col].leftlines > 1 &&
434 colinfo[col].special.empty() && col > 0 &&
435 colinfo[col - 1].rightlines == 0 &&
436 colinfo[col - 1].special.empty()) {
437 ++colinfo[col - 1].rightlines;
438 --colinfo[col].leftlines;
441 // Try to move extra rightlines to the next column
442 for (size_t col = 0; col < colinfo.size(); ++col) {
443 if (colinfo[col].rightlines > 1 &&
444 colinfo[col].special.empty() &&
445 col < colinfo.size() - 1 &&
446 colinfo[col + 1].leftlines == 0 &&
447 colinfo[col + 1].special.empty()) {
448 ++colinfo[col + 1].leftlines;
449 --colinfo[col].rightlines;
452 // Move the lines and alignment settings to the special field if
454 for (size_t col = 0; col < colinfo.size(); ++col)
455 fix_colalign(colinfo[col]);
460 * Parse hlines and similar stuff.
461 * \returns wether the token \p t was parsed
463 bool parse_hlines(Parser & p, Token const & t, string & hlines,
464 bool is_long_tabular)
466 BOOST_ASSERT(t.cat() == catEscape);
468 if (t.cs() == "hline")
471 else if (t.cs() == "cline")
472 hlines += "\\cline{" + p.verbatim_item() + '}';
474 else if (is_long_tabular && t.cs() == "newpage")
475 hlines += "\\newpage";
484 /// Position in a row
486 /// At the very beginning, before the first token
488 /// After the first token and before any column token
490 /// After the first column token. Comments and whitespace are only
491 /// treated as tokens in this position
493 /// After the first non-column token at the end
499 * Parse table structure.
500 * We parse tables in a two-pass process: This function extracts the table
501 * structure (rows, columns, hlines etc.), but does not change the cell
502 * content. The cell content is parsed in a second step in handle_tabular().
504 void parse_table(Parser & p, ostream & os, bool is_long_tabular,
505 RowPosition & pos, unsigned flags)
507 // table structure commands such as \hline
510 // comments that occur at places where we can't handle them
514 Token const & t = p.get_token();
517 cerr << "t: " << t << " flags: " << flags << "\n";
520 // comments and whitespace in hlines
523 case IN_HLINES_START:
525 if (t.cat() == catComment) {
530 // We can't handle comments here,
531 // store them for later use
532 comments += t.asInput();
534 } else if (t.cat() == catSpace ||
535 t.cat() == catNewline) {
536 // whitespace is irrelevant here, we
537 // need to recognize hline stuff
546 // We need to handle structure stuff first in order to
547 // determine wether we need to output a HLINE separator
548 // before the row or not.
549 if (t.cat() == catEscape) {
550 if (parse_hlines(p, t, hlines, is_long_tabular)) {
553 pos = IN_HLINES_START;
558 case IN_HLINES_START:
565 else if (t.cs() == "tabularnewline" ||
569 cerr << "Warning: Converting TeX "
570 "'\\cr' to LaTeX '\\\\'."
572 // stuff before the line break
573 os << comments << HLINE << hlines << HLINE
575 //cerr << "hlines: " << hlines << endl;
582 else if (is_long_tabular &&
583 (t.cs() == "endhead" ||
584 t.cs() == "endfirsthead" ||
585 t.cs() == "endfoot" ||
586 t.cs() == "endlastfoot")) {
587 hlines += t.asInput();
591 // these commands are implicit line
593 os << comments << HLINE << hlines
600 pos = IN_HLINES_START;
602 case IN_HLINES_START:
610 // We need a HLINE separator if we either have no hline
611 // stuff at all and are just starting a row or if we just
612 // got the first non-hline token.
615 // no hline tokens exist, first token at row start
616 case IN_HLINES_START:
617 // hline tokens exist, first non-hline token at row
619 os << hlines << HLINE << comments;
625 // Oops, there is still cell content after hline
626 // stuff. This does not work in LaTeX, so we ignore
628 cerr << "Ignoring '" << hlines << "' in a cell"
639 // If we come here we have normal cell content
643 if (t.cat() == catMath) {
644 // we are inside some text mode thingy, so opening new math is allowed
645 Token const & n = p.get_token();
646 if (n.cat() == catMath) {
647 // TeX's $$...$$ syntax for displayed math
649 // This does only work because parse_math outputs TeX
650 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
652 p.get_token(); // skip the second '$' token
654 // simple $...$ stuff
657 // This does only work because parse_math outputs TeX
658 parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
663 else if (t.cat() == catSpace || t.cat() == catNewline)
666 else if (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";