R - Markdown "! Missing { inserted. <to be read again> " mistake

949 Views Asked by At

When I try to export in pdf a R Markdown file I get the following mistake:

! Missing { inserted. <to be read again> 

The concerned line is this one:

$$
AIC = ln \hat{\sigma}^{2}_\hat{u_t} + \frac{2n_k}{T}
$$

I do not get what is wrong with the way I structure the formula. FYI when I export in .doc it works fine, so all the problems start when I try no knit on pdf!

Anyone has suggestions??

1

There are 1 best solutions below

2
On BEST ANSWER

It's having trouble with your complicated subscript, \hat{u_t} -- try enclosing that entire term in { }.