2

I am new here an hereby apologize for any mistakes I might make in posting this. I am also sorry if a similar topic already exists, but I failed to find anything answering this.

I am interested whether you can "force" latex to vertically center parenthesis on the whole object within rather than on the first element. I think the following example gives a better explanation.

I want to write something like (I have added a couple of exponents extra to highlight the issue):

Note that $a^{b{^{c^{d^e}}}}$ abbreviates 
$a^{\left(b^{\left(c^{\left(d^e\right)}\right)}\right)}$

Sample output

And I don't like the fact that the parenthesis center on the first thing so the letter $b$ instead of the whole object within the parenthesis.

Similar things happens with parenthesis and subscripts and fractions which go "too much" in upwards or downwards direction. (i.e. \frac{\frac{\frac{}{}}{}}{}}).

I would really appreciate any help as this looks really bad to me and I have no clue where to find a solution for this.

Andrew Swann
  • 95,762

2 Answers2

2

If I had to do this (and normally avoid it) I'd probably do

enter image description here

\documentclass{article}

\begin{document}

Note that $a^{b{^{c^{d^e}}}}$ abbreviates 
$a^{(b^{(c^{(d^{e)^{)^{)}}}}}}$

\end{document}
David Carlisle
  • 757,742
0

As the TeX experts suggest, there is probably no way to do this automatically. However, we can make big parentheses to appear in the expected size within superscripts (a/234931). The result is reasonable. We can raise the parentheses to fine-tune the result. Here is an example that incorporates raising into the size adjustment.

\documentclass{article}
\usepackage{mathtools}

\makeatletter \def\bBiggRaise@#1#2#3{{\mathpalette{\bBiggRaise@aux{#1}{#2}{#3}}\relax}} \def\bBiggRaise@aux#1#2#3#4% {@mathmeasure\z@{\nulldelimiterspace\z@}% {#4% \setlength\dimen@{\dimexpr#1\big@size \ifx\scriptscriptstyle#426/50\fi \ifx\scriptstyle#434/50\fi \relax} \left#3\vcenter to\dimen@{}\right.}% \raise#2\box\z@} \def\bigpatched{\bBiggRaise@1{0pt}} \let\bignraise\bBiggRaise@ \makeatother

\begin{document} $a^{\left(b^{\left(c^{\left(d^e\right)}\right)}\right)}$\quad $a^{(b^{(c^{(d^e)})})}$\quad $a^{\bigpatched( b^{\bigpatched( c^{(d^e)} \bigpatched)} \bigpatched)}$\quad $a^{\bignraise{1}{.3ex}( b^{\bignraise{1}{.2ex}( c^{\bignraise{.83}{.1ex}( d^e\bignraise{.83}{.1ex})} \bignraise{1}{.2ex})} \bignraise{1}{.3ex})}$ \par\vskip.5in $a^{b^c}$ $a^{(b^c)}$\quad $a^{b^{\mathstrut^{.^{.^{.^{c}}}}}}$ $a^{\bignraise{1.8}{.9ex}( b^{\mathstrut^{.^{.^{.^{c}}}}} \bignraise{1.8}{.9ex})}$ \end{document}

enter image description here

The definition of \bBiggRaise@ is

\bBiggRaise@<scale><dimen><delim>

The delimiter <delim> is scaled to <scale>*1.2 of the normal size, and is raised by <dimen>. To understand the details, it may be helpful to read the original implementation of \big and \bBigg@ in amsmath, and the adaptation of \bBigg@ in the answer mentioned above. The way to typeset ellipsis dots is taken from an answer to the question q/17648.

54690
  • 215
  • 1
  • 4