]> gitweb.michael.orlitzky.com - mjotex.git/blob - examples.tex
Create an example document and update the makefile to work with it.
[mjotex.git] / examples.tex
1 \documentclass{report}
2
3 \usepackage{mjotex}
4 \usepackage{mathtools}
5
6 \begin{document}
7
8 \begin{section}{Algorithm}
9 An example of an algorithm (bogosort) environment.
10
11 \begin{algorithm}[H]
12 \caption{Sort a list of numbers}
13 \begin{algorithmic}
14 \Require{A list of numbers $L$}
15 \Ensure{A new, sorted copy $M$ of the list $L$}
16
17 \State{$M \gets L$}
18
19 \While{$M$ is not sorted}
20 \State{Rearrange $M$ randomly}
21 \EndWhile
22
23 \Return{$M$}
24 \end{algorithmic}
25 \end{algorithm}
26 \end{section}
27
28 \begin{section}{Arrow}
29 The identity operator on $V$ is $\identity{V}$. The composition of
30 $f$ and $g$ is $\compose{f}{g}$. The inverse of $f$ is
31 $\inverse{f}$.
32 \end{section}
33
34 \begin{section}{Common}
35 The function $f$ applied to $x$ is $f\of{x}$. We can group terms
36 like $a + \qty{b - c}$ or $a + \qty{b - \sqty{c - d}}$. Here's a
37 set $\set{1,2,3} = \setc{n \in \Nn[1]}{ n \le 3 }$. Here's a pair
38 of things $\pair{1}{2}$ or a triple of them
39 $\triple{1}{2}{3}$. The Cartesian product of two sets $A$ and $B$
40 is $\cartprod{A}{B}$; if we take the product with $C$ as well,
41 then we obtain $\cartprodthree{A}{B}{C}$. The direct sum of $V$
42 and $W$ is $\directsum{V}{W}$ and the factorial of the number $10$
43 is $\factorial{10}$.
44
45 Here are a few common tuple spaces that should not have a
46 superscript when that superscript would be one: $\Nn[1]$,
47 $\Zn[1]$, $\Qn[1]$, $\Rn[1]$, $\Cn[1]$. However, if the
48 superscript is (say) two, then it appears: $\Nn[2]$, $\Zn[2]$,
49 $\Qn[2]$, $\Rn[2]$, $\Cn[2]$.
50
51 We also have a few basic set operations, for example the union of
52 two or three sets: $\union{A}{B}$, $\unionthree{A}{B}{C}$. And of
53 course with union comes intersection: $\intersect{A}{B}$,
54 $\intersectthree{A}{B}{C}$.
55 \end{section}
56
57 \begin{section}{Cone}
58 The dual cone of $K$ is $\dual{K}$. Some familiar symmetric cones
59 are $\Rnplus$, $\Lnplus$, $\Snplus$, and $\Hnplus$. If cones
60 $K_{1}$ and $K_{2}$ are given, we can define $\posops{K_{1}}$,
61 $\posops[K_{2}]{K_{1}}$, $\Sof{K_{1}}$, $\Zof{K_{1}}$,
62 $\LL{K_{1}}$, and $\lyapunovrank{K_{1}}$. We can also define $x
63 \gecone_{K} y$, $x \gtcone_{K} y$, $x \lecone_{K} y$, and $x
64 \ltcone_{K} y$ with respect to a cone $K$.
65 \end{section}
66
67 \begin{section}{Convex}
68 The conic hull of a set $X$ is $\cone{X}$; its affine hull is
69 $\aff{X}$, and its convex hull is $\conv{X}$. If $K$ is a cone,
70 then its lineality space is $\linspace{K}$, its lineality is
71 $\lin{K}$, and its extreme directions are $\Ext{K}$.
72 \end{section}
73
74 \begin{section}{Font}
75 We can write things like Carathéodory and Güler and $\mathbb{R}$.
76 \end{section}
77
78 \begin{section}{Linear algebra}
79 The absolute value of $x$ is $\abs{x}$, or its norm is
80 $\norm{x}$. The inner product of $x$ and $y$ is $\ip{x}{y}$ and
81 their tensor product is $\tp{x}{y}$. The Kronecker product of
82 matrices $A$ and $B$ is $\kp{A}{B}$. The adjoint of the operator
83 $L$ is $\adjoint{L}$, or if it's a matrix, then its transpose is
84 $\transpose{L}$. Its trace is $\trace{L}$.
85
86 The span of a set $X$ is $\spanof{X}$, and its codimension is
87 $\codim{X}$. The projection of $X$ onto $V$ is $\proj{V}{X}$. The
88 automorphism group of $X$ is $\Aut{X}$, and its Lie algebra is
89 $\Lie{X}$. We can write a column vector $x \coloneqq
90 \colvec{x_{1},x_{2},x_{3},x_{4}}$ and turn it into a $2 \times 2$
91 matrix with $\matricize{x}$. To recover the vector, we use
92 $\vectorize{\matricize{x}}$.
93
94 The set of all bounded linear operators from $V$ to $W$ is
95 $\boundedops[W]{V}$. If $W = V$, then we write $\boundedops{V}$
96 instead.
97 \end{section}
98
99 \begin{section}{Listing}
100 Here's an interactive sage prompt:
101
102 \begin{tcblisting}{listing only,
103 colback=codebg,
104 coltext=codefg,
105 listing options={language=sage,style=sage}}
106 sage: K = Cone([ (1,0), (0,1) ])
107 sage: K.positive_operator_gens()
108 [
109 [1 0] [0 1] [0 0] [0 0]
110 [0 0], [0 0], [1 0], [0 1]
111 ]
112 \end{tcblisting}
113 \end{section}
114
115 \begin{section}{Miscellaneous}
116 The cardinality of the set $X \coloneqq \set{1,2,3}$ is $\card{X}
117 = 3$.
118 \end{section}
119
120 \begin{section}{Proof by cases}
121
122 \begin{proposition}
123 There are two cases in the following proof.
124
125 \begin{proof}
126 The result should be self-evident once we have considered the
127 following two cases.
128 \begin{pcases}
129 \begin{case}[first case]
130 Nothing happens in the first case.
131 \end{case}
132 \begin{case}[second case]
133 The same thing happens in the second case.
134 \end{case}
135 \end{pcases}
136
137 You see?
138 \end{proof}
139 \end{proposition}
140
141 Here's another one.
142
143 \renewcommand{\baselinestretch}{2}
144 \begin{proposition}
145 Cases should display intelligently even when the document is
146 double-spaced.
147
148 \begin{proof}
149 Here we go again.
150
151 \begin{pcases}
152 \begin{case}[first case]
153 Nothing happens in the first case.
154 \end{case}
155 \begin{case}[second case]
156 The same thing happens in the second case.
157 \end{case}
158 \end{pcases}
159
160 Now it's over.
161 \end{proof}
162 \end{proposition}
163 \renewcommand{\baselinestretch}{1}
164 \end{section}
165
166 \begin{section}{Theorems}
167 \begin{corollary}
168 The
169 \end{corollary}
170
171 \begin{lemma}
172 quick
173 \end{lemma}
174
175 \begin{proposition}
176 brown
177 \end{proposition}
178
179 \begin{theorem}
180 fox
181 \end{theorem}
182
183 \begin{definition}
184 quod
185 \end{definition}
186
187 \begin{example}
188 erat
189 \end{example}
190
191 \begin{remark}
192 demonstradum.
193 \end{remark}
194 \end{section}
195
196 \begin{section}{Theorems (starred)}
197 \begin{corollary*}
198 The
199 \end{corollary*}
200
201 \begin{lemma*}
202 quick
203 \end{lemma*}
204
205 \begin{proposition*}
206 brown
207 \end{proposition*}
208
209 \begin{theorem*}
210 fox
211 \end{theorem*}
212
213 \begin{definition*}
214 quod
215 \end{definition*}
216
217 \begin{example*}
218 erat
219 \end{example*}
220
221 \begin{remark*}
222 demonstradum.
223 \end{remark*}
224 \end{section}
225
226 \begin{section}{Topology}
227 The interior of a set $X$ is $\interior{X}$. Its closure is
228 $\closure{X}$ and its boundary is $\boundary{X}$.
229 \end{section}
230
231 \end{document}