-
Notifications
You must be signed in to change notification settings - Fork 0
/
permpatts.sty
77 lines (59 loc) · 2.37 KB
/
permpatts.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{permpatts}[2016/02/29 Package for working with permutation patterns]
\RequirePackage{stmaryrd} % provides ll\rr brackets
\RequirePackage{mathabx} % provides lcorners and rcorners
\RequirePackage{amsmath}
\RequirePackage{xinttools}
\RequirePackage{permpattsgraphics}
%-- Macros
% ---- Math mode macros -----
\newcommand{\perm}[1]{%
\xintFor ##1 in {#1}\do {##1}}
\newcommand{\mperm}[2]{%
\left(
\perm{#1},#2\right)}
\newcommand{\range}[2]{%
#1,\dotsc,#2}
\newcommand{\setrange}[2]{%
\left\{\range{#1}{#2}\right\}}
\newcommand{\nrange}[1]{%
\left\llbracket{}#1\right\rrbracket{}}
\newcommand{\setsize}[1]{%
\left|#1\right|}
\newcommand{\boks}[1]{{\lcorners{}#1\rcorners}}
\newcommand{\boksright}[1]{{\scriptsize\overrightarrow{\boks{#1}\:}\!}}
\newcommand{\boksleft}[1]{{\scriptsize\overleftarrow{\:\boks{#1}}}}
\newcommand{\boksup}[1]{{\boks{#1}\uparrow}}
\newcommand{\boksdown}[1]{{\boks{#1}\downarrow}}
\newcommand{\boksrightup}[1]{{\scriptsize\overrightarrow{\boks{#1}\:}\!\uparrow}}
\newcommand{\boksleftup}[1]{{\scriptsize\overleftarrow{\:\boks{#1}}\uparrow}}
\newcommand{\boksrightdown}[1]{{\scriptsize\overrightarrow{\boks{#1}\:}\!\downarrow}}
\newcommand{\boksleftdown}[1]{{\scriptsize\overleftarrow{\:\boks{#1}}\downarrow}}
\newcommand{\boksall}[1]{{\boks{#1}\star}}
\DeclareMathOperator{\Av}{Av}
\newcommand{\av}[2][]{\Av_{#1}\!\left(#2\right)}
\DeclareMathOperator{\Cont}{Cont}
\newcommand{\cont}[2][]{\Cont_{#1}\!\left(#2\right)}
\DeclareMathOperator{\Rev}{reverse}
\newcommand{\rev}[1]{\Rev\left(#1\right)}
\DeclareMathOperator{\Com}{complement}
\newcommand{\com}[1]{\Com\left(#1\right)}
\DeclareMathOperator{\Inv}{inverse}
\newcommand{\inv}[1]{\Inv\left(#1\right)}
\newcommand{\powset}[1]{\mathcal{P}(#1)}
\newcommand{\size}[1]{\left|#1\right|}
\newcommand{\addp}[3][\emptyset]{\mathtt{add\_point}\left(#2, #3, #1\right)}
\newcommand{\addpe}[1][\emptyset]{\mathtt{add\_point}\left(\varepsilon, #1\right)}
\newcommand{\adda}[2]{\mathtt{add\_ascent}\left(#1, #2\right)}
\newcommand{\addae}[0]{\mathtt{add\_ascent}\left(\varepsilon\right)}
\newcommand{\addd}[2]{\mathtt{add\_descent}\left(#1, #2\right)}
\newcommand{\addde}[0]{\mathtt{add\_descent}\left(\varepsilon\right)}
\def\twoline#1#2
{\begin{pmatrix}
\xintFor ##1 in {#1}\do {%
\xintifForFirst{##1}{&##1}}
\\
\xintFor ##2 in {#2}\do {%
\xintifForFirst{##2}{&##2}}
\end{pmatrix}
}