2

I have two adjacent terms in a LaTeX equation, and I'd like the brackets around both to scale to the height of both terms.

For example \left[ a \right] \left[ \frac{b}{c} \right] generates:

\left[ a \right] \left[ \frac{b}{c} \right]

I'd like all four brackets to both be the same height.

geometrian
  • 175
  • 6
  • 2
    \biggl[a\biggr]\biggl[\dfrac{b}{c}\biggr] – Gonzalo Medina Jul 29 '13 at 22:08
  • Take a look at the scalerel package, I had a similar question and got this excellent answer: http://tex.stackexchange.com/a/125722/19326. (It was about Images), but if you look inside the scalerel documentation you will find it talking about symbol scaling too, right in teh beginning of chapter 2 and chapter 3. \stretchrel might be what you need. This is overkill if it is just for one occurence though. – ted Jul 29 '13 at 22:26
  • @GonzaloMedina, not as elegant as Werner's. – geometrian Jul 30 '13 at 00:55
  • @ted, unfortunately, this formula is going in MathJax, which doesn't seem to support \usepackage{...}. I ran into that problem earlier when trying to scale a summation. – geometrian Jul 30 '13 at 00:55
  • @IanMallett "elegance" lies in the eye of the beholder :-) Anyway I wouldn't recommend using \left, \right, except perhaps in very, very few cases. – Gonzalo Medina Jul 30 '13 at 01:21
  • @GonzaloMedina Aye; I mean simply that the dependence on the second term is made obvious this way, as opposed to just scaling them to match. What would you suggest instead? The terms I replaced to get my toy example above are actually rather large in real life. – geometrian Jul 30 '13 at 02:20
  • @IanMallett for regular (i.e., not too large expressions) I prefer the \big... family of commands, since the spacing around them is more consistent than using \left, \right. If your actual expressions are too big, then perhaps this is one of those very few cases in which the \left, \right construct is really needed. – Gonzalo Medina Jul 30 '13 at 02:31
  • @GonzaloMedina: are there any other reasons besides the "consistent spacing" against \left/\right? – ted Jul 30 '13 at 06:54
  • @ted spacing is the main reason. Another inconvenience is that if \left, \right is to be used and a change of line is involved in-between, one has to balance using \right. \left. and possibly make additional adjustment with phantoms. – Gonzalo Medina Jul 30 '13 at 12:10

1 Answers1

1

In general, you could use

enter image description here

\left[\vphantom{\frac{b}{c}}a\right] \left[\frac{b}{c}\right]

using \vphantom to obtain the appropriate height of something without introducing an unnecessary width insertion. Alternatively, use fixed-sized scaled delimiters using "big"-variants. From the amsmath user guide (section 4.14.1 Delimiter sizes, p 15):

enter image description here

Werner
  • 603,163