%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Part of the ptx2pdf macro package for formatting USFM text
% copyright (c) 2021 by SIL International
% Pulled from other files and extended by David Gardner
%
% Permission is hereby granted, free of charge, to any person obtaining  
% a copy of this software and associated documentation files (the  
% "Software"), to deal in the Software without restriction, including  
% without limitation the rights to use, copy, modify, merge, publish,  
% distribute, sublicense, and/or sell copies of the Software, and to  
% permit persons to whom the Software is furnished to do so, subject to  
% the following conditions:
%
% The above copyright notice and this permission notice shall be  
% included in all copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  
% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  
% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  
% NONINFRINGEMENT. IN NO EVENT SHALL SIL INTERNATIONAL BE LIABLE FOR  
% ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF  
% CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  
% WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
%
% Except as contained in this notice, the name of SIL International  
% shall not be used in advertising or otherwise to promote the sale,  
% use or other dealings in this Software without prior written  
% authorization from SIL International.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ptx-constants.tex
% Mostly, 'user-interface' constants, like top={t} Other contstants go at the bottom.

% Undefine some TeX definitions that will become paragraph styles, etc.
\let\pm\undefined % No longer +- symbol
\let\v\undefined % No longer v accent
\let\pi\undefined % No longer greek  pi
\let\phi\undefined % No longer  greek phi
\let\psi\undefined % No longer  greek psi
\let\lim\undefined % No longer limit
\let\b\undefined % No longer alignmennt macro
\let\c\undefined % No longer cedila accent
\let\d\undefined % No longer alignmennt macro
\let\tr\undefined % No longer superscript
\let\sp\undefined % No longer superscript
\let\wr\undefined % No longer mathchar
\let\it\undefined % No longer italic
\let\sup\undefined % No longer mathop
\let\rq\undefined % No longer right quote

% Figure  and alignment definitions
\def\size@COL{col}
\def\size@SPAN{span}
\def\size@WIDTH{width}% Full width of page
\def\size@PAGE{page}% a page, within the margins
\def\size@FULL{full}% the paper size
\def\size@FONT{font}% the current font height
\def\size@LINE{line}% the current baselineskip 
% tA,bA  etc are reserved for the top and bottom of polyglot column A
\def\loc@T{t}
\def\loc@B{b}
\def\loc@VB{B}
\def\loc@TL{tl}
\def\loc@TR{tr}
\def\loc@BL{bl}
\def\loc@BR{br}
\def\loc@Inl{h}% In-line graphic, not a float.
\def\loc@InlB{j}% In-line graphic, *below* the trigger
\def\loc@InText{H}% In-text. (immediate)
\def\loc@Cut{c}% cutout
\def\loc@Par{p}% post-paragrpah
\def\loc@Page{P}% Page (with headers/footers)
\def\loc@Full{F}% FullPage (no headers/footers)
\def\loc@M{m}% Margin
\def\@lignInner{i}
\def\@lignOuter{o}
\def\@lignLeft{l}
\def\@lignRight{r}
\def\@lignTop{t}
\def\@lignBot{b}
\def\@lignCent{c}
\def\@lignGCent{g} %Gridded centre alignment, used in tables for centre-alignment of text but on-grid.
\def\keyR@TATE{rotate}
\def\keyP@GE{page}
\def\val@dd{odd}
\def\val@ven{even}
\def\valb@th{both}
\def\val@BIND{binding}
\def\val@EDGE{edge}
\def\val@MULTI{multi}
\def\val@GROUP{group}
\def\@x@{x}
\def\@pdf{pdf}
\def\gr@phic{graphic}
\def\fill@none{NONE}

% Table-constants
\def\cell@r{r}
\def\cell@c{c}
\def\cell@l{l}

% from ptx-extended
\def\sb@rb@x{sidebarBox}%one word
\def\tr@e{T}
\def\false{F}
\def\Img@Shrink{shrink}
\def\Img@Distort{distort}
\def\Img@Crop{crop}
\def\pos@Side{s}

