Can't make a fraction

I had been tried for a long time, but it had worked, I have this code, hope you can help me:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{pmatrix}
m\\
n
\end{pmatrix} = {\frac{m!}{n!(m-n)!}}

\end{document}

• sorry I missed the problem, that is that the "m!" inside the fraction inside {} of \frac{m!}{n!(m-n)!} is outside the fraction Jan 7 '13 at 7:16
• Welcome to TeX.sx! You can always edit your own question to add additional information. I edited your question to format your source as an actual code block (button {}). Jan 7 '13 at 7:28
• The m! is only a problem in the output. Have you checked the .log. It complains about Missing $inserted? That means that you have used macros (\frac) or environments (pmatrix) that are only allowed in “math mode”. You must enter math mode to use those correctly. Enclose the whole formula for example in an equation environment. The fact that everything else except m! is typeset correct is pure luck as (La)TeX itself tries to determine where you had to use math mode. Jan 7 '13 at 7:36 1 Answer You need to use the \frac command in math mode: \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \begin{document} In display style $\begin{pmatrix} m \\ n \end{pmatrix} = \frac{m!}{n!(m-n)!}$ or inline math mode$\begin{pmatrix} m \\ n \end{pmatrix} = \frac{m!}{n!(m-n)!}$. \end{document}  If you're trying to write a binomial expression, it's better to use \binom{m}{n}. It formats better in both of the math styles: \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \begin{document} In display style $\binom{m}{n} = \frac{m!}{n!(m-n)!}$ or inline math mode$\binom{m}{n} = \frac{m!}{n!(m-n)!}\$.
\end{document}