2021-05-19 09:55:54 -04:00
|
|
|
|
% The TAME Programming Language LaTeX style and macros
|
2021-04-30 09:16:01 -04:00
|
|
|
|
%
|
|
|
|
|
% Copyright (C) 2021 Ryan Specialty Group, LLC.
|
|
|
|
|
%
|
|
|
|
|
% Licensed under the Creative Commons Attribution-ShareAlike 4.0
|
|
|
|
|
% International License.
|
|
|
|
|
%%
|
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
%%
|
|
|
|
|
% Package Imports
|
|
|
|
|
%%
|
|
|
|
|
\usepackage[letterpaper]{geometry} % US Letter paper
|
|
|
|
|
\usepackage[amsfonts,amssymb]{concmath} % Fonts used by the text
|
|
|
|
|
\usepackage{euler} % Concrete Mathematics
|
|
|
|
|
\usepackage{makeidx} % Indexing
|
2021-05-26 13:04:55 -04:00
|
|
|
|
\usepackage[backend=biber]{biblatex} % BibTeX replacement
|
2021-05-19 09:55:54 -04:00
|
|
|
|
\usepackage[colorlinks=true,
|
|
|
|
|
linkcolor=href,
|
2021-05-26 13:04:55 -04:00
|
|
|
|
citecolor=cite,
|
|
|
|
|
urlcolor=href,
|
2021-05-19 09:55:54 -04:00
|
|
|
|
draft=false]{hyperref} % Hyperlinks (even in draft mode)
|
|
|
|
|
\usepackage{xcolor} % Colors (for hyperlinks)
|
|
|
|
|
\usepackage{amsmath,amsthm} % AMS macros, including theorems
|
|
|
|
|
\usepackage{suffix} % To aid in defining star macros
|
|
|
|
|
\usepackage{marginnote} % Notes in the margin
|
|
|
|
|
\usepackage{ccicons} % CC license icons
|
|
|
|
|
\usepackage{manfnt} % Dangerous Bend symbols
|
2021-05-26 10:33:01 -04:00
|
|
|
|
\usepackage{rotating} % Rotating objects
|
2021-05-19 09:55:54 -04:00
|
|
|
|
|
2021-05-26 13:04:55 -04:00
|
|
|
|
\addbibresource{tpl.bib}
|
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% Colors
|
|
|
|
|
%
|
2021-04-30 09:16:01 -04:00
|
|
|
|
% Colors from Tango Icon Theme
|
|
|
|
|
% https://en.wikipedia.org/wiki/Tango_Desktop_Project
|
|
|
|
|
\definecolor{href}{HTML}{204a87}
|
2021-05-26 13:04:55 -04:00
|
|
|
|
\definecolor{cite}{HTML}{4e9a06}
|
2021-04-30 09:16:01 -04:00
|
|
|
|
|
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% Common typesetting
|
|
|
|
|
%%
|
|
|
|
|
% TAME
|
|
|
|
|
\newcommand\tame{\textsc{Tame}}
|
|
|
|
|
\newcommand\tamer{\textsc{Tamer}}
|
|
|
|
|
\newcommand\tameparam[1]{\texttt{#1}}
|
|
|
|
|
\newcommand\tameclass[1]{\texttt{#1}}
|
|
|
|
|
\newcommand\tameconst[1]{\texttt{#1}}
|
|
|
|
|
\newcommand\tametrue{\tameconst{TRUE}}
|
|
|
|
|
\newcommand\tamefalse{\tameconst{FALSE}}
|
|
|
|
|
\let\tamepkg\texttt
|
|
|
|
|
|
|
|
|
|
% XML
|
|
|
|
|
\let\xml\texttt
|
|
|
|
|
\newcommand\xmlnl{\\[-3mm]}
|
2021-05-20 10:45:44 -04:00
|
|
|
|
\newcommand\xmlnll{\\[-1mm]}
|
2021-04-30 09:16:01 -04:00
|
|
|
|
\newcommand\xpath[1]{\texttt{#1}}
|
|
|
|
|
\newcommand\xmlnode[1]{\texttt{#1}}
|
2021-05-11 16:37:08 -04:00
|
|
|
|
\newcommand\xmlattr[1]{{@\texttt{#1}}}
|
2021-04-30 09:16:01 -04:00
|
|
|
|
|
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% Mathematics
|
|
|
|
|
%%
|
|
|
|
|
% Boolean
|
|
|
|
|
\newcommand\true{\ensuremath\top}
|
|
|
|
|
\newcommand\false{\ensuremath\bot}
|
2021-05-14 10:32:50 -04:00
|
|
|
|
\newcommand\Bool{\ensuremath{\mathbb{B}}}
|
2021-04-30 09:16:01 -04:00
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
% Numbers
|
2021-04-30 09:16:01 -04:00
|
|
|
|
\newcommand\Int{\ensuremath{\mathbb{Z}}}
|
|
|
|
|
\newcommand\Real{\ensuremath{\mathbb{R}}}
|
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
% Sets and families
|
2021-04-30 09:16:01 -04:00
|
|
|
|
\newcommand\Set[1]{\ensuremath{\left\{#1\right\}}}
|
|
|
|
|
\newcommand\Fam[3]{\ensuremath{\left\{#1_{#2}\right\}_{#2\in #3}}}
|
2021-05-19 09:55:54 -04:00
|
|
|
|
\newcommand\len[1]{\ensuremath{\left|#1\right|}}
|
2021-05-20 15:28:10 -04:00
|
|
|
|
\newcommand\rank[1]{\ensuremath{\left\|#1\right\|}}
|
2021-05-21 16:10:44 -04:00
|
|
|
|
\newcommand\PSet[1]{\mathcal{P}\left(#1\right)}
|
|
|
|
|
\newcommand\PSetcard[2]{\mathcal{P}_{#1}\left(#2\right)}
|
2021-05-19 09:55:54 -04:00
|
|
|
|
\let\union\cup
|
|
|
|
|
\let\Union\bigcup
|
|
|
|
|
\let\intersect\cap
|
2021-04-30 09:16:01 -04:00
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
% Vectors and matrices with family notations
|
2021-04-30 09:16:01 -04:00
|
|
|
|
\newcommand\Vectors{\ensuremath{\mathcal{V}}}
|
|
|
|
|
\newcommand\Vector[1]{\ensuremath{\left\langle#1\right\rangle}}
|
|
|
|
|
\newcommand\VFam[3]{\ensuremath{\Vector{#1_{#2}}_{#2\in #3}}}
|
|
|
|
|
\newcommand\Matrices{\ensuremath{\Vectors^{\Vectors^\Real}}}
|
2021-05-18 10:06:32 -04:00
|
|
|
|
\newcommand\MFam[5]{\ensuremath{%
|
|
|
|
|
\Vector{{#1_{#2}}_#4}_{\underset{#4\in {#5_#2}}{#2\in #3}}
|
|
|
|
|
}}
|
2021-05-26 13:04:55 -04:00
|
|
|
|
\newcommand\eleundef{\boxtimes}
|
2021-04-30 09:16:01 -04:00
|
|
|
|
|
2021-05-20 10:45:44 -04:00
|
|
|
|
% Variable subscripts
|
|
|
|
|
\let\varsubscript\imath
|
|
|
|
|
\newcommand\varsub[1]{{#1}_{\varsubscript}}
|
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
% Logic
|
2021-05-10 16:54:19 -04:00
|
|
|
|
\let\infer\vdash
|
2021-04-30 09:16:01 -04:00
|
|
|
|
\newcommand\Forall{\@ifstar\@Forallstar\@Forall}
|
|
|
|
|
\newcommand\@Forall[2]{\forall #1\left(#2\right)}
|
|
|
|
|
\newcommand\@Forallstar[2]{\forall #1 #2}
|
|
|
|
|
\newcommand\Exists{\@ifstar\@Existsstar\@Exists}
|
|
|
|
|
\newcommand\@Exists[2]{\exists #1\left(#2\right)}
|
|
|
|
|
\newcommand\@Existsstar[2]{\exists #1 #2}
|
|
|
|
|
|
2021-05-20 10:45:44 -04:00
|
|
|
|
% Equivalent, but some syntatic inference involved (e.g. equivalent by
|
|
|
|
|
% index, as in classification matches).
|
2021-05-24 13:24:53 -04:00
|
|
|
|
\newcommand\equivish{\equiv_{\varsubscript}}
|
2021-05-20 10:45:44 -04:00
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
% Group theory
|
|
|
|
|
\newcommand\Monoid[3]{\left({#1},{#2},{#3}\right)}
|
2021-05-26 10:33:01 -04:00
|
|
|
|
\let\monoidop\bullet
|
|
|
|
|
\newcommand\monoidops{\monoidop\cdots\monoidop}
|
2021-05-19 09:55:54 -04:00
|
|
|
|
|
2021-05-20 10:45:44 -04:00
|
|
|
|
% Closed binary function
|
|
|
|
|
\newcommand\cbif[1]{#1\times#1\rightarrow#1}
|
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
% Binary function composition
|
|
|
|
|
\newcommand\bicomp[1]{{#1}^\circ}
|
|
|
|
|
|
|
|
|
|
% Grammar
|
|
|
|
|
\let\emptystr\epsilon
|
|
|
|
|
|
|
|
|
|
% TAME Classification
|
|
|
|
|
\DeclareMathOperator*\Classify{%
|
|
|
|
|
\mathchoice{\vcenter{\hbox{\huge$\mathfrak{C}$}}}
|
|
|
|
|
{\vcenter{\hbox{\Large$\mathfrak{C}$}}}
|
|
|
|
|
{\frak{C}}
|
|
|
|
|
{\frak{C}}
|
|
|
|
|
}
|
2021-05-25 10:50:55 -04:00
|
|
|
|
% Convenience variants
|
|
|
|
|
\DeclareMathOperator*\Classifyland{%
|
|
|
|
|
\mathchoice{\vcenter{\hbox{\huge$\mathfrak{C}^\land$}}}
|
|
|
|
|
{\vcenter{\hbox{\Large$\mathfrak{C}\land$}}}
|
|
|
|
|
{\frak{C^\land}}
|
|
|
|
|
{\frak{C^\land}}
|
|
|
|
|
}
|
|
|
|
|
\DeclareMathOperator*\Classifylor{%
|
|
|
|
|
\mathchoice{\vcenter{\hbox{\huge$\mathfrak{C}^\lor$}}}
|
|
|
|
|
{\vcenter{\hbox{\Large$\mathfrak{C}\lor$}}}
|
|
|
|
|
{\frak{C^\lor}}
|
|
|
|
|
{\frak{C^\lor}}
|
|
|
|
|
}
|
2021-05-19 09:55:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% Theorem environments
|
|
|
|
|
%%
|
|
|
|
|
\numberwithin{equation}{section} % number by section
|
|
|
|
|
|
2021-05-14 10:50:49 -04:00
|
|
|
|
% Create a new theorem environment along with a set of label/ref/pref
|
|
|
|
|
% commands.
|
|
|
|
|
\newcommand\newtheoremwithlabel[3]{%
|
|
|
|
|
\newtheorem{#1}{#2}[section]
|
2021-05-17 13:20:11 -04:00
|
|
|
|
\expandafter\def\csname #1autorefname\endcsname{#2}
|
|
|
|
|
\expandafter\newcommand\csname #3label\endcsname[1]{\label{#1:##1}}
|
|
|
|
|
\expandafter\newcommand\csname #3ref\endcsname[1]{\autoref{#1:##1}}
|
2021-05-26 10:32:50 -04:00
|
|
|
|
\expandafter\newcommand\csname #3pref\endcsname[1]{\spref{#1:##1}}
|
2021-05-14 10:50:49 -04:00
|
|
|
|
}
|
|
|
|
|
|
2021-04-30 09:16:01 -04:00
|
|
|
|
\theoremstyle{definition}
|
2021-05-14 10:50:49 -04:00
|
|
|
|
\newtheoremwithlabel{definition}{Definition}{dfn}
|
2021-05-18 10:06:32 -04:00
|
|
|
|
\newtheoremwithlabel{axiom}{Axiom}{axm}
|
2021-04-30 09:16:01 -04:00
|
|
|
|
|
|
|
|
|
\theoremstyle{plain}
|
2021-05-14 10:50:49 -04:00
|
|
|
|
\newtheoremwithlabel{corollary}{Corollary}{cor}
|
|
|
|
|
\newtheoremwithlabel{lemma}{Lemma}{lem}
|
2021-05-18 10:06:32 -04:00
|
|
|
|
\newtheoremwithlabel{theorem}{Theorem}{thm}
|
2021-05-14 10:32:50 -04:00
|
|
|
|
|
2021-04-30 09:16:01 -04:00
|
|
|
|
\theoremstyle{remark}
|
2021-05-14 10:50:49 -04:00
|
|
|
|
\newtheoremwithlabel{remark}{Remark}{rem}
|
2021-04-30 09:16:01 -04:00
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
|
2021-05-24 12:31:09 -04:00
|
|
|
|
%%
|
|
|
|
|
% Optional page reference
|
|
|
|
|
%%
|
|
|
|
|
% "Smart" page reference changing the text depending on what page the
|
|
|
|
|
% reference appears relative to the current.
|
|
|
|
|
\newcount\@sprefn
|
|
|
|
|
\newcommand\spref[1]{%
|
|
|
|
|
% We use labels to get the current page from the previous run, since
|
|
|
|
|
% \thepage can be inaccurate except right after a \newpage.
|
|
|
|
|
\advance\@sprefn by 1\relax%
|
|
|
|
|
\label{__:#1SELF\the\@sprefn}%
|
|
|
|
|
\xdef\@@realp{\getpagerefnumber{__:#1SELF\the\@sprefn}}%
|
|
|
|
|
\autoref{#1}%
|
|
|
|
|
\xdef\@pref{\getpagerefnumber{#1}}%
|
|
|
|
|
\ifnum\@pref=\@@realp
|
|
|
|
|
% Output nothing; it'd read really awkwardly, for example, if we output
|
|
|
|
|
% a figure using [h] and then say "Figure X on this page" in the
|
|
|
|
|
% paragraph that's _right_ below it. Even if we didn't use [h]. I
|
|
|
|
|
% noticed this awkward effect in Specifying Systems.
|
|
|
|
|
\else
|
|
|
|
|
\space
|
|
|
|
|
\newcount\@p\@p=\@@realp
|
|
|
|
|
\advance\@p by 1\relax
|
|
|
|
|
\ifnum\@p=\@pref
|
|
|
|
|
on the next page%
|
|
|
|
|
\else
|
|
|
|
|
\advance\@p by -2\relax
|
|
|
|
|
\ifnum\@p=\@pref
|
|
|
|
|
on the previous page%
|
|
|
|
|
\else
|
|
|
|
|
on \autopageref{#1}%
|
|
|
|
|
\fi
|
|
|
|
|
\fi
|
|
|
|
|
\fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% General typesetting
|
|
|
|
|
%%
|
2021-04-30 09:16:01 -04:00
|
|
|
|
\newcommand\pref[1]{\ref{#1} on page~\pageref{#1}}
|
|
|
|
|
\newcommand\seclabel[1]{\label{sec:#1}}
|
|
|
|
|
\newcommand\secref[1]{Section~\ref{sec:#1}}
|
|
|
|
|
\newcommand\secpref[1]{Section~\pref{sec:#1}}
|
|
|
|
|
|
2021-05-18 12:13:32 -04:00
|
|
|
|
% Definitions (introduction of terms)
|
|
|
|
|
\let\dfn\textsl
|
2021-05-19 09:55:54 -04:00
|
|
|
|
\newcommand\todo[1]{%
|
|
|
|
|
\marginnote{\underline{\textsc{Todo:}}\\
|
|
|
|
|
\textsl{#1}}%
|
2021-05-11 16:37:08 -04:00
|
|
|
|
}
|
2021-05-11 16:50:11 -04:00
|
|
|
|
\newcommand\mremark[1]{\marginnote{\textsl{#1}}}
|
2021-05-14 10:32:50 -04:00
|
|
|
|
|
2021-05-14 12:05:17 -04:00
|
|
|
|
% A really obnoxious notice making clear to the reader that this portion of
|
|
|
|
|
% the work is unfinished, to the point where it's probably even
|
|
|
|
|
% incorrect. Uses dangerous bend symbol from manfnt, which is admittedly a
|
|
|
|
|
% misuse given that it's often used to represent difficult problems. Though
|
|
|
|
|
% I suppose an unfinished work is a difficult problem.
|
|
|
|
|
\newcommand\INCOMPLETE[1]{%
|
|
|
|
|
\bigskip
|
|
|
|
|
\par
|
|
|
|
|
\todo{This is incomplete!}
|
|
|
|
|
\hfill\textdbend\textbf{\textsl{#1}}\textdbend\hfill
|
|
|
|
|
\bigskip
|
|
|
|
|
}
|
2021-05-18 15:51:48 -04:00
|
|
|
|
|
|
|
|
|
|
2021-05-19 09:55:54 -04:00
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% Indexing
|
|
|
|
|
%%
|
|
|
|
|
% Symbols appear at the beginning of the index
|
|
|
|
|
\newcommand\indexsym[2]{\index{__sym_#2@{\ensuremath{#1}}|see {#2}}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%%
|
2021-05-18 15:51:48 -04:00
|
|
|
|
% Dynamic Configuration
|
2021-05-19 09:55:54 -04:00
|
|
|
|
%%
|
2021-05-18 15:51:48 -04:00
|
|
|
|
\newif\iftplappendix
|
|
|
|
|
|
|
|
|
|
\InputIfFileExists{./conf.tex}%
|
|
|
|
|
{\message{Loaded `./conf.tex'.}}%
|
|
|
|
|
{\message{`./conf.tex' not found (did you run `./configure'?).
|
|
|
|
|
Using defaults.}%
|
2021-05-19 09:55:54 -04:00
|
|
|
|
}
|