%+cpar_strings
% strings for testing against stylesheet parameters
\def\v@rsetext{versetext}
\def\c@nter{center}
\def\l@ft{left}
\def\l@ftb@l{leftbal}
\def\r@ght{right}
\def\he@dings{headings}
\def\intr@{intro}
\def\s@ction{section}
\def\oth@r{other}
%Strings for current/last paragraph type
\def\t@tle{title}
%-cpar_strings

% Style sheet
\def\N@nPublish@ble{nonpublishable}
\def\P@ra{paragraph}
\def\Ch@r{character}
\def\N@te{note}
\def\MSt@ne{milestone}
\def\St@lone{standalone}
\def\gr@dorig{orig} % Grid the text inside and grid the box. (resulting in over-gridding)
\def\gr@dnone{none} % No grid corrections
\def\gr@dheading{heading} % No grid corrections, but keep headings' SpaceBefore at the top of the box
\def\gr@dnormal{normal} % Do something a bit clever at the top of the box
\def\gr@dsmart{smart} % Do something even cleverer, 
\x@\let\csname @gr@d@\gr@dorig\endcsname\tr@e
\x@\let\csname @gr@d@\gr@dnormal\endcsname\tr@e
\x@\let\csname @gr@d@\gr@dsmart\endcsname\tr@e
\x@\let\csname @gr@d@\gr@dnone\endcsname\false
\x@\let\csname @gr@d@\gr@dheading\endcsname\false

% General matching values
\def\relaxval{\relax}
\def\h@phen{-} % for matching
{\catcode`+=11 
 \catcode`-=11
 \catcode`\^=12 
 \catcode`\(=12
 \gdef\pl@sLtr{+}
 \gdef\m@nusLtr{-}
 \gdef\br@Ltr{(}
 \global\let\cflexLtr ^
}
\def\c@lon{:}
\def\equ@ls{=}
\def\tru@{true}% for matching

%style stack
\def\ss@Para{P}%
\def\ss@Char{C}% Basic \foo char style
\def\ss@char{C}% Basic \foo char style
\def\ss@ChrP{c}% Stacking \+foo char style
\def\ss@chrp{c}% Stacking \+foo char style
\def\ss@Note{N}%
\def\ss@MstnS{M}% Static milestones (unused)
\def\ss@Mstn{m}% Floating milestones (always above a par style)
\def\ss@Ctgy{t}%Category
\def\ss@ParCtgy{T}% A category attached to (ended by) a paragraph style
\def\ss@Sbar{s}%
\def\ss@Tbl{b}% table 
\def\ss@Fig{f}% figure 
\def\ss@File{F}% start/end of file 

%Barcode
\def\bc@short{short}
\def\bc@medium{medium}

% special attribute values
\def\zv@r{zvar}
\edef\zv@@r{\detokenize{zvar}}


% Functional constants
\gdef\mcstack@mpty{++,} 
\def\cstackempty{,}
\def\n@ID{UNK}

%Margin notes positions
\def\@uter{outer}
\def\@nner{inner}
\def\@top{top}
\def\@bottom{bottom}
\def\@inline{inline}
% Rule types for graphpaper, grid, etc.
\def\m@jor{Major}
\def\m@nor{Minor}

\def\usc@re{_}
\def\periph@sep@print@name{insert} % Prefix for separate printing.

% Comparisons with detokenized strings
\edef\dt@macro{\detokenize{macro:}}
\edef\dt@undefined{\detokenize{undefined}}
\edef\dt@marker{\detokenize{marker}}

% colour/thinline styles and types
\def\tls@nochk{nocheck}
\def\tls@black{black}
\def\tls@white{white}
\def\tls@colour{colour}
\def\tls@grey{grey}
\def\tlt@R{Rule}
\def\tlt@C{Curve}
\def\@pt@{pt}

% standard categories
\def\c@ttoc{cat:toc|}
% standard numbers
\def\el@ven{11} % Letter
\def\tw@lve{12} % Other
\def\f@urteen{14} % comment

% Diglot
\def\d@glotl{L}
