[Tex/LaTex] Break size-symmetry of `\frac{}{}`

baselinedelimitersfractionsmath-modevertical

If my fraction has a taller numerator than denominator, e.g.:

\frac{\begin{array}{c} t\\a\\l\\l\\ \end{array}}{small}

a nice fraction

I like the way it is still adjusted to the baseline.


However, something weird happens if I need to enclose it with \left and \right delimiters, see:

\left(\frac{\begin{array}{c} t\\a\\l\\l\\ \end{array}}{small}\right)

a weird fraction

Why is there so much empty space under the denominator then?
How can I get rid of this empty space while still keeping the fraction bar aligned with the baseline?

I am aware this would imply that the parentheses are not centered with the fraction bar anymore. But I don't mind.

Best Answer

You should use a different way to express your formulas, I believe.

Anyway, here's a possible solution using delarray.

The syntax is

\delfrac<left>{<numerator>}{<denominator>}<right>

If you need brackets [] you have to use \lbrack and \rbrack, for implementation reasons due to delarray.

\documentclass{article}
\usepackage{amsmath}
\usepackage{delarray}


\makeatletter
\newsavebox{\del@frac@box}
\newcommand\delfrac[4]{\mathpalette\del@frac{{#1}{#2}{#3}{#4}}}
\newcommand{\del@frac}[2]{\del@@frac{#1}#2}
\newcommand{\del@@frac}[5]{%
  \sbox\del@frac@box{$\m@th#1\frac{#3}{#4}$}%
  \sbox\z@{$\begin{array}#2{@{}c@{}}#5\usebox{\del@frac@box}\end{array}$}%
  \raisebox{\dimexpr\depth-\dp\del@frac@box}{\box\z@}%
}
\makeatother

\begin{document}

baseline $\left\{\frac{a}{b}\right\}$ $\delfrac\{{a}{b}\}$
$\delfrac\{{\begin{array}{c} t\\a\\l\\l \end{array}}{small}\}$ is here

\[
x+\delfrac\{{\begin{array}{c} t\\a\\l\\l \end{array}}{small}\}+y
\]

\[
x_{t\delfrac\lbrack{\substack{a\\b\\c\mathstrut}}{\substack{\mathstrut d\\e}}\rbrack}
\]
\end{document}

enter image description here