Want to define a function such that it draws gamma function as per this imageGamma Function stretchable

  • 4
    your image is not readable. Do you like to write this equation or draw Gamma function? From tag one can conclude, that you looking for symbol $\Gamma$ ... Clarify your question!
    – Zarko
    Commented Jan 2, 2020 at 9:31
  • 2
    Do you mean something like this picture (click)?
    – egreg
    Commented Jan 2, 2020 at 10:07
  • @egreg Wish you and your family a very happy New year...
    – MadyYuvi
    Commented Jan 2, 2020 at 11:30
  • 1
    I have never seen a $\Gamma(1+p)$ where the “roof” of \Gamma extends to cover the argument. Could you please elaborate more about where your notation comes from (instead of just a photo)? Commented Jan 2, 2020 at 14:53
  • Possible duplicate: How to draw a partial or incomplete box around one or more words within a paragraph
    – Werner
    Commented Jan 2, 2020 at 18:44

1 Answer 1


Does one of the following possible solutions meet your formatting needs?

enter image description here

I must confess to not knowing what these expressions may have in common with the (conventionally defined) gamma function.

% The following two macros must be used in math mode:
    \mathop{}\!\begin{array}[b]{|c}\hline #1 \end{array}}
   \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.)

$\solutionA{1+p}$ $\solutionB{1+p}$
  • 2
    The array (with default optional argument [c]) approach will produce a different baseline for the 1+p with respect to the surrounding material. See github.com/latex3/latex2e/issues/147 Better to explicitly specify [t] or [b]. Since it is only one row, it should not matter. Commented Jan 2, 2020 at 14:45
  • @RuixiZhang - Many thanks. I've implemented your suggestion to use the [b] placement specifier for the array environments. Let's see if the OP weighs in with his/her opinion on whether my suggestions are even close to what is needed.
    – Mico
    Commented Jan 2, 2020 at 15:08
  • 2
    I'd consider adding \mathop{}\! in front of \solutionB (which is better than \solutionA).
    – egreg
    Commented Jan 2, 2020 at 17:24
  • @egreg - Thanks for this suggestion. I've updated the macros \solutionA and \solutionB accordingly. I'm still hoping that the OP will weigh in and provide some more information about the mysterious desired format for the gamma function...
    – Mico
    Commented Jan 2, 2020 at 21:01
  • Thank you very much for your kind help. I have tried to do some editing in your formula but I am unable to add some whitespace between 1 (of 1/2) and the overline, I typed this $\solutionB{\frac{1}{2}}$.
    – Anit
    Commented Jan 27, 2020 at 6:47

Not the answer you're looking for? Browse other questions tagged .