rendering brackets
Zdenek Wagner
zdenek.wagner at gmail.com
Mon Mar 2 16:02:36 CET 2020
po 2. 3. 2020 v 15:35 odesílatel David Carlisle <d.p.carlisle at gmail.com> napsal:
>
> ...
>
> Basically 1 and a have the same depth so the depth of the denominators are the same, but 1 has more height than a and that affects the height of the numerator and so of the overall fraction.
>
> \documentclass{article}
>
> \begin{document}
>
> \sbox0{$\displaystyle\frac{1}{a}$}
> \typeout{1/a: \the\ht0+\the\dp0}
>
> \sbox0{$\displaystyle\frac{a}{1}$}
> \typeout{a/1: \the\ht0+\the\dp0}
>
>
> \end{document}
>
>
> produces
>
> 1/a: 13.20952pt+6.85951pt
> a/1: 11.07062pt+6.85951pt
>
>
> so the first form is over 2pt taller and so gets a larger bracket if you auto-size the brackets with \left\right.
>
There is another possibility with \left and \right, it is just
necessary to insert \vphantom to make both fractions equally high.
This is my modified file:
\documentclass{article}
\begin{document}
\sbox0{$\displaystyle\frac{1}{a}$}
\typeout{1/a: \the\ht0+\the\dp0}
\sbox0{$\displaystyle\frac{a}{1}$}
\typeout{a/1: \the\ht0+\the\dp0}
\sbox0{$\displaystyle\frac{1a}{1a}$}
\typeout{a/1: \the\ht0+\the\dp0}
\newcommand\vph{\vphantom{\frac{1a}{1a}}}
$$\left(\vph\frac{1}{a}\right)^n+\left(\vph\frac{a}{1}\right)^n$$
$$\left(\frac{1}{a}\right)^n+\left(\frac{a}{1}\right)^n$$
\end{document}
Generally, if A and B are complex expressions, you should do
$$\left(A\vphantom{B}\right) + \left(\vphantom{A}B\right)$$
>
>
>
>>
>> that is what the whole experiment is about. Have it your way... if that is what you prefer.
>
>
> It isn't a question of what I prefer, I am just stating what the font metrics specify.
>
> David
>
>
Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz
More information about the tex-live
mailing list.