答案1
您可以使用\parbox
:
\documentclass{article}
\newcommand{\specialtext}[3]{%
% #1 = width
% #2 = text on top
% #3 = text below
\parbox[t]{#1}{%
\parbox[b]{#1}{\centering#2\vskip1pt\hrule}%
\vskip 1pt
\nointerlineskip
\centering\scriptsize#3%
}%
}
\begin{document}
blabla \specialtext{1cm}{2}{} bla \specialtext{3.3cm}{text1}{text2}
bla \specialtext{2.7cm}{blabla2}{}
\end{document}