This is another follow up to this question.
My current \blap macro works in tabularx X columns with the article class. But it behaves slightly differently with the memoir class. Specifically, the vertical correction of \vspace*{-\parskip}\vspace*{-\baselineskip} seems not to be needed with memoir in this case. (This vertical correction is still needed in other contexts outside of tables in memoir, so I can't get rid of it completely.)
memoir emulates tabularx but using it's method to use the real tabularx package does not make a difference. i.e., this doesn't make any difference:
\DisemulatePackage{tabularx}
\usepackage{tabularx}
Question
Can anyone suggest a fix?
I'm happy with either a workaround, a patch to memoir, or a robust way to test if I'm in an X column cell, so I can conditionally leave out the \vspace*{-\parskip}\vspace*{-\baselineskip}.
MWE
\documentclass[twocolumn]{memoir}% works as intended with article
\usepackage{ifluatex}
\ifluatex
\usepackage{lua-visual-debug}
\fi
\usepackage{tabularx}
\newskip\savedparindent
\newskip\savedparskip
\newskip\savedrightskip
\newcommand{\blap}[1]{%
\savedparindent\parindent
\savedparskip\parskip
\savedrightskip\rightskip
\noindent
\begin{minipage}[t][0pt]{\linewidth}
\parindent\savedparindent
\parskip\savedparskip
\rightskip\savedrightskip
#1%
\end{minipage}%
% The following line is generally needed to line things up
% but not in X columns in memoir (article is OK)
\vspace*{-\parskip}\vspace*{-\baselineskip}%
}
\pagestyle{empty}
\begin{document}
\noindent
\begin{tabularx}{\linewidth}{lX}
A1 & \blap{B1} \\[1cm]
A2 & A2 \\[1cm]
\end{tabularx}
\newpage
\noindent
\begin{tabularx}{\linewidth}{lX}
A1 & B1 \\[1cm]
A2 & A2 \\[1cm]
\end{tabularx}
\end{document}
arraypackage code it doesn't actually include the current array.sty, probably it needs an update to match the 2018 array release. – David Carlisle Sep 04 '18 at 14:20\DisemulatePackage{array}generates errors :(. – David Purton Sep 04 '18 at 14:28memoir? Do you have a development version? Or will it appear in CTAN shortly. (Latest date on CTAN I see is from April) – David Purton Sep 06 '18 at 13:03