- tab_joint_text (tab, c, r, c + cs - 1, r + rs - 1, 0, text);
+ if (sscanf (text, "{%u}", &i) == 1)
+ {
+ struct table *table;
+
+ if (i >= n_tables)
+ error (1, 0, "bad table number %u", i);
+ table = table_ref (tables[i]);
+
+ text = strchr (text, '}') + 1;
+ while (*text)
+ switch (*text++)
+ {
+ case 's':
+ table = table_stomp (table);
+ break;
+
+ case 't':
+ table = table_transpose (table);
+ break;
+
+ default:
+ error (1, 0, "unexpected subtable modifier \"%c\"", *text);
+ }
+ tab_subtable (tab, c, r, c + cs - 1, r + rs - 1, opt,
+ table_item_create (table, NULL, NULL));
+ }
+ else
+ {
+ char *pos = text;
+ char *content;
+ int i;
+
+ for (i = 0; (content = strsep (&pos, "#")) != NULL; i++)
+ if (!i)
+ tab_joint_text (tab, c, r, c + cs - 1, r + rs - 1, opt,
+ content);
+ else
+ tab_footnote (tab, c, r, "%s", content);
+ }