% thesis-defs.tex --- various definitions used throughout -*-latex-*-

% Copyright (C) 2020 Amin Bandali <bandali@uwaterloo.ca>

% This file is part of Amin Bandali's MMath thesis.

% This thesis is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.

% This thesis is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.

% You should have received a copy of the GNU General Public License
% along with this thesis.  If not, see <https://www.gnu.org/licenses/>.


%% ===================================================================
%% Language names and acronyms
%% ===================================================================

% \mbox to disallow splitting "Event-B" into "Event-" and "B" at EOL
\newcommand{\mylang}[1]{\mbox{\textsc{\addfontfeature{Letters=UppercaseSmallCaps}\textlarger{#1}}}}
\newcommand{\B}{\mylang{B}}
\newcommand{\eventb}{\mylang{Event-B}}
\newcommand{\dash}{\mylang{Dash}}
\newcommand{\alloy}{\mylang{Alloy}}
\newcommand{\tla}{\mylang{TLA{\small${}^+$}}}
\newcommand{\pluscal}{\mylang{PlusCal}}
\newcommand{\asmetal}{\mylang{AsmetaL}}

\newcommand{\amn}{\textsc{\addfontfeature{Letters=UppercaseSmallCaps}AMN}}
\newcommand{\asm}{\textsc{\addfontfeature{Letters=UppercaseSmallCaps}ASM}}
\newcommand{\TLA}{\textsc{\addfontfeature{Letters=UppercaseSmallCaps}TLA}}
\newcommand{\tlc}{\textsc{\addfontfeature{Letters=UppercaseSmallCaps}TLC}}

\newcommand{\sat}{\textsc{\addfontfeature{Letters=UppercaseSmallCaps}SAT}}

\newcommand{\href}[1]{#1} % does nothing, but defines the command so
                          % the print-optimized version will ignore
                          % \href tags (redefined by hyperref pkg).
%\newcommand{\texorpdfstring}[2]{#1} % does nothing, but defines the
                                    % command

%% ===================================================================
%% Logical connectives
%% ===================================================================

\newcommand{\qand}{\wedge}
\newcommand{\qor}{\vee}
\newcommand{\qimp}{\Rightarrow}
\newcommand{\qnot}{\neg}
\newcommand{\qiff}{\Leftrightarrow}
\newcommand{\qxor}{\oplus}
\newcommand{\qqm}{\mathop{\hspace{0.1em}\stackrel{?}{\rule{1em}{0.03em}}\hspace{0.1em}}}

%% ===================================================================
%% Colour definitions
%% ===================================================================

\definecolor{eclipseBlue}{RGB}{42,0.0,255}
\definecolor{eclipseGreen}{RGB}{63,127,95}
\definecolor{eclipsePurple}{RGB}{127,0,85}
\definecolor{eclipseCoral}{RGB}{255,127,80}
\definecolor{eclipseBrown}{RGB}{40,26,13}

\definecolor{eventbGreen}{HTML}{008000}
\definecolor{alloyBlue}{HTML}{1F1FAF}
\definecolor{pluscalBrown}{HTML}{CE5C00}

\colorlet{cb}{eclipseBrown}
\colorlet{cdash}{eclipsePurple}
\colorlet{ctla}{eclipseCoral}
\colorlet{ceventb}{eventbGreen}
\colorlet{calloy}{alloyBlue}
\colorlet{cpluscal}{pluscalBrown}
\colorlet{casmetal}{red}

\newcommand{\cB}{{\color{cb}{\B}}}
\newcommand{\ceventb}{{\color{ceventb}{\eventb}}}
\newcommand{\cdash}{{\color{cdash}{\dash}}}
\newcommand{\calloy}{{\color{calloy}{\alloy}}}
\newcommand{\ctla}{{\color{ctla}{\tla}}}
\newcommand{\cpluscal}{{\color{cpluscal}{\pluscal}}}
\newcommand{\casmetal}{{\color{casmetal}{\asmetal}}}

%% ===================================================================
%% Em and en dashes with various options for breakability
%% ===================================================================

\makeatletter
\DeclareRobustCommand{\thinskip}{\hskip 0.16667em\relax}
\def\endash{--}
\def\emdash{\endash-}
\def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
\def\nd{\d@sh\nobreak\endash}
\def\md{\d@sh\nobreak\emdash}
\def\lnd{\d@sh\empty{\hbox{\endash}\nobreak}}
\def\rnd{\d@sh\nobreak\endash}
\def\lmd{\d@sh\empty{\hbox{\emdash}\nobreak}}
\def\rmd{\d@sh\nobreak\emdash}
\makeatother

\newcommand{\swash}[1]{\textit{\addfontfeature{ItalicFeatures={Style=Swash}}#1}}


%% Local Variables:
%% tex-main-file: "./bandali-mmath-thesis.tex"
%% End:
