Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
sorry I missed the problem, that is that the "m!" inside the fraction inside {} of \frac{m!}{n!(m-n)!} is outside the fraction –  user24060 Jan 7 '13 at 7:16
2  
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 {}). –  Qrrbrbirlbel Jan 7 '13 at 7:28
2  
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. –  Qrrbrbirlbel Jan 7 '13 at 7:36

1 Answer 1

You need to use the \frac command in math mode:

enter image description here

\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:

enter image description here

\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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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