summaryrefslogtreecommitdiff
path: root/src/preproc/tbl/table.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/preproc/tbl/table.cpp')
-rw-r--r--src/preproc/tbl/table.cpp76
1 files changed, 67 insertions, 9 deletions
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index 64f5ab40..9a7789ce 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -1819,6 +1819,12 @@ void table::init_output()
".in 0\n"
".\\}\n"
"..\n"
+ // protect # in macro name against eqn
+ ".ig\n"
+ ".EQ\n"
+ "delim off\n"
+ ".EN\n"
+ "..\n"
".de " RELEASE_MACRO_NAME "\n"
".if \\n[" SECTION_DIVERSION_FLAG_REG "] \\{"
".di\n"
@@ -1850,6 +1856,11 @@ void table::init_output()
".rm " SECTION_DIVERSION_NAME "\n"
".\\}\n"
"..\n"
+ ".ig\n"
+ ".EQ\n"
+ "delim on\n"
+ ".EN\n"
+ "..\n"
".nr " TABLE_DIVERSION_FLAG_REG " 0\n"
".de " TABLE_KEEP_MACRO_NAME "\n"
".if '\\n[.z]'' \\{"
@@ -2113,12 +2124,24 @@ void table::compute_expand_width()
if (total_separation)
printfs("-%1n", as_string(total_separation));
prints("\n");
- prints(".if \\n[" EXPAND_REG "]<0 \\{");
+ prints(".if \\n[" EXPAND_REG "]<0 \\{\\\n");
entry_list->set_location();
- if (!(flags & NOWARN))
+ if (!(flags & NOWARN)) {
+ // protect ` and ' in warning message against eqn
+ prints(".ig\n"
+ ".EQ\n"
+ "delim off\n"
+ ".EN\n"
+ "..\n");
prints(".tm1 \"warning: file `\\n[.F]', around line \\n[.c]:\n"
- ".tm1 \" table wider than line width\n"
- ".nr " EXPAND_REG " 0\n");
+ ".tm1 \" table wider than line width\n");
+ prints(".ig\n"
+ ".EQ\n"
+ "delim on\n"
+ ".EN\n"
+ "..\n");
+ prints(".nr " EXPAND_REG " 0\n");
+ }
prints(".\\}\n");
if (colcount > 1)
printfs(".nr " EXPAND_REG " \\n[" EXPAND_REG "]/%1\n",
@@ -2153,18 +2176,31 @@ void table::compute_separation_factor()
for (int i = 0; i < ncolumns; i++)
printfs("-\\n[%1]", span_width_reg(i, i));
printfs("/%1\n", as_string(total_separation));
- prints(".ie \\n[" SEPARATION_FACTOR_REG "]<=0 \\{");
+ prints(".ie \\n[" SEPARATION_FACTOR_REG "]<=0 \\{\\\n");
entry_list->set_location();
- if (!(flags & NOWARN))
+ if (!(flags & NOWARN)) {
+ // protect ` and ' in warning message against eqn
+ prints(".ig\n"
+ ".EQ\n"
+ "delim off\n"
+ ".EN\n"
+ "..\n");
prints(".tm1 \"warning: file `\\n[.F]', around line \\n[.c]:\n"
".tm1 \" column separation set to zero\n"
".nr " SEPARATION_FACTOR_REG " 0\n");
+ }
prints(".\\}\n"
- ".el .if \\n[" SEPARATION_FACTOR_REG "]<1n \\{");
+ ".el .if \\n[" SEPARATION_FACTOR_REG "]<1n \\{\\\n");
entry_list->set_location();
- if (!(flags & NOWARN))
+ if (!(flags & NOWARN)) {
prints(".tm1 \"warning: file `\\n[.F]', around line \\n[.c]:\n"
".tm1 \" table squeezed horizontally to fit line length\n");
+ prints(".ig\n"
+ ".EQ\n"
+ "delim on\n"
+ ".EN\n"
+ "..\n");
+ }
prints(".\\}\n");
}
@@ -2602,6 +2638,12 @@ void table::build_vrule_list()
void table::define_bottom_macro()
{
prints(".eo\n"
+ // protect # in macro name against eqn
+ ".ig\n"
+ ".EQ\n"
+ "delim off\n"
+ ".EN\n"
+ "..\n"
".de T#\n"
".if !\\n[" SUPPRESS_BOTTOM_REG "] \\{"
"." REPEATED_VPT_MACRO " 0\n"
@@ -2636,6 +2678,11 @@ void table::define_bottom_macro()
"." REPEATED_VPT_MACRO " 1\n"
".\\}\n"
"..\n"
+ ".ig\n"
+ ".EQ\n"
+ "delim on\n"
+ ".EN\n"
+ "..\n"
".ec\n");
}
@@ -2882,7 +2929,18 @@ void table::do_bottom()
printfs(".mk %1\n", row_top_reg(nrows));
prints(".nr " NEED_BOTTOM_RULE_REG " 1\n"
".nr T. 1\n"
- ".T#\n");
+ // protect # in macro name against eqn
+ ".ig\n"
+ ".EQ\n"
+ "delim off\n"
+ ".EN\n"
+ "..\n"
+ ".T#\n"
+ ".ig\n"
+ ".EQ\n"
+ "delim on\n"
+ ".EN\n"
+ "..\n");
if (!(flags & NOKEEP) && (flags & (BOX | DOUBLEBOX | ALLBOX)))
prints("." TABLE_RELEASE_MACRO_NAME "\n");
else