%% 
%%  Example 01-14-2 
%%  Copyright (C) 2017 Herbert Voss
%% 
%% ==== 
% Show page(s) 1
%% 
%% 
\documentclass[]{screxa}
\pagestyle{empty}
\setlength\textwidth{158.31393pt}
\usepackage[T1]{fontenc}
\usepackage{kpfonts}
\makeatletter
\def\underbracket{%
  \@ifnextchar[{\@underbracket}{\@underbracket [\@bracketheight]}}
\def\@underbracket[#1]{%
  \@ifnextchar[{\@under@bracket[#1]}{\@under@bracket[#1][0.4em]}}
\def\@under@bracket[#1][#2]#3{%\message {Underbracket: #1,#2,#3}
  \mathop{\vtop{\m@th \ialign {##\crcr $\hfil \displaystyle {#3}\hfil $%
  \crcr \noalign {\kern 3\p@ \nointerlineskip }\upbracketfill {#1}{#2}
     \crcr \noalign {\kern 3\p@ }}}}\limits}
\def\upbracketfill#1#2{$\m@th \setbox \z@ \hbox {$\braceld$}
  \edef\@bracketheight{\the\ht\z@}\bracketend{#1}{#2}
    \leaders \vrule \@height #1 \@depth \z@ \hfill
    \leaders \vrule \@height #1 \@depth \z@ \hfill \bracketend{#1}{#2}$}
\def\bracketend#1#2{\vrule height #2 width #1\relax}
\makeatother
%StartShownPreambleCommands
% has the underbracket stuff in hidden part
%StopShownPreambleCommands
\begin{document}
\begin{tabular}{cl}
1.& $\underbracket{foo~bar}$ \\
2.& $\underbracket[2pt]{foo~bar}$ \\
3.& $\underbracket[2pt][1em] {foo~bar}$
\end{tabular}
\end{document}
