How to use factorial(!) symbol in LaTeX?

A popular symbol used in mathematics is factorial, no command is required to print this symbol in a latex document.

SymbolFactorial
Type of symbolMathematics
Package (requirement)No
ArgumentNo
Latex command!
Examplea! → a!

Type shift + 1 for factorial

Just use bang or exclamation point key shift + ! 1 on your keyboard.

\documentclass{article}
\begin{document}
   \[ n! = n(n-1)(n-2)\cdots (2)(1) \] 
   \[ \frac{(n+1)!}{n!} \]
   \[ \frac{(2n+2)!+(n!)^2}{((n+1)!)^2 (2n)!} \]
\end{document}

Output :

Use factorial symbol in latex.

Add space in factorial

When using multiple factorials side by side, the space between them is not correct.

In that case, you can use the following commands in LaTeX to provide spaces: \,, \enspace, \quad. The example below shows how much space these commands provide.

\documentclass{article}
\begin{document}
  \[  \frac{1}{m!n!} \rightarrow \verb|{m!n!}| \]
  \[ \frac{1}{m!\,n!} \rightarrow \verb|{m!\,n!}| \]
  \[ \frac{1}{m!\enspace n!} \rightarrow \verb|{m!\enspace n!}| \]
  \[ \frac{1}{m!\quad n!} \rightarrow \verb|{m!\quad n!}| \]
\end{document}

Output :

use space in factorial.

In terms of spacing, you can see that \enspace and \quad use the command to take more space than \, , which doesn’t look very good.

But it looks much better to see that the space has been properly maintained using the \, command. so I would recommend using \, it in this case.

Inverse factorial symbol in LaTeX

Generally, the inverse factorial symbol is not used that much, but if you need this symbol at some point, then using the backtick ` symbol next to the factorial ! symbol will print the inverse factorial symbol in the latex document, use it like this !`. And you have to use it in text mode.

\documentclass{article}
\begin{document}
  ! $ \rightarrow $ \verb|Factorial symbol|\\[6pt]
  !` $ \rightarrow $ \verb|Inverse factorial symbol|
\end{document}

Output :

Inverse factorial symbol in latex.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top