![](https://secure.gravatar.com/avatar/46562c7d27388490d62e8d7a5bc960dd.jpg?s=120&d=mm&r=g)
On 11/16/2020 7:15 PM, Wolfgang Schuster wrote:
Hans Hagen schrieb am 16.11.2020 um 19:05:
On 11/16/2020 6:53 PM, Wolfgang Schuster wrote:
Hi,
there are two problems in the following definitions (line 90--99).
1. Extra "s" on \ifparameter
2. \anch_table_check_state doesn't work anymore because it tries to change the value of \dosingleempty which was used to create the optional argument.
\permanent\tolerant\protected\def\tbXC [#1]{\anch_table_check_state\ifparameters#1\or\anch_tables_indeed_XC [#1]\else\expandafter\NC\fi} \permanent\tolerant\protected\def\tbGSC[#1]{\anch_table_check_state\ifparameters#1\or\anch_tables_indeed_GSC[#1]\else\expandafter\NC\fi}
\permanent\tolerant\protected\def\tbGFC[#1]{\anch_table_check_state\ifparameters#1\or\anch_tables_indeed_GFC[#1]\else\expandafter\NC\fi}
\permanent\tolerant\protected\def\tbGTC[#1]{\anch_table_check_state\ifparameters#1\or\anch_tables_indeed_GTC[#1]\else\expandafter\NC\fi}
\def\anch_table_check_state {\iftrialtypesetting \global\settrue\tablehaspositions \firstargumentfalse \fi}
How about this:
\permanent\protected\def\tbXC {\anch_table_checked\anch_tables_indeed_XC } \permanent\protected\def\tbGSC{\anch_table_checked\anch_tables_indeed_GSC}
\permanent\protected\def\tbGFC{\anch_table_checked\anch_tables_indeed_GFC}
\permanent\protected\def\tbGTC{\anch_table_checked\anch_tables_indeed_GTC}
\tolerant\def\anch_table_checked#1[#2]% {\iftrialtypesetting \global\settrue\tablehaspositions \expandafter\NC \orelse\ifparameter#2\or \expandafter#1% \else \expandafter\NC \fi}
The optional argument is now gone and never passed further down, more something like this (not sure about \tripleexpandafter)
\tolerant\def\anch_table_checked#1[#2]% {\iftrialtypesetting \global\settrue\tablehaspositions \tripleexpandafter\NC\expandafter\gobbleoneoptional \orelse\ifparameter#2\or \expandafter#1% \else \tripleexpandafter\NC\expandafter\gobbleoneoptional \fi[#1]}
We're nearly there ... pass [#2] istead of [#1] ... \permanent\protected\def\tbXC {\anch_table_checked\anch_tables_indeed_XC } \permanent\protected\def\tbGSC{\anch_table_checked\anch_tables_indeed_GSC} \permanent\protected\def\tbGFC{\anch_table_checked\anch_tables_indeed_GFC} \permanent\protected\def\tbGTC{\anch_table_checked\anch_tables_indeed_GTC} \tolerant\def\anch_table_checked#1[#2]% {\iftrialtypesetting \global\settrue\tablehaspositions \expandafter\anch_tables_indeed_NC \orelse\ifparameter#2\or \expandafter#1% \else \expandafter\anch_tables_indeed_NC \fi[#2]} \def\anch_tables_indeed_NC[#1]% {\NC} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------