diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/rec-thy/rec-thy.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/rec-thy/rec-thy.sty | 373 |
1 files changed, 214 insertions, 159 deletions
diff --git a/Master/texmf-dist/tex/latex/rec-thy/rec-thy.sty b/Master/texmf-dist/tex/latex/rec-thy/rec-thy.sty index a758fe43fc1..b02e5298912 100644 --- a/Master/texmf-dist/tex/latex/rec-thy/rec-thy.sty +++ b/Master/texmf-dist/tex/latex/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 + |