From 7b6c4a0dba2844a0ecc1fd96a951f9c4c021f0a4 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 21 Sep 2016 12:47:42 -0400 Subject: [PATCH] Create an example document and update the makefile to work with it. --- examples.tex | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++ makefile | 18 +++- 2 files changed, 245 insertions(+), 4 deletions(-) create mode 100644 examples.tex diff --git a/examples.tex b/examples.tex new file mode 100644 index 0000000..c87f59b --- /dev/null +++ b/examples.tex @@ -0,0 +1,231 @@ +\documentclass{report} + +\usepackage{mjotex} +\usepackage{mathtools} + +\begin{document} + + \begin{section}{Algorithm} + An example of an algorithm (bogosort) environment. + + \begin{algorithm}[H] + \caption{Sort a list of numbers} + \begin{algorithmic} + \Require{A list of numbers $L$} + \Ensure{A new, sorted copy $M$ of the list $L$} + + \State{$M \gets L$} + + \While{$M$ is not sorted} + \State{Rearrange $M$ randomly} + \EndWhile + + \Return{$M$} + \end{algorithmic} + \end{algorithm} + \end{section} + + \begin{section}{Arrow} + The identity operator on $V$ is $\identity{V}$. The composition of + $f$ and $g$ is $\compose{f}{g}$. The inverse of $f$ is + $\inverse{f}$. + \end{section} + + \begin{section}{Common} + The function $f$ applied to $x$ is $f\of{x}$. We can group terms + like $a + \qty{b - c}$ or $a + \qty{b - \sqty{c - d}}$. Here's a + set $\set{1,2,3} = \setc{n \in \Nn[1]}{ n \le 3 }$. Here's a pair + of things $\pair{1}{2}$ or a triple of them + $\triple{1}{2}{3}$. The Cartesian product of two sets $A$ and $B$ + is $\cartprod{A}{B}$; if we take the product with $C$ as well, + then we obtain $\cartprodthree{A}{B}{C}$. The direct sum of $V$ + and $W$ is $\directsum{V}{W}$ and the factorial of the number $10$ + is $\factorial{10}$. + + Here are a few common tuple spaces that should not have a + superscript when that superscript would be one: $\Nn[1]$, + $\Zn[1]$, $\Qn[1]$, $\Rn[1]$, $\Cn[1]$. However, if the + superscript is (say) two, then it appears: $\Nn[2]$, $\Zn[2]$, + $\Qn[2]$, $\Rn[2]$, $\Cn[2]$. + + We also have a few basic set operations, for example the union of + two or three sets: $\union{A}{B}$, $\unionthree{A}{B}{C}$. And of + course with union comes intersection: $\intersect{A}{B}$, + $\intersectthree{A}{B}{C}$. + \end{section} + + \begin{section}{Cone} + The dual cone of $K$ is $\dual{K}$. Some familiar symmetric cones + are $\Rnplus$, $\Lnplus$, $\Snplus$, and $\Hnplus$. If cones + $K_{1}$ and $K_{2}$ are given, we can define $\posops{K_{1}}$, + $\posops[K_{2}]{K_{1}}$, $\Sof{K_{1}}$, $\Zof{K_{1}}$, + $\LL{K_{1}}$, and $\lyapunovrank{K_{1}}$. We can also define $x + \gecone_{K} y$, $x \gtcone_{K} y$, $x \lecone_{K} y$, and $x + \ltcone_{K} y$ with respect to a cone $K$. + \end{section} + + \begin{section}{Convex} + The conic hull of a set $X$ is $\cone{X}$; its affine hull is + $\aff{X}$, and its convex hull is $\conv{X}$. If $K$ is a cone, + then its lineality space is $\linspace{K}$, its lineality is + $\lin{K}$, and its extreme directions are $\Ext{K}$. + \end{section} + + \begin{section}{Font} + We can write things like Carathéodory and Güler and $\mathbb{R}$. + \end{section} + + \begin{section}{Linear algebra} + The absolute value of $x$ is $\abs{x}$, or its norm is + $\norm{x}$. The inner product of $x$ and $y$ is $\ip{x}{y}$ and + their tensor product is $\tp{x}{y}$. The Kronecker product of + matrices $A$ and $B$ is $\kp{A}{B}$. The adjoint of the operator + $L$ is $\adjoint{L}$, or if it's a matrix, then its transpose is + $\transpose{L}$. Its trace is $\trace{L}$. + + The span of a set $X$ is $\spanof{X}$, and its codimension is + $\codim{X}$. The projection of $X$ onto $V$ is $\proj{V}{X}$. The + automorphism group of $X$ is $\Aut{X}$, and its Lie algebra is + $\Lie{X}$. We can write a column vector $x \coloneqq + \colvec{x_{1},x_{2},x_{3},x_{4}}$ and turn it into a $2 \times 2$ + matrix with $\matricize{x}$. To recover the vector, we use + $\vectorize{\matricize{x}}$. + + The set of all bounded linear operators from $V$ to $W$ is + $\boundedops[W]{V}$. If $W = V$, then we write $\boundedops{V}$ + instead. + \end{section} + + \begin{section}{Listing} + Here's an interactive sage prompt: + + \begin{tcblisting}{listing only, + colback=codebg, + coltext=codefg, + listing options={language=sage,style=sage}} + sage: K = Cone([ (1,0), (0,1) ]) + sage: K.positive_operator_gens() + [ + [1 0] [0 1] [0 0] [0 0] + [0 0], [0 0], [1 0], [0 1] + ] + \end{tcblisting} + \end{section} + + \begin{section}{Miscellaneous} + The cardinality of the set $X \coloneqq \set{1,2,3}$ is $\card{X} + = 3$. + \end{section} + + \begin{section}{Proof by cases} + + \begin{proposition} + There are two cases in the following proof. + + \begin{proof} + The result should be self-evident once we have considered the + following two cases. + \begin{pcases} + \begin{case}[first case] + Nothing happens in the first case. + \end{case} + \begin{case}[second case] + The same thing happens in the second case. + \end{case} + \end{pcases} + + You see? + \end{proof} + \end{proposition} + + Here's another one. + + \renewcommand{\baselinestretch}{2} + \begin{proposition} + Cases should display intelligently even when the document is + double-spaced. + + \begin{proof} + Here we go again. + + \begin{pcases} + \begin{case}[first case] + Nothing happens in the first case. + \end{case} + \begin{case}[second case] + The same thing happens in the second case. + \end{case} + \end{pcases} + + Now it's over. + \end{proof} + \end{proposition} + \renewcommand{\baselinestretch}{1} + \end{section} + + \begin{section}{Theorems} + \begin{corollary} + The + \end{corollary} + + \begin{lemma} + quick + \end{lemma} + + \begin{proposition} + brown + \end{proposition} + + \begin{theorem} + fox + \end{theorem} + + \begin{definition} + quod + \end{definition} + + \begin{example} + erat + \end{example} + + \begin{remark} + demonstradum. + \end{remark} + \end{section} + + \begin{section}{Theorems (starred)} + \begin{corollary*} + The + \end{corollary*} + + \begin{lemma*} + quick + \end{lemma*} + + \begin{proposition*} + brown + \end{proposition*} + + \begin{theorem*} + fox + \end{theorem*} + + \begin{definition*} + quod + \end{definition*} + + \begin{example*} + erat + \end{example*} + + \begin{remark*} + demonstradum. + \end{remark*} + \end{section} + + \begin{section}{Topology} + The interior of a set $X$ is $\interior{X}$. Its closure is + $\closure{X}$ and its boundary is $\boundary{X}$. + \end{section} + +\end{document} diff --git a/makefile b/makefile index cfe6f20..d9bd9d5 100644 --- a/makefile +++ b/makefile @@ -6,11 +6,14 @@ LATEX = pdflatex -file-line-error -halt-on-error # The name of this document. -PN = paper +PN = examples # A space-separated list of bib files. These must all belong to paths # contained in your $BIBINPUTS environment variable. -BIBS = references.bib +# +# Leave commented if you don't use a bibliography file. +# +#BIBS = references.bib # A space-separated list of the mjotex files that you use. The path to # mjotex must be contain in your $TEXINPUTS environment variable. @@ -95,9 +98,16 @@ $(PN).aux: $(SRCS) # As a side effect, we now need to depend on $(SRCS) here, since we # won't pick it up transitively from $(PN).aux. # +# If the $BIBS variable is undefined, we presume that there are no +# references and create an empty bbl file. Otherwise, we risk trying +# to run biblatex on an aux file containing no citations. +# $(PN).bbl: $(SRCS) | $(PN).aux +ifdef BIBS bibtex $(PN).aux - +else + echo -n '' > $@ +endif # Run chktex to find silly mistakes. There is some exit code weirdness # (Savannah bug 45979), so we just look for empty output. @@ -108,7 +118,7 @@ check: # Clean up leftover junk. .PHONY: clean clean: - rm -f *.{aux,bbl,bcf,bib,blg,lof,log,nav,out,pdf,snm,toc,xml} + rm -f *.{aux,bbl,bcf,bib,blg,listing,lof,log,nav,out,pdf,snm,toc,xml} rm -rf dist/ # If this document will be published, the publisher isn't going to -- 2.44.2