How to write a permutation like this ?
Asked
Active
Viewed 3.3k times
5
3 Answers
10
Consider using amsmath's smallmatrix:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\[
a = \bigl(\begin{smallmatrix}
1 & 2 & 3 & \cdots & n-1 & n \\
2 & 3 & 4 & \cdots & n & 1
\end{smallmatrix}\bigr)
\]
Here is another permutation $a = \bigl(\begin{smallmatrix}
1 & 2 & 3 & \cdots & n-1 & n \\
2 & 3 & 4 & \cdots & n & 1
\end{smallmatrix}\bigr)$ in text mode.
\end{document}
4
Using amsmath's pmatrix environment:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
a =
\begin{pmatrix}
1 & 2 & 3 & \cdots & n-1 & n \\
2 & 3 & 4 & \cdots & n & 1
\end{pmatrix}
\]
\end{document}
Another solution with matrix
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
a =
\left(
\begin{matrix}
1 & 2 & 3 & \cdots & n-1 & n \\
2 & 3 & 4 & \cdots & n & 1
\end{matrix}
\right)
\]
\end{document}
ShreevatsaR
- 45,428
- 10
- 117
- 149
karlkoeller
- 124,410
1
I have discovered a package specific also to write also permutations. This package is available on this site https://ctan.org/pkg/permute. I did not know it but it can be useful for other users.
\documentclass[a4paper,12pt]{article}
\usepackage{permute}%%%% <-----https://ctan.org/pkg/permute
\begin{document}
In this case I have used permute package in math-mode:
\[
a=\pmtid
\pmtdo{(\cdots)}
\pmtdo{1{2} 2{3} 3{4} {n-1}{n} {n}{1}}
\pmtvprint[1 2 3 \cdots {n-1} n]
\]
In text-mode we have:
$a=\pmtid
\pmtdo{(\cdots)}
\pmtdo{1{2} 2{3} 3{4} {n-1}{n} {n}{1}}
\pmtvprint[1 2 3 \cdots {n-1} n]$ similar a smallmatrix option.
\end{document}
Sebastiano
- 54,118


pmatrixenvironment fromamsmathpackage – percusse Jul 05 '13 at 22:07