答案1
以下可能的解决方案之一是否可以满足您的格式化需求?
我必须承认我不知道这些表达式与(传统定义的)伽马函数有什么共同之处。
\documentclass{article}
\usepackage{array}
% The following two macros must be used in math mode:
\newcommand\solutionA[1]{%
\mathop{}\!\begin{array}[b]{|c}\hline #1 \end{array}}
\newcommand\solutionB[1]{%
\mathop{}\!\begin{array}[b]{|@{\,}c@{\,}}\hline #1 \end{array}}
%% (The `\mathop{}\!` particles serve to insert a bit of whitespace, if needed.
%% Many thanks to @egreg for providing this suggestion.)
\begin{document}
$\solutionA{1+p}$ $\solutionB{1+p}$
\end{document}