# 0: file ended while scanning use of \@genfrac [closed]

The code is here

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$$\begin{array}{ll} \hat{\mu_1}&=\dfrac{\sum_{i=1}^nX_{i,1}}{n}\\ \hat{\mu_2}&=\dfrac{\sum_{i=m+1}^nX_{i,2}}{n-m}\\ \hat{\sigma_1^2}&=\dfrac{\sum_{i=1}^n(X_{i,1}-\hat{\mu_1})^2}{n}\\ \hat{\sigma_2^2}&=\dfrac{\sum_{i=m+1}^n(X_{i,2}-\hat{\mu_2})^2}{n-m}\\ \hat{p}&=\dfrac{\sum_{i=m+1}^n(X_{i,1}-\hat{\mu_1})(X_{i,2}-\hat{\mu_2})}{n-m} \end{array}$$

\end{document}


I try to reproduce the problem,and check whether missing bracket.But the error is still there.

-

## closed as too localized by Thorsten, zeroth, egreg, Stefan Kottwitz♦Oct 12 '12 at 7:05

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Please complete your code to a minimal document (in the sense of a minimal working example) allowing us to reproduce the problem. –  Gonzalo Medina Oct 12 '12 at 3:59
Your code works OK in my system. Does this exact code triggers the error mentioned? –  Gonzalo Medina Oct 12 '12 at 4:48
@GonzaloMedina I second that. –  azetina Oct 12 '12 at 4:51
Please add the .log file obtained after processing the code you just posted. If the file is too long, you can upload it elsewhere (pastebin, for example) and provide a link here. –  Gonzalo Medina Oct 12 '12 at 4:54
@baker perhaps there was a corrupted .aux file from a previous run causing the problem. –  Gonzalo Medina Oct 12 '12 at 5:38

The error message you mention is triggered by a missing closing brace in \dfrac (or one of its variants), as the following simple example illustrates:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$\dfrac{a}{b$
\end{document}


Processing the above document yields

Runaway argument?
{b$\end {document} ! File ended while scanning use of \@genfrac. <inserted text> \par <*> a.tex  The solution is to add the missing brace: \documentclass{article} \usepackage{amsmath} \begin{document}$\dfrac{a}{b}\$
\end{document}

-
the error detector says it is in the line 0. And I put all content to comment, the error is still there –  baker Oct 12 '12 at 4:24
@baker Then, please (as I suggested in my comment to your question) add a complete document allowing us to reproduce the problem; if you say that commenting out all the contents still triggers the error, such a complete document can be easily built. –  Gonzalo Medina Oct 12 '12 at 4:26
I tried to reproduce the problem ,and check the bracket already, but it seems that error does not be solved. Code is showed above. Thanks for your help. –  baker Oct 12 '12 at 4:51