6

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}
3
  • 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 {}). 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. Jan 7 '13 at 7:36
11

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}

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.