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
|
|
|
|
|
\usepackage[colorlinks=true,
|
|
|
|
|
linkcolor=href,
|
|
|
|
|
draft=false]{hyperref} % Hyperlinks (even in draft mode)
|
|
|
|
|
\usepackage{xcolor} % Colors (for hyperlinks)
|
|
|
|
|
\usepackage[final]{listings} % Displaying code (even in draft)
|
|
|
|
|
\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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% 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-19 09:55:54 -04:00
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% Listing language
|
|
|
|
|
%%
|
2021-04-30 09:16:01 -04:00
|
|
|
|
\lstset{
|
|
|
|
|
language=XML,
|
|
|
|
|
basicstyle=\ttfamily,
|
|
|
|
|
columns=fullflexible,
|
|
|
|
|
keepspaces=true,
|
|
|
|
|
showstringspaces=false,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
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-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|}}
|
|
|
|
|
\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-04-30 09:16:01 -04:00
|
|
|
|
|
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-19 09:55:54 -04:00
|
|
|
|
% Group theory
|
|
|
|
|
\newcommand\Monoid[3]{\left({#1},{#2},{#3}\right)}
|
|
|
|
|
|
|
|
|
|
% 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}}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% 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}}
|
|
|
|
|
\expandafter\newcommand\csname #3pref\endcsname[1]{\autopref{#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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
% 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
|
|
|
|
}
|