答案1
考虑使用amsmath
的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}
答案2
使用amsmath
的pmatrix
环境:
\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}
另一个解决方案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}
答案3
我发现了一个专门用于编写排列的包。此包可在此站点上找到。https://ctan.org/pkg/permute。我不知道,但它对其他用户有用。
\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}