The following is a piece of LaTeX code displaying a function. But in the PDF file generated , the right bracket "]", which is last thing in the equation, does not show up. However, if I replace "\right]" with just "]", then the right bracket show up. But I want the larger right bracket "\right]", not the small one "]". This code has another problem: the two fractions have different sizes! The first fraction is taller and the second fraction is shorter. The second fraction turns out to have smaller font size on the PDF, which I do not like.

Could anyone please point out to me how I can insert a large right bracket and have all the fractions use the same font size as those non-fractions (i.e. fractions should be twice the height as those non-fraction numbers)?

$\textbf{E} = E_0 \left[\frac{1}{\sqrt{2}} \textbf{\hat{x}} cos(kz-\omega t) + \frac{i}{\sqrt{2}} \textbf{\hat{y}} cos\left(kz-\omega t+\frac{\pi}{2}\right)\right]$

enter image description here

  • Works for me (except I had to replace \textbf with \mathbf around the \hats). What LaTeX distribution are you using? Perhaps something is wrong with it? – jjlin Sep 10 '12 at 5:16
  • If you use \cos (instead of without the slash) it's treated as a proper function name, not three variables named c, o, and s. – Rody Oldenhuis Sep 10 '12 at 5:36
  • 1
    You do also realize that cos(x + pi/2) = -sin(x)? :) – Rody Oldenhuis Sep 10 '12 at 5:36
  • Change all the \textbf to \bf, then the right ] will show up and the second fraction will be in display mode rather than text mode. – ex-officemate of test Sep 11 '12 at 4:25
  • 2
    That input produces many syntax errors and the missing bracket is a by-product of them. Don't overlook error messages from the compiler. – egreg Sep 11 '12 at 8:39

You probably want

$\mathbf{E} = E_0 \bigl[\frac{1}{\sqrt{2}} \mathbf{\hat{x}} \cos(kz-\omega t)
  + \frac{i}{\sqrt{2}} \mathbf{\hat{y}} \cos(kz-\omega t+\frac{\pi}{2})\bigr]$

For getting a variable in boldface the correct way is to say \mathbf (which works also with accents such as \hat).

Instead of \bigl[ and \bigr] you can say \left[ and \right], it depends on personal taste: I feel that the latter gives too high brackets.

For the "cosine function" the right input is \cos.

  • is there a reason that \bigr[ and \bigl] are opposite to what one would expect? – barbara beeton Sep 17 '12 at 17:37
  • @barbarabeeton A mistake? :) – egreg Sep 17 '12 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.