summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/rec-thy
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-03-02 03:04:42 +0000
committerNorbert Preining <norbert@preining.info>2021-03-02 03:04:42 +0000
commit4763ec8ceefaf2b038d591b8c15d88d081aec6c9 (patch)
tree113e7c21358dd01318b8e7a1e3f3228ec33bc563 /macros/latex/contrib/rec-thy
parent3a1a102e980610859d9f1b197733d6ce6a541c62 (diff)
CTAN sync 202103020304
Diffstat (limited to 'macros/latex/contrib/rec-thy')
-rw-r--r--macros/latex/contrib/rec-thy/README2
-rw-r--r--macros/latex/contrib/rec-thy/rec-thy.pdfbin113253 -> 121041 bytes
-rw-r--r--macros/latex/contrib/rec-thy/rec-thy.sty373
-rw-r--r--macros/latex/contrib/rec-thy/rec-thy.tex33
4 files changed, 241 insertions, 167 deletions
diff --git a/macros/latex/contrib/rec-thy/README b/macros/latex/contrib/rec-thy/README
index 0d4e624988..2524d9cc5e 100644
--- a/macros/latex/contrib/rec-thy/README
+++ b/macros/latex/contrib/rec-thy/README
@@ -37,3 +37,5 @@ Github URL: https://github.com/TruePath/Recursion-Theory-Latex-Package
05/08/2020 - v3.3 Fixed/added tweak to overline so it looks correct. Also added real symbols so that \subfunneq and \supfunneq can be defined appropriately. Fixed incorrect use of tiny in math mode.
06/01/2020 - v3.3.1 Fixed typo causing error under pdflatex.
06/04/2020 - v3.4 Eliminated dependence on undertilde which is missing from texlive
+v3.5 - Added \Hop command and misc code cleanup.
+v3.6 - Fixed \REA[n] so that dash is shorter. Added BeamerRequirements to add a block for requirements in beamer and fixed the requirements environment for beamer. Fixed \req* command. Improved syntax for \recfnl so it can accept a () delimited argument via the same standard as \REset and \recf. Improved \setcol to allow it to be used repeatedly without typesetting bugs. Changed the code and pair commands to use only a single angle bracket.
diff --git a/macros/latex/contrib/rec-thy/rec-thy.pdf b/macros/latex/contrib/rec-thy/rec-thy.pdf
index d466d49ff6..783a3ef95d 100644
--- a/macros/latex/contrib/rec-thy/rec-thy.pdf
+++ b/macros/latex/contrib/rec-thy/rec-thy.pdf
Binary files differ
diff --git a/macros/latex/contrib/rec-thy/rec-thy.sty b/macros/latex/contrib/rec-thy/rec-thy.sty
index a758fe43fc..b02e529891 100644
--- a/macros/latex/contrib/rec-thy/rec-thy.sty
+++ b/macros/latex/contrib/rec-thy/rec-thy.sty
@@ -1,7 +1,29 @@
-\NeedsTeXFormat{LaTeX2e}
+% \NeedsTeXFormat{LaTeX2e}
% Release Notes see README
-\def\recthyVersion{3.4}
-\ProvidesPackage{rec-thy}[2020/06/04 v\recthyVersion Provides commands for writing up recursion theory papers]
+\RequirePackage{expl3}
+\RequirePackage{ltxcmds}
+\RequirePackage{expl3}
+\RequirePackage{ifxetex,ifpdf}
+\RequirePackage{suffix}
+\RequirePackage{ifmtarg}
+\RequirePackage{xifthen}
+\RequirePackage{xkeyval}
+\RequirePackage{etoolbox}
+\RequirePackage{pict2e,picture}
+\RequirePackage{xparse}
+\def\recthyVersion{3.6}
+\ProvidesExplPackage
+ {rec-thy}
+ {2021/02/28}
+ {\recthyVersion}
+ {Provides commands for writing up recursion theory papers}
+
+
+
+\ExplSyntaxOff
+
+% \ProvidesExplPackage{rec-thy}{2020/06/04}{3.5}{Provides commands for writing up recursion theory papers} % Description
+% \ProvidesPackage{rec-thy}[2021/02/05 v\recthyVersion Provides commands for writing up recursion theory papers]
\makeatletter
% \newcommand*{\@curpack}{\@currname} %rec-thy.sty
\newcommand*{\@packinfo}[1]{\PackageInfo{rec-thy}{#1}}
@@ -15,18 +37,12 @@
% \ProvidesPackage{\@curpack} %file name is package name
-\RequirePackage{ltxcmds}
-\RequirePackage{ifxetex,ifpdf}
-\RequirePackage{suffix}
-\RequirePackage{ifmtarg}
-\RequirePackage{xifthen}
-\RequirePackage{xkeyval}
-\RequirePackage{etoolbox}
-\RequirePackage{pict2e,picture}
+
\robustify\(
\robustify\)
-\RequirePackage{xparse}
+
\AtBeginDocument{
+% \@ifundefined{hyperref}{\providecommand{\texorpdfstring}[2]{def} }
\ltx@ifpackageloaded{amsmath}{}{\RequirePackage{amsmath}}
\ltx@ifpackageloaded{amssymb}{}{\RequirePackage{amssymb}}
\ltx@ifpackageloaded{amsfonts}{}{\RequirePackage{amsfonts}}
@@ -46,9 +62,6 @@
}
% \ifxetex %workaround for bug...hopefully can dispense on later
-% \gdef\symbf#1{\symbf{#1}}
-% \fi
-% \global\let\symbf=\symbf
\ifxetex
\else
\def\symbf#1{\mathbf{#1}}
@@ -108,11 +121,13 @@
\newif\ifrecthy@noreqhelper \recthy@noreqhelperfalse
\newif\ifrecthy@nosubfun \recthy@nosubfunfalse
\newif\ifrecthy@nopfcases \@ifclassloaded{beamer}{\recthy@nopfcasestrue}{\recthy@nopfcasesfalse}
+\newif\ifrecthy@beamersupp \@ifclassloaded{beamer}{\recthy@beamersupptrue}{\recthy@beamersuppfalse}
\newif\ifrecthy@noprioritytrees \recthy@noprioritytreesfalse
\newif\ifrecthy@nosuppprioritytrees \recthy@nosuppprioritytreestrue
\newif\ifrecthy@hyperreqs \recthy@hyperreqstrue
\newif\ifrecthy@nooperators \recthy@nooperatorsfalse
\newif\ifrecthy@fix@typeset \recthy@fix@typesettrue
+\newif\ifrecthy@nodoubleangles \recthy@nodoubleanglesfalse
%\newif\ifrecthy@nomodule \recthy@nomodulefalse
\DeclareOptionX{nohyphenation}{\recthy@nohyphenationtrue}
@@ -142,10 +157,16 @@
\DeclareOptionX{nohyperreqs}{\recthy@hyperreqsfalse}
\DeclareOptionX{nooperators}{\recthy@nooperatorstrue}
\DeclareOptionX{compat31}{\recthy@compat@threeOne}
+\DeclareOptionX{compat35}{\recthy@compat@threeFive}
\DeclareOptionX{nofixtype}{\ifrecthy@fix@typesetfalse}
+\DeclareOptionX{nodoubleangles}{\ifrecthy@nodoubleanglestrue}
+
+
+\newcommand*{\recthy@rollback@threeTwo}{}
+\newcommand*{\recthy@rollback@threeSix}{}
+\newcommand*{\recthy@compat@threeFive}{\recthy@rollback@threeSix}
+\newcommand*{\recthy@compat@threeOne}{\recthy@compat@threeFive\recthy@rollback@threeTwo}
-\newcommand*{\recthy@compat@threeOne}{\recthy@rollback@threeTwo@threeOne@REA}
-\newcommand*{\recthy@rollback@threeTwo@threeOne@REA}{}
%\DeclareOptionX{nomodule}{\recthy@nomoduletrue}
\DeclareOptionX{degjoin}{\def\Tjoin{\Tdegjoin}}
@@ -391,16 +412,6 @@
\end{picture}%
}
-% \newcommand{\not@pnrelbar}{%
-% \linethickness{\dimen2}%
-% \sbox\z@{$\m@th\nprec$}%
-% \dimen@=1.1\ht\z@
-% \begin{picture}(\dimen@,.4ex)
-% \roundcap
-% \put(0,.2ex){\line(1,0){\dimen@}}
-% \put(\dimexpr 0.5\dimen@-.2ex\relax,0){\line(1,1){.4ex}}
-% \end{picture}%
-% }
\newcommand{\@snrelbar}{%
\linethickness{\dimen2}%
@@ -413,16 +424,6 @@
\end{picture}%
}
-% \newcommand{\not@snrelbar}{%
-% \linethickness{\dimen2}%
-% \sbox\z@{$\m@th\nsucc$}%
-% \dimen@=1.1\ht\z@
-% \begin{picture}(\dimen@,.4ex)
-% \roundcap
-% \put(0,.2ex){\line(1,0){\dimen@}}
-% \put(\dimexpr 0.5\dimen@-.2ex\relax,0){\line(1,1){.4ex}}
-% \end{picture}%
-% }
\newcommand{\@precneq}{\mathrel{\vcenter{\hbox{\text{\prec@neq}}}}}
\newcommand{\prec@neq}{%
@@ -435,16 +436,6 @@
}%
}
-% \newcommand{\@nprecneq}{\mathrel{\vcenter{\hbox{\text{\nprec@neq}}}}}
-% \newcommand{\nprec@neq}{%
-% \dimen2=\f@size\dimexpr.04pt\relax
-% \oalign{%
-% \noalign{\kern\dimexpr.2ex-.5\dimen2\relax}
-% $\m@th\nprec$\cr
-% \noalign{\kern-.5\dimen2}
-% \hidewidth\not@pnrelbar\hidewidth\cr
-% }%
-% }
\newcommand{\@succneq}{\mathrel{\vcenter{\hbox{\text{\succ@neq}}}}}
\newcommand{\succ@neq}{%
@@ -457,16 +448,6 @@
}%
}
-% \newcommand{\@nsuccneq}{\mathrel{\vcenter{\hbox{\text{\nsucc@neq}}}}}
-% \newcommand{\nsucc@neq}{%
-% \dimen2=\f@size\dimexpr.04pt\relax
-% \oalign{%
-% \noalign{\kern\dimexpr.2ex-.5\dimen2\relax}
-% $\m@th\nprec$\cr
-% \noalign{\kern-.5\dimen2}
-% \hidewidth\not@snrelbar\hidewidth\cr
-% }%
-% }
\NewDocumentCommand{\subfun}{o}{\prec\IfNoValueTF{#1}{}{_{#1}}}
\NewDocumentCommand{\supfun}{o}{\succ\IfNoValueTF{#1}{}{_{#1}}}
@@ -485,6 +466,10 @@
\let\@recthy@reqscr\mathscr
\DeclareOptionX{reqscr}[mathscr]{\letcs{\@recthy@reqscr}{#1}}
+% \DeclareOptionX{beamerreq}[@recthy@EmptyStr@Default]{\letcs{\@recthy@EmptyStr}{#1}}
+
+\newcommand*{\@pmg@saveeqstate}{\let\@origif@fleqn@pmg=\if@fleqn \let\@origiftagsleft@pmg=\iftagsleft@}
+\newcommand*{\@pmg@restoreeqstate}{ \let\if@fleqn=\@origif@fleqn@pmg\let\iftagsleft@=\@origiftagsleft@pmg}
\AtEndOfPackage{
@@ -492,40 +477,29 @@
\@packinfo{Not loading requirement assist.}
\else
\@packinfo{Loading requirement assist.}
- \newcommand*{\req@orig}[3][]{\ensuremath{\ifthenelse{\isempty{#1}}{\@recthy@reqscr{#2}_{#3}}{\@recthy@reqscr{#2}^{#1}_{#3}}}}
+ % \newcommand*{\req@beamer}[3][]{\ensuremath{\@recthy@reqscr{#2}^{#1}_{#3}}}
+ \newcommand*{\req@orig}[3]{\ensuremath{\@ifmtarg{#1}{\@recthy@reqscr{#2}_{#3}}{\@recthy@reqscr{#2}_{#3}^{#1}}}}
+ \NewDocumentCommand{\req@nohref}{sO{}mO{}m}{\req@orig{#2#4}{#3}{#5}}
+ \NewDocumentCommand{\req@href}{O{}mO{}m}{\hyperref[\detokenize{req:#2@#1#3}]{\req@orig{#1#3}{#2}{#4}}}
- \NewDocumentCommand{\req@href}{O{}mO{}m}{\@ifundefined{hyperref}{\req@orig[#1#3]{#2}{#4}}{\hyperref[\detokenize{req:#2@#1#3}]{\req@orig[#1#3]{#2}{#4}}}}
- \NewDocumentCommand{\req@nohref}{O{}mO{}m}{\req@orig[#1#3]{#2}{#4}}
+ \NewDocumentCommand\req@href@star{s}{\IfBooleanTF#1{\req@nohref}{\req@href}}
+ \newcommand{\req}{\req@nohref}
\ifrecthy@hyperreqs
- \let\req=\req@href
- \else
- \let\req=\req@nohref
+ \AtBeginDocument{\@ifundefined{hyperref}{}{\let\req=\req@href@star}}
\fi
- \WithSuffix\def\req*{\req@nohref}
- % \newsavebox{\@recthy@reqbox}
- % \def\defreq#1#2\par{
- % \begin{equation}\let\veqno\@@leqno%
- % \tag*{#1}%
- % \begin{lrbox}{\@recthy@reqbox}%
- % \begin{minipage}{\textwidth}#2\end{minipage}%
- % \end{lrbox}%
- % \makebox[0pt]{\usebox{\@recthy@reqbox}}%
- % \end{equation}}
+
\newtagform{colon}{}{:}
+ % \@ifclassloaded{beamer}{\def\setmmonefivecm{\@mathmargin{1.5cm}}}{\def\setmmonefivecm{\setlength\@mathmargin{1.5cm}}}%
\newenvironment{requirement}[1]{
- \let\@origif@fleqn@pmg=\if@fleqn
- \let\@origiftagsleft@pmg=\iftagsleft@
+ \@pmg@saveeqstate
\@fleqntrue
\setlength\@mathmargin{1.5cm}
\tagsleft@true
\usetagform{colon}
- % \let\maketag@@@orig@pmg=\maketag@@@
- % \def\maketag@@@#1{\hbox{\m@th\normalfont#1:}}
\begin{equation}\tag{#1}
}{
\end{equation}
- \let\if@fleqn=\@origif@fleqn@pmg
- \let\iftagsleft@=\@origiftagsleft@pmg
+ \@pmg@restoreeqstate
\usetagform{default}
% \let\maketag@@@=\maketag@@@orig@pmg
}
@@ -535,26 +509,54 @@
}{
\end{requirement}%
}
- % \NewDocumentEnvironment{require*}{O{}mO{}m}{
- % \begin{requirement}{\req@nohref[#1#3]{#2}{#4}}%
- % }{
- % \end{requirement}%
- % }
+ \NewDocumentEnvironment{require*}{O{}mO{}m}{
+ \begin{requirement}{\req@nohref[#1#3]{#2}{#4}}
+ }{
+ \end{requirement}%
+ }
+
+
+
\NewDocumentCommand{\refreq}{O{}mO{}}{\ref{\detokenize{req:#2@#1#3}}}
\NewDocumentCommand{\require@nested}{sO{}mO{}m}{
- \IfBooleanTF{#1}{\tag{\req@nohref[#2#4]{#3}{#5}}}{\tag{\req@nohref[#2#4]{#3}{#5}}\label{\detokenize{req:#3@#2#4}}}
+ \tag{\req@nohref[#2#4]{#3}{#5}}\IfBooleanTF{#1}{}{\label{\detokenize{req:#3@#2#4}}}
}
- % \newcommand*{\require@nested}{\require@nested@href}
- % \WithSuffix\def\require@nested*{\require@nested@nohref}
- % \NewDocumentEnvironment{require*}{O{}mO{}m}{
- % \tag{\req@nohref[#1#3]{#2}{#4}}%
- % }{}
- \NewDocumentEnvironment{requirements}{}{
- \let\@origif@fleqn@pmg=\if@fleqn
- \let\@origiftagsleft@pmg=\iftagsleft@
+
+\ifrecthy@beamersupp
+ \newtheorem{reqblock}{Requirements}
+ \let\OLDreqblock=\reqblock
+ \def\reqblock{%
+ \setbeamercolor{block title}{fg=white,bg=Maroon}%
+ \setbeamercolor{block body}{fg=black,bg=Maroon!10}\OLDreqblock
+ }
+
+ \NewDocumentCommand{\require@beamer}{sO{}mO{}m}{\tag{$\@ifmtarg{#2#4}{\mathscr{#3}_{#5}}{\mathscr{#3}_{#5}^{#2#4}}$} \IfBooleanTF{#1}{}{\label{\detokenize{req:#3@#2#4}}} & }
+
+ \NewDocumentEnvironment{BeamerRequirements}{d<>b}{\IfValueTF{#1}{\begin{reqblock}<#1>}{\begin{reqblock}}%
+ \vspace*{-.5cm}
+ \usetagform{colon} %
+ \let\myhalign\halign%
+ \def\halign{\let\mylb\\ \renewcommand{\\}{& \mylb}\myhalign}%
+ \let\require=\require@beamer %
+ \begin{flalign*}%
+ #2 &
+ \end{flalign*}%
+ \end{reqblock}}{}
+
+ \NewDocumentEnvironment{requirements}{b}{\usetagform{colon} %
+ \let\myhalign\halign%
+ \def\halign{\let\mylb\\ \renewcommand{\\}{& \mylb}\myhalign}%
+ \let\require=\require@beamer %
+ \begin{flalign*}%
+ #1 &
+ \end{flalign*}}{}
+ \else
+
+ \NewDocumentEnvironment{requirements}{}{
+ \@pmg@saveeqstate
\@fleqntrue
\setlength\@mathmargin{1.5cm}
\tagsleft@true
@@ -565,12 +567,14 @@
\gather
}{
\endgather
- \let\if@fleqn=\@origif@fleqn@pmg
- \let\iftagsleft@=\@origiftagsleft@pmg
+ \@pmg@restoreeqstate
\usetagform{default}
% \let\maketag@@@=\maketag@@@orig@pmg
}
+ \fi
+
+
\fi
}
@@ -663,15 +667,14 @@
\providecommand*{\restr}[1]{\mathpunct{\restriction_{#1}}}
\providecommand*{\ordpair}[2]{\left( #1, #2 \right) }
%%%%%%%%Function commands
- \let\recthy@rollback@threeTwo@threeOne@REA@mathsave=\recthy@rollback@threeTwo@threeOne@REA
- \renewcommand*{\recthy@rollback@threeTwo@threeOne@REA}{
+
+ \appto{\recthy@rollback@threeTwo}{
\providecommand*{\map}[2]{:##1\mapsto ##2}
\providecommand*{\functo}[3]{##1\map{##2}{##3}}
\ifdefined\funcomp
\else
\let\funcomp=\compfunc
\fi
- \recthy@rollback@threeTwo@threeOne@REA@mathsave
}
\providecommand*{\compfunc}{\mathbin{\circ}}
@@ -719,8 +722,8 @@
\fi
}
-\newcommand*{\@recthy@llangle}{\mathopen{\langle\!\langle}}
-\newcommand*{\@recthy@rrangle}{\mathclose{\rangle\!\rangle}}
+\newcommand*{\@recthy@llangle}{\langle\!\langle}
+\newcommand*{\@recthy@rrangle}{\rangle\!\rangle}
@@ -758,8 +761,11 @@
\newcommand*{\godelnum}[1]{\left\ulcorner #1 \right\urcorner}
\let\cornerquote=\godelnum
\let\gcode=\godelnum
- \recthy@strip{llangle}
- \recthy@strip{rrangle}
+ \ifrecthy@nodoubleangles
+ \else
+ \let\llangle=\@recthy@llangle
+ \let\rrangle=\@recthy@rrangle
+ \fi
\fi
}
@@ -779,9 +785,9 @@
\newcommand*{\@recthy@ComputablyEnumerable}{\@recthy@ensuretext{Computably enumerable}}
\def\@recthy@REA{REA}
\def\@recthy@CEA{CEA}
-
-\NewDocumentCommand{\REA}{d()o}{\ensuremath{\IfValueTF{#2}{#2-}{}\text{\@recthy@REA}\IfValueTF{#1}{[#1]}{}}}
-\NewDocumentCommand{\CEA}{d()o}{\ensuremath{\IfValueTF{#2}{#2-}{}\text{\@recthy@CEA}\IfValueTF{#1}{[#1]}{}}}
+\mathchardef\@recthy@mhyphen="2D % Define a "math hyphen"
+\NewDocumentCommand{\REA}{d()o}{\ensuremath{\IfValueTF{#2}{#2 \@recthy@mhyphen}{}\text{\@recthy@REA}\IfValueTF{#1}{(#1)}{}}}
+\NewDocumentCommand{\CEA}{d()o}{\ensuremath{\IfValueTF{#2}{#2 \@recthy@mhyphen}{}\text{\@recthy@CEA}\IfValueTF{#1}{(#1)}{}}}
% \newcommand*{\@recthy@REA}{\ensuremath{\text{REA}}}
% \WithSuffix\def\@recthy@REA[#1]{#1-\@recthy@REA\relax}
@@ -857,8 +863,6 @@
\newcommand*{\@recthy@nin}{\notin}
\newcommand*{\@recthy@powset}[1]{\mathcal{P}\left(#1\right)}
\newcommand*{\@recthy@eset}{\emptyset}
-% \newcommand*{\@recthy@setcmpminusSYM}{\backsim}
-% \newcommand*{\@recthy@setminuscmp}[1]{\mathop{\@recthy@setcmpminusSYM} #1}
\newcommand*{\@recthy@setovercmp}[1]{\overline{#1}}
\newcommand*{\@recthy@setsimcmp}[1]{\backsim #1}
\let\@recthy@setcmp=\@recthy@setovercmp
@@ -918,6 +922,8 @@
\let\forall@orig@recthy=\forall
\newcommand*{\exists@recthy}{\exists@orig@recthy}
\newcommand*{\forall@recthy}{\forall@orig@recthy}
+ % \NewDocumentCommand{\exists@paren@recthy}{O{}m}{\left(\exists@orig@recthy^{#1} #2 \right)\!}
+ % \NewDocumentCommand{\exists@brak@recthy}{O{}m}{\left[\exists@orig@recthy^{#1} #2 \right]\!}
\let\nexists@orig@recthy=\nexists
\newcommand*{\nexists@recthy}{\nexists@orig@recthy}
\let\nforall@orig@recthy=\nforall
@@ -925,7 +931,6 @@
\newcommand*{\existsuniq}{\exists@orig@recthy !}
\newcommand*{\nexistsuniq}{\nexists@orig@recthy !}
- \NewDocumentCommand{\axset}{D<>{}d()O{}d()}
\WithSuffix\def\existsuniq(#1){\left(\existsuniq #1 \right)\!}
\WithSuffix\def\nexistsuniq(#1){\left(\nexistsuniq #1 \right)\!}
\WithSuffix\def\existsuniq[#1]{\left[\existsuniq #1 \right]\!}
@@ -947,7 +952,9 @@
\WithSuffix\def\nexistsinf(#1){\left(\nexistsinf #1\right)\!}
\WithSuffix\def\nexistsinf[#1]{\left[\nexistsinf #1\right]\!}
+
\WithSuffix\def\exists@recthy(#1){\left(\exists #1 \right)\!}
+ % \NewDocumentCommand{\exists@recthy}{d()od()o}{\IfValueTF{#1}{\exists@paren@recthy{#1}}{\IfValueTF{#1}{\exists@brak@recthy{#2}} } }
\WithSuffix\def\forall@recthy(#1){\left(\forall #1 \right)\!}
\WithSuffix\def\nexists@recthy(#1){\left(\nexists #1 \right)\!}
\WithSuffix\def\exists@recthy[#1]{\left[\exists #1 \right]\!}
@@ -1001,51 +1008,8 @@
}
-%Strings
-\def\@recthy@concatSYM@Default{\widehat{\phantom{X}}}
-\def\@recthy@EmptyStr@Default{\mathopen{\langle}\mathclose{\rangle}}
-\let\@recthy@concatSYM\@recthy@concatSYM@Default
-\let\@recthy@EmptyStr\@recthy@EmptyStr@Default
-\DeclareOptionX{emptystr}[@recthy@EmptyStr@Default]{\letcs{\@recthy@EmptyStr}{#1}}
-\DeclareOptionX{concatsym}[@recthy@concatSYM@Default]{\letcs{\@recthy@concatSYM}{#1}}
-\newcommand*{\@recthy@pair}[2]{\mathopen{\@recthy@llangle} #1, #2 \mathclose{\@recthy@rrangle}}
-\NewDocumentCommand{\incompat@recthy}{o}{\mathrel{\mid}\IfValueTF{#1}{_{#1}}{}}
-\NewDocumentCommand{\compat@recthy}{o}{\mathrel{\not\mid}\IfValueTF{#1}{_{#1}}{}}
-
-\AtEndOfPackage{
-\ifrecthy@nostrings
- \@packinfo{No strings loading.}
-\else
- \@packinfo{Strings loading.}
- \newcommand*{\closedn}[1]{{#1}^\blacktriangledown}
- \newcommand*{\str}[1]{\mathopen{\langle}#1\mathclose{\rangle}}
- \newcommand*{\code}[1]{\mathopen{\@recthy@llangle}#1\mathclose{\@recthy@rrangle}}
- \newcommand*{\EmptyStr}{\@recthy@EmptyStr}
- \newcommand*{\estr}{\EmptyStr}
- \newcommand*{\decode}[2]{(#1)_{#2}}
- \let\godelpair=\@recthy@pair
- \let\gpair=\@recthy@pair
- \newcommand*{\concat}{\@recthy@concatSYM}
- \WithSuffix\def\concat[#1]{\concat\str{#1}}
- \newcommand*{\strpred}[1]{{#1}^{-}}
- \providecommand*{\lh}[2][]{\@recthy@abs{#2}_{#1}} %% Gives length of a string
-
- \providecommand*{\incompat}{\incompat@recthy} %incompatible stringes FIX SPACING
- \providecommand*{\incomp}{\incompat@recthy}
- \providecommand*{\compat}{\compat@recthy}
- \providecommand*{\nincompat}{\compat@recthy}
- \providecommand*{\nincomp}{\compat@recthy}
- \newcommand*{\setcol}[2]{{#1}^{[#2]}}
- \ifrecthy@nopair
- \@packinfo{No redefining pair.}
- \else
- \@packinfo{pair=godelpair.}
- \let\pair=\@recthy@pair
- \fi
-\fi
-}
\AtEndOfPackage{
\ifrecthy@notrees
@@ -1688,7 +1652,13 @@
% \newcommand*{\recf}[3][]{\@recthy@recfSYM^{#1}_{#2}\ifthenelse{\isempty{#3}}{}{\left(#3\right)}} %If give an empty arg just print function no parens
%\newcommand*{\brecf}[3][]{\brecfSYM^{#1}_{#2}\ifthenelse{\isempty{#3}}{}{\left(#3\right)}}
%\recfnl[d]{i}{Y}{x} gives i-th d-recursive functional operating on set Y and integer x
- \newcommand*{\recfnl}[4][]{\@recthy@recfnlSYM_{#2\ifthenelse{\isempty{#1}}{}{,{#1}} }%
+
+ \NewDocumentCommand{\recfnl@improved}{omm!g!d()}{{
+ \def\temp@pmg@arg{}
+ \IfValueTF{#4}{\ifthenelse{\isempty{#4}}{}{\def\temp@pmg@arg{; #4}}}{\IfValueTF{#5}{\ifthenelse{\isempty{#5}}{}{\def\temp@pmg@arg{; #5}}}}
+ \@recthy@recfnlSYM_{#2\IfValueT{#1}{, #1}}\ifthenelse{\isempty{#3}}{}{\!\left(#3\temp@pmg@arg \right)}
+ }}
+ \newcommand*{\recfnl@old}[4][]{\@recthy@recfnlSYM_{#2\ifthenelse{\isempty{#1}}{}{,{#1}} }%
\ifthenelse{\isempty{#4}}%
{\ifthenelse{\isempty{#3}}%
{}% No args then print no parents
@@ -1696,6 +1666,10 @@
}%If no oracle we just refer to the functional without any arguments
{\ifthenelse{\isempty{#3}}{(#4)}{(#3;#4)}%
}}
+ \let\recfnl=\recfnl@improved
+ \appto{\recthy@rollback@threeSix}{
+ \let\recfnl=\recfnl@old
+ }
\NewDocumentCommand{\recf}{od()md()}{
\@recthy@recfSYM_{#3\IfNoValueTF{#1}{}{\ifthenelse{\isempty{#3}}{}{, }{#1}}}\IfNoValueTF{#2}{}{^{#2}}\IfNoValueTF{#4}{}{(#4)}
}
@@ -1746,10 +1720,9 @@
% \NewDocumentCommand{\nconv}{o}{\mathpunct{\mkern-4mu{\arrownot\mkern 4mu \downarrow}_{#1}}}
\NewDocumentCommand{\nconv}{O{}}{\mathpunct{\mkern-4mu{\smallsetminus\mkern 4mu \downarrow}_{#1}}}
\newcommand*{\diverge}{\mathpunct{\uparrow}}
- % \newcommand*{\use}[2]{\mathscr{u}(#1\ifthenelse{\isempty{#2}}{}{,#2})}
\newcommand*{\use}[1]{\mathop{\@recthy@useSYM}\left[#1\right]}
% \newcommand*{\use}[1]{\ltx@ifpackageloaded{unicode-math}{\symbffrak{u}}{\mathfrak{u}}\left(#1\right)}
- % \NewDocumentCommand{\REset}{omd()}{
+ % \NewDocumentCommand{\REset}{D(){}omd()}{
% W_{#2\IfNoValueTF{#1}{}{, #1}}\IfNoValueTF{#3}{}{^{#3}}
% }
@@ -1764,20 +1737,27 @@
\fi}
\WithSuffix\def\@REsetbody(#1){\def\@PMG@parenarg{#1}\@REsetbody}
\WithSuffix\def\@REsetbody[#1]{\def\@PMG@braketarg{#1}\@REsetbody}
- \NewDocumentCommand{\REAop}{st+d()od()mm}{{\IfBooleanTF{#1}{\mathcal{J}}{\widehat{\mathcal{J}}}}^{\IfBooleanTF{#1}{\vphantom{x}^\dagger}{}#7}_{#6\IfValueTF{#4}{, #4}{}} \IfValueTF{#3}{\left(#3\right)}{\IfValueTF{#5}{\left(#5\right)}{}}}
- \NewDocumentCommand{\oneREAop}{st+d()od()m}{{\IfBooleanTF{#1}{\mathcal{J}}{\widehat{\mathcal{J}}}}^{\IfBooleanTF{#1}{\vphantom{x}^\dagger}{}}_{#6\IfValueTF{#4}{, #4}{}} \IfValueTF{#3}{\left(#3\right)}{\IfValueTF{#5}{\left(#5\right)}{}}}
+ \NewDocumentCommand{\Hop}{oD(){}mD(){}}{\mathcal{H}_{#3\IfValueTF{#1}{, #1}{}}\left(\ifthenelse{\isempty{#2#4}}{\eset}{#2#4} \right)}
+ \NewDocumentCommand{\REAop}{st+d()od()mm}{%
+ {\IfBooleanTF{#1}%
+ {\mathcal{J}}%
+ {\widehat{\mathcal{J}}}%
+ }^{%
+ \IfBooleanTF{#2}{\vphantom{x}^\dagger}{}%
+ #7}_{#6\IfValueTF{#4}{, #4}{}}%
+ \IfValueTF{#3}{\left(#3\right)}{\IfValueTF{#5}{\left(#5\right)}{}}%
+ }
+ \NewDocumentCommand{\oneREAop}{st+d()od()m}{{\IfBooleanTF{#1}{\mathcal{J}}{\widehat{\mathcal{J}}}}^{\IfBooleanTF{#1}{\vphantom{x}^\dagger}{}}_{#6\IfValueTF{#4}{, #4}{}} \IfValueTF{#3}{\left(#3\right)}{\IfValueTF{#5}{\left(#5\right)}{}}}
\let\iREAop=\oneREAop
\newcommand*{\entersat}[1]{\mathbin{\searrow_{#1}}}
% \newcommand*{\alphaREAop}[2][]{\mathcal{J}^{#2}_{#1}}
- \let\recthy@rollback@threeTwo@threeOne@REA@computationssave=\recthy@rollback@threeTwo@threeOne@REA
- \renewcommand*{\recthy@rollback@threeTwo@threeOne@REA}{
+ \appto{\recthy@rollback@threeTwo}{
\let\reaop=\REAop
\let\alphaREAop=\REAop
\let\aREAop=\alphaREAop
- \recthy@rollback@threeTwo@threeOne@REA@computationssave
}
@@ -1878,6 +1858,25 @@
}
+%Strings
+ \def\@recthy@concatSYM@Default{\widehat{\phantom{X}}}
+ \def\@recthy@EmptyStr@Default{\mathopen{\langle}\mathclose{\rangle}}
+ \let\@recthy@concatSYM\@recthy@concatSYM@Default
+ \let\@recthy@EmptyStr\@recthy@EmptyStr@Default
+
+ \DeclareOptionX{emptystr}[@recthy@EmptyStr@Default]{\letcs{\@recthy@EmptyStr}{#1}}
+ \DeclareOptionX{concatsym}[@recthy@concatSYM@Default]{\letcs{\@recthy@concatSYM}{#1}}
+ \newcommand*{\@recthy@pair}[2]{\mathopen{\langle} #1, #2 \mathclose{\rangle}}
+ \newcommand*{\@recthy@str}[1]{\mathopen{\langle}#1\mathclose{\rangle}}
+ \newcommand*{\@recthy@code}[1]{\mathopen{\langle}#1\mathclose{\rangle}}
+
+ \appto{\recthy@rollback@threeSix}{
+ \renewcommand*{\@recthy@pair}[2]{\mathopen{\@recthy@llangle} #1, #2 \mathclose{\@recthy@rrangle}}
+ \def\@recthy@EmptyStr@Default{\mathopen{\langle}\mathclose{\rangle}}
+ % \renewcommand*{\@recthy@str}[1]{\mathopen{\langle}#1\mathclose{\rangle}}
+ \renewcommand*{\@recthy@code}[1]{\mathopen{\@recthy@llangle}#1\mathclose{\@recthy@rrangle}}
+ \newcommand*{\closedn}[1]{{#1}^\blacktriangledown}
+ }
% \ProcessOptions*
% \ProcessOptionsX<\@recthy@family>
@@ -1886,6 +1885,62 @@
+\NewDocumentCommand{\incompat@recthy}{o}{\mathrel{\mid}\IfValueTF{#1}{_{#1}}{}}
+\NewDocumentCommand{\compat@recthy}{o}{\mathrel{\not\mid}\IfValueTF{#1}{_{#1}}{}}
+
+\ifrecthy@nostrings
+ \@packinfo{No strings loading.}
+\else
+ \@packinfo{Strings loading.}
+ \let\code=\@recthy@code
+ \let\str=\@recthy@str
+ \newcommand*{\EmptyStr}{\@recthy@EmptyStr}
+ \newcommand*{\estr}{\EmptyStr}
+ \newcommand*{\decode}[2]{(#1)_{#2}}
+ \let\godelpair=\@recthy@pair
+ \let\gpair=\@recthy@pair
+ \newcommand*{\concat}{\@recthy@concatSYM}
+ \WithSuffix\def\concat[#1]{\concat\str{#1}}
+ \newcommand*{\strpred}[1]{{#1}^{-}}
+ \providecommand*{\lh}[2][]{\@recthy@abs{#2}_{#1}} %% Gives length of a string
+
+ \providecommand*{\incompat}{\incompat@recthy} %incompatible stringes FIX SPACING
+ \providecommand*{\incomp}{\incompat@recthy}
+ \providecommand*{\compat}{\compat@recthy}
+ \providecommand*{\nincompat}{\compat@recthy}
+ \providecommand*{\nincomp}{\compat@recthy}
+ % \newcommand*{\setcol}[2]{{#1}^{[#2]}}
+ \ExplSyntaxOn %thx stackexghance
+ \NewDocumentCommand \setcol {m m}
+ {
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn { \tl_count:n {#1} } = 3 }
+ { \tl_if_head_eq_meaning_p:nN {#1} \setcol }
+ {
+ \pgerdes_setcol_special:nnnn #1 {#2}
+ }
+ {
+ \pgerdes_setcol_normal:nn {#1} {#2}
+ }
+ }
+ \cs_new:Npn \pgerdes_setcol_special:nnnn #1 #2 #3 #4
+ {
+ {#2} \sp { [#3] [#4] }
+ }
+ \cs_new:Npn \pgerdes_setcol_normal:nn #1 #2
+ {
+ {#1} \sp { [#2] }
+ }
+ \ExplSyntaxOff
+
+ \ifrecthy@nopair
+ \@packinfo{No redefining pair.}
+ \else
+ \@packinfo{pair=godelpair.}
+ \let\pair=\@recthy@pair
+ \fi
+\fi
+
diff --git a/macros/latex/contrib/rec-thy/rec-thy.tex b/macros/latex/contrib/rec-thy/rec-thy.tex
index e43e148ec3..a73dc445e8 100644
--- a/macros/latex/contrib/rec-thy/rec-thy.tex
+++ b/macros/latex/contrib/rec-thy/rec-thy.tex
@@ -49,7 +49,6 @@
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{xtab}
-\usepackage[suppPriorityTrees]{rec-thy}
\usepackage{suffix}
\usepackage{metalogo}
@@ -60,6 +59,17 @@
% Running Headers and footers
%\usepackage{fancyhdr}
\usepackage[parfill]{parskip}
+\usepackage{etoolbox}
+\makeatletter
+\patchcmd{\@maketitle}
+ {\ifx\@empty\@dedicatory}
+ {\ifx\@empty\@date \else {\vskip3ex \centering\footnotesize\@date\par\vskip1ex}\fi
+ \ifx\@empty\@dedicatory}
+ {}{}
+\patchcmd{\@adminfootnotes}
+ {\ifx\@empty\@date\else \@footnotetext{\@setdate}\fi}
+ {}{}{}
+\makeatother
%\usepackage{setspace}
% Multipart figures
@@ -78,7 +88,7 @@
%\usepackage[pdftex]{graphicx}
%\DeclareGraphicsExtensions{.pdf, .jpg, .tif}
-
+\usepackage[suppPriorityTrees]{rec-thy}
\title{The rec-thy Package}
\author{Peter M. Gerdes (gerdes@invariant.org)}
\date{\DateOfPackage{rec-thy}: Version \recthyVersion}
@@ -125,6 +135,7 @@ While the symbols used by default in the package are suggested for adoption to a
\item[recfsym] Sets the symbol used for recursive functions. Default is \( \phi \).
\item[usesym] Sets the symbol used for the use operator. Default is \( \symbffrak{u} \) where this is printed using \verb=\symbfrak= if unicode-math is loaded and with \verb=\mathfrak= otherwise.
\item[ballsymb] Sets the symbol used for the ball command. Default is \( \mathscr{B} \).
+ \item[nodoubleangles] Prevents redefinition of \verb=\rrangle= and \verb=\llangle= with versions that use the repeated angle brackets e.g., lets you use the weird XITS versions.
\end{itemize}
As an example of how to use these commands consider the following code changing the ball symbol to \( \mathbf{B} \).
@@ -193,10 +204,14 @@ To disable these commands pass the option \verb=nocomputations=. \\ To specify
\verb=\recfnl{e}{}{x}\nconv= & \( \recfnl{e}{}{x}\nconv \) &\multirow{2}{*}{Divergence} \\[6pt]
\tab \verb=\recfnl{e}{}{x}\nconv[s]= & \( \recfnl{e}{}{x}\nconv[s] \) & \\ \midrule
\verb=\use{\recfnl{e}{Y}{x}}= & \( \use{\recfnl{e}{Y}{x}} \) & Use of a computation. \\ \midrule
- \verb=\REset{e}= & \( \REset{e} \) & \multirow{4}{*}{c.e. sets} \\[6pt]
- \verb=\REset[s]{e}= & \( \REset[s]{e} \) & \\[6pt]
- \verb=\REset(X){e}= & \( \REset(X){e} \) & \\[6pt]
- \verb=\REset[s](X){e}= & \( \REset[s](X){e} \) & \\ \midrule
+ \verb=\REset{e}= & \( \REset{e} \) & \multirow{4}{*}{c.e. sets} \\[6pt]
+ \verb=\REset[s]{e}= & \( \REset[s]{e} \) & \\[6pt]
+ \verb=\REset(X){e}= & \( \REset(X){e} \) & \\[6pt]
+ \verb=\REset[s](X){e}= & \( \REset[s](X){e} \) & \\ \midrule
+ \verb=\Hop{e}(X)= & \( \Hop{e}(X) \) & \multirow{4}{*}{Hop sets} \\[6pt]
+ \verb=\Hop[s](X){e}= & \( \Hop[s](X){e} \) & \\[6pt]
+ \verb=\Hop[s]{e}= & \( \Hop[s]{e} \) & \\[6pt]
+ \verb=\Hop{e}= & \( \Hop{e} \) & \\ \midrule
\verb=\iREAop{e}(\eset)= & \multirow{2}{*}{\( \iREAop{e}(\eset) \)} &\multirow{2}{*}{1-REA operator} \\
\tab \verb=\oneREAop{e}(\eset)= & & \\ \midrule
% \verb=\alphaREAop{\alpha}(\eset)= & \multirow{2}{*}{\( \alphaREAop{\alpha}(\eset) \)} &\multirow{2}{*}{\( \alpha \)-REA operator} \\[6pt]
@@ -260,7 +275,7 @@ To disable these commands pass the option \verb=nodegrees=. \\
\makeatletter
\subsection{Requirement Assistance}
To disable these commands pass the option \verb=noreqhelper=. To disable the hyperlinked requirements pass \verb=nohyperreqs=\\
-Math mode is not required for \verb=\req{R}{e\}=
+Math mode is not required for \verb=\req{R}{e}=
\begin{tabular}{l | l | l}\toprule
\verb=\req{R}{e}= & \( \req{R}{e} \) & \multirow{3}{*}{Requirement } \\ \midrule
@@ -572,7 +587,7 @@ To disable these commands pass the option \verb=noforcing=.\\
\subsection{Syntax}
To disable these commands pass the option \verb=nosyntax=.\\ All syntax classes can be relativized with an optional argument in square brackets even when not listed below. Only the \( \Delta \) formula classes are listed below since the syntax is identical for \( \Sigma \) and \( \Pi \). Capitalizing the first letter gives the boldface version in all cases (except the computable infinitary formulas as this doesn't make sense). Not all formulas/abbreviations are demonstrated below given the huge number but the enough are included to make it clear what command is required to generate the desired formula class, e.g., substituting pi for delta does what you think it does.
-To change the syntax for the computable infinitary formulas you can pass the options \verb!cdeltasym=macroname!, \verb!csigmasym=macroname! and \verb!cpisym=macroname! where macroname is the name (without the leading \\) of the macro giving the desired symbol to use for the relevant class.
+To change the syntax for the computable infinitary formulas you can pass the options \verb!cdeltasym=macroname!, \verb!csigmasym=macroname! and \verb!cpisym=macroname! where macroname is the name (without the leading \verb=\=) of the macro giving the desired symbol to use for the relevant class.
\begin{xtabular}{l | l | l}\toprule
\verb=\Cdeltan[X]{\alpha}= & \( \Cdeltan[X]{2} \) & The computable \( \delta^{X}_\alpha \) formulas \\ \midrule
@@ -685,6 +700,8 @@ Finally to enable the mrref helper macros pass the option \verb=mrref=.\\ These
% TESTING: \verb=\fpmapsto=, \verb=\fpmapsfrom=, \verb=\ParFuncs{Y}{X}= and \verb=\FinParFuncs{Y}{X}=
\begin{itemize}
+ \item[3.6] Fixed \verb=\REA[n]= so that dash is shorter. Added BeamerRequirements to add a block for requirements in beamer and fixed the requirements environment for beamer. Fixed \verb=\req*= error. Improved syntax for \verb=\recfnl= so it can accept a parenthesis delimited argument as the oracle. Improved \verb=\setcol= to allow it to be used in a nested fashion without typesetting bugs. Changed the \verb=\code= and \verb=\pair= commands to use only a single angle bracket.
+ \item[3.5] Added \verb=\Hop= and misc code cleanup.
\item[3.4] Eliminated dependence on undertilde which is missing from texlive
\item[3.3.1] Fixed typo causing error under pdflatex.
\item[3.3] - Fixed/added tweak to overline so it looks correct. Also added real symbols so that \verb=\subfunneq= and \verb=\supfunneq= can be defined appropriately. Added \verb=\floor= and \verb=\ceil=. Note these aren't yet shown off in package doc. Fixed incorrect use of tiny in math mode.