
%This centers and overlaps text.  Examples:

%\clap{\LARGE A big and large sentence}{little}{} {\LARGE A big and large
%sentence}
%                                    % to check alignments --v---^
%
%\clap{\LARGE A big sentence}{little}{5pt} {\LARGE A big sentence}

\makeatletter
\newdimen\@@@tmpa
\newdimen\@@@tmpb
\newdimen\@@@tmpc
\newdimen\@@@tmpd
\def\clap#1#2#3{%  clap=centerlap
       \setbox0=\hbox{#1}\setbox1=\hbox{#2}%
       \@@@tmpa\wd0\@@@tmpb\wd1\advance\@@@tmpa-\@@@tmpb%
       \ifdim\@@@tmpa>0pt\@@@tmpb\wd0%
       \else\@@@tmpb\wd1\fi\@@@tmpc\ht0\@@@tmpd\ht1%
       \advance\@@@tmpc\dp0\advance\@@@tmpd\dp1%
       \advance\@@@tmpc-\@@@tmpd\divide\@@@tmpc2%
       \ifdim\@@@tmpc>0pt\@@@tmpd\ht0\advance\@@@tmpd\dp0\@@@tmpc-\dp0%
       \else\@@@tmpd\ht1\advance\@@@tmpd\dp1\advance\@@@tmpc-\dp0\fi%
       \ifx#3\empty\else\advance\@@@tmpc#3\fi%
       \leavevmode\raise\@@@tmpc\hbox to \@@@tmpb{\rlap{\hbox to
\@@@tmpb{\hss%
            \vbox to \@@@tmpd{\vss\box0\vss}\hss}}%
            \hss\vbox to \@@@tmpd{\vss\box1\vss}\hss}%
       }
\makeatother
