- if (havetable) {
- if (getType() == hullSimple) {
- ms << MTag("mtable");
- } else if (getType() >= hullAlign && getType() <= hullXXAlignAt) {
- string alignment;
- for (col_type col = 0; col < ncols(); ++col) {
- alignment += (col % 2) ? "left " : "right ";
- }
- ms << MTag("mtable", "displaystyle='true' columnalign='" + alignment + "'");
- } else {
- ms << MTag("mtable", "displaystyle='true'");
+ // Simplest case: single row, single column, no numbering.
+ if (!havetable) {
+ ms << cell(index(0, 0));
+ return;
+ }
+
+ // More complex case: wrap elements in a table.
+ if (getType() == hullSimple) {
+ ms << MTag("mtable");
+ } else if (getType() >= hullAlign && getType() <= hullXXAlignAt) {
+ // hullAlign, hullAlignAt, hullXAlignAt, hullXXAlignAt
+ string alignment;
+ for (col_type col = 0; col < ncols(); ++col) {
+ alignment += (col % 2) ? "left " : "right ";