Using David's idea, I create n horizontal boxes. In the last one I insert a zero height \vbox
, which in turn contains the material to be vertically and horizontally centered. The asterisks are those of math mode, so we can lower them by the axis height and smash them.
Some additional vertical space has to be added before the material, because of the gap between the baseline of the last \hbox
and the text in the following line. I used \dp\strutbox
, which seems to provide a decent centering (the wye will not be misled anyway).
\documentclass[twocolumn]{memoir}
\usepackage{lipsum}
\usepackage{xcolor}
\ExplSyntaxOn
\NewDocumentCommand{\interruption}{mm}
{% #1 = number of lines
% #2 = material to be centered
\par
\prg_replicate:nn { #1 - 1 } { \hbox:n { } }
\hbox:n
{
\vbox_to_zero:n
{
\vss
\vbox_to_ht:nn { #1\baselineskip }
{
\vfil
\vspace{\dp\strutbox}
\hbox_to_wd:nn { \linewidth } { \hfil #2 \hfil }
\vfil
}
}
}
}
\ExplSyntaxOff
% asterisks centered on the baseline
\NewDocumentCommand{\asterisks}{}{%
\sbox{0}{$ $}\raisebox{-\fontdimen22\textfont2}[0pt][0pt]{${*}{*}{*}$}%
}
% this will show the baseline
\newcommand{\debugrule}{\makebox[0pt]{%
\color{red}\vrule width 3\textwidth height 0pt depth 0.3pt}%
}
\begin{document}
\lipsum[1]
\interruption{3}{\asterisks}
\debugrule
\lipsum[2-4]
\interruption{2}{\asterisks}
\debugrule
\lipsum[2]
\end{document}
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/DWcbsy4E.png)
With \debugrule
I show that the baselines in the two columns agree.