chiark / gitweb /
mdwtab.dtx: Add a sneaky kern after `\multicolumn'. mdw/tangle
authorMark Wooding <mdw@distorted.org.uk>
Thu, 18 May 2023 21:55:06 +0000 (22:55 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 18 May 2023 21:55:06 +0000 (22:55 +0100)
I don't know, any more, why `\tab@tabcr' does `\@maybe@unskip' if it's
in hmode and you ask for a nonzero interrow gap, but it does.  And the
result, if you put `\multicolumn' in the last column of a row,
terminated by `\\[...]', is that the `\tabcolsep' glue gets eaten, and,
in a right- or centre-aligned row, the cell contents ends up misaligned.

So add `\kern 0pt' to make it not do that.

mdwtab.dtx

index 97320f32b04c79b11b1955be9f1d90118e852e4c..11cf692881b7fe494815e28fe36445d2dd63ddee 100644 (file)
@@ -36,7 +36,7 @@
 %<+color>                [2020/09/06 1.14.0 Fix for people who can't spell]
 % \end{meta-comment}
 %
-% \CheckSum{3424}
+% \CheckSum{3426}
 %% \CharacterTable
 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
 % which seems a little silly.  Then again, I forgot to do it the first
 % time around.)
 %
+% Again, we have a sneaky |\kern| to prevent the final |\tabcolsep| glue from
+% being eaten by a later |\unskip|.
+%
 %    \begin{macrocode}
 \long\def\multicolumn#1#2#3{%
   \multispan{#1}%
     \let\tab@looped\tab@err@multi%
     \tab@readpreamble{#2}%
     \the\tab@preamble%
+    \kern\z@%
   \endgroup%
   \ignorespaces%
 }