diff options
author | Karl Berry <karl@freefriends.org> | 2022-02-27 16:49:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-02-27 16:49:46 +0000 |
commit | c489a98a6a396006c547b314a4ab73516a044c0d (patch) | |
tree | 2f15c67e98c5f62ddceefb627329ae0d3779dee1 /Master/texmf-dist/tex | |
parent | 474aac9fa41d2e4b66266cd5402fa48bf972e381 (diff) |
stex (26feb22) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2021.final@62231 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
59 files changed, 7635 insertions, 3281 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/cmath/cmath.sty b/Master/texmf-dist/tex/latex/stex/cmath/cmath.sty deleted file mode 100644 index b34e72973b0..00000000000 --- a/Master/texmf-dist/tex/latex/stex/cmath/cmath.sty +++ /dev/null @@ -1,38 +0,0 @@ -%% -%% This is file `cmath.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% cmath.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{cmath}[2019/03/20 v0.1 inline content math] -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{presentation}} -\ProcessOptions -\RequirePackage{presentation} - -\newcommand\vname[2][]{#2% -\def\@opt{#1}% -\ifx\@opt\@empty\else\expandafter\gdef\csname MOD@name@#1\endcsname{#2}\fi} -\def\vnref#1{\csname MOD@name@#1\endcsname} -\newcommand\primvar[2][]{\vname[#1]{#2^\prime}} -\newcommand\pprimvar[2][]{\vname[#1]{#2^{\prime\prime}}} -\newcommand\uivar[3][]{\vname[#1]{{#2}^{#3}}} -\newcommand\livar[3][]{\vname[#1]{{#2}_{#3}}} -\newcommand\ulivar[4][]{\vname[#1]{{#2}^{#3}_{#4}}} -\newcommand\nappa[3][]{\prefix[#1]{#2}{#3}} -\newcommand\nappe[4][]{\nappa[#1]{#2}{#3,\ldots,#4}} -\newcommand\nappf[5][]{\nappe[#1]{#2}{#3{#4}}{#3{#5}}} -\newcommand\nappli[5][]{\nappe[#1]{#2}{#3_{#4}}{#3_{#5}}} -\newcommand\nappui[5][]{\nappe[#1]{#2}{#3^{#4}}{#3^{#5}}} -\newcommand\anappa[3][]{\assoc[#1]{#2}{#3}} -\newcommand\anappe[4][]{\anappa[#1]{#2}{#3,\ldots,#4}} -\newcommand\anappf[5][]{\anappe[#1]{#2}{#3{#4}}{#3{#5}}} -\newcommand\anappli[5][]{\anappe[#1]{#2}{#3_{#4}}{#3_{#5}}} -\newcommand\anappui[5][]{\anappe[#1]{#2}{#3^{#4}}{#3^{#5}}} -\def\LXMID#1#2{\expandafter\gdef\csname xmarg#1\endcsname{#2}\csname xmarg#1\endcsname} -\def\LXMRef#1{\csname xmarg#1\endcsname} -\endinput -%% -%% End of file `cmath.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty b/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty deleted file mode 100644 index 64343862c27..00000000000 --- a/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty +++ /dev/null @@ -1,87 +0,0 @@ -%% -%% This is file `dcm.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% dcm.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{dcm}[2019/03/20 v0.3 Dublin Core Metadata] -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{rdfmeta} - \PassOptionsToPackage{\CurrentOption}{workaddress}} -\ProcessOptions -\RequirePackage{workaddress} -\RequirePackage[sectioning]{rdfmeta} -\newenvironment{DCmetadata}[1][]% -{\def\@style{#1}}% to set the way things are presented. -{\@ifundefined{dcm@\@style @block}% -{\message{style {\@style} not defined}}% -{\csname dcm@\@style @block\endcsname}} -\def\DCMcreators#1{\@for\@I:=#1\do{\wa@ref1{person}\@I{id}} -\gdef\dcm@creators{#1}} -\def\DCMcontributors#1{\@for\@I:=#1\do{\wa@ref1{person}\@I{id}}% -\def\dcm@contributors{#1}} -\def\DCMtitle#1{\def\dcm@title{#1}\providecommand{\dcm@shorttitle}{#1}} -\def\dcm@subtitle{} -\def\DCMsubtitle#1{\def\dcm@subtitle{#1}} -\def\dcm@shorttitle{} -\def\DCMshorttitle#1{\def\dcm@shorttitle{#1}} -\def\DCMsubject#1{\def\dcm@subject{#1}} -\long\def\DCMdescription#1{\long\def\dcm@description{#1}} -\def\DCMpublisher#1{\def\dcm@publisher{#1}} -\def\dcm@date{\today} -\def\DCMdate#1{\def\dcm@date{#1}} -\def\DCMtype#1{\def\dcm@type{#1}} -\def\DCMidentifier#1#2{\def\dcm@scheme{#1}\def\dcm@identifier{#2}} -\def\DCMsource#1{\def\dcm@source{#1}} -\def\DCMlanguage#1{\def\dcm@language{#1}} -\def\DCMrelation#1{\def\dcm@relation{#1}} -\def\DCMrights#1{\long\def\dcm@rights{#1}} -\def\DCMlicense#1{\def\dcm@license{#1}} -\def\dcm@license{All rights reserved} -\def\DCMlicensenotice#1{\long\def\dcm@license{\\[1ex]License: #1}} -\def\DCMcopyrightnotice#1#2{\DCMrights{Copyright {\copyright} #1: #2}} -\def\cclicense#1{\def\attribution{\def\dcm@by{yes}} - \def\noncommercial{\def\dcm@nc{yes}} - \def\sharealike{\defdcm@sharealike{yes}} - \def\noderivativeworks{\def\dcm@derivatives{no}}} -\long\def\DCMabstract#1{\long\def\dcm@abstract{#1}} -\def\dcm@titlepage@block{\begin{titlepage} - \null\vfil\vskip 60\p@ - \begin{center} - \ifx\dcm@title\@empty - \PackageWarning{dcm}{No title specified}{\LARGE Add title here\par} - \else\LARGE \dcm@title \par\fi - \ifx\dcm@subtitle\@empty - \vskip 3em\Large \dcm@subtitle \par\vskip 3em - \else\large\lineskip .75em\WAauthorblock\dcm@creators\vskip 1.5em\fi - \ifx\dcm@date\@empty - \PackageWarning{dcm}{No date specified}{\large\today\par} - \else{\large\dcm@date\par}\vskip 2em\fi - \end{center}\vskip2em - \ifx\dcm@abstract\@empty - \PackageWarning{dcm}{No Abstract specified}\else - \begin{quote}\textbf\dcm@abstract@heading:\dcm@abstract\end{quote}\fi - \vskip 2em\par\vfil\noindent - {\small\noindent\dcm@rights\dcm@license} - \end{titlepage}} -\def\dcm@maketitle@block{\def\@title{\dcm@title\ifx\dcm@subtitle\empty\else\newline\dcm@subtitle\fi}% -\def\@author{\WAauthorblock\dcm@creators}% -\def\@date{\dcm@date}\maketitle} -\def\ISOtimestamp{\count1=\time\divide\count1 by 60 % hours -\count2=\count1\multiply\count2 by 60% minutes in \count1 hours -\count3=\time\advance\count3 by -\count2 % minutes -\the\year -\ifnum\month>9\else0\fi\the\month-\ifnum\day>9\else0\fi\the\day -T\ifnum\count1>9\else0\fi\the\count1:\ifnum\count3>9\else0\fi\the\count3:00Z} -\def\dcm@abstract@heading{Abstract} -\def\dcm@creators@heading{Author(s)} -\def\dcm@contributors@connector{with contributions from} -\def\dcm@chapter@heading{Chapter} -\def\dcm@section@heading{Section} -\def\dcm@subsection@heading{Subsection} -\def\dcm@subsubsection@heading{Subsubsection} -\def\dcm@paragraph@heading{Paragraph} -\endinput -%% -%% End of file `dcm.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/document-structure.cls b/Master/texmf-dist/tex/latex/stex/document-structure.cls new file mode 100644 index 00000000000..1c70de1c5f5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/document-structure.cls @@ -0,0 +1,53 @@ +%% +%% This is file `document-structure.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% document-structure.dtx (with options: `cls') +%% +\ProvidesExplClass{document-structure}{2022/02/26}{3.0.1}{Modular Document Structure Class} +\RequirePackage{l3keys2e} +\keys_define:nn{ document-structure / pkg }{ + class .str_set_x:N = \c_document_structure_class_str, + minimal .bool_set:N = \c_document_structure_minimal_bool, + report .code:n = { + \ClassWarning{document-structure}{the option 'report' is deprecated, use 'class=report', instead} + \str_set:Nn \c_document_structure_class_str {report} + }, + book .code:n = { + \ClassWarning{document-structure}{the option 'book' is deprecated, use 'class=book', instead} + \str_set:Nn \c_document_structure_class_str {book} + }, + bookpart .code:n = { + \ClassWarning{document-structure}{the option 'bookpart' is deprecated, use 'class=book,topsect=chapter', instead} + \str_set:Nn \c_document_structure_class_str {book} + \str_set:Nn \c_document_structure_topsect_str {chapter} + }, + docopt .str_set_x:N = \c_document_structure_docopt_str, + unknown .code:n = { + \PassOptionsToPackage{ \CurrentOption }{ document-structure } + } +} +\ProcessKeysOptions{ document-structure / pkg } +\str_if_empty:NT \c_document_structure_class_str { + \str_set:Nn \c_document_structure_class_str {article} +} +\exp_after:wN\LoadClass\exp_after:wN[\c_document_structure_docopt_str] + {\c_document_structure_class_str} + +\RequirePackage{document-structure} +\bool_if:NF \c_document_structure_minimal_bool { +\keys_define:nn { document-structure / document }{ + id .str_set_x:N = \c_document_structure_document_id_str +} +\let\__document_structure_orig_document=\document +\renewcommand{\document}[1][]{ + \keys_set:nn{ document-structure / document }{ #1 } + \stex_ref_new_doc_target:n { \c_document_structure_document_id_str } + \__document_structure_orig_document +} +} +\endinput +%% +%% End of file `document-structure.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/document-structure.sty b/Master/texmf-dist/tex/latex/stex/document-structure.sty new file mode 100644 index 00000000000..e2d031b4cb9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/document-structure.sty @@ -0,0 +1,264 @@ +%% +%% This is file `document-structure.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% document-structure.dtx (with options: `package') +%% +\ProvidesExplPackage{document-structure}{2022/02/26}{3.0.1}{Modular Document Structure} +\RequirePackage{l3keys2e} + +\keys_define:nn{ document-structure / pkg }{ + class .str_set_x:N = \c_document_structure_class_str, + topsect .str_set_x:N = \c_document_structure_topsect_str, +} +\ProcessKeysOptions{ document-structure / pkg } +\str_if_empty:NT \c_document_structure_class_str { + \str_set:Nn \c_document_structure_class_str {article} +} +\str_if_empty:NT \c_document_structure_topsect_str { + \str_set:Nn \c_document_structure_topsect_str {section} +} +\RequirePackage{xspace} +\RequirePackage{comment} +\AddToHook{begindocument}{ +\ltx@ifpackageloaded{babel}{ + \clist_set:Nx \l_tmpa_clist {\bbl@loaded} + \clist_if_in:NnT \l_tmpa_clist {ngerman}{ + \makeatletter\input{document-structure-ngerman.ldf}\makeatother + } + }{} +} +\int_new:N \l_document_structure_section_level_int +\str_case:VnF \c_document_structure_topsect_str { + {part}{ + \int_set:Nn \l_document_structure_section_level_int {0} + } + {chapter}{ + \int_set:Nn \l_document_structure_section_level_int {1} + } +}{ + \str_case:VnF \c_document_structure_class_str { + {book}{ + \int_set:Nn \l_document_structure_section_level_int {0} + } + {report}{ + \int_set:Nn \l_document_structure_section_level_int {0} + } + }{ + \int_set:Nn \l_document_structure_section_level_int {2} + } +} +\def\current@section@level{document}% +\newcommand\currentsectionlevel{\lowercase\expandafter{\current@section@level}\xspace}% +\newcommand\Currentsectionlevel{\expandafter\MakeUppercase\current@section@level\xspace}% +\cs_new_protected:Npn \skipomgroup { + \ifcase\l_document_structure_section_level_int + \or\stepcounter{part} + \or\stepcounter{chapter} + \or\stepcounter{section} + \or\stepcounter{subsection} + \or\stepcounter{subsubsection} + \or\stepcounter{paragraph} + \or\stepcounter{subparagraph} + \fi +} +\newcommand\at@begin@blindomgroup[1]{} +\newenvironment{blindfragment} +{ + \int_incr:N\l_document_structure_section_level_int + \at@begin@blindomgroup\l_document_structure_section_level_int +}{} +\newcommand\omgroup@nonum[2]{ + \ifx\hyper@anchor\@undefined\else\phantomsection\fi + \addcontentsline{toc}{#1}{#2}\@nameuse{#1}*{#2} +} +\newcommand\omgroup@num[2]{ + \tl_if_empty:NTF \l__document_structure_omgroup_short_tl { + \@nameuse{#1}{#2} + }{ + \cs_if_exist:NTF\rdfmeta@sectioning{ + \@nameuse{rdfmeta@#1@old}[\l__document_structure_omgroup_short_tl]{#2} + }{ + \@nameuse{#1}[\l__document_structure_omgroup_short_tl]{#2} + } + } +} +\keys_define:nn { document-structure / omgroup }{ + id .str_set_x:N = \l__document_structure_omgroup_id_str, + date .str_set_x:N = \l__document_structure_omgroup_date_str, + creators .clist_set:N = \l__document_structure_omgroup_creators_clist, + contributors .clist_set:N = \l__document_structure_omgroup_contributors_clist, + srccite .tl_set:N = \l__document_structure_omgroup_srccite_tl, + type .tl_set:N = \l__document_structure_omgroup_type_tl, + short .tl_set:N = \l__document_structure_omgroup_short_tl, + display .tl_set:N = \l__document_structure_omgroup_display_tl, + intro .tl_set:N = \l__document_structure_omgroup_intro_tl, + loadmodules .bool_set:N = \l__document_structure_omgroup_loadmodules_bool +} +\cs_new_protected:Nn \__document_structure_omgroup_args:n { + \str_clear:N \l__document_structure_omgroup_id_str + \str_clear:N \l__document_structure_omgroup_date_str + \clist_clear:N \l__document_structure_omgroup_creators_clist + \clist_clear:N \l__document_structure_omgroup_contributors_clist + \tl_clear:N \l__document_structure_omgroup_srccite_tl + \tl_clear:N \l__document_structure_omgroup_type_tl + \tl_clear:N \l__document_structure_omgroup_short_tl + \tl_clear:N \l__document_structure_omgroup_display_tl + \tl_clear:N \l__document_structure_omgroup_intro_tl + \bool_set_false:N \l__document_structure_omgroup_loadmodules_bool + \keys_set:nn { document-structure / omgroup } { #1 } +} +\newif\if@mainmatter\@mainmattertrue +\newcommand\at@begin@omgroup[3][]{} +\keys_define:nn { document-structure / sectioning }{ + name .str_set_x:N = \l__document_structure_sect_name_str , + ref .str_set_x:N = \l__document_structure_sect_ref_str , + clear .bool_set:N = \l__document_structure_sect_clear_bool , + clear .default:n = {true} , + num .bool_set:N = \l__document_structure_sect_num_bool , + num .default:n = {true} +} +\cs_new_protected:Nn \__document_structure_sect_args:n { + \str_clear:N \l__document_structure_sect_name_str + \str_clear:N \l__document_structure_sect_ref_str + \bool_set_false:N \l__document_structure_sect_clear_bool + \bool_set_false:N \l__document_structure_sect_num_bool + \keys_set:nn { document-structure / sectioning } { #1 } +} +\newcommand\omdoc@sectioning[3][]{ + \__document_structure_sect_args:n {#1 } + \let\omdoc@sect@name\l__document_structure_sect_name_str + \bool_if:NT \l__document_structure_sect_clear_bool { \cleardoublepage } + \if@mainmatter% numbering not overridden by frontmatter, etc. + \bool_if:NTF \l__document_structure_sect_num_bool { + \omgroup@num{#2}{#3} + }{ + \omgroup@nonum{#2}{#3} + } + \def\current@section@level{\omdoc@sect@name} + \else + \omgroup@nonum{#2}{#3} + \fi +}% if@mainmatter +\newcommand\omgroup@redefine@addtocontents[1]{% +}% hypreref.sty loaded? +\newenvironment{sfragment}[2][]% keys, title +{ + \__document_structure_omgroup_args:n { #1 }%\sref@target% + \bool_if:NT \l__document_structure_omgroup_loadmodules_bool { + \omgroup@redefine@addtocontents{ + %\@ifundefined{module@id}\used@modules% + %{\@ifundefined{module@\module@id @path}{\used@modules}\module@id} + } + } + \int_incr:N\l_document_structure_section_level_int + \ifcase\l_document_structure_section_level_int + \or\omdoc@sectioning[name=\omdoc@part@kw,clear,num]{part}{#2} + \or\omdoc@sectioning[name=\omdoc@chapter@kw,clear,num]{chapter}{#2} + \or\omdoc@sectioning[name=\omdoc@section@kw,num]{section}{#2} + \or\omdoc@sectioning[name=\omdoc@subsection@kw,num]{subsection}{#2} + \or\omdoc@sectioning[name=\omdoc@subsubsection@kw,num]{subsubsection}{#2} + \or\omdoc@sectioning[name=\omdoc@paragraph@kw,ref=this \omdoc@paragraph@kw]{paragraph}{#2} + \or\omdoc@sectioning[name=\omdoc@subparagraph@kw,ref=this \omdoc@subparagraph@kw]{paragraph}{#2} + \fi + \at@begin@omgroup[#1]\l_document_structure_section_level_int{#2} + \str_if_empty:NF \l__document_structure_omgroup_id_str { + \stex_ref_new_doc_target:n\l__document_structure_omgroup_id_str + } +}% for customization +{} +\newcommand\omdoc@part@kw{Part} +\newcommand\omdoc@chapter@kw{Chapter} +\newcommand\omdoc@section@kw{Section} +\newcommand\omdoc@subsection@kw{Subsection} +\newcommand\omdoc@subsubsection@kw{Subsubsection} +\newcommand\omdoc@paragraph@kw{paragraph} +\newcommand\omdoc@subparagraph@kw{subparagraph} +\providecommand\printindex{\IfFileExists{\jobname.ind}{\input{\jobname.ind}}{}} +\cs_if_exist:NTF\frontmatter{ + \let\__document_structure_orig_frontmatter\frontmatter + \let\frontmatter\relax +}{ + \tl_set:Nn\__document_structure_orig_frontmatter{ + \clearpage + \@mainmatterfalse + \pagenumbering{roman} + } +} +\cs_if_exist:NTF\backmatter{ + \let\__document_structure_orig_backmatter\backmatter + \let\backmatter\relax +}{ + \tl_set:Nn\__document_structure_orig_backmatter{ + \clearpage + \@mainmatterfalse + \pagenumbering{roman} + } +} +\newenvironment{frontmatter}{ + \__document_structure_orig_frontmatter +}{ + \cs_if_exist:NTF\mainmatter{ + \mainmatter + }{ + \clearpage + \@mainmattertrue + \pagenumbering{arabic} + } +} +\newenvironment{backmatter}{ + \__document_structure_orig_backmatter +}{ + \cs_if_exist:NTF\mainmatter{ + \mainmatter + }{ + \clearpage + \@mainmattertrue + \pagenumbering{arabic} + } +} +\@mainmattertrue\pagenumbering{arabic} +\def \c__document_structure_document_str{document} +\newcommand\afterprematurestop{} +\def\prematurestop@endomgroup{ + \unless\ifx\@currenvir\c__document_structure_document_str + \expandafter\expandafter\expandafter\end\expandafter\expandafter\expandafter{\expandafter\@currenvir\expandafter} + \expandafter\prematurestop@endomgroup + \fi +} +\providecommand\prematurestop{ + \message{Stopping~sTeX~processing~prematurely} + \prematurestop@endomgroup + \afterprematurestop + \end{document} +} +\iffalse +\providecommand{\lxDocumentID}[1]{}% +\def\LXMID#1#2{\expandafter\gdef\csname xmarg#1\endcsname{#2}\csname xmarg#1\endcsname} +\def\LXMRef#1{\csname xmarg#1\endcsname} +\long\def\STRlabel#1#2{\STRlabeldef{#1}{#2}{#2}} +\newcommand\STRcopy[2][]{\expandafter\ifx\csname STR@#2\endcsname\relax +\message{STR warning: reference #2 undefined!} +\else\csname STR@#2\endcsname\fi} +\newcommand\STRsemantics[3][]{#2\def\@test{#1}\ifx\@test\@empty\STRlabeldef{#1}{#2}\fi} +\def\STRlabeldef#1{\expandafter\gdef\csname STR@#1\endcsname} +\fi +\RequirePackage{etoolbox} +\newcommand\setSGvar[1]{\@namedef{sTeX@Gvar@#1}} +\newrobustcmd\useSGvar[1]{% + \@ifundefined{sTeX@Gvar@#1} + {\PackageError{document-structure} + {The sTeX Global variable #1 is undefined} + {set it with \protect\setSGvar}} +\@nameuse{sTeX@Gvar@#1}} +\newrobustcmd\ifSGvar[3]{\def\@test{#2}% + \@ifundefined{sTeX@Gvar@#1} + {\PackageError{document-structure} + {The sTeX Global variable #1 is undefined} + {set it with \protect\setSGvar}} + {\expandafter\ifx\csname sTeX@Gvar@#1\endcsname\@test #3\fi}} +\endinput +%% +%% End of file `document-structure.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/etc/beamernotesthemesTeX.sty b/Master/texmf-dist/tex/latex/stex/etc/beamernotesthemesTeX.sty new file mode 100644 index 00000000000..af1c0c2a4c3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/etc/beamernotesthemesTeX.sty @@ -0,0 +1,14 @@ +% Beamer sTeX notes theme; +% Copyright (c) 2022 Michael Kohlhase <michael.kohlhase@fau.de>. +\ProvidesPackage{beamernotestheme-sTeX} +\typeout{Beamer sTeX notes theme} +\setbeamertemplate{theorem begin} +{% + \inserttheoremheadfont + \inserttheoremname + \inserttheoremnumber + \ifx \inserttheoremaddition \empty \else\ (\inserttheoremaddition)\fi + \inserttheorempunctuation\xspace + \inserttheorembodyfont +} +\setbeamertemplate{theorem end}{} diff --git a/Master/texmf-dist/tex/latex/stex/etc/beamerthemesTeX.sty b/Master/texmf-dist/tex/latex/stex/etc/beamerthemesTeX.sty new file mode 100644 index 00000000000..5d3a63c630c --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/etc/beamerthemesTeX.sty @@ -0,0 +1,61 @@ +% Beamer sTeX slide theme; +% Copyright (c) 20 Michael Kohlhase <michael.kohlhase@fau.de>. +\ProvidesPackage{beamertheme-sTeX} +\typeout{Beamer sTeX theme} +\RequirePackage{xspace} + +% General appearance of theorems, like "ams style", but without the block env. +\setbeamertemplate{theorem begin} +{% + \inserttheoremheadfont + \inserttheoremname + \inserttheoremnumber + \ifx \inserttheoremaddition \empty \else\ (\inserttheoremaddition)\fi + \inserttheorempunctuation\xspace + \inserttheorembodyfont +} +\setbeamertemplate{theorem end}{} + +% THEME +\mode +<presentation> + +%% Logo images +\pgfdeclareimage[height=2ex]{instlogo}{sTeX-logo} +\pgfdeclareimage[height=2ex]{cclogo}{cc_somerights} + +%% A simple frame title with a long rule under it. +\setbeamertemplate{frametitle}{% + \usebeamerfont{frametitle}\insertframetitle\strut% + \vskip-.1\baselineskip% + \leaders\vrule width \paperwidth\vskip0.4pt% + \vskip0pt% + \nointerlineskip +} + +%% A Footer line with a Institution and CC logos +\setbeamertemplate{footline}[text line]{% + \usebeamercolor[fg]{titlelike} + \pgfuseimage{instlogo}\hspace*{1cm}\insertshortauthor: \insertshorttitle\hfill{}% + \insertframenumber\hfill\insertshortdate\hspace*{1cm}\pgfuseimage{cclogo}% + } + +%% Turn off the navigation symbols +\setbeamertemplate{navigation symbols}{} + +%% Inner theme +\useinnertheme{default} +%\setbeamertemplate{enumerate item}{(\alph{enumi})} +%\setbeamertemplate{enumerate subitem}{(\roman{enumii})} + +\mode +<all> + +%% Redefine various margin sizes +\setbeamersize{text margin left=3mm} +\setbeamersize{text margin right=3mm} +\setbeamersize{description width=0.57cm} +\setlength\leftmargini{1em} +\setlength\leftmarginii{1em} +\setlength\leftmarginiii{1em} +\providecommand{\vstretch}[1]{\vspace*{\stretch{#1}}} diff --git a/Master/texmf-dist/tex/latex/stex/etc/hwexam-default.header b/Master/texmf-dist/tex/latex/stex/etc/hwexam-default.header new file mode 100644 index 00000000000..f3ee390bf90 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/etc/hwexam-default.header @@ -0,0 +1,30 @@ +\noindent\large{}Name: \hfill% +Matriculation Number:\hspace*{2cm}\strut\\[1ex] + +\begin{center} + \Large\textbf{\@title}\\[1ex] + \large\@date\\[3ex] +\end{center} + +\textbf{You have {\hwexamminutes} (sharp) for the test};\\ +Write the solutions to the sheet. + +\noindent +The estimated time for solving this exam is {\theassignment@totalmin} minutes, +leaving you {\check@time} minutes for revising your exam. + +\noindent +You can reach {\theassignment@totalpts} points if you solve all problems. +You will only need {\testheading@reqpts} points for a perfect score, i.e. +{\bonus@pts} points are bonus points. +\vfill +\begin{center} +{ + \Large\em You have ample time, so take it slow and avoid rushing + to mistakes!\\[2ex] + Different problems test different skills and knowledge, so do not + get stuck on one problem. +}\vfill + +\resizebox{\textwidth}{!}{\correction@table}\\[3ex] +\end{center}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/stex/etc/lststex.sty b/Master/texmf-dist/tex/latex/stex/etc/lststex.sty new file mode 100644 index 00000000000..e3865cb464d --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/etc/lststex.sty @@ -0,0 +1,45 @@ +\RequirePackage{xcolor} +\RequirePackage{listings} + +\lstdefinelanguage{pseudocode} +{morekeywords={procedure,function,end,loop,return,to,local,Value,fail,if,then,do,for,else,elif,foreach,in,true,false, + inputs,returns,persistent,repeat,until,while}, + morecomment=[s]{(*}{*)}, + morecomment=[s]{/*}{*/}, % preferred over (* ... *) + morecomment=[s][\sl]{<}{>} +} + +\lstdefinelanguage[sTeX]{TeX}[LaTeX]{TeX}% + {moretexcs={[2]defin,twindef,atwindef,definalt,twindefalt,atwindefalt,definiendum, + importmodule,usemodule,importmhmodule,usemhmodule,gimport,guse, + symdef,symvariant,symtest, + defi,defii,defiii,adefi,adefii,adefiii,defis,defiis,defiiis, + trefi,trefii,trefiii,atrefi,atrefii,atrefiii,mtrefi,mtrefii,mtrefiii, + trefis,trefiis,trefiiis,atrefis,atrefiis,atrefiiis, + symi,symii,symiii, + termref,sref}, + morekeywords={module,definition,axiom,assertion,omtext, + mhmodule,mhmodsig,mhmodnl,modsig,modnl, + inputref, + sproof,spfstep,spfcases,spfcase,justification,premise}} + +\definecolor{backcolor}{gray}{.96} + +\lstset{columns=fullflexible,basicstyle=\ttfamily} +\lstset{frame=none,numbers=none,lineskip=-.7ex}%,aboveskip=-1em,belowskip=-2em} +\lstset{keywordstyle=[2]\color{red},keywordstyle=[3]\color{blue}} +\lstset{keywordstyle=[4]\color{green},keywordstyle=[5]\color{magenta}} +\lstset{emphstyle=[2]\color{red},emphstyle=[3]\color{blue}} +\lstset{emphstyle=[4]\color{green},emphstyle=[5]\color{magenta}} +\lstset{commentstyle=\color{brown}} +\lstset{backgroundcolor=\color{backcolor}} +\newcommand{\lstkeycolor}[2]{\ifcase#1\textbf{#1}\or\red{#2}\or\blue{#2}\or\green{#2}\or\magenta{#2}\fi} +\define@key{stexlisting}{id}{\def\sref@id{#1}} +\define@key{stexlisting}{id}{\def\stexlst@id{#1}} + +% LocalWords: lstdefinelanguage morekeywords morecomment moretexcs defin sref +% LocalWords: twindef atwindef definalt twindefalt atwindefalt termref lstset +% LocalWords: basicstyle scriptsize fullflexible lineskip aboveskip belowskip +% LocalWords: keywordstyle keywordstyle newcommand lstkeycolor ifcase textbf +% LocalWords: stexlisting stexlst sproof spfstep symdef spfcases spfcase tt +% LocalWords: texcsstyle emphstyle emphstyle ttfamily diff --git a/Master/texmf-dist/tex/latex/stex/etc/rustex.sty b/Master/texmf-dist/tex/latex/stex/etc/rustex.sty new file mode 100644 index 00000000000..dafcc184eb5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/etc/rustex.sty @@ -0,0 +1,67 @@ +\ProvidesPackage{rustex}[2022/01/11] +\RequirePackage{xspace} + +\ifcsname if@rustex\endcsname\else + \expandafter\newif\csname if@rustex\endcsname + \@rustexfalse +\fi + +\if@rustex\else + \def\rustex@directHTML#1{} + % usage: plain HTML as argument, e.g. + % \rustex@directHTML{<div>foo</div>} + + \def\rustex@annotateHTML#1{} + \def\rustex@annotateHTMLEnd{} + % usage: First argument: attributes and styles + % attribute names may contain URL prefixes + % styles should be prefixed with style: + % second argument: The stuff that gets annotated + % e.g. + %\rustex@annotateHTML{rustex:mycolor="grey" style:fontsize="150\%"}hello\rustex@annotateHTMLEnd + + \def\rustex@addNamespaceAbbrev#1#2{} + % e.g. \rustex@addNamespaceAbbrev{stex}{http://kwarc.info/ns/sTeX} + \def\rustexBREAK{} +\fi + +\ifcsname ExplSyntaxOn\endcsname + \ExplSyntaxOn + \prg_new_conditional:Nnn \rustex_if: {p, T, F, TF} { + \if@rustex + \prg_return_true: + \else: + \prg_return_false: + \fi: + } + \cs_new_protected:Npn\rustex_direct_HTML:n #1 { + \rustex_if:T {\cs:w rustex@directHTML\cs_end:{#1}} + } + \cs_new_protected:Npn\rustex_annotate_HTML_begin:n #1 { + \rustex_if:T {\cs:w rustex@annotateHTML\cs_end:{#1}} + } + \cs_new_protected:Nn\rustex_annotate_HTML_end: { + \rustex_if:T {\cs:w rustex@annotateHTMLEnd\cs_end:} + } + \cs_new_protected:Npn\rustex_annotate_HTML:nn #1 #2 { + \rustex_if:TF { + \rustex_annotate_HTML_begin:n{#1} + #2 + \rustex_annotate_HTML_end: + }{#2} + } + \cs_new_protected:Npn\rustex_add_Namespace:nn #1 #2 { + \rustex_if:T { + \cs:w rustex@addNamespaceAbbrev\cs_end:{#1}{#2} + } + } + \ExplSyntaxOff +\fi + +\protected\def\RusTeX{% + \@ifundefined{texorpdfstring}% + {\let\texorpdfstring\@firstoftwo}% + {}% + \texorpdfstring{R\kern-0.1em\raise-0.1em\hbox{\scriptsize US}\kern-0.2em\TeX}{RusTeX}\xspace% +} +\let\rustex\RusTeX
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/stex/etc/stexthm.sty b/Master/texmf-dist/tex/latex/stex/etc/stexthm.sty new file mode 100644 index 00000000000..5f2071c4fea --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/etc/stexthm.sty @@ -0,0 +1,45 @@ +\ProvidesExplPackage{stexthm}{2022/02/24}{3.0.0}{Default Typesetting for sTeX Statements} + +\RequirePackage{stex} +\RequirePackage{amsthm} +\RequirePackage{thmtools} + +\declaretheorem[parent=section]{theorem} +\stexpatchassertion[theorem] +{\ifx\sassertiontitle\@empty\begin{theorem}\else\begin{theorem}[\sassertiontitle]\fi} +{\end{theorem}} + +\declaretheorem[sibling=theorem]{observation} +\stexpatchassertion[observation] +{\ifx\sassertiontitle\@empty\begin{observation}\else\begin{observation}[\sassertiontitle]\fi} +{\end{observation}} + +\declaretheorem[sibling=theorem]{corollary} +\stexpatchassertion[corollary] +{\ifx\sassertiontitle\@empty\begin{corollary}\else\begin{corollary}[\sassertiontitle]\fi} +{\end{corollary}} + +\declaretheorem[sibling=theorem]{lemma} +\stexpatchassertion[lemma] +{\ifx\sassertiontitle\@empty\begin{lemma}\else\begin{lemma}[\sassertiontitle]\fi} +{\end{lemma}} + +\declaretheorem[sibling=theorem]{axiom} +\stexpatchassertion[axiom] +{\ifx\sassertiontitle\@empty\begin{axiom}[type=axiom]\else\begin{axiom}[type=axiom,\sassertiontitle]\fi} +{\end{axiom}} + +\declaretheorem[sibling=theorem,style=remark]{remark} +\stexpatchassertion[remark] +{\ifx\sassertiontitle\@empty\begin{remark}\else\begin{remark}[\sassertiontitle]\fi} +{\end{remark}} + +\declaretheorem[sibling=theorem,style=definition]{example} +\stexpatchexample +{\ifx\sexampletitle\@empty\begin{example}\else\begin{example}[\sexampletitle]\fi} +{\end{example}} + +\declaretheorem[sibling=theorem,style=definition]{definition} +\stexpatchdefinition +{\ifx\sdefinitiontitle\@empty\begin{definition}\else\begin{definition}[\sdefinitiontitle]\fi} + {\end{definition}}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.cls b/Master/texmf-dist/tex/latex/stex/hwexam.cls index d436118c072..3d1427cb2ba 100644 --- a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.cls +++ b/Master/texmf-dist/tex/latex/stex/hwexam.cls @@ -6,16 +6,16 @@ %% %% hwexam.dtx (with options: `cls') %% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesClass{hwexam}[2019/03/20 v1.1 assignment and exam documents] +\ProvidesExplClass{hwexam}{2022/02/26}{3.0.1}{homework assignments and exams} +\RequirePackage{l3keys2e} \DeclareOption*{ - \PassOptionsToClass{\CurrentOption}{omdoc} + \PassOptionsToClass{\CurrentOption}{document-structure} \PassOptionsToPackage{\CurrentOption}{stex} \PassOptionsToPackage{\CurrentOption}{hwexam} \PassOptionsToPackage{\CurrentOption}{tikzinput} } \ProcessOptions -\LoadClass{omdoc} +\LoadClass{document-structure} \RequirePackage{stex} \RequirePackage{hwexam} \RequirePackage{tikzinput} @@ -25,8 +25,11 @@ \RequirePackage{amstext} \RequirePackage{amsmath} \newcommand\assig@default@type{\hwexam@assignment@kw} -\addmetakey[\assig@default@type]{document}{hwexamtype} \def\document@hwexamtype{\assig@default@type} +\keys_define:nn { document-structure / document }{ +id .str_set_x:N = \c_document_structure_document_id_str, +hwexamtype .tl_set:N = \document@hwexamtype +} \endinput %% %% End of file `hwexam.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/hwexam.sty b/Master/texmf-dist/tex/latex/stex/hwexam.sty new file mode 100644 index 00000000000..b1738e32924 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/hwexam.sty @@ -0,0 +1,298 @@ +%% +%% This is file `hwexam.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% hwexam.dtx (with options: `package') +%% +\ProvidesExplPackage{hwexam}{2022/02/26}{3.0.1}{homework assignments and exams} +\RequirePackage{l3keys2e} + +\newif\iftest\testfalse +\DeclareOption{test}{\testtrue} +\newif\ifmultiple\multiplefalse +\DeclareOption{multiple}{\multipletrue} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{problem}} +\ProcessOptions +\RequirePackage{keyval}[1997/11/10] +\RequirePackage{problem} +\newcommand\hwexam@assignment@kw{Assignment} +\newcommand\hwexam@given@kw{Given} +\newcommand\hwexam@due@kw{Due} +\newcommand\hwexam@testemptypage@kw{This~page~was~intentionally~left~ +blank~for~extra~space} +\def\hwexam@minutes@kw{minutes} +\newcommand\correction@probs@kw{prob.} +\newcommand\correction@pts@kw{total} +\newcommand\correction@reached@kw{reached} +\newcommand\correction@sum@kw{Sum} +\newcommand\correction@grade@kw{grade} +\newcommand\correction@forgrading@kw{To~be~used~for~grading,~do~not~write~here} +\AddToHook{begindocument}{ +\ltx@ifpackageloaded{babel}{ +\makeatletter +\clist_set:Nx \l_tmpa_clist {\bbl@loaded} +\clist_if_in:NnT \l_tmpa_clist {ngerman}{ + \input{hwexam-ngerman.ldf} +} +\clist_if_in:NnT \l_tmpa_clist {finnish}{ + \input{hwexam-finnish.ldf} +} +\clist_if_in:NnT \l_tmpa_clist {french}{ + \input{hwexam-french.ldf} +} +\clist_if_in:NnT \l_tmpa_clist {russian}{ + \input{hwexam-russian.ldf} +} +\makeatother +}{} +} + +\newcounter{assignment} +\numberproblemsin{assignment} +\renewcommand\prob@label[1]{\assignment@number.#1} +\keys_define:nn { hwexam / assignment } { +id .str_set_x:N = \l__hwexam_assign_id_str, +number .int_set:N = \l__hwexam_assign_number_int, +title .tl_set:N = \l__hwexam_assign_title_tl, +type .tl_set:N = \l__hwexam_assign_type_tl, +given .tl_set:N = \l__hwexam_assign_given_tl, +due .tl_set:N = \l__hwexam_assign_due_tl, +loadmodules .code:n = { +\bool_set_true:N \l__hwexam_assign_loadmodules_bool +} +} +\cs_new_protected:Nn \__hwexam_assignment_args:n { +\str_clear:N \l__hwexam_assign_id_str +\int_set:Nn \l__hwexam_assign_number_int {-1} +\tl_clear:N \l__hwexam_assign_title_tl +\tl_clear:N \l__hwexam_assign_type_tl +\tl_clear:N \l__hwexam_assign_given_tl +\tl_clear:N \l__hwexam_assign_due_tl +\bool_set_false:N \l__hwexam_assign_loadmodules_bool +\keys_set:nn { hwexam / assignment }{ #1 } +} +\newcommand\given@due[2]{ +\bool_lazy_all:nF { +{\tl_if_empty_p:V \l__hwexam_inclassign_given_tl} +{\tl_if_empty_p:V \l__hwexam_assign_given_tl} +{\tl_if_empty_p:V \l__hwexam_inclassign_due_tl} +{\tl_if_empty_p:V \l__hwexam_assign_due_tl} +}{ #1 } + +\tl_if_empty:NTF \l__hwexam_inclassign_given_tl { +\tl_if_empty:NF \l__hwexam_assign_given_tl { +\hwexam@given@kw\xspace\l__hwexam_assign_given_tl +} +}{ +\hwexam@given@kw\xspace\l__hwexam_inclassign_given_tl +} + +\bool_lazy_or:nnF { +\bool_lazy_and_p:nn { +\tl_if_empty_p:V \l__hwexam_inclassign_due_tl +}{ +\tl_if_empty_p:V \l__hwexam_assign_due_tl +} +}{ +\bool_lazy_and_p:nn { +\tl_if_empty_p:V \l__hwexam_inclassign_due_tl +}{ +\tl_if_empty_p:V \l__hwexam_assign_due_tl +} +}{ ,~ } + +\tl_if_empty:NTF \l__hwexam_inclassign_due_tl { +\tl_if_empty:NF \l__hwexam_assign_due_tl { +\hwexam@due@kw\xspace \l__hwexam_assign_due_tl +} +}{ +\hwexam@due@kw\xspace \l__hwexam_inclassign_due_tl +} + +\bool_lazy_all:nF { +{ \tl_if_empty_p:V \l__hwexam_inclassign_given_tl } +{ \tl_if_empty_p:V \l__hwexam_assign_given_tl } +{ \tl_if_empty_p:V \l__hwexam_inclassign_due_tl } +{ \tl_if_empty_p:V \l__hwexam_assign_due_tl } +}{ #2 } +} +\newcommand\assignment@title[3]{ +\tl_if_empty:NTF \l__hwexam_inclassign_title_tl { +\tl_if_empty:NTF \l__hwexam_assign_title_tl { +#1 +}{ +#2\l__hwexam_assign_title_tl#3 +} +}{ +#2\l__hwexam_inclassign_title_tl#3 +} +} +\newcommand\assignment@number{ +\int_compare:nNnTF \l__hwexam_inclassign_number_int = {-1} { +\int_compare:nNnTF \l__hwexam_assign_number_int = {-1} { +\arabic{assignment} +} { +\int_use:N \l__hwexam_assign_number_int +} +}{ +\int_use:N \l__hwexam_inclassign_number_int +} +} +\newenvironment{assignment}[1][]{ +\__hwexam_assignment_args:n { #1 } +\int_compare:nNnTF \l__hwexam_assign_number_int = {-1} { +\global\stepcounter{assignment} +}{ +\global\setcounter{assignment}{\int_use:N\l__hwexam_assign_number_int} +} +\setcounter{problem}{0} +\def\current@section@level{\document@hwexamtype} +\begin{@assignment} +}{ +\end{@assignment} +} +\def\ass@title{ +\protect\document@hwexamtype~\arabic{assignment} +\assignment@title{}{\;(}{)\;} -- \given@due{}{} +} +\ifmultiple +\newenvironment{@assignment}{ +\bool_if:NTF \l__hwexam_assign_loadmodules_bool { +\begin{sfragment}[loadmodules]{\ass@title} +}{ +\begin{sfragment}{\ass@title} +} +}{ +\end{sfragment} +} +\else +\newenvironment{@assignment}{ +\begin{center}\bf +\Large\@title\strut\\ +\document@hwexamtype~\arabic{assignment}\assignment@title{\;}{:\;}{\\} +\large\given@due{--\;}{\;--} +\end{center} +}{} +\fi% multiple +\keys_define:nn { hwexam / inclassignment } { +number .int_set:N = \l__hwexam_inclassign_number_int, +title .tl_set:N = \l__hwexam_inclassign_title_tl, +type .tl_set:N = \l__hwexam_inclassign_type_tl, +given .tl_set:N = \l__hwexam_inclassign_given_tl, +due .tl_set:N = \l__hwexam_inclassign_due_tl, +mhrepos .str_set_x:N = \l__hwexam_inclassign_mhrepos_str +} +\cs_new_protected:Nn \__hwexam_inclassignment_args:n { +\int_set:Nn \l__hwexam_inclassign_number_int {-1} +\tl_clear:N \l__hwexam_inclassign_title_tl +\tl_clear:N \l__hwexam_inclassign_type_tl +\tl_clear:N \l__hwexam_inclassign_given_tl +\tl_clear:N \l__hwexam_inclassign_due_tl +\str_clear:N \l__hwexam_inclassign_mhrepos_str +\keys_set:nn { hwexam / inclassignment }{ #1 } +} +\__hwexam_inclassignment_args:n {} + +\newcommand\inputassignment[2][]{ +\__hwexam_inclassignment_args:n { #1 } +\str_if_empty:NTF \l__hwexam_inclassign_mhrepos_str { +\input{#2} +}{ +\stex_in_repository:nn{\l__hwexam_inclassign_mhrepos_str}{ +\input{\mhpath{\l__hwexam_inclassign_mhrepos_str}{#2}} +} +} +\__hwexam_inclassignment_args:n {} +} +\newcommand\includeassignment[2][]{ +\newpage +\inputassignment[#1]{#2} +} +\ExplSyntaxOff +\newcommand\quizheading[1]{% +\def\@tas{#1}% +\large\noindent NAME: \hspace{8cm} MAILBOX:\\[2ex]% +\ifx\@tas\@empty\else% +\noindent TA:~\@for\@I:=\@tas\do{{\Large$\Box$}\@I\hspace*{1em}}\\[2ex]% +\fi% +} +\ExplSyntaxOn + +\def\hwexamheader{\input{hwexam-default.header}} + +\def\hwexamminutes{ +\tl_if_empty:NTF \testheading@duration { +{\testheading@min}~\hwexam@minutes@kw +}{ +\testheading@duration +} +} + +\keys_define:nn { hwexam / testheading } { +min .tl_set:N = \testheading@min, +duration .tl_set:N = \testheading@duration, +reqpts .tl_set:N = \testheading@reqpts, +tools .tl_set:N = \testheading@tools +} +\cs_new_protected:Nn \__hwexam_testheading_args:n { +\tl_clear:N \testheading@min +\tl_clear:N \testheading@duration +\tl_clear:N \testheading@reqpts +\tl_clear:N \testheading@tools +\keys_set:nn { hwexam / testheading }{ #1 } +} +\newenvironment{testheading}[1][]{ +\__hwexam_testheading_args:n{ #1 } +\newcount\check@time\check@time=\testheading@min +\advance\check@time by -\theassignment@totalmin +\newif\if@bonuspoints +\tl_if_empty:NTF \testheading@reqpts { +\@bonuspointsfalse +}{ +\newcount\bonus@pts +\bonus@pts=\theassignment@totalpts +\advance\bonus@pts by -\testheading@reqpts +\edef\bonus@pts{\the\bonus@pts} +\@bonuspointstrue +} +\edef\check@time{\the\check@time} + +\makeatletter\hwexamheader\makeatother +}{ +\newpage +} +\newcommand\testspace[1]{\iftest\vspace*{#1}\fi} +\newcommand\testnewpage{\iftest\newpage\fi} +\newcommand\testemptypage[1][]{\iftest\begin{center}\hwexam@testemptypage@kw\end{center}\vfill\eject\else\fi} +\renewcommand\@problem[3]{ +\stepcounter{assignment@probs} +\def\__problemspts{#2} +\ifx\__problemspts\@empty\else +\addtocounter{assignment@totalpts}{#2} +\fi +\def\__problemsmin{#3}\ifx\__problemsmin\@empty\else\addtocounter{assignment@totalmin}{#3}\fi +\xdef\correction@probs{\correction@probs & #1}% +\xdef\correction@pts{\correction@pts & #2} +\xdef\correction@reached{\correction@reached &} +} +\newcounter{assignment@probs} +\newcounter{assignment@totalpts} +\newcounter{assignment@totalmin} +\def\correction@probs{\correction@probs@kw} +\def\correction@pts{\correction@pts@kw} +\def\correction@reached{\correction@reached@kw} +\stepcounter{assignment@probs} +\newcommand\correction@table{ +\resizebox{\textwidth}{!}{% +\begin{tabular}{|l|*{\theassignment@probs}{c|}|l|}\hline% +&\multicolumn{\theassignment@probs}{c||}%| +{\footnotesize\correction@forgrading@kw} &\\\hline +\correction@probs & \correction@sum@kw & \correction@grade@kw\\\hline +\correction@pts &\theassignment@totalpts & \\\hline +\correction@reached & & \\[.7cm]\hline +\end{tabular}}} +\endinput +%% +%% End of file `hwexam.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty deleted file mode 100644 index 5c0e175cf0a..00000000000 --- a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty +++ /dev/null @@ -1,205 +0,0 @@ -%% -%% This is file `hwexam.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% hwexam.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{hwexam}[2019/03/20 v1.1 homework assignments and exams] -\newif\if@hwexam@mh@\@hwexam@mh@false -\DeclareOption{mh}{\@hwexam@mh@true} -\newif\iftest\testfalse -\DeclareOption{test}{\testtrue} -\newif\ifmultiple\multiplefalse -\DeclareOption{multiple}{\multipletrue} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{problem}} -\ProcessOptions -\RequirePackage{keyval}[1997/11/10] -\if@hwexam@mh@\RequirePackage{hwexam-mh}\fi -\RequirePackage{problem} -\AfterBabelLanguage{ngerman}{\input{hwexam-ngerman.ldf}} -\AfterBabelLanguage{arabic}{\input{hwexam-arabic.ldf}} -\newcommand\hwexam@assignment@kw{Assignment} -\newcommand\hwexam@given@kw{Given} -\newcommand\hwexam@due@kw{Due} -\newcommand\hwexam@testemptypage@kw{This page was intentionally left blank for extra - space}% -\newcommand\correction@probs@kw{prob.}% -\newcommand\correction@pts@kw{total}% -\newcommand\correction@reached@kw{reached}% -\newcommand\correction@sum@kw{Sum}% -\newcommand\correction@grade@kw{grade}% -\newcommand\correction@forgrading@kw{To be used for grading, do not write here} -\newcounter{assignment} -\numberproblemsin{assignment} -\renewcommand\prob@label[1]{\arabic{assignment}.#1} -\srefaddidkey{assig} -\addmetakey{assig}{number} -\addmetakey*{assig}{title} -\addmetakey{assig}{type} -\addmetakey{assig}{given} -\addmetakey{assig}{due} -\addmetakey[false]{assig}{loadmodules}[true] -\newcommand\given@due[2]{% -\ifx \inclassig@given\@empty -\ifx \assig@given\@empty -\ifx \inclassig@due\@empty -\ifx \assig@due\@empty% all empty do nothing -\else #1% -\fi -\else #1% -\fi -\else #1% -\fi -\else #1% -\fi -\ifx\inclassig@given\@empty -\ifx\assig@given\@empty% do nothing -\else \hwexam@given@kw\xspace \assig@given% -\fi -\else \hwexam@given@kw\xspace \inclassig@given% -\fi -\ifx \inclassig@due\@empty -\ifx \assig@due\@empty% do nothing -\else -\ifx \inclassig@given\@empty -\ifx \assig@given\@empty% do nothing -\else ,~% -\fi -\else ,~% -\fi -\fi -\else -\ifx \inclassig@given\@empty -\ifx \assig@given\@empty% do nothing -\else ,~% -\fi -\else ,~% -\fi -\fi -\ifx \inclassig@due\@empty -\ifx \assig@due\@empty% do nothing -\else \hwexam@due@kw\xspace \assig@due% -\fi -\else \hwexam@due@kw\xspace \inclassig@due% -\fi -\ifx \inclassig@given\@empty -\ifx \assig@given\@empty -\ifx \inclassig@due\@empty -\ifx \assig@due\@empty% all empty do nothing -\else #2% -\fi -\else #2% -\fi -\else #2% -\fi -\else #2% -\fi -} -\newcommand\assignment@title[3] -{\ifx\inclassig@title\@empty% if there is no outside title -\ifx\assig@title\@empty{#1}\else{#2\assig@title{#3}}\fi -\else{#2}\inclassig@title{#3}\fi}% else show the outside title -\newcommand\assignment@number% -{\ifx\inclassig@number\@empty% if there is no outside number -\ifx\assig@number\@empty\else\assig@number\fi -\else\inclassig@number\fi}% else show the outside number -\newenvironment{assignment}[1][]{\metasetkeys{assig}{#1}\sref@target% -\edef\@@num{\assignment@number}% -\ifx\@@num\@empty\stepcounter{assignment}\else\setcounter{assignment}{\@@num}\fi% -\setcounter{problem}{0}% -\def\current@section@level{\document@hwexamtype}% -\sref@label@id{\document@hwexamtype \thesection}% -\begin{@assignment}} -{\end{@assignment}} -\def\@@asstitle{\protect\document@hwexamtype~\arabic{assignment}% -\assignment@title{}{\;(}{)\;} -- \given@due{}{}} -\ifmultiple -\newenvironment{@assignment}% -{\ifx\assig@loadmodules\@true -\begin{omgroup}[loadmodules]{\@@asstitle} -\else -\begin{omgroup}{\@@asstitle} -\fi} -{\end{omgroup}} -\else -\newenvironment{@assignment} -{\begin{center}\bf -\Large\@title\strut\\ -\document@hwexamtype~\arabic{assignment}\assignment@title{\;}{:\;}{\\}% -\large\given@due{--\;}{\;--} -\end{center}} -{} -\fi% multiple -\addmetakey{inclassig}{number} -\addmetakey*{inclassig}{title} -\addmetakey{inclassig}{type} -\addmetakey{inclassig}{given} -\addmetakey{inclassig}{due} -\addmetakey{inclassig}{mhrepos} -\clear@inclassig@keys%initially -\newcommand\includeassignment[2][]{\metasetkeys{inclassig}{#1}% -\include{#2}\clear@inclassig@keys} -\newcommand\inputassignment[2][]{\metasetkeys{inclassig}{#1}% -\input{#2}\clear@inclassig@keys} -\addmetakey{quizheading}{tas} -\newcommand\quizheading[1]{\def\@tas{#1}% -\large\noindent NAME: \hspace{8cm} MAILBOX:\\[2ex]% -\ifx\@tas\@empty\else% -\noindent TA: \@for\@I:=\@tas\do{{\Large$\Box$}\@I\hspace*{1em}}\\[2ex]\fi} -\addmetakey{testheading}{min} -\addmetakey{testheading}{duration} -\addmetakey{testheading}{reqpts} -\newenvironment{testheading}[1][]{\metasetkeys{testheading}{#1} -{\noindent\large{}Name: \hfill Matriculation Number:\hspace*{2cm}\strut\\[1ex] -\begin{center}\Large\textbf{\@title}\\[1ex]\large\@date\\[3ex]\end{center} -{\textbf{You have -\ifx\testheading@duration\@empty\testheading@min minutes\else\testheading@duration\fi -(sharp) for the test}};\\ Write the solutions to the sheet.}\par\noindent - -\newcount\check@time\check@time=\testheading@min -\advance\check@time by -\theassignment@totalmin -The estimated time for solving this exam is {\theassignment@totalmin} minutes, -leaving you {\the\check@time} minutes for revising your exam. - -\newcount\bonus@pts\bonus@pts=\theassignment@totalpts -\advance\bonus@pts by -\testheading@reqpts -You can reach {\theassignment@totalpts} points if you solve all problems. You will only need -{\testheading@reqpts} points for a perfect score, i.e.\ {\the\bonus@pts} points are -bonus points. \vfill -\begin{center} - {\Large\em - Different problems test different skills and knowledge, so do not get stuck on - one problem.}\vfill\par\correction@table \\[3ex] -\end{center}} -{\newpage} -\newcommand\testspace[1]{\iftest\vspace*{#1}\fi} -\newcommand\testnewpage{\iftest\newpage\fi} -\newcommand\testemptypage[1][]{\iftest\begin{center}\hwexam@testemptypage@kw\end{center}\vfill\eject\else\fi} -\renewcommand\@problem[3]{\stepcounter{assignment@probs} -\def\@@pts{#2}\ifx\@@pts\@empty\else\addtocounter{assignment@totalpts}{#2}\fi -\def\@@min{#3}\ifx\@@min\@empty\else\addtocounter{assignment@totalmin}{#3}\fi -\xdef\correction@probs{\correction@probs & #1}% -\xdef\correction@pts{\correction@pts & #2} -\xdef\correction@reached{\correction@reached &}} -\newcounter{assignment@probs} -\newcounter{assignment@totalpts} -\newcounter{assignment@totalmin} -\def\correction@probs{\correction@probs@kw}% -\def\correction@pts{\correction@pts@kw}% -\def\correction@reached{\correction@reached@kw}% -\def\after@correction@table{}% -\stepcounter{assignment@probs} -\newcommand\correction@table{\begin{tabular}{|l|*{\theassignment@probs}{c|}|l|}\hline% -&\multicolumn{\theassignment@probs}{c||}%| -{\footnotesize\correction@forgrading@kw} &\\\hline -\correction@probs & \correction@sum@kw & \correction@grade@kw\\\hline -\correction@pts &\theassignment@totalpts & \\\hline -\correction@reached & & \\[.7cm]\hline -\end{tabular} -\ifx\after@correction@table\@empty\else\strut\par\noindent\after@correction@table\fi} -\endinput -%% -%% End of file `hwexam.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/img/sTeX-logo.png b/Master/texmf-dist/tex/latex/stex/img/sTeX-logo.png Binary files differnew file mode 100644 index 00000000000..1e292797403 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/img/sTeX-logo.png diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/cc-by-sa.png b/Master/texmf-dist/tex/latex/stex/img/stex-cc-by-sa.png Binary files differindex f0a944e0b89..f0a944e0b89 100644 --- a/Master/texmf-dist/tex/latex/stex/mikoslides/cc-by-sa.png +++ b/Master/texmf-dist/tex/latex/stex/img/stex-cc-by-sa.png diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/cc_somerights.png b/Master/texmf-dist/tex/latex/stex/img/stex-cc_somerights.png Binary files differindex fd7d3c7f33c..fd7d3c7f33c 100644 --- a/Master/texmf-dist/tex/latex/stex/mikoslides/cc_somerights.png +++ b/Master/texmf-dist/tex/latex/stex/img/stex-cc_somerights.png diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/dangerous-bend.png b/Master/texmf-dist/tex/latex/stex/img/stex-dangerous-bend.png Binary files differindex fbcfefa5d97..fbcfefa5d97 100644 --- a/Master/texmf-dist/tex/latex/stex/mikoslides/dangerous-bend.png +++ b/Master/texmf-dist/tex/latex/stex/img/stex-dangerous-bend.png diff --git a/Master/texmf-dist/tex/latex/stex/ldf/document-structure-ngerman.ldf b/Master/texmf-dist/tex/latex/stex/ldf/document-structure-ngerman.ldf new file mode 100644 index 00000000000..34868138336 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/document-structure-ngerman.ldf @@ -0,0 +1,17 @@ +% German Language Bindings for the sTeX omdoc package +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsngerman{ +\def\omdoc@part@kw{Teil} +\def\omdoc@chapter@kw{Kapitel} +\def\omdoc@section@kw{Abschnitt} +\def\omdoc@subsection@kw{Unterabschnitt} +\def\omdoc@subsubsection@kw{Unterabschnitt} +\def\omdoc@paragraph@kw{Paragraph} +\def\omdoc@subparagraph@kw{Unterparagraph} +}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/stex/ldf/hwexam-finnish.ldf b/Master/texmf-dist/tex/latex/stex/ldf/hwexam-finnish.ldf new file mode 100644 index 00000000000..92454d2b2c2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/hwexam-finnish.ldf @@ -0,0 +1,21 @@ +% Finnish Language Bindings for the sTeX hwexam package +% Translations thanks to Jukka Kohonen <jukka.kohonen@aalto.fi> +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsfinnish{ +\def\hwexam@assignment@kw{Kotitehtävä} +\def\hwexam@given@kw{Annettu} +\def\hwexam@due@kw{Palautettava} +\def\correction@forgrading@kw{Käytetään arvosteluun, älä kirjoita tähän!} +\def\hwexam@testemptypage@kw{Tämä sivu on tarkoituksellisesti tyhjä} +\def\correction@probs@kw{Tehtävä}% +\def\correction@pts@kw{Maksimi}% +\def\correction@reached@kw{Pisteet}% +\def\correction@sum@kw{Summa}% +\def\correction@grade@kw{Arvosana}% +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/hwexam-french.ldf b/Master/texmf-dist/tex/latex/stex/ldf/hwexam-french.ldf new file mode 100644 index 00000000000..23992740cda --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/hwexam-french.ldf @@ -0,0 +1,21 @@ +% French Language Bindings for the sTeX hwexam package +% Translations thanks to Samuel Lelièvre <samuel.lelievre@gmail.com> +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsfrench{ +\def\hwexam@assignment@kw{Devoir} +\def\hwexam@given@kw{Distribué} +\def\hwexam@due@kw{À rendre} +\def\correction@forgrading@kw{Réservé pour la correction} +\def\hwexam@testemptypage@kw{Page laissée blanche exprès} +\def\correction@probs@kw{Pb}% +\def\correction@pts@kw{pt}% +\def\correction@reached@kw{Score}% +\def\correction@sum@kw{Total}% +\def\correction@grade@kw{Note}% +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/hwexam-ngerman.ldf b/Master/texmf-dist/tex/latex/stex/ldf/hwexam-ngerman.ldf new file mode 100644 index 00000000000..31af25aba81 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/hwexam-ngerman.ldf @@ -0,0 +1,21 @@ +% German Language Bindings for the sTeX hwexam package +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsngerman{ +\def\hwexam@assignment@kw{Hausaufgabe} +\def\hwexam@given@kw{Ausgegeben} +\def\hwexam@due@kw{Abgabetermin} +\def\hwexam@minutes@kw{Minuten} +\def\correction@forgrading@kw{Nur zur Korrektur, bitte freilassen!} +\def\hwexam@testemptypage@kw{Diese Seite wurde für mehr Platz absichtlich leer gelassen.} +\def\correction@probs@kw{Aufgabe}% +\def\correction@pts@kw{M\"oglich}% +\def\correction@reached@kw{Erreicht}% +\def\correction@sum@kw{Summe}% +\def\correction@grade@kw{Note}% +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/hwexam-russian.ldf b/Master/texmf-dist/tex/latex/stex/ldf/hwexam-russian.ldf new file mode 100644 index 00000000000..6da7c9e8cb9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/hwexam-russian.ldf @@ -0,0 +1,20 @@ +% Russian Language Bindings for the sTeX hwexam package +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsrussian{ +\def\hwexam@assignment@kw{Домашнее задание} +\def\hwexam@given@kw{Дано} +\def\hwexam@due@kw{Дата сдачи} +\def\correction@forgrading@kw{Для исправлений. Пожалуйста, оставьте свободное место!} +\def\hwexam@testemptypage@kw{Эта страница преднамеренно оставлена пустой для дополнительных записей.} +\def\correction@probs@kw{Задание}% +\def\correction@pts@kw{Максимальный балл}% +\def\correction@reached@kw{Ваш балл}% +\def\correction@sum@kw{Общий балл}% +\def\correction@grade@kw{Отметка}% +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/problem-finnish.ldf b/Master/texmf-dist/tex/latex/stex/ldf/problem-finnish.ldf new file mode 100644 index 00000000000..3619f283a02 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/problem-finnish.ldf @@ -0,0 +1,13 @@ +% Finnish Language Bindings for the sTeX problem package +% Translations thanks to Jukka Kohonen <jukka.kohonen@aalto.fi> +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsfinnish{ +\def\prob@problem@kw{Tehtävä} +\def\prob@solution@kw{Ratkaisu} +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/problem-french.ldf b/Master/texmf-dist/tex/latex/stex/ldf/problem-french.ldf new file mode 100644 index 00000000000..80d577c4813 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/problem-french.ldf @@ -0,0 +1,13 @@ +% French Language Bindings for the sTeX problem package +% Translations thanks to Samuel Lelièvre <samuel.lelievre@gmail.com> +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsfrench{ +\def\prob@problem@kw{Problème} +\def\prob@solution@kw{Solution} +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/problem-ngerman.ldf b/Master/texmf-dist/tex/latex/stex/ldf/problem-ngerman.ldf new file mode 100644 index 00000000000..d53bed5591c --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/problem-ngerman.ldf @@ -0,0 +1,17 @@ +% German Language Bindings for the sTeX problem package +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsngerman{ +\def\prob@problem@kw{Aufgabe} +\def\prob@solution@kw{Lösung} +\def\prob@hint@kw{Hinweis} +\def\prob@note@kw{Bemerkung} +\def\prob@note@kw{Bewertung} +\def\prob@pt@kw{Pkt} +\def\prob@min@kw{Min} +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/problem-russian.ldf b/Master/texmf-dist/tex/latex/stex/ldf/problem-russian.ldf new file mode 100644 index 00000000000..d27d8ffabc3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/problem-russian.ldf @@ -0,0 +1,16 @@ +% Russian Language Bindings for the sTeX problem package +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsrussian{ +\def\prob@problem@kw{Задание} +\def\prob@solution@kw{Решение} +\def\prob@hint@kw{Подсказка} +\def\prob@note@kw{Примечание} +\def\prob@pt@kw{бл} +\def\prob@min@kw{мин} +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/sproof-finnish.ldf b/Master/texmf-dist/tex/latex/stex/ldf/sproof-finnish.ldf new file mode 100644 index 00000000000..3ab1f02690c --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/sproof-finnish.ldf @@ -0,0 +1,14 @@ +% Finnish Language Bindings for the sTeX sproof package +% Translations thanks to Jukka Kohonen <jukka.kohonen@aalto.fi> +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsfinnish{ +\def\spf@proofsketch@kw{Todistusidea} +\def\spf@proof@kw{Todistus} +\def\spf@step@kw{Askel} +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/sproof-french.ldf b/Master/texmf-dist/tex/latex/stex/ldf/sproof-french.ldf new file mode 100644 index 00000000000..8425e0d4a84 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/sproof-french.ldf @@ -0,0 +1,14 @@ +% French Language Bindings for the sTeX sproof package +% Translations thanks to Samuel Lelièvre <samuel.lelievre@gmail.com> +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsfrench{ +\def\spf@proofsketch@kw{Esquisse de démonstration} +\def\spf@proof@kw{Démonstration} +\def\spf@step@kw{Étape} +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/sproof-ngerman.ldf b/Master/texmf-dist/tex/latex/stex/ldf/sproof-ngerman.ldf new file mode 100644 index 00000000000..5bd1024ebab --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/sproof-ngerman.ldf @@ -0,0 +1,13 @@ +% German Language Bindings for the sTeX sproof package +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsngerman{ +\def\spf@proofsketch@kw{Beweisskizze} +\def\spf@proof@kw{Beweis} +\def\spf@step@kw{Schritt} +} diff --git a/Master/texmf-dist/tex/latex/stex/ldf/sproof-russian.ldf b/Master/texmf-dist/tex/latex/stex/ldf/sproof-russian.ldf new file mode 100644 index 00000000000..314cee130b2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ldf/sproof-russian.ldf @@ -0,0 +1,13 @@ +% Russian Language Bindings for the sTeX sproof package +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ + +\g@addto@macro\captionsrussian{ +\def\spf@proofsketch@kw{Набросок доказательства} +\def\spf@proof@kw{Доказательство} +\def\spf@step@kw{Шаг} +} diff --git a/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty b/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty deleted file mode 100644 index ac2304e9f0e..00000000000 --- a/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty +++ /dev/null @@ -1,112 +0,0 @@ -%% -%% This is file `metakeys.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% metakeys.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{metakeys}[2019/03/20 v0.9 Framework for Metadata Keys] -\newif\ifmetakeys@showmeta\metakeys@showmetafalse -\DeclareOption{showmeta}{\metakeys@showmetatrue} -\DeclareOption*{} -\ProcessOptions -\RequirePackage{keyval}[1997/11/10] -\RequirePackage{etoolbox} -\newcommand\addmetakey{\@ifstar\addmetakey@star\addmetakey@nostar}% -\newcommand\addmetakey@star[3][]{% - \@ifnextchar[{% - \addmetakey@star@aux[#1]{#2}{#3}% - }{% - \addmetakey@star@aux[#1]{#2}{#3}[]% - }% -}% -\def\addmetakey@star@aux[#1]#2#3[#4]{% - \metakeys@ext@clear@keys{#2}{#3}{#1}% - \metakeys@initialize@showkeys{#2}% - \define@key{#2}{#3}[#4]{% - \csxdef{#2@#3}{##1}% - }% -}% -\newcommand\addmetakey@nostar[3][]{% - \metakeys@ext@showkeys{#2}{#3}% - \addmetakey@star[#1]{#2}{#3}% -}% -\newcommand\metasetkeys[2]{% - \@nameuse{clear@#1@keys}% - \setkeys{#1}{#2}% - \ifmetakeys@showmeta% - \edef\@@keys{\@nameuse{#1@showkeys}}% - \metakeys@show@keys{#1}{% - \@for\@I:=\@@keys\do{% - \metakeys@show@keyval{#1}{\@I}% - }% - }% - \fi% -}% -\newrobustcmd\metakeys@ext@clear@keys[3]{% - \@metakeys@ext@clear@keys{#1}{#1@#2}{#3}% -}% -\newrobustcmd\@metakeys@ext@clear@keys[3]{% - \@ifundefined{clear@#1@keys}{% -\csgdef{clear@#1@keys}{\csgdef{#2}{#3}}% - }% - {\expandafter\gappto\csname clear@#1@keys\endcsname{\csgdef{#2}{#3}}}% -}% -\newrobustcmd\addmetalistkey{% - \@ifstar\addmetalistkey@star\addmetalistkey@nostar% -}% -\newrobustcmd\addmetalistkey@star[3][]{% - \metakeys@ext@clear@keys{#2}{#3}{#1}% - \metakeys@initialize@showkeys{#2}% - \csgdef{#2@#3s}{}% - \define@key{#2}{#3}[#1]{% - \ifcsempty{#2@#3s}{% - \csgdef{#2@#3s}{##1}% - }{% - \csxdef{#2@#3s}{\csuse{#2@#3s},##1}% - }% - }% -}% -\newrobustcmd\addmetalistkey@nostar[3][]{% - \metakeys@ext@showkeys{#2}{#3}% - \addmetalistkey@star[#1]{#2}{#3}% -}% -\newrobustcmd\metakeys@initialize@showkeys[1]{% - \@ifundefined{#1@showkeys}{% - \csdef{#1@showkeys}{}% - }{}% -}% -\newrobustcmd\metakeys@ext@showkeys[2]{% - \@ifundefined{#1@showkeys}{% - \csdef{#1@showkeys}{#2}% - }{% - \csedef{#1@showkeys}{\csuse{#1@showkeys},#2}% - }% -}% -\newrobustcmd\@metakeys@show@key[2]{\metakeys@show@key{#2}{#1}}% -\newrobustcmd\metakeys@show@key[2]{% - \edef\@test{#2}% - \ifx\@test\@empty\else #1:#2\quad\fi% -}% -\newrobustcmd\metakeys@show@keys[2]{\marginpar{{\scriptsize #2}}}% -\newrobustcmd\metakeys@show@keyval[2]{% - \expandafter\@metakeys@show@key\csname #1@#2\endcsname{#2}% -}% -\newrobustcmd\showmetakeys{\metakeys@showmetatrue}% -\newrobustcmd\hidemetakeys{\metakeys@showmetafalse}% -\newrobustcmd\addmetakeynew[3][]{% - \metakeys@ext@clear@keys{#2}{#3}{#1}% - \define@key{#2}{#3}{% - \csgdef{#2@#3}{##1}% - }% -}% -\newrobustcmd\metakeys@unspecified{an metakeys-defined key left unspecified}% -\newrobustcmd\metakeysifus[4]{% - \message{testing #1@#2=\csname#1@#2\endcsname}% - \expandafter\ifx\csname #1@#2\endcsname\metakeys@unspecified{#3}\else{#4}\fi% -}% -\endinput -%% -%% End of file `metakeys.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/beamerthemeJacobs.sty b/Master/texmf-dist/tex/latex/stex/mikoslides/beamerthemeJacobs.sty deleted file mode 100644 index 2581f00c04c..00000000000 --- a/Master/texmf-dist/tex/latex/stex/mikoslides/beamerthemeJacobs.sty +++ /dev/null @@ -1,64 +0,0 @@ -% Beamer Jacobs slide theme; some hints from CXL's DFKI theme included -% -% (C) 2009 Michael Kohlhase <m.kohlhase@jacobs-university.de. - -\ProvidesPackage{beamerthemeJacobs} -\typeout{Beamer KWARC theme} -\author[Kohlhase]{Michael Kohlhase} -\institute{Computer Science, Jacobs University Bremen, Germany\\\url{http://kwarc.info}} - -\mode -<presentation> - -%% Shadings and logo images -\pgfdeclareimage[height=.5ex,width=113mm]{shade-l2r}{shading-l2r} -\pgfdeclareimage[height=2ex]{jacobslogo}{jacobs-logo} -\pgfdeclareimage[height=2ex]{cclogo}{cc_somerights} - -%% Headers flushed to the left. -\setbeamertemplate{frametitle}[default][left] - - -%% Add the line below the header -\addtobeamertemplate{frametitle}{}{\hspace*{-1cm} % - \begin{pgfpicture}{0cm}{0cm}{128mm}{2mm} - \pgfputat{\pgforigin}{\pgfbox[left,bottom]{\pgfuseimage{shade-l2r}}} - \end{pgfpicture} - } - -\setbeamertemplate{footline}[text line]{% - \usebeamercolor[fg]{titlelike} - \strut\hspace*{2cm}\insertshortauthor: \insertshorttitle\hfill{}% - \insertframenumber\hfill\insertshortdate\hspace*{3cm}% - } - \addtobeamertemplate{footline}{ % - \begin{pgfpicture}{0cm}{0cm}{128mm}{0mm} % - \pgfputat{\pgfpoint{126mm}{1mm}}{\pgfbox[right,top]{\pgfuseimage{jacobslogo}}} % - \pgfputat{\pgfpoint{10mm}{1mm}}{\pgfbox[right,top]{\pgfuseimage{cclogo}}} % - \end{pgfpicture}}{} - -%% Turn off the navigation symbols -\setbeamertemplate{navigation symbols}{} - -%% Inner theme -\useinnertheme{default} -%\setbeamertemplate{enumerate item}{(\alph{enumi})} -%\setbeamertemplate{enumerate subitem}{(\roman{enumii})} - -%% Big logo for the title page. -%\pgfdeclareimage[height=1cm]{biglogo}{beamer/img/DFKI-SKS} -%\titlegraphic{\pgfuseimage{biglogo}} - -\mode -<all> - -%% Redefine various margin sizes -\setbeamersize{text margin left=3mm} -\setbeamersize{text margin right=3mm} -\setlength\leftmargini{1em} -\setlength\leftmarginii{1em} -\setlength\leftmarginiii{1em} -\providecommand{\vstretch}[1]{\vspace*{\stretch{#1}}} -\beamer@descriptionwidth=1cm - - diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/jacobs-logo.png b/Master/texmf-dist/tex/latex/stex/mikoslides/jacobs-logo.png Binary files differdeleted file mode 100644 index 0bbe28c44fc..00000000000 --- a/Master/texmf-dist/tex/latex/stex/mikoslides/jacobs-logo.png +++ /dev/null diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.cls b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.cls deleted file mode 100644 index fab70a55370..00000000000 --- a/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.cls +++ /dev/null @@ -1,36 +0,0 @@ -%% -%% This is file `mikoslides.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% mikoslides.dtx (with options: `cls') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesClass{mikoslides}[2019/03/20 v1.2 MiKo slides Class] -\RequirePackage{kvoptions} -\RequirePackage{etoolbox} -\SetupKeyvalOptions{family=mks@cls,prefix=mks@cls@} -\DeclareStringOption[article]{class} -\AddToKeyvalOption*{class}{\PassOptionsToClass{class=\mks@cls@class}{omdoc} - \ifdefstring{\mks@cls@class}{book}{\PassOptionsToPackage{topsect=part}{mikoslides}}{} - \ifdefstring{\mks@cls@class}{report}{\PassOptionsToPackage{topsect=part}{mikoslides}}}{} -\DeclareBoolOption{notes} -\DeclareComplementaryOption{slides}{notes} -\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{omdoc} - \PassOptionsToClass{\CurrentOption}{beamer} - \PassOptionsToPackage{\CurrentOption}{mikoslides}} -\ProcessKeyvalOptions{mks@cls} -\ifmks@cls@notes - \LoadClass{omdoc} -\else - \LoadClass[10pt,notheorems]{beamer} - \newcounter{Item} - \newcounter{paragraph} - \newcounter{subparagraph} - \newcounter{Hfootnote} -\fi -\RequirePackage{mikoslides} -\endinput -%% -%% End of file `mikoslides.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.sty b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.sty deleted file mode 100644 index cd19d98152b..00000000000 --- a/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.sty +++ /dev/null @@ -1,297 +0,0 @@ -%% -%% This is file `mikoslides.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% mikoslides.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{mikoslides}[2019/03/20 v1.2 MiKo slides Package] -\RequirePackage{kvoptions} -\SetupKeyvalOptions{family=mks@sty,prefix=mks@sty@} -\DeclareStringOption[section]{topsect} -\DeclareBoolOption{mh} -\AddToKeyvalOption*{mh}{ - \PassOptionsToPackage{mh}{stex} - \PassOptionsToPackage{mh}{smglom} - \PassOptionsToPackage{mh}{tikzinput}} -\newif\ifnotes\notestrue -\DeclareBoolOption{notes} -\AddToKeyvalOption*{notes}{\notestrue\PassOptionsToPackage{notes}{statements}} -\DeclareComplementaryOption{slides}{notes} -\AddToKeyvalOption*{slides}{\notesfalse\PassOptionsToPackage{nontheorem}{statements}} -\DeclareBoolOption{sectocframes} -\AddToKeyvalOption*{sectocframes}{\PassOptionsToPackage{msection}{statements}} -\DeclareBoolOption{frameimages} -\DeclareBoolOption{noproblems} -\DeclareDefaultOption{\PassOptionsToPackage{\CurrentOption}{stex} - \PassOptionsToPackage{\CurrentOption}{smglom} - \PassOptionsToPackage{\CurrentOption}{tikzinput}} -\ProcessKeyvalOptions{mks@sty} -\ifmks@sty@notes -\RequirePackage{a4wide} -\RequirePackage{marginnote} -\RequirePackage{xcolor} -\RequirePackage{mdframed} -\RequirePackage[noxcolor,noamsthm]{beamerarticle} -\fi -\ifmks@sty@mh\RequirePackage{mikoslides-mh}\fi -\RequirePackage{etoolbox} -\RequirePackage{amssymb} -\RequirePackage{amsmath} -\RequirePackage{comment} -\RequirePackage{textcomp} -\RequirePackage{url} -\RequirePackage{graphicx} -\RequirePackage{stex-logo} -\RequirePackage{pgf} -\ifmks@sty@notes -\RequirePackage[bookmarks,bookmarksopen,bookmarksnumbered,breaklinks, -linkcolor=black,citecolor=black,urlcolor=cyan,filecolor=cyan,colorlinks]{hyperref} -\fi -\RequirePackage{metakeys} -\ifmks@sty@notes -\renewcommand\usetheme[2][]{\usepackage[#1]{beamernotestheme#2}} -\fi -\newcounter{slide} -\newlength{\slidewidth}\setlength{\slidewidth}{12.8cm} -\newlength{\slideheight}\setlength{\slideheight}{9cm} -\ifmks@sty@notes% - \renewenvironment{note}{\ignorespaces}{}% -\else% - \excludecomment{note}% -\fi% -\newcommand\ninputref[2][]{\ifmks@sty@notes\inputref[#1]{#2}\fi} -\ifmks@sty@notes - \newlength{\slideframewidth} - \setlength{\slideframewidth}{1.5pt} - \addmetakey{frame}{label} - \addmetakey[yes]{frame}{allowframebreaks} - \addmetakey{frame}{allowdisplaybreaks} - \addmetakey[yes]{frame}{fragile} - \addmetakey[yes]{frame}{shrink} - \addmetakey[yes]{frame}{squeeze} - \addmetakey[yes]{frame}{t} - \renewenvironment{frame}[1][]{% - \metasetkeys{frame}{#1}% - \stepcounter{slide}% - \def\@currentlabel{\theslide}% - \ifx\frame@label\@empty% - \else% - \label{\frame@label}% - \fi% - \def\itemize@level{outer}% - \def\itemize@outer{outer}% - \def\itemize@inner{inner}% - \renewcommand\newpage{}% - \renewcommand\metakeys@show@keys[2]{\marginnote{{\scriptsize ##2}}}% - \renewenvironment{itemize}{% - \ifx\itemize@level\itemize@outer% - \def\itemize@label{$\rhd$}% - \fi% - \ifx\itemize@level\itemize@inner% - \def\itemize@label{$\scriptstyle\rhd$}% - \fi% - \begin{list}% - {\itemize@label}% - {\setlength{\labelsep}{.3em}% - \setlength{\labelwidth}{.5em}% - \setlength{\leftmargin}{1.5em}% - }% - \edef\itemize@level{\itemize@inner}% - }{% - \end{list}% - }% - \begin{mdframed}[linewidth=\slideframewidth,skipabove=1ex,skipbelow=1ex,userdefinedwidth=\slidewidth,align=center]\sf% - }{% - \medskip\miko@slidelabel\end{mdframed}% - }% - \renewcommand{\frametitle}[1]{{\Large\bf\sf\color{blue}{#1}}\medskip}% -\fi %ifnotes -\newrobustcmd\frameimage[2][]{% - \stepcounter{slide}% - \ifmks@sty@frameimages% - \def\Gin@ewidth{}\setkeys{Gin}{#1}% - \ifmks@sty@notes\else\vfill\fi% - \ifx\Gin@ewidth\@empty% - \mycgraphics[width=\slidewidth,#1]{#2}\else\mycgraphics[#1]{#2}% - \fi% - \par\strut\hfill{\footnotesize Slide \arabic{slide}}% - \ifmks@sty@notes\else\vfill\fi% - \fi% -}% ifframeimages -\ifmks@sty@notes\newcommand\pause{}\fi -\ifmks@sty@notes\newenvironment{nomtext}[1][]{\begin{omtext}[#1]}{\end{omtext}}% -\else\excludecomment{nomtext}\fi% -\ifmks@sty@notes\newenvironment{nomgroup}[2][]{\begin{omgroup}[#1]{#2}}{\end{omgroup}}% -\else\excludecomment{nomgroup}\fi% -\newlength{\slidelogoheight} -\ifmks@sty@notes% - \setlength{\slidelogoheight}{.4cm}% -\else% - \setlength{\slidelogoheight}{1cm}% -\fi% -\newsavebox{\slidelogo}% -\sbox{\slidelogo}{\sTeX}% -\newrobustcmd{\setslidelogo}[1]{% - \sbox{\slidelogo}{\includegraphics[height=\slidelogoheight]{#1}}% -}% -\def\source{Michael Kohlhase}% customize locally -\newrobustcmd{\setsource}[1]{\def\source{#1}}% -\def\copyrightnotice{\footnotesize\copyright:\hspace{.3ex}{\source}}% -\newsavebox{\cclogo}% -\sbox{\cclogo}{\includegraphics[height=\slidelogoheight]{cc_somerights}}% -\newif\ifcchref\cchreffalse% -\AtBeginDocument{% - \@ifpackageloaded{hyperref}{\cchreftrue}{\cchreffalse} -}% -\def\licensing{% - \ifcchref% - \href{http://creativecommons.org/licenses/by-sa/2.5/}{\usebox{\cclogo}}% - \else% - {\usebox{\cclogo}}% - \fi% -}% -\newrobustcmd{\setlicensing}[2][]{% - \def\@url{#1}% - \sbox{\cclogo}{\includegraphics[height=\slidelogoheight]{#2}}% - \ifx\@url\@empty% - \def\licensing{{\usebox{\cclogo}}}% - \else% - \def\licensing{% - \ifcchref% - \href{#1}{\usebox{\cclogo}}% - \else% - {\usebox{\cclogo}}% - \fi% - }% - \fi% -}% -\newrobustcmd\miko@slidelabel{% - \vbox to \slidelogoheight{% - \vss\hbox to \slidewidth% - {\licensing\hfill\copyrightnotice\hfill\arabic{slide}\hfill\usebox{\slidelogo}}% - }% -}% -\sffamily -\AtBeginDocument{% -\definecolor{green}{rgb}{0,.5,0}% -\definecolor{purple}{cmyk}{.3,1,0,.17}% -}% -\def\defemph#1{{\textcolor{magenta}{#1}}} -\def\notemph#1{{\textcolor{magenta}{#1}}} -\def\stDMemph#1{{\textcolor{blue}{#1}}} -\def\@@lec#1{(\textcolor{green}{#1})} -\pgfdeclareimage[width=.8em]{miko@small@dbend}{dangerous-bend} -\def\smalltextwarning{% - \pgfuseimage{miko@small@dbend}% - \xspace% -}% -\pgfdeclareimage[width=1.2em]{miko@dbend}{dangerous-bend} -\newrobustcmd\textwarning{% - \raisebox{-.05cm}{\pgfuseimage{miko@dbend}}% - \xspace% -}% -\pgfdeclareimage[width=2.5em]{miko@big@dbend}{dangerous-bend}% -\newrobustcmd\bigtextwarning{% - \raisebox{-.05cm}{\pgfuseimage{miko@big@dbend}}% - \xspace% -}% -\newrobustcmd\putgraphicsat[3]{% - \begin{picture}(0,0)\put(#1){\includegraphics[#2]{#3}}\end{picture}% -}% -\newrobustcmd\putat[2]{% - \begin{picture}(0,0)\put(#1){#2}\end{picture}% -}% -\ifmks@sty@sectocframes% -\ifdefstring\mks@sty@topsect{part}{% - \newcounter{mpart}\newcounter{mchapter}\newcounter{msection}[mchapter]} -{\ifdefstring\mks@sty@topsect{chapter}{% - \newcounter{mchapter}\newcounter{msection}[mchapter]} - {\newcounter{msection}}} -\newcounter{msubsection}[msection]% -\newcounter{msubsubsection}[msubsection]% -\newcounter{msubsubsubsection}[msubsubsection]% -\fi% ifsectocframes -\RequirePackage{stex} -\RequirePackage{smglom} -\RequirePackage{tikzinput} -\section@level=2 -\ifdefstring{\mks@sty@topsect}{part}{\section@level=0}{} -\ifdefstring{\mks@sty@topsect}{chapter}{\section@level=1}{} -\ifmks@sty@notes\else% only in slides -\def\part@prefix{\ifdefstring\mks@sty@topsect{part}{\arabic{mchapter}.}{}} -\renewenvironment{omgroup}[2][]{% - \metasetkeys{omgroup}{#1}\sref@target% - \advance\section@level by 1% - \ifmks@sty@sectocframes% - \stepcounter{slide} - \begin{frame}[noframenumbering]% - \vfill\Large\centering% - \red{% - \ifcase\section@level\or - \stepcounter{mpart} - \def\@@label{Part \Roman{mpart}} - \def\currentsectionlevel{part} - \or% - \stepcounter{mchapter} - \def\@@label{Chapter \arabic{mchapter}} - \def\currentsectionlevel{chapter} - \or - \stepcounter{msection} - \def\@@label{\part@prefix\arabic{msection}} - \def\currentsectionlevel{section} - \or - \stepcounter{msubsection} - \def\@@label{\part@prefix\arabic{msection}.\arabic{msubsection}} - \def\currentsectionlevel{subsection} - \or - \stepcounter{msubsubsection} - \def\@@label{\part@prefix\arabic{msection}.\arabic{msubsection}.\arabic{msubsubsection}} - \def\currentsectionlevel{subsubsection} - \or - \stepcounter{msubsubsubsection} - \def\@@label{\part@prefix\arabic{msection}.\arabic{msubsection}.\arabic{msubsubsection}.\arabic{msubsubsubsection}} - \def\currentsectionlevel{subsubsubsection} - \fi% end ifcase - \@@label\sref@label@id\@@label - \quad #2% - }% - \vfill% - \end{frame}% - \fi %ifmks@sty@sectocframes -} -{\advance\section@level by -1}% -\fi% ifmks@sty@notes -\def\inserttheorembodyfont{\normalfont} -\defbeamertemplate{theorem begin}{miko} -{\inserttheoremheadfont\inserttheoremname\inserttheoremnumber - \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi% - \inserttheorempunctuation\inserttheorembodyfont\xspace} -\defbeamertemplate{theorem end}{miko}{} -\setbeamertemplate{theorems}[miko] -\expandafter\def\csname Parent2\endcsname{} -\ifmks@sty@notes% - \renewenvironment{columns}[1][]{% - \par\noindent% - \begin{minipage}% - \slidewidth\centering\leavevmode% - }{% - \end{minipage}\par\noindent% - }% - \newsavebox\columnbox% - \renewenvironment<>{column}[2][]{% - \begin{lrbox}{\columnbox}\begin{minipage}{#2}% - }{% - \end{minipage}\end{lrbox}\usebox\columnbox% - }% -\fi% ifnotes -\ifmks@sty@noproblems% - \newenvironment{problems}{}{}% -\else% - \excludecomment{problems}% -\fi% -\endinput -%% -%% End of file `mikoslides.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/shading-l2r.png b/Master/texmf-dist/tex/latex/stex/mikoslides/shading-l2r.png Binary files differdeleted file mode 100644 index 2eabe7a8b17..00000000000 --- a/Master/texmf-dist/tex/latex/stex/mikoslides/shading-l2r.png +++ /dev/null diff --git a/Master/texmf-dist/tex/latex/stex/modules/modules.sty b/Master/texmf-dist/tex/latex/stex/modules/modules.sty deleted file mode 100644 index e2b6f5a4467..00000000000 --- a/Master/texmf-dist/tex/latex/stex/modules/modules.sty +++ /dev/null @@ -1,410 +0,0 @@ -%% -%% This is file `modules.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% modules.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{modules}[2019/03/20 v1.4 Semantic Markup] -\newif\if@modules@mh@\@modules@mh@false -\DeclareOption{mh}{\@modules@mh@true} -\newif\ifmod@show\mod@showfalse -\DeclareOption{showmods}{\mod@showtrue} -\newif\ifaux@req\aux@reqtrue -\DeclareOption{noauxreq}{\aux@reqfalse} -\newif\ifmod@qualified\mod@qualifiedfalse -\DeclareOption{qualifiedimports}{\mod@qualifiedtrue} -\newif\if@trwarn\@trwarnfalse -\DeclareOption{trwarn}{\@trwarntrue} -\newif\if@mmt\@mmtfalse -\DeclareOption{mmt}{\@mmttrue} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{sref}} -\ProcessOptions -\RequirePackage{sref} -\if@modules@mh@\RequirePackage{modules-mh}\fi -\if@mmt\RequirePackage{mmt}\fi -\RequirePackage{xspace} -\RequirePackage{mdframed} -\RequirePackage{pathsuris} -\addmetakey{module}{cd}% no longer used -\addmetakey{module}{load}% ignored -\addmetakey*{module}{title} -\addmetakey*{module}{creators} -\addmetakey*{module}{contributors} -\addmetakey*{module}{srccite} -\addmetakey*{module}{align}[WithTheModuleOfTheSameName] -\addmetakey*{module}{noalign}[true] -\define@key{module}{id}{% - \edef\this@module{% - \expandafter\noexpand\csname module@defs@#1\endcsname% - }% - \csgdef{module@defs@#1}{}% - \ifmod@qualified% - \edef\this@qualified@module{% - \expandafter\noexpand\csname module@defs@#1\endcsname% - }% - \csgdef{module@defs@qualified@#1}{}% - \fi% - \def\mod@id{#1}% -}% -\ifdef{\thesection}{\newcounter{module}[section]}{\newcounter{module}}% -\newrobustcmd\module@heading{% - \stepcounter{module}% - \ifmod@show% - \noindent{\textbf{Module} \thesection.\themodule [\mod@id]}% - \sref@label@id{Module \thesection.\themodule [\mod@id]}% - \ifx\module@title\@empty :\quad\else\quad(\module@title)\hfill\\\fi% - \fi% -}% mod@show -\newenvironment{module}[1][]{% - \begin{@module}[#1]% - \ifcsundef{mod@id}{}{% only define if components are! - \ifcsundef{mod@path}{}{\csxdef{module@\mod@id @path}{\mod@path}}% - \ifcsundef{mod@ext}{}{\csxdef{module@\mod@id @ext}{\mod@ext}}% - }% - \if@mmt\if@importing\else\mmtheory{\mod@id}{????}\fi\fi% - \module@heading% make the headings - \ignorespaces}{% - \if@mmt\if@importing\else\mmtheoryend\fi\fi% - \end{@module}% - \ignorespacesafterend% -}% -\ifmod@show\surroundwithmdframed{module}\fi% -\newenvironment{@module}[1][]{\metasetkeys{module}{#1}}{}% -\def\activate@defs#1{% - \ifcsundef{module@#1@activated}{\csname module@defs@#1\endcsname}{}% - \@namedef{module@#1@activated}{true}% -}% -\def\export@defs#1{\@ifundefined{mod@id}{}{% -\expandafter\expandafter\expandafter\g@addto@macro% -\expandafter\this@module\expandafter{\activate@defs{#1}}}}% -\newif\if@importing\@importingfalse -\newcommand\update@used@modules[1]{% - \ifx\used@modules\@empty% - \edef\used@modules{#1}% - \else% - \edef\used@modules{\used@modules,#1}% - \fi} -\gdef\used@modules{} -\srefaddidkey{importmodule} -\addmetakey{importmodule}{load} -\addmetakey[sms]{importmodule}{ext} -\addmetakey[false]{importmodule}{conservative}[true] -\newcommand\importmodule[2][]{% - \metasetkeys{importmodule}{#1}% - \update@used@modules{#2}% - \@importmodule[\importmodule@load]{#2}{\importmodule@ext}{export}% - \ignorespacesandpars% -}% -\newcommand\@importmodule[4][]{% - {\@importingtrue% to shut up macros while in the group opened here - \edef\@load{#1}% - \ifx\@load\@empty% - \relax% - \else% - \ifcsundef{module@#2@path}{% - \requiremodules{#1}{#3}% - }{% - \edef\@path{\csname module@#2@path\endcsname}% - \IfStrEq\@load\@path{% if the known path is the same as the requested one - \relax% do nothing, it has already been loaded, else signal an error - }{% - \PackageError{modules} - {Module Name Clash\MessageBreak - A module with name #2 was already loaded under the path "\@path"\MessageBreak - The imported path "\@load" is probably a different module with the\MessageBreak - same name; this is dangerous -- not importing}% - {Check whether the Module name is correct}% - }% - }% - \fi}% - \activate@defs{#2}% activate the module - \edef\@export{#4}\def\@@export{export}%prepare comparison - \ifx\@export\@@export\export@defs{#2}\fi% export the module - \if@importing\else\if@mmt\mmtinclude{#1?#2}\fi\fi% -}% -\newcommand\usemodule[2][]{% - \metasetkeys{importmodule}{#1}% - \update@used@modules{#2}% - \@importmodule[\importmodule@load]{#2}{\importmodule@ext}{noexport}% - \ignorespacesandpars% -}% -\newcommand\withusedmodules[2]{{\@for\@I:=#1\do{\activate@defs\@I}{#2}}}% -\newrobustcmd\importOMDocmodule[3][]{\importmodule[#1]{#3}}% -\let\metalanguage=\importmodule% -\let\mod@newcommand=\providerobustcmd% -\srefaddidkey{conceptdef}% -\addmetakey*{conceptdef}{title}% -\addmetakey{conceptdef}{subject}% -\addmetakey*{conceptdef}{display}% -\def\conceptdef@type{Symbol}% -\newrobustcmd\conceptdef[2][]{% - \metasetkeys{conceptdef}{#1}% - \ifx\conceptdef@display\st@flow\else{\stDMemph{\conceptdef@type} #2:}\fi% - \ifx\conceptdef@title\@empty~\else~(\stDMemph{\conceptdef@title})\par\fi% -}% -\newif\if@symdeflocal% -\srefaddidkey{symdef}% -\define@key{symdef}{local}[true]{\@symdeflocaltrue}% -\define@key{symdef}{noverb}[all]{}% -\define@key{symdef}{align}[WithTheSymbolOfTheSameName]{}% -\define@key{symdef}{specializes}{}% -\addmetakey*{symdef}{noalign}[true] -\define@key{symdef}{primary}[true]{}% -\define@key{symdef}{assocarg}{}% -\define@key{symdef}{bvars}{}% -\define@key{symdef}{bargs}{}% -\addmetakey{symdef}{name}% -\addmetakey*{symdef}{title}% -\addmetakey*{symdef}{description}% -\addmetakey{symdef}{subject}% -\addmetakey*{symdef}{display}% -\def\symdef{\@ifnextchar[{\@symdef}{\@symdef[]}}% -\def\@symdef[#1]#2{\@ifnextchar[{\@@symdef[#1]{#2}}{\@@symdef[#1]{#2}[0]}}% -\def\@mod@nc#1{\mod@newcommand{#1}[1]}% -\def\ignorespacesandpars{% - \begingroup - \catcode13=10 - \@ifnextchar\relax - {\endgroup}% - {\endgroup}% -} -\def\ignorespacesandparsafterend#1\ignorespaces\fi{#1\fi\ignorespacesandpars} -\def\ignorespacesandpars{ - \ifhmode\unskip\fi% - \@ifnextchar\par% - {\expandafter\ignorespacesandpars\@gobble}% - {}% -} -\def\@@symdef[#1]#2[#3]#4{% - \@symdeflocalfalse% - \metasetkeys{symdef}{#1}% - \if@mmt\if@importing\else% -\ifx\symdef@name\@empty\mmtconstdec{#2}\else\mmtconstdec{\symdef@name}\fi% -\fi\fi% - \expandafter\mod@newcommand\csname modules@#2@pres@\endcsname[#3]{#4}% - \expandafter\mod@newcommand\csname #2\endcsname[1][]% - {\csname modules@#2@pres@##1\endcsname}% - \expandafter\@mod@nc\csname mod@symref@#2\expandafter\endcsname\expandafter% - {\expandafter\mod@termref\expandafter{\mod@id}{#2}{##1}}% - \if@symdeflocal% - \else% - \ifcsundef{mod@id}{}{% - \expandafter\g@addto@macro\this@module% - {\expandafter\mod@newcommand\csname modules@#2@pres@\endcsname[#3]{#4}}% - \expandafter\g@addto@macro\this@module% - {\expandafter\mod@newcommand\csname #2\endcsname[1][]% - {\csname modules@#2@pres@##1\endcsname}}% - \expandafter\g@addto@macro\csname module@defs@\mod@id\expandafter\endcsname\expandafter% - {\expandafter\@mod@nc\csname mod@symref@#2\expandafter\endcsname\expandafter% - {\expandafter\mod@termref\expandafter{\mod@id}{#2}{##1}}}% - \ifmod@qualified% - \expandafter\g@addto@macro\this@qualified@module% - {\expandafter\mod@newcommand\csname modules@#2@pres@qualified\endcsname[#3]{#4}}% - \expandafter\g@addto@macro\this@qualified@module% - {\expandafter\def\csname#2@qualified\endcsname{\csname modules@#2@pres@qualified\endcsname}}% - \fi% - }% mod@qualified - \fi% symdeflocal - \ifmod@show% - \ifx\symdef@display\st@flow\else{\noindent\stDMemph{\symdef@type} #2:}\fi% - \ifx\symdef@title\@empty~\else~(\stDMemph{\symdef@title})\par\fi% - \fi% - \ignorespacesandpars% -}% mod@show -\def\symdef@type{Symbol}% -\def\symvariant#1{% - \@ifnextchar[{\@symvariant{#1}}{\@symvariant{#1}[0]}% - }% -\def\@symvariant#1[#2]#3#4{% - \expandafter\mod@newcommand\csname modules@#1@pres@#3\endcsname[#2]{#4}% - \ifcsundef{mod@id}{}{% - \expandafter\g@addto@macro\this@module% - {\expandafter\mod@newcommand\csname modules@#1@pres@#3\endcsname[#2]{#4}}% - }% -\ignorespacesandpars}% -\def\resymdef{% - \@ifnextchar[{\@resymdef}{\@resymdef[]}% -}% -\def\@resymdef[#1]#2{% - \@ifnextchar[{\@@resymdef[#1]{#2}}{\@@resymdef[#1]{#2}[0]}% -}% -\def\@@resymdef[#1]#2[#3]#4{% - \PackageError{modules}% - {The \protect\resymdef macro is deprecated}{use the \protect\symvariant instead!}% -}% -\let\abbrdef\symdef% -\define@key{DefMathOp}{name}{% - \def\defmathop@name{#1}% -}% -\newrobustcmd\DefMathOp[2][]{% - \setkeys{DefMathOp}{#1}% - \symdef[#1]{\defmathop@name}{#2}% -}% -\newcommand\assdef[2][]{#2} -\def\vardef{\@ifnextchar[{\@vardef}{\@vardef[]}}% -\def\@vardef[#1]#2{% - \@ifnextchar[{\@@vardef[#1]{#2}}{\@@vardef[#1]{#2}[0]}} -\def\@@vardef[#1]#2[#3]#4{% - \def\@test{#1}% - \ifx\@test\@empty% - \@@symdef[local]{#2}[#3]{#4}% - \else% - \symdef[local,#1]{#2}[#3]{#4}% - \fi% - \ignorespacesandpars}% -\addmetakey{symtest}{name}% -\addmetakey{symtest}{variant}% -\newrobustcmd\symtest[3][]{% - \if@importing% - \else% - \metasetkeys{symtest}{#1}% - \par\noindent \textbf{Symbol}~% - \ifx\symtest@name\@empty\texttt{#2}\else\texttt{\symtest@name}\fi% - \ifx\symtest@variant\@empty\else\ (variant \texttt{\symtest@variant})\fi% - \ with semantic macro % - \texttt{\textbackslash #2\ifx\symtest@variant\@empty\else[\symtest@variant]\fi}% - : used e.g. in \ensuremath{#3}% - \fi% - \ignorespacesandpars% -}% -\addmetakey{abbrtest}{name}% -\newrobustcmd\abbrtest[3][]{% - \if@importing% - \else% - \metasetkeys{abbrtest}{#1}% - \par\noindent \textbf{Abbreviation}~% - \ifx\abbrtest@name\@empty\texttt{#2}\else\texttt{\abbrtest@name}\fi% - : used e.g. in \ensuremath{#3}% - \fi% - \ignorespacesandpars}% -\def\mod@true{true}% -\addmetakey[false]{termdef}{local}% -\addmetakey{termdef}{name}% -\newrobustcmd\termdef[3][]{% - \metasetkeys{termdef}{#1}% - \expandafter\mod@newcommand\csname#2\endcsname[0]{#3\xspace}% - \ifx\termdef@local\mod@true% - \else% - \ifcsundef{mod@id}{}{% - \expandafter\g@addto@macro\this@module% - {\expandafter\mod@newcommand\csname#2\endcsname[0]{#3\xspace}}% - }% - \fi% -}% -\def\@capitalize#1{\uppercase{#1}}% -\newrobustcmd\capitalize[1]{\expandafter\@capitalize #1}% -\newcommand\mod@component[1]{} -\newcommand\mod@termref[3]{\def\@test{#3}% - \@ifundefined{module@defs@#1}{% - \protect\G@refundefinedtrue% - \if@trwarn - \PackageWarning{modules}{`\protect\termref' with unidentified cd "#1":\MessageBreak - the cd key must reference an active module}% - \else - \PackageError{modules}{`\protect\termref' with unidentified cd "#1"} - {the cd key must reference an active module}% - \fi}% - {\def\@label{sref@#2@#1\mod@component{#1}@target}% - \@ifundefined{module@#1@path}% local reference - {\sref@hlink@ifh{\@label}{\ifx\@test\@empty #2\else #3\fi}% - }% - {\def\@uri{\csname module@#1@path\endcsname\mod@component{#1}.pdf\#\@label}% - \sref@href@ifh{\@uri}{\ifx\@test\@empty #2\else #3\fi}% -}% - }}% -\def\CurrentDir{}% -\newrobustcmd{\@rinput}[2]{% - \@cpath{\CurrentDir#1}% - \StrCut[\value{RealAddrNum}]{/\@CanPath}{/}\@TempPath\@Rubbish% - \StrCut[1]{\@TempPath/}{/}\@Rubbish\@DirPath% - \edef\CurrentDir{\@DirPath}% - \input{\@CanPath.#2}% - \def\CurrentDir{}% -}% -\newrobustcmd\requiremodules[2]{% - \mod@showfalse% - \@importingtrue% save state and ensure silence while reading sms - \edef\mod@path{#1}% - \edef\mod@ext{#2}% set up path/ext - \input{#1.#2}% -}% -\newrobustcmd\@requiremodules[2]{% - \if@tempswa\requiremodules{#1}{#2}\fi% -}% -\newrobustcmd\inputref[2][]{% - \def\@Slash{/} - \edef\@load{#2}% - \StrChar{\@load}{1}[\@testchar] - \ifx\@testchar\@Slash% - \edef\mod@path{#2}% - \edef\mod@ext{tex}% - \input{#2}% - \else% - \@rinput{#2}{tex}% - \fi% -}% -\def\requirepackage#1#2{\makeatletter\input{#1.sty}\makeatother}% -\newrobustcmd\sinput[1]{% - \PackageError{modules}% - {The `\protect\sinput' macro is deprecated}{use the \protect\input instead!}% -}% -\newrobustcmd\sinputref[1]{% - \PackageError{modules}% - {The \protect\sinputref macro is deprecated}{use the \protect\inputref instead!}% -}% -\define@key{module}{uses}{% - \@for\module@tmp:=#1\do{\activate@defs\module@tmp\export@defs\module@tmp}% -}% -\define@key{module}{usesqualified}{% - \@for\module@tmp:=#1\do{\activate@defs{qualified@\module@tmp}\export@defs\module@tmp}% -}% -\def\coolurion{\PackageWarning{modules}{coolurion is obsolete, please remove}}% -\def\coolurioff{\PackageWarning{modules}{coolurioff is obsolete, please remove}}% -\def\csymdef{\@ifnextchar[{\@csymdef}{\@csymdef[]}}% -\def\@csymdef[#1]#2{% - \@ifnextchar[{\@@csymdef[#1]{#2}}{\@@csymdef[#1]{#2}[0]}% -}% -\def\@@csymdef[#1]#2[#3]#4#5{% - \@@symdef[#1]{#2}[#3]{#4}% -}% -\def\notationdef[#1]#2#3{} -\newrobustcmd\reqmodules[2]{% - \ifinlist{#1}{\@register}{}{\listadd\@register{#1}\input{#1.#2}}% -}% -\newcounter{@pl} -\DeclareListParser*{\forpathlist}{/} -\def\file@name#1{% - \setcounter{@pl}{0}% - \forpathlist{\stepcounter{@pl}\listadd\@pathlist}{#1} - \def\do##1{% - \ifnumequal{\value{@pl}}{1}{##1}{\addtocounter{@pl}{-1}} - }% - \dolistloop{\@pathlist}% -}% -\def\file@path#1{% - \setcounter{@pl}{0}% - \forpathlist{\stepcounter{@pl}\listadd\@pathlist}{#1}% - \def\do##1{% - \ifnumequal{\value{@pl}}{1}{}{% - \addtocounter{@pl}{-1}% - \ifnumequal{\value{@pl}}{1}{##1}{##1/}% - }% - }% - \dolistloop{\@pathlist}% -}% -\def\@NEWcurrentprefix{} -\def\NEWrequiremodules#1{% - \def\@pref{\file@path{#1}}% - \ifx\@pref\@empty% - \else% - \xdef\@NEWcurrentprefix{\@NEWcurrentprefix/\@pref}% - \fi% - \edef\@input@me{\@NEWcurrentprefix/\file@name{#1}}% - \message{requiring \@input@me}\reqmodule{\@input@me}% -}% -\endinput -%% -%% End of file `modules.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/notesslides.cls b/Master/texmf-dist/tex/latex/stex/notesslides.cls new file mode 100644 index 00000000000..267511a95d6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/notesslides.cls @@ -0,0 +1,49 @@ +%% +%% This is file `notesslides.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% notesslides.dtx (with options: `cls') +%% +\ProvidesExplClass{notesslides}{2022/02/26}{3.0.1}{notesslides Class} +\RequirePackage{l3keys2e} + +\keys_define:nn{notesslides / cls}{ + class .code:n = { + \PassOptionsToClass{\CurrentOption}{document-structure} + \str_if_eq:nnT{#1}{book}{ + \PassOptionsToPackage{defaulttopsec=part}{notesslides} + } + \str_if_eq:nnT{#1}{report}{ + \PassOptionsToPackage{defaulttopsec=part}{notesslides} + } + }, + notes .bool_set:N = \c__notesslides_notes_bool , + slides .code:n = { \bool_set_false:N \c__notesslides_notes_bool }, + unknown .code:n = { + \PassOptionsToClass{\CurrentOption}{document-structure} + \PassOptionsToClass{\CurrentOption}{beamer} + \PassOptionsToPackage{\CurrentOption}{notesslides} + } +} +\ProcessKeysOptions{ notesslides / cls } +\bool_if:NTF \c__notesslides_notes_bool { + \PassOptionsToPackage{notes=true}{notesslides} +}{ + \PassOptionsToPackage{notes=false}{notesslides} +} +\bool_if:NTF \c__notesslides_notes_bool { + \LoadClass{document-structure} +}{ + \LoadClass[10pt,notheorems,xcolor={dvipsnames,svgnames}]{beamer} + \newcounter{Item} + \newcounter{paragraph} + \newcounter{subparagraph} + \newcounter{Hfootnote} + \RequirePackage{document-structure} +} +\RequirePackage{notesslides} +\endinput +%% +%% End of file `notesslides.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/notesslides.sty b/Master/texmf-dist/tex/latex/stex/notesslides.sty new file mode 100644 index 00000000000..b315199f709 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/notesslides.sty @@ -0,0 +1,455 @@ +%% +%% This is file `notesslides.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% notesslides.dtx (with options: `package') +%% +\ProvidesExplPackage{notesslides}{2022/02/26}{3.0.1}{notesslides Package} +\RequirePackage{l3keys2e} + +\keys_define:nn{notesslides / pkg}{ + topsect .str_set_x:N = \c__notesslides_topsect_str, + defaulttopsect .str_set_x:N = \c__notesslides_defaulttopsec_str, + notes .bool_set:N = \c__notesslides_notes_bool , + slides .code:n = { \bool_set_false:N \c__notesslides_notes_bool }, + sectocframes .bool_set:N = \c__notesslides_sectocframes_bool , + frameimages .bool_set:N = \c__notesslides_frameimages_bool , + fiboxed .bool_set:N = \c__notesslides_fiboxed_bool , + noproblems .bool_set:N = \c__notesslides_noproblems_bool, + unknown .code:n = { + \PassOptionsToClass{\CurrentOption}{stex} + \PassOptionsToClass{\CurrentOption}{tikzinput} + } +} +\ProcessKeysOptions{ notesslides / pkg } +\newif\ifnotes +\bool_if:NTF \c__notesslides_notes_bool { + \notestrue +}{ + \notesfalse +} + +\str_if_empty:NTF \c__notesslides_topsect_str { + \str_set_eq:NN \__notesslidestopsect \c__notesslides_defaulttopsec_str +}{ + \str_set_eq:NN \__notesslidestopsect \c__notesslides_topsect_str +} +\bool_if:NT \c__notesslides_notes_bool { + \RequirePackage{a4wide} + \RequirePackage{marginnote} + \PassOptionsToPackage{usenames,dvipsnames,svgnames}{xcolor} + \RequirePackage{mdframed} + \RequirePackage[noxcolor,noamsthm]{beamerarticle} + \RequirePackage[bookmarks,bookmarksopen,bookmarksnumbered,breaklinks,hidelinks]{hyperref} +} +\RequirePackage{stex-tikzinput} +\RequirePackage{etoolbox} +\RequirePackage{amssymb} +\RequirePackage{amsmath} +\RequirePackage{comment} +\RequirePackage{textcomp} +\RequirePackage{url} +\RequirePackage{graphicx} +\RequirePackage{pgf} +\bool_if:NT \c__notesslides_notes_bool { + \renewcommand\usetheme[2][]{\usepackage[#1]{beamernotestheme#2}} +} +\newcounter{slide} +\newlength{\slidewidth}\setlength{\slidewidth}{13.5cm} +\newlength{\slideheight}\setlength{\slideheight}{9cm} +\bool_if:NTF \c__notesslides_notes_bool { + \renewenvironment{note}{\ignorespaces}{} +}{ + \excludecomment{note} +} +\bool_if:NT \c__notesslides_notes_bool { + \newlength{\slideframewidth} + \setlength{\slideframewidth}{1.5pt} + \cs_new_protected:Nn \__notesslides_do_yes_param:Nn { + \exp_args:Nx \str_if_eq:nnTF { \str_uppercase:n{ #2 } }{ yes }{ + \bool_set_true:N #1 + }{ + \bool_set_false:N #1 + } + } + \keys_define:nn{notesslides / frame}{ + label .str_set_x:N = \l__notesslides_frame_label_str, + allowframebreaks .code:n = { + \__notesslides_do_yes_param:Nn \l__notesslides_frame_allowframebreaks_bool { #1 } + }, + allowdisplaybreaks .code:n = { + \__notesslides_do_yes_param:Nn \l__notesslides_frame_allowdisplaybreaks_bool { #1 } + }, + fragile .code:n = { + \__notesslides_do_yes_param:Nn \l__notesslides_frame_fragile_bool { #1 } + }, + shrink .code:n = { + \__notesslides_do_yes_param:Nn \l__notesslides_frame_shrink_bool { #1 } + }, + squeeze .code:n = { + \__notesslides_do_yes_param:Nn \l__notesslides_frame_squeeze_bool { #1 } + }, + t .code:n = { + \__notesslides_do_yes_param:Nn \l__notesslides_frame_t_bool { #1 } + }, + } + \cs_new_protected:Nn \__notesslides_frame_args:n { + \str_clear:N \l__notesslides_frame_label_str + \bool_set_true:N \l__notesslides_frame_allowframebreaks_bool + \bool_set_true:N \l__notesslides_frame_allowdisplaybreaks_bool + \bool_set_true:N \l__notesslides_frame_fragile_bool + \bool_set_true:N \l__notesslides_frame_shrink_bool + \bool_set_true:N \l__notesslides_frame_squeeze_bool + \bool_set_true:N \l__notesslides_frame_t_bool + \keys_set:nn { notesslides / frame }{ #1 } + } + \renewenvironment{frame}[1][]{ + \__notesslides_frame_args:n{#1} + \sffamily + \stepcounter{slide} + \def\@currentlabel{\theslide} + \str_if_empty:NF \l__notesslides_frame_label_str { + \label{\l__notesslides_frame_label_str} + } + \def\itemize@level{outer} + \def\itemize@outer{outer} + \def\itemize@inner{inner} + \renewcommand\newpage{\addtocounter{framenumber}{1}} + \newcommand\metakeys@show@keys[2]{\marginnote{{\scriptsize ##2}}} + \renewenvironment{itemize}{ + \ifx\itemize@level\itemize@outer + \def\itemize@label{$\rhd$} + \fi + \ifx\itemize@level\itemize@inner + \def\itemize@label{$\scriptstyle\rhd$} + \fi + \begin{list} + {\itemize@label} + {\setlength{\labelsep}{.3em} + \setlength{\labelwidth}{.5em} + \setlength{\leftmargin}{1.5em} + } + \edef\itemize@level{\itemize@inner} + }{ + \end{list} + } + \begin{mdframed}[linewidth=\slideframewidth,skipabove=1ex,skipbelow=1ex,userdefinedwidth=\slidewidth,align=center]\sf + }{ + \medskip\miko@slidelabel\end{mdframed} + } + \renewcommand{\frametitle}[1]{{\Large\bf\sf\color{blue}{#1}}\medskip} +} +\bool_if:NT \c__notesslides_notes_bool { + \newcommand\pause{} +} +\bool_if:NTF \c__notesslides_notes_bool { + \newenvironment{nparagraph}[1][]{\begin{sparagraph}[#1]}{\end{sparagraph}} +}{ + \excludecomment{nparagraph} +} +\bool_if:NTF \c__notesslides_notes_bool { + \newenvironment{nfragment}[2][]{\begin{sfragment}[#1]{#2}}{\end{sfragment}} +}{ + \excludecomment{nfragment} +} +\bool_if:NTF \c__notesslides_notes_bool { + \newenvironment{ndefinition}[1][]{\begin{sdefinition}[#1]}{\end{sdefinition}} +}{ + \excludecomment{ndefinition} +} +\bool_if:NTF \c__notesslides_notes_bool { + \newenvironment{nassertion}[1][]{\begin{sassertion}[#1]}{\end{sassertion}} +}{ + \excludecomment{nassertion} +} +\bool_if:NTF \c__notesslides_notes_bool { + \newenvironment{nproof}[2][]{\begin{sproof}[#1]{#2}}{\end{sproof}} +}{ + \excludecomment{nproof} +} +\bool_if:NTF \c__notesslides_notes_bool { + \newenvironment{nexample}[1][]{\begin{sexample}[#1]}{\end{sexample}} +}{ + \excludecomment{nexample} +} +\def\inputref@preskip{\smallskip} +\def\inputref@postskip{\medskip} +\let\orig@inputref\inputref +\def\inputref{\@ifstar\ninputref\orig@inputref} +\newcommand\ninputref[2][]{ + \bool_if:NT \c__notesslides_notes_bool { + \orig@inputref[#1]{#2} + } +} +\newlength{\slidelogoheight} + +\bool_if:NTF \c__notesslides_notes_bool { + \setlength{\slidelogoheight}{.4cm} +}{ + \setlength{\slidelogoheight}{1cm} +} +\newsavebox{\slidelogo} +\sbox{\slidelogo}{\sTeX} +\newrobustcmd{\setslidelogo}[1]{ + \sbox{\slidelogo}{\includegraphics[height=\slidelogoheight]{#1}} +} +\def\source{Michael Kohlhase}% customize locally +\newrobustcmd{\setsource}[1]{\def\source{#1}} +\def\copyrightnotice{\footnotesize\copyright :\hspace{.3ex}{\source}} +\newsavebox{\cclogo} +\sbox{\cclogo}{\includegraphics[height=\slidelogoheight]{stex-cc_somerights}} +\newif\ifcchref\cchreffalse +\AtBeginDocument{ + \@ifpackageloaded{hyperref}{\cchreftrue}{\cchreffalse} +} +\def\licensing{ + \ifcchref + \href{http://creativecommons.org/licenses/by-sa/2.5/}{\usebox{\cclogo}} + \else + {\usebox{\cclogo}} + \fi +} +\newrobustcmd{\setlicensing}[2][]{ + \def\@url{#1} + \sbox{\cclogo}{\includegraphics[height=\slidelogoheight]{#2}} + \ifx\@url\@empty + \def\licensing{{\usebox{\cclogo}}} + \else + \def\licensing{ + \ifcchref + \href{#1}{\usebox{\cclogo}} + \else + {\usebox{\cclogo}} + \fi + } + \fi +} +\newrobustcmd\miko@slidelabel{ + \vbox to \slidelogoheight{ + \vss\hbox to \slidewidth + {\licensing\hfill\copyrightnotice\hfill\arabic{slide}\hfill\usebox{\slidelogo}} + } +} +\def\Gin@mhrepos{} +\define@key{Gin}{mhrepos}{\def\Gin@mhrepos{#1}} +\define@key{Gin}{label}{\def\@currentlabel{\arabic{slide}}\label{#1}} +\newrobustcmd\frameimage[2][]{ + \stepcounter{slide} + \bool_if:NT \c__notesslides_frameimages_bool { + \def\Gin@ewidth{}\setkeys{Gin}{#1} + \bool_if:NF \c__notesslides_notes_bool { \vfill } + \begin{center} + \bool_if:NTF \c__notesslides_fiboxed_bool { + \fbox{ + \ifx\Gin@ewidth\@empty + \ifx\Gin@mhrepos\@empty + \mhgraphics[width=\slidewidth,#1]{#2} + \else + \mhgraphics[width=\slidewidth,#1,mhrepos=\Gin@mhrepos]{#2} + \fi + \else% Gin@ewidth empty + \ifx\Gin@mhrepos\@empty + \mhgraphics[#1]{#2} + \else + \mhgraphics[#1,mhrepos=\Gin@mhrepos]{#2} + \fi + \fi% Gin@ewidth empty + } + }{ + \ifx\Gin@ewidth\@empty + \ifx\Gin@mhrepos\@empty + \mhgraphics[width=\slidewidth,#1]{#2} + \else + \mhgraphics[width=\slidewidth,#1,mhrepos=\Gin@mhrepos]{#2} + \fi + \ifx\Gin@mhrepos\@empty + \mhgraphics[#1]{#2} + \else + \mhgraphics[#1,mhrepos=\Gin@mhrepos]{#2} + \fi + \fi% Gin@ewidth empty + } + \end{center} + \par\strut\hfill{\footnotesize Slide \arabic{slide}}% + \bool_if:NF \c__notesslides_notes_bool { \vfill } + } +} % ifmks@sty@frameimages +\sffamily +\AddToHook{begindocument}{ + \definecolor{green}{rgb}{0,.5,0} + \definecolor{purple}{cmyk}{.3,1,0,.17} +} +\def\defemph#1{{\textcolor{magenta}{#1}}} +\def\symrefemph#1{{\textcolor{cyan}{#1}}} +\def\compemph#1{{\textcolor{blue}{#1}}} +\def\titleemph#1{{\textcolor{blue}{#1}}} +\def\__omtext_lec#1{(\textcolor{green}{#1})} +\pgfdeclareimage[width=.8em]{miko@small@dbend}{stex-dangerous-bend} +\def\smalltextwarning{ + \pgfuseimage{miko@small@dbend} + \xspace +} +\pgfdeclareimage[width=1.2em]{miko@dbend}{stex-dangerous-bend} +\newrobustcmd\textwarning{ + \raisebox{-.05cm}{\pgfuseimage{miko@dbend}} + \xspace +} +\pgfdeclareimage[width=2.5em]{miko@big@dbend}{stex-dangerous-bend} +\newrobustcmd\bigtextwarning{ + \raisebox{-.05cm}{\pgfuseimage{miko@big@dbend}} + \xspace +} +\newrobustcmd\putgraphicsat[3]{ + \begin{picture}(0,0)\put(#1){\includegraphics[#2]{#3}}\end{picture} +} +\newrobustcmd\putat[2]{ + \begin{picture}(0,0)\put(#1){#2}\end{picture} +} +\bool_if:NT \c__notesslides_sectocframes_bool { + \str_if_eq:VnTF \__notesslidestopsect{part}{ + \newcounter{chapter}\counterwithin*{section}{chapter} + }{ + \str_if_eq:VnT\__notesslidestopsect{chapter}{ + \newcounter{chapter}\counterwithin*{section}{chapter} + } + } +} +\def\part@prefix{} +\@ifpackageloaded{document-structure}{}{ + \str_case:VnF \__notesslidestopsect { + {part}{ + \int_set:Nn \l_document_structure_section_level_int {0} + \def\thesection{\arabic{chapter}.\arabic{section}} + \def\part@prefix{\arabic{chapter}.} + } + {chapter}{ + \int_set:Nn \l_document_structure_section_level_int {1} + \def\thesection{\arabic{chapter}.\arabic{section}} + \def\part@prefix{\arabic{chapter}.} + } + }{ + \int_set:Nn \l_document_structure_section_level_int {2} + \def\part@prefix{} + } +} + +\bool_if:NF \c__notesslides_notes_bool { % only in slides + \renewenvironment{sfragment}[2][]{ + \__document_structure_omgroup_args:n { #1 } + \int_incr:N \l_document_structure_section_level_int + \bool_if:NT \c__notesslides_sectocframes_bool { + \stepcounter{slide} + \begin{frame}[noframenumbering] + \vfill\Large\centering + \red{ + \ifcase\l_document_structure_section_level_int\or + \stepcounter{part} + \def\__notesslideslabel{\omdoc@part@kw~\Roman{part}} + \def\currentsectionlevel{\omdoc@part@kw} + \or + \stepcounter{chapter} + \def\__notesslideslabel{\omdoc@chapter@kw~\arabic{chapter}} + \def\currentsectionlevel{\omdoc@chapter@kw} + \or + \stepcounter{section} + \def\__notesslideslabel{\part@prefix\arabic{section}} + \def\currentsectionlevel{\omdoc@section@kw} + \or + \stepcounter{subsection} + \def\__notesslideslabel{\part@prefix\arabic{section}.\arabic{subsection}} + \def\currentsectionlevel{\omdoc@subsection@kw} + \or + \stepcounter{subsubsection} + \def\__notesslideslabel{\part@prefix\arabic{section}.\arabic{subsection}.\arabic{subsubsection}} + \def\currentsectionlevel{\omdoc@subsubsection@kw} + \or + \stepcounter{paragraph} + \def\__notesslideslabel{\part@prefix\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\arabic{paragraph}} + \def\currentsectionlevel{\omdoc@paragraph@kw} + \else + \def\__notesslideslabel{} + \def\currentsectionlevel{\omdoc@paragraph@kw} + \fi% end ifcase + \__notesslideslabel%\sref@label@id\__notesslideslabel + \quad #2% + }% + \vfill% + \end{frame}% + } + \str_if_empty:NF \l__document_structure_omgroup_id_str { + \stex_ref_new_doc_target:n\l__document_structure_omgroup_id_str + } + }{} +} +\def\inserttheorembodyfont{\normalfont} + +\AddToHook{begindocument}{ % this does not work for some reasone + \setbeamertemplate{theorems}[ams style] +} +\bool_if:NT \c__notesslides_notes_bool { + \renewenvironment{columns}[1][]{% + \par\noindent% + \begin{minipage}% + \slidewidth\centering\leavevmode% + }{% + \end{minipage}\par\noindent% + }% + \newsavebox\columnbox% + \renewenvironment<>{column}[2][]{% + \begin{lrbox}{\columnbox}\begin{minipage}{#2}% + }{% + \end{minipage}\end{lrbox}\usebox\columnbox% + }% +} +\bool_if:NTF \c__notesslides_noproblems_bool { + \newenvironment{problems}{}{} +}{ + \excludecomment{problems} +} +\gdef\printexcursions{} +\newcommand\excursionref[2]{% label, text + \bool_if:NT \c__notesslides_notes_bool { + \begin{sparagraph}[title=Excursion] + #2 \sref[fallback=the appendix]{#1}. + \end{sparagraph} + } +} +\newcommand\activate@excursion[2][]{ + \gappto\printexcursions{\inputref[#1]{#2}} +} +\newcommand\excursion[4][]{% repos, label, path, text + \bool_if:NT \c__notesslides_notes_bool { + \activate@excursion[#1]{#3}\excursionref{#2}{#4} + } +} +\keys_define:nn{notesslides / excursiongroup }{ + id .str_set_x:N = \l__notesslides_excursion_id_str, + intro .tl_set:N = \l__notesslides_excursion_intro_tl, + mhrepos .str_set_x:N = \l__notesslides_excursion_mhrepos_str +} +\cs_new_protected:Nn \__notesslides_excursion_args:n { + \tl_clear:N \l__notesslides_excursion_intro_tl + \str_clear:N \l__notesslides_excursion_id_str + \str_clear:N \l__notesslides_excursion_mhrepos_str + \keys_set:nn {notesslides / excursiongroup }{ #1 } +} +\newcommand\excursiongroup[1][]{ + \__notesslides_excursion_args:n{ #1 } + \ifdefempty\printexcursions{}% only if there are excursions + {\begin{note} + \begin{sfragment}[#1]{Excursions}% + \ifdefempty\l__notesslides_excursion_intro_tl{}{ + \inputref[\l__notesslides_excursion_mhrepos_str]{ + \l__notesslides_excursion_intro_tl + } + } + \printexcursions% + \end{sfragment} + \end{note}} +} +\ifcsname beameritemnestingprefix\endcsname\else\def\beameritemnestingprefix{}\fi +\endinput +%% +%% End of file `notesslides.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls deleted file mode 100644 index 0b339f1841e..00000000000 --- a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls +++ /dev/null @@ -1,54 +0,0 @@ -%% -%% This is file `omdoc.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% omdoc.dtx (with options: `cls') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesClass{omdoc}[2019/03/20 v1.3 OMDoc Documents] -\RequirePackage{etoolbox} -\RequirePackage{kvoptions} -\SetupKeyvalOptions{family=omdoc@cls,prefix=omdoc@cls@} -\DeclareStringOption[article]{class} -\AddToKeyvalOption*{class}{\PassOptionsToPackage{class=\omdoc@cls@class}{omdoc}} -\DeclareVoidOption{report}{\def\omdoc@cls@class{report}% -\ClassWarning{omdoc}{the option 'report' is deprecated, use 'class=report', instead}} -\DeclareVoidOption{book}{\def\omdoc@cls@class{book}% -\ClassWarning{omdoc}{the option 'part' is deprecated, use 'class=book', instead}} -\DeclareVoidOption{bookpart}{\def\omdoc@cls@class{book}% -\PassOptionsToPackage{topsect=chapter}{omdoc}% -\ClassWarning{omdoc}{the option 'bookpart' is deprecated, use 'class=book,topsect=chapter', instead}} -\def\@omdoc@cls@docopt{} -\DeclareDefaultOption{% -\ifx\@omdoc@cls@docopt\@empty% -\xdef\@omdoc@cls@docopt{\CurrentOption}% -\else\xappto\@omdoc@cls@docopt{,\CurrentOption}% -\fi}% -\PassOptionsToPackage{\CurrentOption}{omdoc} -\PassOptionsToPackage{\CurrentOption}{stex} -\ProcessKeyvalOptions{omdoc@cls} -\LoadClass[\@omdoc@cls@docopt]{\omdoc@cls@class} -\RequirePackage{omdoc} -\RequirePackage{stex} -\srefaddidkey{document} -\newcommand\documentkeys[1]{\metasetkeys{document}{#1}} -\let\orig@document=\document -\renewcommand{\document}[1][]{\metasetkeys{document}{#1}\orig@document} -\ifcsdef{frontmatter}% to redefine if necessary - {\cslet{orig@frontmatter}{\frontmatter}\cslet{frontmatter}{\relax}} - {\cslet{orig@frontmatter}{\clearpage\@mainmatterfalse\pagenumbering{roman}}} -\ifcsdef{backmatter}% to redefine if necessary - {\cslet{orig@backmatter}{\backmatter}\cslet{backmatter}{\relax}} - {\cslet{orig@backmatter}{\clearpage\@mainmatterfalse\pagenumbering{roman}}} -\newenvironment{frontmatter} -{\orig@frontmatter} -{\ifcsdef{mainmatter}{}{\clearpage\@mainmattertrue\pagenumbering{arabic}}} -\newenvironment{backmatter} -{\orig@backmatter} -{\ifcsdef{mainmatter}{}{\clearpage\@mainmattertrue\pagenumbering{arabic}}} -\pagenumbering{arabic} -\endinput -%% -%% End of file `omdoc.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty deleted file mode 100644 index ae8ac708578..00000000000 --- a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty +++ /dev/null @@ -1,139 +0,0 @@ -%% -%% This is file `omdoc.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% omdoc.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{omdoc}[2019/03/20 v1.3 OMDoc document Structure] -\RequirePackage{kvoptions} -\SetupKeyvalOptions{family=omdoc@sty,prefix=omdoc@sty@} -\DeclareBoolOption{mh} -\DeclareStringOption[article]{class} -\DeclareBoolOption{showignores} -\DeclareStringOption[section]{topsect} -\newcount\section@level -\DeclareDefaultOption{\PassOptionsToPackage{\CurrentOption}{sref}} -\ProcessKeyvalOptions{omdoc@sty} -\ifomdoc@sty@mh\RequirePackage{omdoc-mh}\fi -\RequirePackage{sref} -\RequirePackage{xspace} -\RequirePackage{comment} -\RequirePackage{pathsuris} -\section@level=2 -\ifdefstring{\omdoc@sty@class}{book}{\section@level=0}{} -\ifdefstring{\omdoc@sty@class}{report}{\section@level=0}{} -\ifdefstring{\omdoc@sty@topsect}{part}{\section@level=0}{} -\ifdefstring{\omdoc@sty@topsect}{chapter}{\section@level=1}{} -\def\current@section@level{document}% -\newcommand\currentsectionlevel{\lowercase\expandafter{\current@section@level}\xspace}% -\newcommand\Currentsectionlevel{\expandafter\MakeUppercase\current@section@level\xspace}% -\newcommand\at@begin@blindomgroup[1]{} -\newenvironment{blindomgroup} -{\advance\section@level by 1\at@begin@blindomgroup\setion@level} -{\advance\section@level by -1} -\newcommand\omgroup@nonum[2]{% -\ifx\hyper@anchor\@undefined\else\phantomsection\fi% -\addcontentsline{toc}{#1}{#2}\@nameuse{#1}*{#2}} -\newcommand\omgroup@num[2]{% -\edef\@@ID{\sref@id} -\ifx\omgroup@short\@empty% no short title -\@nameuse{#1}{#2}% -\else% we have a short title -\@ifundefined{rdfmeta@sectioning}% - {\@nameuse{#1}[\omgroup@short]{#2}}% - {\@nameuse{rdfmeta@#1@old}[\omgroup@short]{#2}}% -\fi% -\sref@label@id@arg{\omdoc@sect@name~\@nameuse{the#1}}\@@ID} -\def\@true{true} -\def\@false{false} -\srefaddidkey{omgroup} -\addmetakey{omgroup}{date} -\addmetakey{omgroup}{creators} -\addmetakey{omgroup}{contributors} -\addmetakey{omgroup}{srccite} -\addmetakey{omgroup}{type} -\addmetakey*{omgroup}{short} -\addmetakey*{omgroup}{display} -\addmetakey[false]{omgroup}{loadmodules}[true] -\newif\if@@num\@@numtrue -\newif\if@mainmatter\@mainmattertrue -\newcommand\at@begin@omgroup[3][]{} -\addmetakey{omdoc@sect}{name} -\addmetakey[false]{omdoc@sect}{clear}[true] -\addmetakey{omdoc@sect}{ref} -\addmetakey[false]{omdoc@sect}{num}[true] -\newcommand\omdoc@sectioning[3][]{\metasetkeys{omdoc@sect}{#1}% -\ifx\omdoc@sect@clear\@true\cleardoublepage\fi% -\if@@num% numbering not overridden by frontmatter, etc. -\ifx\omdoc@sect@num\@true\omgroup@num{#2}{#3}\else\omgroup@nonum{#2}{#3}\fi% -\def\current@section@level{\omdoc@sect@name}% -\else\omgroup@nonum{#2}{#3}% -\fi}% if@@num -\newcommand\omgroup@redefine@addtocontents[1]{% -\edef\@@import{#1}% -\@for\@I:=\@@import\do{% -\edef\@path{\csname module@\@I @path\endcsname}% -\@ifundefined{tf@toc}\relax% - {\protected@write\tf@toc{}{\string\@requiremodules{\@path}{sms}}}} -\ifx\hyper@anchor\@undefined% hyperref.sty loaded? -\def\addcontentsline##1##2##3{% -\addtocontents{##1}{\protect\contentsline{##2}{\string\withusedmodules{#1}{##3}}{\thepage}}} -\else% hyperref.sty not loaded -\def\addcontentsline##1##2##3{% -\addtocontents{##1}{\protect\contentsline{##2}{\string\withusedmodules{#1}{##3}}{\thepage}{\@currentHref}}}% -\fi}% hypreref.sty loaded? -\newenvironment{omgroup}[2][]% keys, title -{\metasetkeys{omgroup}{#1}\sref@target% -\ifx\omgroup@display\st@flow\@@numfalse\fi -\if@mainmatter\else\@@numfalse\fi -\ifx\omgroup@loadmodules\@true% -\omgroup@redefine@addtocontents{\@ifundefined{mod@id}\used@modules% -{\@ifundefined{module@\mod@id @path}{\used@modules}\mod@id}}\fi% -\advance\section@level by 1\relax% -\ifcase\section@level% -\or\omdoc@sectioning[name=Part,clear,num]{part}{#2}% -\or\omdoc@sectioning[name=Chapter,clear,num]{chapter}{#2}% -\or\omdoc@sectioning[name=Section,num]{section}{#2}% -\or\omdoc@sectioning[name=Subsection,num]{subsection}{#2}% -\or\omdoc@sectioning[name=Subsubsection,num]{subsubsection}{#2}% -\or\omdoc@sectioning[name=Paragraph,ref=this paragraph]{paragraph}{#2}% -\or\omdoc@sectioning[name=Subparagraph,ref=this subparagraph]{paragraph}{#2}% -\fi% \ifcase -\at@begin@omgroup[#1]\section@level{#2}}% for customization -{\advance\section@level by -1} -\providecommand\printindex{\IfFileExists{\jobname.ind}{\input{\jobname.ind}}{}} -\ifomdoc@sty@showignores -\addmetakey{ignore}{type} -\addmetakey{ignore}{comment} -\newenvironment{ignore}[1][] -{\metasetkeys{ignore}{#1}\textless\ignore@type\textgreater\bgroup\itshape} -{\egroup\textless/\ignore@type\textgreater} -\renewenvironment{ignore}{}{}\else\excludecomment{ignore}\fi -\providecommand{\lxDocumentID}[1]{}% -\def\LXMID#1#2{\expandafter\gdef\csname xmarg#1\endcsname{#2}\csname xmarg#1\endcsname} -\def\LXMRef#1{\csname xmarg#1\endcsname} -\long\def\STRlabel#1#2{\STRlabeldef{#1}{#2}{#2}} -\newcommand\STRcopy[2][]{\expandafter\ifx\csname STR@#2\endcsname\relax -\message{STR warning: reference #2 undefined!} -\else\csname STR@#2\endcsname\fi} -\newcommand\STRsemantics[3][]{#2\def\@test{#1}\ifx\@test\@empty\STRlabeldef{#1}{#2}\fi} -\def\STRlabeldef#1{\expandafter\gdef\csname STR@#1\endcsname} -\newcommand\setSGvar[1]{\@namedef{sTeX@Gvar@#1}} -\newcommand\useSGvar[1]{\@nameuse{sTeX@Gvar@#1}} -\newcommand\ifSGvar[3]{\def\@test{#2}\expandafter\ifx\csname sTeX@Gvar@#1\endcsname\@test #3\fi} -\def\black#1{\textcolor{black}{#1}} -\def\gray#1{\textcolor{gray}{#1}} -\def\blue#1{\textcolor{blue}{#1}} -\def\red#1{\textcolor{red}{#1}} -\def\green#1{\textcolor{green}{#1}} -\def\cyan#1{\textcolor{cyan}{#1}} -\def\magenta#1{\textcolor{magenta}{#1}} -\def\brown#1{\textcolor{brown}{#1}} -\def\yellow#1{\textcolor{yellow}{#1}} -\def\orange#1{\textcolor{orange}{#1}} -\endinput -%% -%% End of file `omdoc.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/omtext/omtext.sty b/Master/texmf-dist/tex/latex/stex/omtext/omtext.sty deleted file mode 100644 index 3e9fa337484..00000000000 --- a/Master/texmf-dist/tex/latex/stex/omtext/omtext.sty +++ /dev/null @@ -1,193 +0,0 @@ -%% -%% This is file `omtext.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% omtext.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{omtext}[2019/03/20 v1.1 OMDoc Text Fragments] -\newif\if@omtext@mh@\@omtext@mh@false -\DeclareOption{mh}{\@omtext@mh@true -\PassOptionsToPackage{\CurrentOption}{modules}} -\newif\ifindex\indextrue -\DeclareOption{noindex}{\indexfalse} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{modules}} -\ProcessOptions -\ifindex\makeindex\fi -\if@omtext@mh@\RequirePackage{omtext-mh}\fi -\RequirePackage{xspace} -\RequirePackage{modules} -\RequirePackage{comment} -\RequirePackage{mdframed} -\RequirePackage{latexsym} -\srefaddidkey{omtext} -\addmetakey[]{omtext}{functions} -\addmetakey*{omtext}{display} -\addmetakey{omtext}{for} -\addmetakey{omtext}{from} -\addmetakey{omtext}{type} -\addmetakey*{omtext}{title} -\addmetakey*{omtext}{start} -\addmetakey{omtext}{theory} -\addmetakey{omtext}{continues} -\addmetakey{omtext}{verbalizes} -\addmetakey{omtext}{subject} -\define@key{omtext}{require}{\requiremodules{#1}{sms}} -\define@key{omtext}{module}{\message{module: #1}\importmodule{#1}\def\omtext@theory{#1}} -\def\st@flow{flow} -\newif\if@in@omtext\@in@omtextfalse -\def\omtext@pre@skip{\smallskip} -\def\omtext@post@skip{} -\providecommand{\stDMemph}[1]{\textbf{#1}} -\newenvironment{omtext}[1][]{\@in@omtexttrue% -\bgroup\metasetkeys{omtext}{#1}\sref@label@id{this paragraph}% -\def\lec##1{\@lec{##1}}% -\ifx\omtext@display\st@flow\else\omtext@pre@skip\par\noindent% -\ifx\omtext@title\@empty% -\ifx\omtext@start\@empty\else\stDMemph{\omtext@start}\xspace\fi% -\else\stDMemph{\omtext@title}:\xspace% -\ifx\omtext@start\@empty\else\omtext@start\xspace\fi% -\fi% omtext@title empty -\fi% omtext@display=flow -\ignorespaces} -{\egroup\omtext@post@skip\@in@omtextfalse} -\srefaddidkey{phrase} -\addmetakey{phrase}{style} -\addmetakey{phrase}{class} -\addmetakey{phrase}{index} -\addmetakey{phrase}{verbalizes} -\addmetakey{phrase}{type} -\addmetakey{phrase}{only} -\newcommand\phrase[2][]{\metasetkeys{phrase}{#1}% -\ifx\prhase@only\@empty\only<\phrase@only>{#2}\else #2\fi} -\providecommand\textsubscript[1]{\ensuremath{_{#1}}} -\newcommand\corefs[2]{#1\textsubscript{#2}} -\newcommand\coreft[2]{#1\textsuperscript{#2}} -\newcommand\nlex[1]{\green{\sl{#1}}} -\newcommand\nlcex[1]{*\green{\sl{#1}}} -\def\@sinlinequote#1{``{\sl{#1}}''} -\def\@@sinlinequote#1#2{\@sinlinequote{#2}~#1} -\newcommand\sinlinequote[2][] -{\def\@opt{#1}\ifx\@opt\@empty\@sinlinequote{#2}\else\@@sinlinequote\@opt{#2}\fi} -\newcommand\vdec[2][]{#2} -\newcommand\vrest[2][]{#2} -\newcommand\vcond[2][]{#2} -\newcommand\strucdec[2][]{#2} -\newcommand\impdec[2][]{#2} -\def\begin@sblockquote{\begin{quote}\sl} -\def\end@sblockquote{\end{quote}} -\def\begin@@sblockquote#1{\begin@sblockquote} -\def\end@@sblockquote#1{\def\@@lec##1{\textrm{##1}}\@lec{#1}\end@sblockquote} -\newenvironment{sblockquote}[1][] - {\def\@opt{#1}\ifx\@opt\@empty\begin@sblockquote\else\begin@@sblockquote\@opt\fi} - {\ifx\@opt\@empty\end@sblockquote\else\end@@sblockquote\@opt\fi} -\newenvironment{sboxquote}[1][] -{\def\@@src{#1}\begin{mdframed}[leftmargin=.5cm,rightmargin=.5cm]} -{\@lec{\textrm\@@src}\end{mdframed}} -\providecommand{\@@lec}[1]{(#1)} -\def\@lec#1{\strut\hfil\strut\null\nobreak\hfill\@@lec{#1}} -\def\lec#1{\@lec{#1}\par} -\newcommand\mygraphics[2][]{\includegraphics[#1]{#2}} -\newcommand\mycgraphics[2][]{\begin{center}\mygraphics[#1]{#2}\end{center}} -\newcommand\mybgraphics[2][]{\fbox{\mygraphics[#1]{#2}}} -\newcommand\mycbgraphics[2][]{\begin{center}\fbox{\mygraphics[#1]{#2}}\end{center}} -\addmetakey{omdoc@index}{at} -\addmetakey[false]{omdoc@index}{loadmodules}[true] -\newcommand\omdoc@indexi[2][]{\ifindex% -\metasetkeys{omdoc@index}{#1}% -\@bsphack\begingroup\@sanitize% -\protected@write\@indexfile{}{\string\indexentry% -{\ifx\omdoc@index@at\@empty\else\omdoc@index@at @\fi% -\ifx\omdoc@index@loadmodules\@true% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#2}% -\else #2\fi% loadmodules -}{\thepage}}% -\endgroup\@esphack\fi}%ifindex -\newcommand\omdoc@indexii[3][]{\ifindex% -\metasetkeys{omdoc@index}{#1}% -\@bsphack\begingroup\@sanitize% -\protected@write\@indexfile{}{\string\indexentry% -{\ifx\omdoc@index@at\@empty\else\omdoc@index@at @\fi% -\ifx\omdoc@index@loadmodules\@true% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#2}!% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#3}% -\else #2!#3\fi% loadmodules -}{\thepage}}% -\endgroup\@esphack\fi}%ifindex -\newcommand\omdoc@indexiii[4][]{\ifindex% -\metasetkeys{omdoc@index}{#1}% -\@bsphack\begingroup\@sanitize% -\protected@write\@indexfile{}{\string\indexentry% -{\ifx\omdoc@index@at\@empty\else\omdoc@index@at @\fi% -\ifx\omdoc@index@loadmodules\@true% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#2}!% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#3}!% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#4}% -\else #2!#3!#4\fi% loadmodules -}{\thepage}}% -\endgroup\@esphack\fi}%ifindex -\newcommand\omdoc@indexiv[5][]{\ifindex% -\metasetkeys{omdoc@index}{#1}% -\@bsphack\begingroup\@sanitize% -\protected@write\@indexfile{}{\string\indexentry% -{\ifx\omdoc@index@at\@empty\else\omdoc@index@at @\fi% -\ifx\omdoc@index@loadmodules\@true% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#2}!% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#3}!% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#4}% -\string\withusedmodules{\@ifundefined{mod@id}\used@modules\mod@id}{#5}% -\else #2!#3!#4!#5\fi% loadmodules -}{\thepage}}% -\endgroup\@esphack\fi}%ifindex -\newcommand\aindi[3][]{{#2}\omdoc@indexi[#1]{#3}} -\newcommand\indi[2][]{{#2}\omdoc@indexi[#1]{#2}} -\newcommand\indis[2][]{{#2}\omdoc@indexi[#1]{#2s}} -\newcommand\Indi[2][]{{\captitalize{#2}}\omdoc@indexi[#1]{#2}} -\newcommand\Indis[2][]{{\capitalize{#2}}\omdoc@indexi[#1]{#2s}} - -\newcommand\@indii[3][]{\omdoc@indexii[#1]{#2}{#3}\omdoc@indexii[#1]{#3}{#2}} -\newcommand\aindii[4][]{#2\@indii[#1]{#3}{#4}} -\newcommand\indii[3][]{{#2 #3}\@indii[#1]{#2}{#3}} -\newcommand\indiis[3][]{{#2 #3s}\@indii[#1]{#2}{#3}} -\newcommand\Indii[3][]{{\captitalize{#2 #3}}\@indii[#1]{#2}{#3}} -\newcommand\Indiis[3][]{{\capitalize{#2 #3}}\@indii[#1]{#2}{#3}} - -\newcommand\@indiii[4][]{\omdoc@indexiii[#1]{#2}{#3}{#4}\omdoc@indexii[#1]{#3}{#2 (#4)}} -\newcommand\aindiii[5][]{{#2}\@indiii[#1]{#3}{#4}{#5}} -\newcommand\indiii[4][]{{#2 #3 #4}\@indiii[#1]{#2}{#3}{#4}} -\newcommand\indiiis[4][]{{#2 #3 #4s}\@indiii[#1]{#2}{#3}{#4}} -\newcommand\Indiii[4][]{\captitalize{#2 #3 #4}\@indiii[#1]{#2}{#3}{#4}} -\newcommand\Indiiis[4][]{\capitalize{#2 #3 #4s}\@indiii[#1]{#2}{#3}{#4}} - -\newcommand\@indiv[5][]{\omdoc@indexiv[#1]{#2}{#3}{#4}{#5}} -\newcommand\aindiv[6][]{#2\@indiv[#1]{#3}{#4}{#5}{#6}} -\newcommand\indiv[5][]{{#2 #3 #4 #5}\@indiv[#1]{#2}{#3}{#4}{#5}} -\newcommand\indivs[5][]{{#2 #3 #4 #5s}\@indiv[#1]{#2}{#3}{#4}{#5}} -\newcommand\Indiv[5][]{\capitalize{#2 #3 #4 #5s}\@indiv[#1]{#2}{#3}{#4}{#5}} -\newcommand\Indivs[5][]{\capitalize{#2 #3 #4 #5s}\@indiv[#1]{#2}{#3}{#4}{#5}} -\newcommand\hateq{\ensuremath{\widehat=}\xspace} -\newcommand\hatequiv{\ensuremath{\widehat\equiv}\xspace} -\@ifundefined{ergo}% -{\newcommand\ergo{\ensuremath{\leadsto}\xspace}}% -{\renewcommand\ergo{\ensuremath{\leadsto}\xspace}}% -\newcommand{\reflect@squig}[2]{\reflectbox{$\m@th#1\rightsquigarrow$}}% -\newcommand\ogre{\ensuremath{\mathrel{\mathpalette\reflect@squig\relax}}\xspace}% -\newcommand\notergo{\ensuremath{\not\leadsto}} -\newcommand\notogre{\ensuremath{\not\mathrel{\mathpalette\reflect@squig\relax}}\xspace}% -\newcommand\indextoo[2][]{\indi[#1]{#2}% -\PackageWarning{omtext}{\protect\indextoo\space is deprecated, use \protect\indi\space instead}} -\newcommand\indexalt[2][]{\aindi[#1]{#2}% -\PackageWarning{omtext}{\protect\indextoo\space is deprecated, use \protect\aindi\space instead}} -\newcommand\twintoo[3][]{\indii[#1]{#2}{#3}% -\PackageWarning{omtext}{\protect\twintoo\space is deprecated, use \protect\indii\space instead}} -\newcommand\twinalt[3][]{\aindii[#1]{#2}{#3}% -\PackageWarning{omtext}{\protect\twinalt\space is deprecated, use \protect\aindii\space instead}} -\newcommand\atwintoo[4][]{\indiii[#1]{#2}{#3}{#4}% -\PackageWarning{omtext}{\protect\atwintoo\space is deprecated, use \protect\indiii\space instead}} -\newcommand\atwinalt[4][]{\aindii[#1]{#2}{#3}{#4}% -\PackageWarning{omtext}{\protect\atwinalt\space is deprecated, use \protect\aindiii\space instead}} -\endinput -%% -%% End of file `omtext.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/presentation/presentation.sty b/Master/texmf-dist/tex/latex/stex/presentation/presentation.sty deleted file mode 100644 index a657281b8b7..00000000000 --- a/Master/texmf-dist/tex/latex/stex/presentation/presentation.sty +++ /dev/null @@ -1,187 +0,0 @@ -%% -%% This is file `presentation.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% presentation.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{presentation}[2019/03/20 v1.0 presentation for semantic macros] -\DeclareOption*{} -\ProcessOptions -\RequirePackage{keyval}[1997/11/10] -\RequirePackage{amsmath} -\def\pres@default@precedence{0} -\def\pres@infty{1000000} -\def\pres@infty@minusone{999999} -\def\iprec{\pres@infty} -\def\niprec{-\pres@infty} -\def\pres@initial@precedence{0} -\def\pres@current@precedence{\pres@initial@precedence} -\def\pres@default@lbrack{(}\def\pres@lbrack{\pres@default@lbrack} -\def\pres@default@rbrack{)}\def\pres@rbrack{\pres@default@rbrack} -\newcommand\withpreci[1]{\edef\pres@current@precedence{#1}} -\newcommand\withprecii[1]{\edef\pres@current@precedence{#1}} -\newcommand\withpreciii[1]{\edef\pres@current@precedence{#1}} -\newcommand\PrecSet[1]{\edef\pres@default@precedence{#1}} -\def\PrecWrite#1{\ifnum\pres@p>\pres@current@precedence\else{#1}\fi} -\def\PrepostPrecWrite#1{\ifnum\pres@p@key>\pres@infty@minusone\else{#1}\fi} -\def\prepost@clearkeys{\def\pres@p@key{\pres@default@precedence}\def\pres@pi@key{\niprec} -\def\pres@lbrack{\pres@default@lbrack}\def\pres@rbrack{\pres@default@rbrack}} -\define@key{prepost}{lbrack}{\def\pres@lbrack{#1}} -\define@key{prepost}{rbrack}{\def\pres@lbrack{#1}} -\define@key{prepost}{p}{\def\pres@p@key{#1}} -\define@key{prepost}{pi}{\def\pres@pi@key{#1}} -\define@key{prepost}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}% -\def\pres@pi@key{-\pres@infty}} -\newcommand\prefix[3][]%key, fn, arg -{\prepost@clearkeys\setkeys{prepost}{#1} -{#2}\PrepostPrecWrite\pres@lbrack{\edef\pres@current@precedence{\pres@pi@key}#3}\PrepostPrecWrite\pres@rbrack} -\newcommand\postfix[3][]%key, fn, arg -{\prepost@clearkeys\setkeys{prepost}{#1} -\PrepostPrecWrite\pres@lbrack{\edef\pres@current@precedence{\pres@pi@key}#3}\PrepostPrecWrite\pres@rbrack{#2}} -\def\clearkeys{\let\pres@p@key=\relax -\let\pres@pi@key=\relax% -\let\pres@pi@key=\relax% -\let\pres@pii@key=\relax% -\let\pres@piii@key=\relax} -\define@key{mi}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}% -\def\pres@pi@key{-\pres@infty}} -\define@key{mi}{lbrack}{\def\pres@lbrack@key{#1}} -\define@key{mi}{rbrack}{\def\pres@lbrack@key{#1}} -\define@key{mi}{p}{\def\pres@p@key{#1}} -\define@key{mi}{pi}{\def\pres@pi@key{#1}} -\def\prep@keys@mi% -{\edef\pres@lbrack{\@ifundefined{pres@lbrack@key}\pres@default@lbrack\pres@lbrack@key} -\edef\pres@rbrack{\@ifundefined{pres@rbrack@key}\pres@default@rbrack\pres@rbrack@key} -\edef\pres@p{\@ifundefined{pres@p@key}\pres@default@precedence\pres@p@key} -\edef\pres@pi{\@ifundefined{pres@pi@key}\pres@p\pres@pi@key}} -\newcommand\mixfixi[4][]%key, pre, arg, post -{\clearkeys\setkeys{mi}{#1}\prep@keys@mi% -\PrecWrite\pres@lbrack% -#2{\edef\pres@current@precedence{\pres@pi}#3}#4% -\PrecWrite\pres@rbrack} -\def\@assoc#1#2#3{% precedence, function, argv -\let\@tmpop=\relax% do not print the function the first time round -\@for\@I:=#3\do{\@tmpop% print the function -{\edef\pres@current@precedence{#1}\@I}% -\def\@tmpop{#2}}}%update the function -\newcommand\mixfixa[5][]%key, pre, arg, post, assocop -{\clearkeys\setkeys{mi}{#1}\prep@keys@mi% -\PrecWrite\pres@lbrack{#2}{\@assoc\pres@pi{#5}{#3}}{#4}\PrecWrite\pres@rbrack} -\newcommand\mixfixA[5][]%key, pre, arg, post, assocop -{\clearkeys\setkeys{mi}{#1}\prep@keys@mi% -\renewcommand\do[1]{\@assoc\pres@pi{#5}{##1}{#5}\tabularnewline}% -\PrecWrite\pres@lbrack% write bracket if necessary -#2{\begin{array}{l}\docsvlist{#3}\end{array}}% -#4\PrecWrite\pres@rbrack} -\define@key{mii}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}% -\def\pres@pi@key{-\pres@infty}\def\pres@pii@key{-\pres@infty}} -\define@key{mii}{lbrack}{\def\pres@lbrack@key{#1}} -\define@key{mii}{rbrack}{\def\pres@lbrack@key{#1}} -\define@key{mii}{p}{\def\pres@p@key{#1}} -\define@key{mii}{pi}{\def\pres@pi@key{#1}} -\define@key{mii}{pii}{\def\pres@pii@key{#1}} -\def\prep@keys@mii{\prep@keys@mi% -\edef\pres@pii{\@ifundefined{pres@pii@key}\pres@p\pres@pii@key}} -\newcommand\mixfixii[6][]%key, pre, arg1, mid, arg2, post -{\clearkeys\setkeys{mii}{#1}\prep@keys@mii% -\PrecWrite\pres@lbrack% write bracket if necessary -#2{\edef\pres@current@precedence{\pres@pi}#3}% -#4{\edef\pres@current@precedence{\pres@pii}#5}#6% -\PrecWrite\pres@rbrack} -\newcommand\mixfixia[7][]%key, pre, arg1, mid, arg2, post, assocop -{\clearkeys\setkeys{mii}{#1}\prep@keys@mii% -\PrecWrite\pres@lbrack% write bracket if necessary -#2{\edef\pres@current@precedence{\pres@pi}#3}% -#4{\@assoc\pres@pii{#7}{#5}}#6% -\PrecWrite\pres@rbrack} -\newcommand\mixfixiA[7][]%key, pre, arg1, mid, arg2, post, assocop -{\clearkeys\setkeys{mii}{#1}\prep@keys@mii% -\renewcommand\do[1]{\@assoc\pres@pi{#7}{##1}{#7}\tabularnewline}% -\PrecWrite\pres@lbrack% write bracket if necessary -#2{\edef\pres@current@precedence{\pres@pi}#3}% -#4{\begin{array}{l}\docsvlist{#5}\end{array}}#6% -\PrecWrite\pres@rbrack} -\newcommand\mixfixai[7][]%key, pre, arg1, mid, arg2, post, assocop -{\clearkeys\setkeys{mii}{#1}\prep@keys@mii% -\PrecWrite\pres@lbrack% write bracket if necessary -#2{\@assoc\pres@pi{#7}{#3}}% -#4{\edef\pres@current@precedence{\pres@pii}#5}#6% -\PrecWrite\pres@rbrack} -\define@key{miii}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}% -\def\pres@pi@key{-\pres@infty} -\def\pres@pii@key{-\pres@infty} -\def\pres@pii@key{-\pres@infty}} -\define@key{miii}{lbrack}{\def\pres@lbrack@key{#1}} -\define@key{miii}{rbrack}{\def\pres@lbrack@key{#1}} -\define@key{miii}{p}{\def\pres@p@key{#1}} -\define@key{miii}{pi}{\def\pres@pi@key{#1}} -\define@key{miii}{pii}{\def\pres@pii@key{#1}} -\define@key{miii}{piii}{\def\pres@piii@key{#1}} -\def\prep@keys@miii{\prep@keys@mii% -\edef\pres@piii{\@ifundefined{pres@piii@key}{\pres@p}{\pres@piii@key}}} -\newcommand\mixfixiii[8][]%key, pre, arg1, mid1, arg2, mid2, arg3, post -{\clearkeys\setkeys{miii}{#1}\prep@keys@miii% -\PrecWrite\pres@lbrack% write bracket if necessary -#2{\edef\pres@current@precedence{\pres@pi}#3}% -#4{\edef\pres@current@precedence{\pres@pii}#5}% -#6{\edef\pres@current@precedence{\pres@pii}#7}#8% -\PrecWrite\pres@rbrack} -\newcommand\mixfixaii[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post, sep -{\clearkeys\setkeys{miii}{#1}\prep@keys@miii% -\PrecWrite\pres@lbrack% write bracket if necessary -#2{\@assoc\pres@pi{#9}{#3}}% -#4{\edef\pres@current@precedence{\pres@pii}#5}% -#6{\edef\pres@current@precedence{\pres@pii}#7}#8% -\PrecWrite\pres@rbrack} -\newcommand\mixfixiai[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post, assocop -{\clearkeys\setkeys{miii}{#1}\prep@keys@miii% -\PrecWrite\pres@lbrack% write bracket if necessary -#2{\edef\pres@current@precedence{\pres@pi}#3}% -#4{\@assoc\pres@pi{#9}{#5}}% -#6{\edef\pres@current@precedence{\pres@pii}#7}#8% -\PrecWrite\pres@rbrack} -\newcommand\mixfixiia[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post,assocop -{\clearkeys\setkeys{miii}{#1}\prep@keys@miii% -\PrecWrite\pres@lbrack% write bracket if necessary -#2{\edef\pres@current@precedence{\pres@pi}#3}% -#4{\edef\pres@current@precedence{\pres@pii}#5}% -#6{\@assoc\pres@pi{#9}{#7}}#8% -\PrecWrite\pres@rbrack} -\newcommand\prefixa[4][]%keys, fn, arg, sep -{\prepost@clearkeys\setkeys{prepost}{#1}% -{#2}\pres@lbrack{\@assoc\pres@pi@key{#4}{#3}}\pres@rbrack} -\newcommand\postfixa[4][]%keys, fn, arg, sep -{\prepost@clearkeys\setkeys{prepost}{#1}% -\pres@lbrack{\@assoc\pres@pi@key{#4}{#3}}\pres@rbrack{#2}} -\newcommand\infix[4][]{\mixfixii[#1]{}{#3}{#2}{#4}{}} -\newcommand\assoc[3][]{\mixfixa[#1]{}{#3}{}{#2}} -\def\setegroup#1#2{\expandafter\def\csname #1@egroup\endcsname{#2}} -\def\elide#1#2#3{\@ifundefined{#1@egroup}% -{\def\@elevel{0} -\PackageError{presentation}{undefined egroup #1, assuming value 0}% -{When calling \protect\elide{#1}... the elision group #1 has be have\MessageBreak -been set by \protect\setegroup before, e.g. by \protect\setegroup{an}{0}.}}% -{\edef\@elevel{\csname #1@egroup\endcsname}}% -\ifnum\@elevel>#2\else{#3}\fi} -\def\provideEdefault#1#2{\expandafter\def\csname#1@edefault\endcsname{#2} -\@ifundefined{this@module}{}% -{\expandafter\g@addto@macro\this@module{\expandafter\def\csname#1@edefault\endcsname{#2}}}} -\def\setEdefault#1#2{\expandafter\def\csname #1@edfault\endcsname{#2}} -\def\fromEcontext#1{\csname #1@edefault\endcsname} -\newcommand\parray[2]{\begin{array}{#1}#2\end{array}} -\newcommand\parrayline[2]{#1#2\\} -\newcommand\prmatrix[1]{\begin{matrix}#1\end{matrix}} -\def\pmrow#1{\expandafter\@gobble\x@mrow#1\endx@mrow,} -\def\x@mrow#1,{\x@mrow} -\def\endx@mrow#1{\\} -\def\pmrowh#1{\expandafter\@gobble\x@mrowh#1\endx@mrowh,} -\def\x@mrowh#1,{\x@mrowh} -\def\endx@mrowh#1{\\\hline} -\newcommand\parraylineh[2]{#1#2\\\hline} -\newcommand\parraycell[1]{#1&} -\endinput -%% -%% End of file `presentation.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/problem.sty b/Master/texmf-dist/tex/latex/stex/problem.sty new file mode 100644 index 00000000000..2e927431576 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/problem.sty @@ -0,0 +1,446 @@ +%% +%% This is file `problem.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% problem.dtx (with options: `package') +%% +\ProvidesExplPackage{problem}{2022/02/26}{3.0.1}{Semantic Markup for Problems} +\RequirePackage{l3keys2e,stex} + +\keys_define:nn { problem / pkg }{ + notes .default:n = { true }, + notes .bool_set:N = \c__problems_notes_bool, + gnotes .default:n = { true }, + gnotes .bool_set:N = \c__problems_gnotes_bool, + hints .default:n = { true }, + hints .bool_set:N = \c__problems_hints_bool, + solutions .default:n = { true }, + solutions .bool_set:N = \c__problems_solutions_bool, + pts .default:n = { true }, + pts .bool_set:N = \c__problems_pts_bool, + min .default:n = { true }, + min .bool_set:N = \c__problems_min_bool, + boxed .default:n = { true }, + boxed .bool_set:N = \c__problems_boxed_bool, + unknown .code:n = {} +} +\newif\ifsolutions + +\ProcessKeysOptions{ problem / pkg } +\bool_if:NTF \c__problems_solutions_bool { + \solutionstrue +}{ + \solutionsfalse +} +\RequirePackage{comment} +\bool_if:NT \c__problems_boxed_bool { \RequirePackage{mdframed} } +\def\prob@problem@kw{Problem} +\def\prob@solution@kw{Solution} +\def\prob@hint@kw{Hint} +\def\prob@note@kw{Note} +\def\prob@gnote@kw{Grading} +\def\prob@pt@kw{pt} +\def\prob@min@kw{min} +\AddToHook{begindocument}{ + \ltx@ifpackageloaded{babel}{ + \makeatletter + \clist_set:Nx \l_tmpa_clist {\bbl@loaded} + \clist_if_in:NnT \l_tmpa_clist {ngerman}{ + \input{problem-ngerman.ldf} + } + \clist_if_in:NnT \l_tmpa_clist {finnish}{ + \input{problem-finnish.ldf} + } + \clist_if_in:NnT \l_tmpa_clist {french}{ + \input{problem-french.ldf} + } + \clist_if_in:NnT \l_tmpa_clist {russian}{ + \input{problem-russian.ldf} + } + \makeatother + }{} +} +\keys_define:nn{ problem / problem }{ + id .str_set_x:N = \l__problems_prob_id_str, + pts .tl_set:N = \l__problems_prob_pts_tl, + min .tl_set:N = \l__problems_prob_min_tl, + title .tl_set:N = \l__problems_prob_title_tl, + type .tl_set:N = \l__problems_prob_type_tl, + refnum .int_set:N = \l__problems_prob_refnum_int +} +\cs_new_protected:Nn \__problems_prob_args:n { + \str_clear:N \l__problems_prob_id_str + \tl_clear:N \l__problems_prob_pts_tl + \tl_clear:N \l__problems_prob_min_tl + \tl_clear:N \l__problems_prob_title_tl + \tl_clear:N \l__problems_prob_type_tl + \int_zero_new:N \l__problems_prob_refnum_int + \keys_set:nn { problem / problem }{ #1 } + \int_compare:nNnT \l__problems_prob_refnum_int = 0 { + \let\l__problems_prob_refnum_int\undefined + } +} +\newcounter{problem} +\newcommand\numberproblemsin[1]{\@addtoreset{problem}{#1}} +\newcommand\prob@label[1]{#1} +\newcommand\prob@number{ + \int_if_exist:NTF \l__problems_inclprob_refnum_int { + \prob@label{\int_use:N \l__problems_inclprob_refnum_int } + }{ + \int_if_exist:NTF \l__problems_prob_refnum_int { + \prob@label{\int_use:N \l__problems_prob_refnum_int } + }{ + \prob@label\theproblem + } + } +} +\newcommand\prob@title[3]{% + \tl_if_exist:NTF \l__problems_inclprob_title_tl { + #2 \l__problems_inclprob_title_tl #3 + }{ + \tl_if_exist:NTF \l__problems_prob_title_tl { + #2 \l__problems_prob_title_tl #3 + }{ + #1 + } + } +} +\def\prob@heading{ + {\prob@problem@kw}\ \prob@number\prob@title{~}{~(}{)\strut} + %\sref@label@id{\prob@problem@kw~\prob@number}{} +} +\newenvironment{sproblem}[1][]{ + \__problems_prob_args:n{#1}%\sref@target% + \@in@omtexttrue% we are in a statement (for inline definitions) + \stepcounter{problem}\record@problem + \def\current@section@level{\prob@problem@kw} + \tl_if_exist:NTF \l__problems_inclprob_type_tl { + \tl_set_eq:NN \sproblemtype \l__problems_inclprob_type_tl + }{ + \tl_set_eq:NN \sproblemtype \l__problems_prob_type_tl + } + \str_if_exist:NTF \l__problems_inclprob_id_str { + \str_set_eq:NN \sproblemid \l__problems_inclprob_id_str + }{ + \str_set_eq:NN \sproblemid \l__problems_prob_id_str + } + + \clist_set:No \l_tmpa_clist \sproblemtype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__problems_sproblem_##1_start:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__problems_sproblem_##1_start:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__problems_sproblem_start: + }{ + \l_tmpa_tl + } + \stex_ref_new_doc_target:n \sproblemid +}{ + \clist_set:No \l_tmpa_clist \sproblemtype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__problems_sproblem_##1_end:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__problems_sproblem_##1_end:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__problems_sproblem_end: + }{ + \l_tmpa_tl + } + + \smallskip +} + +\cs_new_protected:Nn \__problems_sproblem_start: { + \par\noindent\textbf\prob@heading\show@pts\show@min\\\ignorespacesandpars +} +\cs_new_protected:Nn \__problems_sproblem_end: {\par\smallskip} + +\newcommand\stexpatchproblem[3][] { + \str_set:Nx \l_tmpa_str{ #1 } + \str_if_empty:NTF \l_tmpa_str { + \tl_set:Nn \__problems_sproblem_start: { #2 } + \tl_set:Nn \__problems_sproblem_end: { #3 } + }{ + \exp_after:wN \tl_set:Nn \csname __problems_sproblem_#1_start:\endcsname{ #2 } + \exp_after:wN \tl_set:Nn \csname __problems_sproblem_#1_end:\endcsname{ #3 } + } +} + +\bool_if:NT \c__problems_boxed_bool { + \surroundwithmdframed{problem} +} +\def\record@problem{ + \protected@write\@auxout{} + { + \string\@problem{\prob@number} + { + \tl_if_exist:NTF \l__problems_inclprob_pts_tl { + \l__problems_inclprob_pts_tl + }{ + \l__problems_prob_pts_tl + } + }% + { + \tl_if_exist:NTF \l__problems_inclprob_min_tl { + \l__problems_inclprob_min_tl + }{ + \l__problems_prob_min_tl + } + } + } +} +\def\@problem#1#2#3{} +\keys_define:nn { problem / solution }{ + id .str_set_x:N = \l__problems_solution_id_str , + for .tl_set:N = \l__problems_solution_for_tl , + height .dim_set:N = \l__problems_solution_height_dim , + creators .clist_set:N = \l__problems_solution_creators_clist , + contributors .clist_set:N = \l__problems_solution_contributors_clist , + srccite .tl_set:N = \l__problems_solution_srccite_tl +} +\cs_new_protected:Nn \__problems_solution_args:n { + \str_clear:N \l__problems_solution_id_str + \tl_clear:N \l__problems_solution_for_tl + \tl_clear:N \l__problems_solution_srccite_tl + \clist_clear:N \l__problems_solution_creators_clist + \clist_clear:N \l__problems_solution_contributors_clist + \dim_zero:N \l__problems_solution_height_dim + \keys_set:nn { problem / solution }{ #1 } +} +\newcommand\@startsolution[1][]{ + \__problems_solution_args:n { #1 } + \@in@omtexttrue% we are in a statement. + \bool_if:NF \c__problems_boxed_bool { \hrule } + \smallskip\noindent + {\textbf\prob@solution@kw :\enspace} + \begin{small} + \def\current@section@level{\prob@solution@kw} + \ignorespacesandpars +} +\newcommand\startsolutions{ + \specialcomment{solution}{\@startsolution}{ + \bool_if:NF \c__problems_boxed_bool { + \hrule\medskip + } + \end{small}% + } + \bool_if:NT \c__problems_boxed_bool { + \surroundwithmdframed{solution} + } +} +\newcommand\stopsolutions{\excludecomment{solution}} +\ifsolutions + \startsolutions +\else + \stopsolutions +\fi +\bool_if:NTF \c__problems_notes_bool { + \newenvironment{exnote}[1][]{ + \par\smallskip\hrule\smallskip + \noindent\textbf{\prob@note@kw : }\small + }{ + \smallskip\hrule + } +}{ + \excludecomment{exnote} +} +\bool_if:NTF \c__problems_notes_bool { + \newenvironment{hint}[1][]{ + \par\smallskip\hrule\smallskip + \noindent\textbf{\prob@hint@kw :~ }\small + }{ + \smallskip\hrule + } + \newenvironment{exhint}[1][]{ + \par\smallskip\hrule\smallskip + \noindent\textbf{\prob@hint@kw :~ }\small + }{ + \smallskip\hrule + } +}{ + \excludecomment{hint} + \excludecomment{exhint} +} +\bool_if:NTF \c__problems_notes_bool { + \newenvironment{gnote}[1][]{ + \par\smallskip\hrule\smallskip + \noindent\textbf{\prob@gnote@kw : }\small + }{ + \smallskip\hrule + } +}{ + \excludecomment{gnote} +} +\newenvironment{mcb}{ + \begin{enumerate} +}{ + \end{enumerate} +} +\cs_new_protected:Nn \__problems_do_yes_param:Nn { + \exp_args:Nx \str_if_eq:nnTF { \str_lowercase:n{ #2 } }{ yes }{ + \bool_set_true:N #1 + }{ + \bool_set_false:N #1 + } +} +\keys_define:nn { problem / mcc }{ + id .str_set_x:N = \l__problems_mcc_id_str , + feedback .tl_set:N = \l__problems_mcc_feedback_tl , + T .default:n = { true } , + T .bool_set:N = \l__problems_mcc_t_bool , + F .default:n = { true } , + F .bool_set:N = \l__problems_mcc_f_bool , + Ttext .code:n = { + \__problems_do_yes_param:Nn \l__problems_mcc_Ttext_bool { #1 } + } , + Ftext .code:n = { + \__problems_do_yes_param:Nn \l__problems_mcc_Ftext_bool { #1 } + } +} +\cs_new_protected:Nn \l__problems_mcc_args:n { + \str_clear:N \l__problems_mcc_id_str + \tl_clear:N \l__problems_mcc_feedback_tl + \bool_set_true:N \l__problems_mcc_t_bool + \bool_set_true:N \l__problems_mcc_f_bool + \bool_set_true:N \l__problems_mcc_Ttext_bool + \bool_set_false:N \l__problems_mcc_Ftext_bool + \keys_set:nn { problem / mcc }{ #1 } +} +\newcommand\mcc[2][]{ + \l__problems_mcc_args:n{ #1 } + \item #2 + \ifsolutions + \\ + \bool_if:NT \l__problems_mcc_t_bool { + % TODO! + % \ifcsstring{mcc@T}{T}{}{\mcc@Ttext}% + } + \bool_if:NT \l__problems_mcc_f_bool { + % TODO! + % \ifcsstring{mcc@F}{F}{}{\mcc@Ftext}% + } + \tl_if_empty:NTF \l__problems_mcc_feedback_tl { + ! + }{ + \l__problems_mcc_feedback_tl + } + \fi +} %solutions + +\keys_define:nn{ problem / inclproblem }{ + id .str_set_x:N = \l__problems_inclprob_id_str, + pts .tl_set:N = \l__problems_inclprob_pts_tl, + min .tl_set:N = \l__problems_inclprob_min_tl, + title .tl_set:N = \l__problems_inclprob_title_tl, + refnum .int_set:N = \l__problems_inclprob_refnum_int, + type .tl_set:N = \l__problems_inclprob_type_tl, + mhrepos .str_set_x:N = \l__problems_inclprob_mhrepos_str +} +\cs_new_protected:Nn \__problems_inclprob_args:n { + \str_clear:N \l__problems_prob_id_str + \tl_clear:N \l__problems_inclprob_pts_tl + \tl_clear:N \l__problems_inclprob_min_tl + \tl_clear:N \l__problems_inclprob_title_tl + \tl_clear:N \l__problems_inclprob_type_tl + \int_zero_new:N \l__problems_inclprob_refnum_int + \str_clear:N \l__problems_inclprob_mhrepos_str + \keys_set:nn { problem / inclproblem }{ #1 } + \tl_if_empty:NT \l__problems_inclprob_pts_tl { + \let\l__problems_inclprob_pts_tl\undefined + } + \tl_if_empty:NT \l__problems_inclprob_min_tl { + \let\l__problems_inclprob_min_tl\undefined + } + \tl_if_empty:NT \l__problems_inclprob_title_tl { + \let\l__problems_inclprob_title_tl\undefined + } + \tl_if_empty:NT \l__problems_inclprob_type_tl { + \let\l__problems_inclprob_type_tl\undefined + } + \int_compare:nNnT \l__problems_inclprob_refnum_int = 0 { + \let\l__problems_inclprob_refnum_int\undefined + } +} + +\cs_new_protected:Nn \__problems_inclprob_clear: { + \let\l__problems_inclprob_id_str\undefined + \let\l__problems_inclprob_pts_tl\undefined + \let\l__problems_inclprob_min_tl\undefined + \let\l__problems_inclprob_title_tl\undefined + \let\l__problems_inclprob_type_tl\undefined + \let\l__problems_inclprob_refnum_int\undefined + \let\l__problems_inclprob_mhrepos_str\undefined +} +\__problems_inclprob_clear: + +\newcommand\includeproblem[2][]{ + \__problems_inclprob_args:n{ #1 } + \str_if_empty:NTF \l__problems_inclprob_mhrepos_str { + \input{#2} + }{ + \stex_in_repository:nn{\l__problems_inclprob_mhrepos_str}{ + \input{\mhpath{\l__problems_inclprob_mhrepos_str}{#2}} + } + } + \__problems_inclprob_clear: +} +\AddToHook{enddocument}{ + \bool_if:NT \c__problems_pts_bool { + \message{Total:~\arabic{pts}~points} + } + \bool_if:NT \c__problems_min_bool { + \message{Total:~\arabic{min}~minutes} + } +} +\def\pts#1{ + \bool_if:NT \c__problems_pts_bool { + \marginpar{#1~\prob@pt@kw} + } +} +\def\min#1{ + \bool_if:NT \c__problems_min_bool { + \marginpar{#1~\prob@min@kw} + } +} +\newcounter{pts} +\def\show@pts{ + \tl_if_exist:NTF \l__problems_inclprob_pts_tl { + \bool_if:NT \c__problems_pts_bool { + \marginpar{\l__problems_inclprob_pts_tl\ \prob@pt@kw\smallskip} + \addtocounter{pts}{\l__problems_inclprob_pts_tl} + } + }{ + \tl_if_exist:NT \l__problems_prob_pts_tl { + \bool_if:NT \c__problems_pts_bool { + \marginpar{\l__problems_prob_pts_tl\ \prob@pt@kw\smallskip} + \addtocounter{pts}{\l__problems_prob_pts_tl} + } + } + } +} +\newcounter{min} +\def\show@min{ + \tl_if_exist:NTF \l__problems_inclprob_min_tl { + \bool_if:NT \c__problems_min_bool { + \marginpar{\l__problems_inclprob_pts_tl\ min} + \addtocounter{min}{\l__problems_inclprob_min_tl} + } + }{ + \tl_if_exist:NT \l__problems_prob_min_tl { + \bool_if:NT \c__problems_min_bool { + \marginpar{\l__problems_prob_min_tl\ min} + \addtocounter{min}{\l__problems_prob_min_tl} + } + } + } +} +\endinput +%% +%% End of file `problem.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/problem/problem.sty b/Master/texmf-dist/tex/latex/stex/problem/problem.sty deleted file mode 100644 index ff617ee26d7..00000000000 --- a/Master/texmf-dist/tex/latex/stex/problem/problem.sty +++ /dev/null @@ -1,146 +0,0 @@ -%% -%% This is file `problem.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% problem.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{problem}[2019/03/20 v1.3 Semantic Markup for Problems] -\newif\if@problem@mh@\@problem@mh@false -\DeclareOption{mh}{\@problem@mh@true} -\newif\ifexnotes\exnotesfalse -\DeclareOption{notes}{\exnotestrue} -\newif\ifhints\hintsfalse -\DeclareOption{hints}{\hintstrue} -\newif\ifsolutions\solutionsfalse -\DeclareOption{solutions}{\solutionstrue} -\newif\ifpts\ptsfalse -\DeclareOption{pts}{\ptstrue} -\newif\ifmin\minfalse -\DeclareOption{min}{\mintrue} -\newif\ifboxed\boxedfalse -\DeclareOption{boxed}{\boxedtrue} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{omtext}} -\ProcessOptions -\if@problem@mh@\RequirePackage{problem-mh}\fi -\RequirePackage{omtext} -\RequirePackage{comment} -\RequirePackage{mdframed} -\RequirePackage[base]{babel} -\AfterBabelLanguage{ngerman}{\input{problem-ngerman.ldf}} -\AfterBabelLanguage{arabic}{\input{problem-arabic.ldf}} -\def\prob@problem@kw{Problem} -\def\prob@solution@kw{Solution} -\srefaddidkey[prefix=prob.]{problem} -\addmetakey{problem}{pts} -\addmetakey{problem}{min} -\addmetakey*{problem}{title} -\addmetakey{problem}{refnum} -\newcounter{problem} -\newcommand\numberproblemsin[1]{\@addtoreset{problem}{#1}} -\newcommand\prob@label[1]{#1} -\newcommand\prob@number{% -\ifx\inclprob@refnum\@empty% if there is no outside refnumb -\ifx\problem@refnum\@empty\prob@label\theproblem% -\else\prob@label\problem@refnum\fi% -\else\prob@label\inclprob@refnum\fi} -\newcommand\prob@title[3]{% -\ifx\inclprob@title\@empty% if there is no outside title -\ifx\problem@title\@empty{#1}\else{#2\problem@title{#3}}\fi -\else{#2}\inclprob@title{#3}\fi}% else show the outside title -\def\prob@heading{\prob@problem@kw~\prob@number\prob@title{ }{ (}{)\strut\\}% -\sref@label@id{\prob@problem@kw~\prob@number}} -\newenvironment{problem}[1][]{\metasetkeys{problem}{#1}\sref@target% -\@in@omtexttrue% we are in a statement (for inline definitions) -\stepcounter{problem}\record@problem% -\def\current@section@level{\prob@problem@kw}% -\par\noindent\textbf\prob@heading\show@pts\show@min\rmfamily\noindent\ignorespaces} -{\smallskip} -\ifboxed\surroundwithmdframed{problem}\fi -\def\record@problem{\protected@write\@auxout{}% -{\string\@problem{\prob@number}% -{\ifx\inclprob@pts\@empty\problem@pts\else\inclprob@pts\fi}% -{\ifx\inclprob@min\@empty\problem@min\else\inclprob@min\fi}}} -\def\@problem#1#2#3{} -\srefaddidkey{soln} -\addmetakey{soln}{for} -\addmetakey{soln}{height} -\addmetakey{soln}{creators} -\addmetakey{soln}{contributors} -\addmetakey{soln}{srccite} -\newcommand\@startsolution[1][]{\metasetkeys{soln}{#1}% -\@in@omtexttrue% we are in a statement. -\ifboxed\else\hrule\fi\smallskip\noindent{\textbf\prob@solution@kw: }\begin{small}% -\def\current@section@level{\prob@solution@kw}% -\ignorespaces} -\newcommand\startsolutions{\specialcomment{solution}{\@startsolution}% -{\ifboxed\else\hrule\medskip\fi\end{small}}% -\ifboxed\surroundwithmdframed{solution}\fi} -\newcommand\stopsolutions{\excludecomment{solution}} -\ifsolutions\startsolutions\else\stopsolutions\fi -\ifexnotes -\newenvironment{exnote}[1][]% -{\par\smallskip\hrule\smallskip\noindent\textbf{Note: }\small} -{\smallskip\hrule} -\else%ifexnotes -\excludecomment{exnote} -\fi%ifexnotes -\ifhints -\newenvironment{hint}[1][]% -{\par\smallskip\hrule\smallskip\noindent\textbf{Hint: }\small} -{\smallskip\hrule} -\newenvironment{exhint}[1][]% -{\par\smallskip\hrule\smallskip\noindent\textbf{Hint: }\small} -{\smallskip\hrule} -\else%ifhints -\excludecomment{hint} -\excludecomment{exhint} -\fi%ifhints -\newenvironment{mcb} -{\begin{enumerate}} -{\end{enumerate}} -\srefaddidkey{mcc} -\addmetakey{mcc}{feedback} -\addmetakey[T]{mcc}{T} -\addmetakey[F]{mcc}{F} -\addmetakey[Yes]{mcc}{Ttext} -\addmetakey[No]{mcc}{Ftext} -\newcommand\mcc[2][]{% -\metasetkeys{mcc}{#1}% -\item #2% -\ifsolutions\\% -\ifcsstring{mcc@T}{T}{}{\mcc@Ttext}% -\ifcsstring{mcc@F}{F}{}{\mcc@Ftext}% -\ifx\mcc@feedback\@empty!\else, \mcc@feedback\fi% -\fi} %solutions -\addmetakey{inclprob}{pts} -\addmetakey{inclprob}{min} -\addmetakey*{inclprob}{title} -\addmetakey{inclprob}{refnum} -\addmetakey{inclprob}{mhrepos} -\clear@inclprob@keys%initially -\newcommand\includeproblem[2][]{\metasetkeys{inclprob}{#1}% -\input{#2}\clear@inclprob@keys} -\def\pts#1{\ifpts\marginpar{#1 pt}\fi} -\def\min#1{\ifmin\marginpar{#1 min}\fi} -\AtEndDocument{\ifpts\message{Total: \arabic{pts} points}\fi -\ifmin\message{Total: \arabic{min} minutes}\fi} -\newcounter{pts} -\def\show@pts{\ifx\inclprob@pts\@empty% -\ifx\problem@pts\@empty\else% -\ifpts\marginpar{\problem@pts pt\smallskip}\addtocounter{pts}{\problem@pts}\fi% -\fi\else% inclprob@pts nonempty -\ifpts\marginpar{\inclprob@pts pt\smallskip}\addtocounter{pts}{\inclprob@pts}\fi% -\fi} -\newcounter{min} -\def\show@min{\ifx\inclprob@min\@empty% -\ifx\problem@min\@empty\else% -\ifmin\marginpar{\problem@min min}\addtocounter{min}{\problem@min}\fi% -\fi\else% -\ifmin\marginpar{\inclprob@min min}\addtocounter{min}{\inclprob@min}\fi -\fi} -\endinput -%% -%% End of file `problem.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/rfdmeta/rdfmeta.sty b/Master/texmf-dist/tex/latex/stex/rfdmeta/rdfmeta.sty deleted file mode 100644 index 594b2a763a7..00000000000 --- a/Master/texmf-dist/tex/latex/stex/rfdmeta/rdfmeta.sty +++ /dev/null @@ -1,72 +0,0 @@ -%% -%% This is file `rdfmeta.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% rdfmeta.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{rdfmeta}[2019/03/20 v0.2 Metadata key upgrades] -\newif\if@rdfmeta@sectioning\@rdfmeta@sectioningfalse -\DeclareOption{sectioning}{\@rdfmeta@sectioningtrue} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{sref} - \PassOptionsToPackage{\CurrentOption}{modules}} -\ProcessOptions -\RequirePackage{sref} -\RequirePackage{modules} -\newcommand\rdfmeta@loaded{yes} -\if@rdfmeta@sectioning\newcommand\rdfmeta@sectioning{yes}\fi -\newcommand\keydef[2]{\addmetakey{#1}{#2}% -\expandafter\g@addto@macro\this@module{\addmetakey{#1}{#2}}} -\newcommand\listkeydef[2]{\addmetalistkey{#1}{#2}% -\expandafter\g@addto@macro\this@module{\addmetalistkey{#1}{#2}}} -\def\@yes@{yes} -\addmetakey*{upgrade}{idlabel} -\addmetakey*{upgrade}{optarg} -\addmetakey*[yes]{upgrade}{optargstar} -\addmetakey*{upgrade}{keygroup} -\def\rdfmeta@upgrade{\@ifstar\rdfmeta@upgrade@star\rdfmeta@upgrade@nostar} -\newcommand\rdfmeta@upgrade@nostar[2][]{\metasetkeys{upgrade}{#1}% -\ifx\upgrade@keygroup\@empty\def\@@group{#2}\else\def\@@group{\upgrade@keygroup}\fi -\rdfmeta@upgrade@base{#2}{\@nameuse{\@@group @\upgrade@optarg}}} -\newcommand\rdfmeta@upgrade@star[2][]{\metasetkeys{upgrade}{#1}% -\ifx\upgrade@keygroup\@empty\def\@@group{#2}\else\def\@@group{\upgrade@keygroup}\fi -\rdfmeta@upgrade@base@star{#2}{\@nameuse{\@@group @\upgrade@optarg}}} -\newcommand\rdfmeta@upgrade@base[2]{\@ifundefined{#1}{}% -{\message{redefining macro #1,} -\ifx\upgrade@idlabel\@empty\srefaddidkey{#1}\else\srefaddidkey[prefix=\upgrade@idlabel]{#1}\fi% -\expandafter\let\csname rdfmeta@#1@old\expandafter\endcsname\csname #1\endcsname% -\expandafter\renewcommand\csname #1\endcsname[2][]% -{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}[#2]{##2}} -\addmetakey*\@@group{\upgrade@optarg}}} -\newcommand\rdfmeta@upgrade@base@star[2]{\@ifundefined{#1}{}% -{\message{redefining macros #1 and #1*,} -\ifx\upgrade@idlabel\@empty\srefaddidkey{#1}\else\srefaddidkey[prefix=\upgrade@idlabel]{#1}\fi% -\expandafter\let\csname rdfmeta@#1@old\expandafter\endcsname\csname #1\endcsname% -\expandafter\renewcommand\csname #1\endcsname% -{\@ifstar{\@nameuse{rdfmeta@#1@star}}{\@nameuse{rdfmeta@#1@nostar}}}% -\expandafter\newcommand\csname rdfmeta@#1@nostar\endcsname[2][]% -{\metasetkeys{#1}{##1}\edef\@test{#2}% -\ifx\@test\@empty\@nameuse{rdfmeta@#1@old}{##2}% -\else\@nameuse{rdfmeta@#1@old}[#2]{##2}\fi}% -\ifx\upgrade@optargstar\@yes@% -\expandafter\newcommand\csname rdfmeta@#1@star\endcsname[2][]% -{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}*[#2]{##2}}% -\else% -\expandafter\newcommand\csname rdfmeta@#1@star\endcsname[2][]% -{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}*{##2}}% -\fi% -\addmetakey*\@@group{\upgrade@optarg}}} -\if@rdfmeta@sectioning -\message{redefining sectioning commands!} -\rdfmeta@upgrade*[optarg=short,optargstar=no]{part} -\rdfmeta@upgrade*[optarg=short,optargstar=no]{chapter} -\rdfmeta@upgrade*[optarg=short,optargstar=no]{section} -\rdfmeta@upgrade*[optarg=short,optargstar=no]{subsection} -\rdfmeta@upgrade*[optarg=short,optargstar=no]{subsubsection} -\rdfmeta@upgrade*[optarg=short,optargstar=no]{paragraph} -\fi -\endinput -%% -%% End of file `rdfmeta.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/smglom/smglom.cls b/Master/texmf-dist/tex/latex/stex/smglom/smglom.cls deleted file mode 100644 index 82a69eb0212..00000000000 --- a/Master/texmf-dist/tex/latex/stex/smglom/smglom.cls +++ /dev/null @@ -1,22 +0,0 @@ -%% -%% This is file `smglom.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% smglom.dtx (with options: `cls') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesClass{smglom}[2019/03/20 v0.1 Semantic Multilingual Glossary for Math] -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{omdoc} - \PassOptionsToPackage{\CurrentOption}{stex} - \PassOptionsToPackage{\CurrentOption}{smglom}} -\ProcessOptions -\LoadClass{omdoc} -\RequirePackage{smglom} -\RequirePackage{stex} -\RequirePackage{amstext} -\RequirePackage{amsfonts} -\endinput -%% -%% End of file `smglom.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/smultiling/smultiling.sty b/Master/texmf-dist/tex/latex/stex/smultiling/smultiling.sty deleted file mode 100644 index 1db482dc0b6..00000000000 --- a/Master/texmf-dist/tex/latex/stex/smultiling/smultiling.sty +++ /dev/null @@ -1,113 +0,0 @@ -%% -%% This is file `smultiling.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% smultiling.dtx (with options: `sty') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{smultiling}[2019/03/20 v0.2 Multilingual Support for sTeX] -\newif\if@smultiling@mh@\@smultiling@mh@false -\DeclareOption{mh}{\@smultiling@mh@true} -\newif\if@langfiles\@langfilesfalse -\DeclareOption{langfiles}{\@langfilestrue} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{modules}} -\ProcessOptions -\if@smultiling@mh@\RequirePackage{smultiling-mh}\fi -\RequirePackage{etoolbox} -\RequirePackage{structview} -\newenvironment{modsig}[2][]{\def\@test{#1}% -\ifx\@test\@empty\begin{module}[id=#2]\else\begin{module}[id=#2,#1]\fi% -\expandafter\gdef\csname mod@#2@multiling\endcsname{true}% -\ignorespacesandpars} -{\end{module}\ignorespacesandparsafterend} -\renewcommand\mod@component[1]{% -\expandafter\ifx\csname mod@#1@multiling\endcsname\@true% -\@ifundefined{smultiling@language}{} -{.\smultiling@language}% -\fi} -\newcommand\sTeXlanguage[1]{\def\smultiling@language{#1}} -\sTeXlanguage{en} -\newenvironment{viewsig}[4][]{\def\@test{#1}\ifx\@test\@empty% - \begin{view}[id=#2,ext=tex]{#3}{#4}\else\begin{view}[id=#2,#1,ext=tex]{#3}{#4}\fi% - \ignorespacesandpars} - {\end{view}\ignorespacesandparsafterend} -\define@key{symi}{noverb}[all]{}% -\define@key{symi}{align}[WithTheSymbolOfTheSameName]{}% -\define@key{symi}{specializes}{}% -\define@key{symi}{noalign}[true]{}% -\newcommand\symi{\@ifstar\@symi@star\@symi} -\newcommand\@symi[2][]{\metasetkeys{symi}{#1}% - \if@importing\else\par\noindent Symbol: \textsf{#2}\fi\ignorespacesandpars} -\newcommand\@symi@star[2][]{\metasetkeys{symi}{#1}% - \if@importing\else\par\noindent Primary Symbol: \textsf{#2}\fi\ignorespacesandpars} -\newcommand\symii{\@ifstar\@symii@star\@symii} -\newcommand\@symii[3][]{\metasetkeys{symi}{#1}% - \if@importing\else\par\noindent Symbol: \textsf{#2-#3}\fi\ignorespacesandpars} -\newcommand\@symii@star[3][]{\metasetkeys{symi}{#1}% - \if@importing\else\par\noindent Primary Symbol: \textsf{#2-#3}\fi\ignorespacesandpars} -\newcommand\symiii{\@ifstar\@symiii@star\@symiii} -\newcommand\@symiii[4][]{\metasetkeys{symi}{#1}% - \if@importing\else\par\noindent Symbol: \textsf{#2-#3-#4}\fi\ignorespacesandpars} -\newcommand\@symiii@star[4][]{\metasetkeys{symi}{#1}% - \if@importing\else\par\noindent Primary Symbol: \textsf{#2-#3-#4}\fi\ignorespacesandpars} -\newcommand\symiv{\@ifstar\@symiv@star\@symiv} -\newcommand\@symiv[5][]{\metasetkeys{symi}{#1}% - \if@importing\else\par\noindent Symbol: \textsf{#2-#3-#4-#5}\fi\ignorespacesandpars} -\newcommand\@symiv@star[5][]{\metasetkeys{symi}{#1}% - \if@importing\else\par\noindent Primary Symbol: \textsf{#2-#3-#4-#5}\fi\ignorespacesandpars} -\addmetakey{modnl}{load} -\addmetakey*{modnl}{title} -\addmetakey*{modnl}{creators} -\addmetakey*{modnl}{contributors} -\addmetakey{modnl}{srccite} -\addmetakey{modnl}{primary}[yes] -\newenvironment{modnl}[3][]{\metasetkeys{modnl}{#1}% - \def\@test{#1}\ifx\@test\@empty\begin{module}[id=#2.#3]\else\begin{module}[id=#2.#3,#1]\fi% - \def\smultiling@language{#3}% - \if@langfiles\importmodule[load=#2,ext=tex]{#2}\else - \ifx\modnl@load\@empty\importmodule{#2}\else\importmodule[ext=tex,load=\modnl@load]{#2}\fi% - \fi% - \ignorespacesandpars} -{\end{module}\ignorespacesandparsafterend} -\newenvironment{viewnl}[5][]{\def\@test{#1}\ifx\@test\@empty% - \begin{view}[id=#2.#3,ext=tex]{#4}{#5}\else% - \begin{view}[id=#2.#3,#1,ext=tex]{#4}{#5}\fi% - \ignorespacesandpars} - {\end{view}\ignorespacesandparsafterend} -\def\@instring#1#2{TT\fi\begingroup\edef\x{\endgroup\noexpand\in@{#1}{#2}}\x\ifin@} -\def\@mtref#1?#2\relax{\@@mtref{#1}{#2}} -\newcommand\@@mtref[3]{\def\@@cd{#1}\def\@@name{#2}% -\ifx\@@cd\@empty% -\ifx\@@name\@empty\termref[]{#3}\else\termref[name=\@@name]{#3}\fi% -\else% -\ifx\@@name\@empty\termref[cd=\@@cd]{#3}\else\termref[cd=\@@cd,name=\@@name]{#3}\fi% -\fi} -\newcommand\mtref[2][]{\if\@instring{?}{#1}\@mtref #1\relax{#2}\else\termref[cd=#1]{#2}\fi} -\newcommand\mtrefi[2][]{\if\@instring{?}{#1}\@mtref #1\relax{#2}% -\else\termref[cd=#1]{#2}\fi} -\newcommand\mtrefis[2][]{\mtrefi[#1]{#2s}} -\newcommand\Mtrefi[2][]{\if\@instring{?}{#1}\@mtref #1\relax{\capitalize{#2}}% -\else\termref[cd=#1]{\capitalize{#2}}\fi} -\newcommand\Mtrefis[2][]{\Mtrefi[#1]{#2s}} -\newcommand\mtrefii[3][]{\mtrefi[#1]{#2 #3}} -\newcommand\mtrefiis[3][]{\mtrefi[#1]{#2 #3s}} -\newcommand\Mtrefii[3][]{\Mtrefi[#1]{#2 #3a}} -\newcommand\Mtrefiis[3][]{\Mtrefi[#1]{#2 #3s}} -\newcommand\mtrefiii[4][]{\mtrefi[#1]{#2 #3 #4}} -\newcommand\Mtrefiiis[4][]{\Mtrefi[#1]{#2 #3 #4s}} -\newcommand\Mtrefiii[4][]{\Mtrefi[#1]{#2 #3 #4}} -\newcommand\mtrefiiis[4][]{\mtrefi[#1]{#2 #3 #4s}} -\newcommand\mtrefiv[5][]{\mtrefi[#1]{#2 #3 #4 #5}} -\newcommand\mtrefivs[5][]{\mtrefi[#1]{#2 #3 #4 #5s}} -\newcommand\Mtrefiv[5][]{\Mtrefi[#1]{#2 #3 #4 #5}} -\newcommand\Mtrefivs[5][]{\Mtrefi[#1]{#2 #3 #4 #5s}} -\addmetakey{symi}{gfc} -\addmetakey{symdef}{gfc}% -\addmetakey{definiendum}{gfa} -\addmetakey{definiendum}{gfl} -\newcommand\ttl[1]{\red{TTL: #1}} -\endinput -%% -%% End of file `smultiling.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty b/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty deleted file mode 100644 index b780babe962..00000000000 --- a/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty +++ /dev/null @@ -1,196 +0,0 @@ -%% -%% This is file `sproof.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% sproof.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{sproof}[2019/03/20 v1.1 Semantic Markup for Proofs] -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{sref}} -\ProcessOptions -\RequirePackage{sref} -\RequirePackage{etoolbox} -\RequirePackage[base]{babel} -\srefaddidkey{spf} -\addmetakey*{spf}{display} -\addmetakey{spf}{for} -\addmetakey{spf}{from} -\addmetakey*[\sproof@box]{spf}{proofend} -\addmetakey{spf}{type} -\addmetakey*{spf}{title} -\addmetakey{spf}{continues} -\addmetakey{spf}{functions} -\addmetakey{spf}{method} -\def\spf@flow{flow} -\newenvironment{pst@with@label}[1]{% - \edef\pst@label{#1}% - \advance\count10 by 1% - \count\count10=1% -}{% - \advance\count10 by -1% -}% -\def\the@pst@label{% - \pst@make@label\pst@label{\number\count\count10}\pstlabel@postfix% -}% -\addmetakey[P]{pstlabel}{prefix}[] -\addmetakey[.]{pstlabel}{delimiter}[] -\addmetakey[]{pstlabel}{postfix}[] -\metasetkeys{pstlabel}{}% initialization -\newrobustcmd\setpstlabelstyle[1]{% - \metasetkeys{pstlabel}{#1}% -}% -\newrobustcmd\setpstlabelstyledefault{% - \metasetkeys{pstlabel}{prefix=P,delimiter=.,postfix=}% -}% -\def\pst@make@label@long#1#2{\@for\@I:=#1\do{\expandafter\@I\pstlabel@delimiter}#2} -\def\pst@make@label@angles#1#2{\ensuremath{\@for\@I:=#1\do{\rangle}}#2} -\def\pst@make@label@short#1#2{#2} -\def\pst@make@label@empty#1#2{} -\def\pstlabelstyle#1{% - \def\pst@make@label{\@nameuse{pst@make@label@#1}}% -}% -\pstlabelstyle{long}% -\def\next@pst@label{% - \global\advance\count\count10 by 1% -}% -\def\sproof@box{% - \hbox{\vrule\vbox{\hrule width 6 pt\vskip 6pt\hrule}\vrule}% -}% -\def\spf@proofend{\sproof@box}% -\def\sproofend{% - \ifx\spf@proofend\@empty% - \else% - \hfil\null\nobreak\hfill\spf@proofend\par\smallskip% - \fi% -}% -\def\sProofEndSymbol#1{\def\sproof@box{#1}}% -\def\spf@proofsketch@kw{Proof Sketch} -\def\spf@proof@kw{Proof} -\def\spf@step@kw{Step} -\AfterBabelLanguage{ngerman}{\input{sproof-ngerman.ldf}} -\AfterBabelLanguage{arabic}{\input{sproof-arabic.ldf}} -\newrobustcmd\spfsketch[2][]{% - \metasetkeys{spf}{#1}% - \sref@target% - \ifx\spf@display\spf@flow% - \else% - {\stDMemph{\ifx\spf@type\@empty\spf@proofsketch@kw\else\spf@type\fi}:} - \fi{ #2}% - \sref@label@id{this \ifx\spf@type\@empty\spf@proofsketch@kw\else\spf@type\fi}\sproofend% -}% -\newenvironment{spfeq}[2][]{% - \metasetkeys{spf}{#1}\sref@target% - \ifx\spf@display\spf@flow% - \else% - {\stDMemph{\ifx\spf@type\@empty\spf@proof@kw\else\spf@type\fi}:} #2% - \fi% display=flow - \begin{displaymath}\begin{array}{rcll}% -}{% - \end{array}\end{displaymath}% -}% -\newenvironment{spf@proof}[2][]{% - \metasetkeys{spf}{#1}% - \sref@target% - \count10=10% - \par\noindent% - \ifx\spf@display\spf@flow% - \else% - \stDMemph{\ifx\spf@type\@empty\spf@proof@kw\else\spf@type\fi}:% - \fi{ #2}% - \sref@label@id{this \ifx\spf@type\@empty\spf@proof@kw\else\spf@type\fi}% - \def\pst@label{}% - \newcount\pst@count% initialize the labeling mechanism - \begin{description}\begin{pst@with@label}{\pstlabel@prefix}% -}{% - \end{pst@with@label}\end{description}% -}% -\newenvironment{sproof}[2][]{\begin{spf@proof}[#1]{#2}}{\sproofend\end{spf@proof}}% -\newenvironment{sProof}[2][]{\begin{spf@proof}[#1]{#2}}{\end{spf@proof}}% -\newrobustcmd\spfidea[2][]{% - \metasetkeys{spf}{#1}% - \stDMemph{\ifx\spf@type\@empty{Proof Idea}\else\spf@type\fi:} #2\sproofend% -}% -\newenvironment{spfstep}[1][]{% - \metasetkeys{spf}{#1}% - \@in@omtexttrue% - \ifx\spf@display\spf@flow% - \else% - \item[\the@pst@label]% - \fi% - \ifx\spf@title\@empty\else{(\stDMemph{\spf@title}) }\fi% - \sref@label@id{\pst@label}\ignorespaces% -}{% - \next@pst@label\@in@omtextfalse\ignorespaces% -}% -\newenvironment{sproofcomment}[1][]{% - \metasetkeys{spf}{#1}% - \ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi% -}{% - \next@pst@label% -}% -\newenvironment{subproof}[2][]{% - \metasetkeys{spf}{#1}% - \def\@test{#2}% - \ifx\@test\empty% - \else% - \ifx\spf@display\spf@flow {#2}% - \else% - \item[\the@pst@label]{#2} % - \fi% - \fi% - \begin{pst@with@label}{\pst@label,\number\count\count10}% -}{% - \end{pst@with@label}\next@pst@label% -}% -\newenvironment{spfcases}[2][]{% - \def\@test{#1}% - \ifx\@test\empty% - \begin{subproof}[method=by-cases]{#2}% - \else% - \begin{subproof}[#1,method=by-cases]{#2}% - \fi% -}{% - \end{subproof}% -}% -\newenvironment{spfcase}[2][]{% - \metasetkeys{spf}{#1}% - \ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi% - \def\@test{#2}% - \ifx\@test\@empty% - \else% - {\stDMemph{#2}: }% need blank here - \fi% - \begin{pst@with@label}{\pst@label,\number\count\count10} -}{% - \ifx\spf@display\spf@flow% - \else% - \sproofend% - \fi% - \end{pst@with@label}% - \next@pst@label% -}% -\newrobustcmd\spfcasesketch[3][]{% - \metasetkeys{spf}{#1}% - \ifx\spf@display\spf@flow% - \else% - \item[\the@pst@label]% - \fi% - \def\@test{#2}% - \ifx\@test\@empty% - \else% - {\stDMemph{#2}: }% - \fi#3% - \next@pst@label% -}% -\srefaddidkey{just} -\addmetakey{just}{method} -\addmetakey{just}{premises} -\addmetakey{just}{args} -\newenvironment{justification}[1][]{}{} -\newrobustcmd\premise[2][]{#2} -\newrobustcmd\justarg[2][]{#2} -\endinput -%% -%% End of file `sproof.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/sref/sref.sty b/Master/texmf-dist/tex/latex/stex/sref/sref.sty deleted file mode 100644 index 66a4821b64c..00000000000 --- a/Master/texmf-dist/tex/latex/stex/sref/sref.sty +++ /dev/null @@ -1,245 +0,0 @@ -%% -%% This is file `sref.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% sref.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{sref}[2019/03/20 v1.2 Semantic Cross-References] -\newif\ifextrefs\extrefsfalse -\DeclareOption{extrefs}{\extrefstrue} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{metakeys}} -\ProcessOptions -\RequirePackage{metakeys} -\RequirePackage{xspace} -\RequirePackage{etoolbox} -\addmetakey{sref}{linktext} -\addmetakey{sref}{fallback} -\addmetakey{sref}{pre} -\addmetakey{sref}{post} -\newcommand\sref[2][]{% - \metasetkeys{sref}{#1}% - \ifcsundef{sref@part}{% - \sref@hlink[\sref@linktext]{#2}{\sref@fallback}{\sref@pre}{\sref@post}% - }{% - \sref@hlink[\sref@linktext]{\sref@part @#2}{\sref@fallback}{\sref@pre}{\sref@post}% - }% - \xspace% -}% -\newcommand\srefs[3][]{% - \def\@test{#1}% - \ifx\@test\@empty% - \sref{#2} and \sref{#3}% - \else% - #1% - \fi% -}% -\newcommand\srefl[3][]{% - \def\@test{#1}% - \ifx\@test\@empty% - \sref{#2} to \sref{#3}% - \else% - #1% - \fi% -}% -\newcommand\spageref[1]{% - \ifcsundef{sref@part}{% - \sref@pageref{#1}% - }{% - \sref@pageref{\sref@part @#1}% - }% -}% -\newif\ifhref\hreffalse% -\AtBeginDocument{% - \@ifpackageloaded{hyperref}{% - \hreftrue% - }{% - \hreffalse% - }% -}% -\newcommand\sref@href@ifh[2]{% - \ifhref% - \href{#1}{#2}% - \else% - #2% - \fi% -}% -\newcommand\sref@hlink@ifh[2]{% - \ifhref% - \hyperlink{#1}{#2}% - \else% - #2% - \fi% -}% -\newcommand\sref@target@ifh[2]{% - \ifhref% - \hypertarget{#1}{#2}% - \else% - #2% - \fi% -}% -\def\sref@target{% - \ifx\sref@id\@empty% - \relax% - \else% - \edef\@target{sref@\ifcsundef{sref@part}{}{\sref@part @}\sref@id @target}% - \sref@target@ifh\@target{}% - \fi% -}% -\newcommand\@sref@def[3]{\csgdef{sref@#1@#2}{#3}} -\ifextrefs% - \newwrite\refs@file% -\else% - \def\refs@file{\@auxout}% -\fi% -\newcommand\sref@def[3]{% - %\@sref@def{#1}{#2}{#3}% - \protected@write\refs@file{}{\string\@sref@def{#1}{#2}{#3}}% -}% -\addmetakey{srefaddidkey}{prefix} -\newcommand\srefaddidkey[2][]{% - \metasetkeys{srefaddidkey}{#1}% - \@metakeys@ext@clear@keys{#2}{sref@id}{}% id cannot have a default - \metakeys@ext@clear@keys{#2}{id}{}% - \metakeys@ext@showkeys{#2}{id}% - \define@key{#2}{id}{% - \edef\sref@id{\srefaddidkey@prefix ##1}% - %\expandafter\edef\csname #2@id\endcsname{\srefaddidkey@prefix ##1}% - \csedef{#2@id}{\srefaddidkey@prefix ##1}% - }% -}% -\newcommand\makeextrefs[1]{% - \gdef\sref@part{#1}% - \makeatletter% - \IfFileExists{\jobname.refs}{\input{\jobname.refs}}{}% - \immediate\openout\refs@file=\jobname.refs - \makeatother% -}% -\newcommand\sref@label[2]{% - \sref@def{\ifcsundef{sref@part}{}{\sref@part @}#2}{page}{\thepage}% - \sref@def{\ifcsundef{sref@part}{}{\sref@part @}#2}{label}{#1}% -}% -\newcommand\sreflabel[2]{\sref@label{#1 \@currentlabel}{#2}} -\newcommand\sref@label@id[1]{% - \ifx\sref@id\@empty% - \relax% - \else% - \sref@label{#1}{\sref@id}% - \fi% -}% -\newcommand\sref@label@id@arg[2]{% - \def\@@id{#2} - \ifx\@@id\@empty% - \relax% - \else% - \sref@label{#1}{\@@id}% - \fi% -}% -\newcommand\sref@hlink[5][]{% - \edef\@linktext{#1}% - \edef\@fallback{#3}% - \ifcsundef{sref@#2@label}{% - \ifx\@fallback\@empty% warn about undefined links and show a substitute - \protect\G@refundefinedtrue\PackageWarning{sref}{reference #2 undefined}% - \ifx\@linktext\@empty% - ?#2?% - \else% - \@linktext% - \fi% - \else% - \protect\G@refundefinedtrue\PackageWarning{sref}{using fallback for undefined reference #2}% - \@fallback% - \fi - }{% - \edef\@link{#4\@nameuse{sref@#2@label}#5}% retrieve the reference label and prepost it - \ifx\@linktext\@empty% - \sref@hlink@ifh{sref@#2@target}{\@link}% - \else% - \sref@hlink@ifh{sref@#2@target}{\@linktext}% - \fi% - }% -}% -\newcommand\sref@page@label[1]{p.~{#1}} -\newcommand\sref@pageref[1]{% - \ifcsundef{sref@#1@page}{% - \protect\G@refundefinedtrue\PackageWarning{sref}{reference #1 undefined}\sref@page@label{??}% - }{% - \sref@hlink@ifh{sref@#1@target}{\sref@page@label{\@nameuse{sref@#1@page}}}% - }% -}% -\newcommand\sref@href[3][]{% - \edef\@linktext{#1}% - \ifcsundef{sref@#2@label}{% - \protect\G@refundefinedtrue\PackageWarning{sref}{reference #2 undefined}??% - }{% - \ifcsundef{sref@#3@URI}{% - \protect\G@refundefinedtrue\PackageWarning{sref}{external refs of type #3 undefined}??% - }{% - \edef\@uri{\@nameuse{sref@#3@URI}.pdf\#sref@#2@target}% - \edef\@label{\ifx\@linktext\@empty\@nameuse{sref@#2@label}\else\@linktext\fi}% - \sref@href@ifh\@uri\@label% - }% - }% -}% -\ifextrefs% - \newcommand\extref[3][]{% - \def\theextref{\sref@href[#1]{#2@#3}{#2}}% - \csname doextref@#2\endcsname% - }% -\else% - \newcommand\extref[3][]{\sref[#1]{#3}}% -\fi% -\ifextrefs% - \newcommand\extpageref[3][]{% - \def\theextref{\sref@pageref{#2@#3}}% - \csname doextpageref@#2\endcsname% - }% -\else% - \newcommand\extpageref[3][]{\spageref{#3}}% -\fi% -\newcommand\extrefstyle[2]{\csgdef{doextref@#1}{#2}}% -\newcommand\extpagerefstyle[2]{\csgdef{doextpageref@#1}{#2}}% -\newcommand\inputrefs[2]{% - %\@namedef{sref@#1@URI}{#2}% - \csdef{sref@#1@URI}{#2}% - \extrefstyle{#1}{\theextref}\extpagerefstyle{#1}{\theextref}% - \makeatletter% - \IfFileExists{#2.refs}{% - \message{Reading external references: #2.refs}\input{#2.refs}% - }{% - \PackageError{sref}{Reference file #2.refs does not exist}% - {Maybe you have to run LaTeX on #2.tex first}}% - \makeatother% -}% -\srefaddidkey{sequation}% -\def\sref@sequation@heading{equation}% -\newenvironment{sequation}[1][]{% - \metasetkeys{sequation}{#1}% - \ifx\sref@id\@empty% - \begin{displaymath}% - \else% no id, using equation* - \begin{equation}% - \sref@target\sref@label@id{\sref@sequation@heading~(\theequation)}% - \fi% -}{% - \ifx\sref@id\@empty% - \end{displaymath}% - \else% - \end{equation}% - \fi% -}% -\newenvironment{seqnarray}[1][]{% - \metasetkeys{sequation}{#1}% - \begin{eqnarray*}% - \sref@target% - \sref@label@id{\sref@sequation@heading~(\theequation)}% -}{% - \end{eqnarray*}% -}% -\newcommand\withcite[2]{#2~\cite{#1}}% -\newenvironment{withcitation}[1]{\def\citeit{\cite{#1}\xspace}}{}% -\endinput -%% -%% End of file `sref.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/statements/statements.sty b/Master/texmf-dist/tex/latex/stex/statements/statements.sty deleted file mode 100644 index c62654e24b9..00000000000 --- a/Master/texmf-dist/tex/latex/stex/statements/statements.sty +++ /dev/null @@ -1,334 +0,0 @@ -%% -%% This is file `statements.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% statements.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{statements}[2019/03/20 v1.4 Semantic Markup for Statements] -\newif\ifdef@index\def@indexfalse -\DeclareOption{defindex}{\def@indextrue} -\newif\if@nthm\@nthmtrue -\DeclareOption{nontheorem}{\@nthmfalse} -\newif\if@msection\@msectionfalse -\DeclareOption{msection}{\@msectiontrue} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{omtext}} -\ProcessOptions -\RequirePackage{omtext} -\RequirePackage[base]{babel} -\ifcsdef{proof}{\cslet{proof}{\relax}\cslet{endproof}{\relax}}{}% to redefine if necessary -\if@nthm -\RequirePackage[hyperref]{ntheorem} -\theoremstyle{plain} -\else -\RequirePackage{amsthm} -\fi -\AfterBabelLanguage{ngerman}{\input{statements-ngerman.ldf}} -\AfterBabelLanguage{arabic}{\input{statements-arabic.ldf}} -\providecommand\STpresent[1]{#1} -\def\define@statement@env#1{% -\ifcsdef{#1}{\cslet{#1}{\relax}\cslet{end#1}{\relax}}{}% to redefine if necessary -\newenvironment{#1}[1][]{\metasetkeys{omtext}{##1}\sref@target% -\@in@omtexttrue% -\ifx\omtext@display\st@flow\else% -\ifx\omtext@title\@empty\begin{ST#1Env}\else\begin{ST#1Env}[\omtext@title]\fi% -\ifx\sref@id\@empty\else\label{#1.\sref@id}\fi -\csname st@#1@initialize\endcsname\fi% display -\ifx\sref@id\@empty\sref@label@id{here}\else% -\sref@label@id{\STpresent{\csname st@#1@kw\endcsname}~\@currentlabel}\fi% -\strut\ignorespaces} -{\csname st@#1@terminate\endcsname\ifx\omtext@display\st@flow\else\end{ST#1Env}\fi% -\omtext@post@skip\@in@omtextfalse}} -\newenvironment{assertion}[1][]{\metasetkeys{omtext}{#1}\sref@target% -\@in@omtexttrue% -\ifx\omtext@display\st@flow - \itshape\noindent\ignorespaces% -\else% display!=flow - \xdef\@@@type{\omtext@type}% to keep it safe from \inlinedef - \ifx\omtext@title\@empty\begin{ST\@@@type AssEnv}% - \else\begin{ST\@@@type AssEnv}[\omtext@title]% - \fi% -\fi %display=flow -\ifx\omtext@type\@empty\else% -\sref@label@id{\STpresent{\csname st@\@@@type @kw\endcsname}~\@currentlabel} -\fi} -{\ifx\omtext@display\st@flow\else\end{ST\@@@type AssEnv}\@in@omtextfalse\fi} -\def\st@theorem@kw{Theorem} -\def\st@lemma@kw{Lemma} -\def\st@proposition@kw{Proposition} -\def\st@corollary@kw{Corollary} -\def\st@conjecture@kw{Conjecture} -\def\st@falseconjecture@kw{Conjecture (false)} -\def\st@postulate@kw{Postulate} -\def\st@obligation@kw{Obligation} -\def\st@assumption@kw{Assumption} -\def\st@rule@kw{Rule} -\def\st@observation@kw{Observation} -\def\st@remark@kw{Remark} -\if@nthm -\theorembodyfont{\itshape} -\theoremheaderfont{\normalfont\bfseries} -\else -\theoremstyle{plain} -\fi -\if@msection -\newtheorem{STtheoremAssEnv}{\st@theorem@kw}[msection] -\else -\ifdef{\thesection} -{\newtheorem{STtheoremAssEnv}{\st@theorem@kw}[section]} -{\newtheorem{STtheoremAssEnv}{\st@theorem@kw}} -\fi -\newtheorem{STlemmaAssEnv}[STtheoremAssEnv]{\st@lemma@kw} -\newtheorem{STpropositionAssEnv}[STtheoremAssEnv]{\st@proposition@kw} -\newtheorem{STcorollaryAssEnv}[STtheoremAssEnv]{\st@corollary@kw} -\newtheorem{STconjectureAssEnv}[STtheoremAssEnv]{\st@conjecture@kw} -\newtheorem{STfalseconjectureAssEnv}[STtheoremAssEnv]{\st@falseconjecture@kw} -\newtheorem{STpostulateAssEnv}[STtheoremAssEnv]{\st@postulate@kw} -\newtheorem{STobligationAssEnv}[STtheoremAssEnv]{\st@obligation@kw} -\newtheorem{STassumptionAssEnv}[STtheoremAssEnv]{\st@assumption@kw} -\newtheorem{STobservationAssEnv}[STtheoremAssEnv]{\st@observation@kw} -\if@nthm\theorembodyfont{\rmfamily}\else\theoremstyle{definition}\fi -\newtheorem{STremarkAssEnv}[STtheoremAssEnv]{\st@remark@kw} -\newtheorem{STruleAssEnv}[STtheoremAssEnv]{\st@rule@kw} -\def\st@example@initialize{}\def\st@example@terminate{} -\define@statement@env{example} -\def\st@example@kw{Example} -\newtheorem{STexampleEnv}[STtheoremAssEnv]{\st@example@kw} -\def\st@axiom@initialize{}\def\st@axiom@terminate{} -\define@statement@env{axiom} -\def\st@axiom@kw{Axiom} -\newtheorem{STaxiomEnv}[STtheoremAssEnv]{\st@axiom@kw} -\srefaddidkey{symboldec} -\addmetakey{symboldec}{functions} -\addmetakey{symboldec}{role} -\addmetakey*{symboldec}{title} -\addmetakey*{symboldec}{name} -\addmetakey{symboldec}{subject} -\addmetakey*{symboldec}{display} -\newenvironment{symboldec}[1][]{\metasetkeys{symboldec}{#1}\sref@target\st@indeftrue% -\ifx\symboldec@display\st@flow\else{\noindent\stDMemph{\symdef@type} \symboldec@name:}\fi% -\ifx\symboldec@title\@empty~\else~(\stDMemph{\symboldec@title})\par\fi}{} -\srefaddidkey{symtype} -\addmetakey*{symtype}{system} -\addmetakey*{symtype}{for} -\newcommand\type@type{Type} -\newcommand\symtype[3][]{\metasetkeys{symtype}{#1}\sref@target% -\noindent\type@type \ifx\symtype@\@empty\else (\symtype@system)\fi #2: $#3$} -\newcommand\inlinetypedec[3][]{\metasetkeys{symtype}{#1}\sref@target{\def\thedectype{#2}#3}} -\def\st@typedec@kw{Type Declaration} -\newtheorem{STtypedecEnv}[STtheoremAssEnv]{\st@typedec@kw} -\newenvironment{typedec}[2][]{\metasetkeys{omtext}{#1}\sref@target% -\def\thedectype{#2}% -\ifx\omtext@display\st@flow\else% -\ifx\omtext@title\@empty\begin{STtypedecEnv}\else\begin{STtypedecEnv}[\omtext@title]\fi% -\ifx\sref@id\@empty\else\label{typedec.\sref@id}\fi -\ifx\sref@id\@empty\sref@label@id{here}\else% -\sref@label@id{\STpresent{\csname st@typedec@kw\endcsname}~\@currentlabel}\fi% -\ignorespaces} -{\ifx\omtext@display\st@flow\else\end{STtypedecEnv}\fi\omtext@post@skip} -\newif\ifst@indef\st@indeffalse -\ifcsdef{definition}{\cslet{definition}{\relax}\cslet{enddefinition}{\relax}}{}% to redefine if necessary -\newenvironment{definition}[1][]{\metasetkeys{omtext}{#1}\sref@target\st@indeftrue% -\ifx\omtext@display\st@flow\else% -\ifx\omtext@title\@empty\begin{STdefinitionEnv}\else\begin{STdefinitionEnv}[\omtext@title]\fi\fi% -\ifx\sref@id\@empty\sref@label@id{here}\else% -\sref@label@id{\STpresent{\csname st@definition@kw\endcsname}~\@currentlabel}\fi% -\ignorespaces} -{\ifx\omtext@display\st@flow\else\end{STdefinitionEnv}\fi} -\def\st@definition@kw{Definition} -\newtheorem{STdefinitionEnv}[STtheoremAssEnv]{\st@definition@kw} -\def\notemph#1{#1} -\def\st@notation@terminate{} -\def\st@notation@initialize{} -\define@statement@env{notation} -\def\st@notation@kw{Notation} -\newtheorem{STnotationEnv}[STtheoremAssEnv]{\st@notation@kw} -\newcommand\st@def@target[3]{\edef\@symname{#1}\def\@verbname{#2}% -\ifst@indef% if we are in a definition or such -\@ifundefined{mod@id}% if we are not in a module -{\PackageWarning{statements}{definiendum in unidentified module\MessageBreak -\protect\definiendum, \protect\defi*, -\protect\Defi*, \protect\defi*s, \protect\Defi*s\MessageBreak -can only be referenced when called in a module with id key}}% -{% now we are in a module -\edef\@@cd{\ifx\omtext@theory\@empty\mod@id\else\omtext@theory\fi}% -\edef\@@name{\ifx\@symname\@empty\@verbname\else\@symname\fi}% -\defemph{\@ifundefined{sref@\@@name @\@@cd @defined}% -{\expandafter\sref@target@ifh{sref@\@@name @\@@cd @target}{#3}}% -{#3}}% -\expandafter\gdef\csname sref@\@@name @\@@cd @defined\endcsname{yes}% -\ifmetakeys@showmeta\metakeys@show@keys{\@@cd}{name:\@@name}\fi}% -\else% st@indef: we are not in a definition or such -\PackageError{statements}% -{definiendum outside definition context\MessageBreak -\protect\definiendum, \protect\defi, -\protect\Defi, \protect\defi*s, \protect\Defi*s\MessageBreak -do not make sense semantically outside a definition.} -{Consider wrapping the defining phrase in a \protect\inlinedef}% -\fi}% st@indef -\newcommand\@termdef[2][]{\def\@test{#1}% -\@ifundefined{mod@id}{}{\ifx\@test\@empty\def\@@name{#2}\else\def\@@name{#1}\fi% -\termdef{\mod@id @\@@name}{#2}}} -\addmetakey{definiendum}{name} -\addmetakey{definiendum}{lemma} -\newcommand\definiendum[2][]{\setkeys{definiendum}{#1}% -\st@def@target{\definiendum@name}{\definiendum@name}{#2}} -\newcommand\notatiendum[2][]{\notemph{#2}} -\newcommand\@defi[1][]{\ifdef@index\omdoc@indexi[#1]{\@phrase}\fi\xspace} -\newcommand\defi[2][]{\metasetkeys{definiendum}{#1}% -\st@def@target{\definiendum@name}{#2}{#2}\def\@phrase{#2}\@defi} -\newcommand\defis[2][]{\metasetkeys{definiendum}{#1}% -\st@def@target{\definiendum@name}{#2}{#2s}\def\@phrase{#2}\@defi} -\newcommand\Defi[2][]{\metasetkeys{definiendum}{#1}% -\st@def@target{\definiendum@name}{#2}{\capitalize{#2}}\def\@phrase{#2}\@defi} -\newcommand\Defis[2][]{\metasetkeys{definiendum}{#1}% -\st@def@target{\definiendum@name}{#2}{\capitalize{#2s}}\def\@phrase{#2}\@defi} -\newcommand\adefi[3][]{\metasetkeys{definiendum}{#1}\def\@verb{#3}% -\st@def@target{\definiendum@name}{#3}{#2}\@adefi} -\newcommand\@adefi[1][]{% -\ifdef@index% -\ifx\definiendum@name\@empty\omdoc@indexi[#1]{\@verb}% -\else\omdoc@indexi[at=\definiendum@name,#1]{\@verb}\fi% -\fi\xspace} -\newcommand\@defii[1][]{\ifdef@index\omdoc@indexii[#1]{\@pone}{\@ptwo}\fi\xspace} -\newcommand\defii[3][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}% -\st@def@target{\definiendum@name}{#2-#3}{#2 #3}\@defii} -\newcommand\defiis[3][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}% -\st@def@target{\definiendum@name}{#2-#3}{#2 #3s}\@defii} -\newcommand\Defii[3][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}% -\st@def@target{\definiendum@name}{#2-#3}{\capitalize{#2 #3}}\@defii} -\newcommand\Defiis[3][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}% -\st@def@target{\definiendum@name}{#2-#3}{\capitalize{#2 #3s}}\@defii} -\newcommand\adefii[4][]{\metasetkeys{definiendum}{#1}\def\@pone{#3}\def\@ptwo{#4}% -\st@def@target{\definiendum@name}{#3-#4}{#2}\@adefii} -\newcommand\@adefii[1][]{% -\ifdef@index% -\ifx\definiendum@name\@empty\omdoc@indexii[#1]{\@pone}{\@ptwo}% -\else\omdoc@indexii[at=\definiendum@name,#1]{\@pone}{\@ptwo}\fi% -\fi\xspace} -\newcommand\@defiii[1][]{\ifdef@index\omdoc@indexiii[#1]{\@pone}{\@ptwo}{\@pthree}\fi\xspace} -\newcommand\defiii[4][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}\def\@pthree{#4}% -\st@def@target{\definiendum@name}{#2-#3-#4}{#2 #3 #4}\@defiii} -\newcommand\defiiis[4][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}\def\@pthree{#4}% -\st@def@target{\definiendum@name}{#2-#3-#4}{#2 #3 #4s}\@defiii} -\newcommand\Defiii[4][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}\def\@pthree{#4}% -\st@def@target{\definiendum@name}{#2-#3-#4}{\capitalize{#2 #3 #4}}\@defiii} -\newcommand\Defiiis[4][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}\def\@pthree{#4}% -\st@def@target{\definiendum@name}{#2-#3-#4}{\capitalize{#2 #3 #4s}}\@defiii} -\newcommand\adefiii[5][]{\metasetkeys{definiendum}{#1}\def\@pone{#3}\def\@ptwo{#4}\def\@pthree{#5}% -\st@def@target{\definiendum@name}{#3-#4-#5}{#2}\@adefiii} -\newcommand\@adefiii[1][]{% -\ifdef@index% -\ifx\definiendum@name\@empty\omdoc@indexiii[#1]{\@pone}{\@ptwo}{\@pthree}% -\else\omdoc@indexiii[at=\definiendum@name,#1]{\@pone}{\@ptwo}{\@pthree}\fi% -\fi\xspace} -\newcommand\@defiv[1][]{\ifdef@index\omdoc@indexiv[#1]{\@pone}{\@ptwo}{\@pthree}{\@ptfour}\fi\xspace} -\newcommand\defiv[5][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}\def\@pthree{#4}\def\@ptfour{#5}% -\st@def@target{\definiendum@name}{#2-#3-#4-#5}{#2 #3 #4 #5}\@defiv} -\newcommand\defivs[5][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}\def\@pthree{#4}\def\@ptfour{#5}% -\st@def@target{\definiendum@name}{#2-#3-#4-#5}{#2 #3 #4 #5s}\@defiv} -\newcommand\Defiv[5][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}\def\@pthree{#4}\def\@ptfour{#5}% -\st@def@target{\definiendum@name}{#2-#3-#4-#5}{\capitalize{#2 #3 #4 #5}}\@defiv} -\newcommand\Defivs[5][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#2}\def\@ptwo{#3}\def\@pthree{#4}\def\@ptfour{#5}% -\st@def@target{\definiendum@name}{#2-#3-#4-#5}{\capitalize{#2 #3 #4 #5s}}\@defiv} -\newcommand\adefiv[6][]{\metasetkeys{definiendum}{#1}% -\def\@pone{#3}\def\@ptwo{#4}\def\@pthree{#5}\def\@ptfour{#6}% -\st@def@target{\definiendum@name}{#3-#4-#5-#6}{#2}\@adefiv} -\newcommand\@adefiv[1][]{% -\ifdef@index% -\ifx\definiendum@name\@empty\@indiv[#1]{\@pone}{\@ptwo}{\@pthree}{\@ptfour}% -\else\@indiv[at=\definiendum@name,#1]{\@pone}{\@ptwo}{\@pthree}{\@ptfour}\fi% -\fi\xspace} -\newcommand\inlineex[2][]{\metasetkeys{omtext}{#1}% -\sref@target\sref@label@id{here}#2} -\newcommand\inlineass[2][]{\metasetkeys{omtext}{#1}% -\sref@target\sref@label@id{here}#2} -\newcommand\inlinedef[2][]{\metasetkeys{omtext}{#1}% -\if@in@omtext\else% we are not in an omtext or statement -\PackageError{modules}{\protect\inlinedef\space outside a statement!}% -{Try wrapping the paragraph in a\MessageBreak -\protect\begin{omtext}, \protect\begin{assertion}, \protect\begin{axiom}, ... \MessageBreak -whatever is suitable semantically}\fi% -\sref@target\sref@label@id{here}\st@indeftrue #2} -\addmetakey*{termref}{cd} -\addmetakey*{termref}{cdbase} -\addmetakey*{termref}{name} -\addmetakey*{termref}{role} -\newcommand\termref[2][]{\metasetkeys{termref}{#1}% -\ifx\termref@cd\@empty\def\termref@cd{\mod@id}\fi% -\ifx\termref@name\@empty\def\termref@name{#2}\fi% -\@ifundefined{sref@\termref@name @\termref@cd @defined}% -{\ifx\termref@cdbase\@empty% external reference -\mod@termref\termref@cd\termref@name{#2}% -\else\sref@href@ifh\termref@cdbase{#2}% -\fi}% -{\def\@label{sref@\termref@name @\termref@cd @target}% -\sref@hlink@ifh\@label{#2}%\footnote{termref: internal reference to \@label} -}} -\newcommand\atrefi[3][]{\def\@test{#1}% -\ifx\@test\@empty\termref[name=#3]{#2}\else\termref[cd=#1,name=#3]{#2}\fi} -\newcommand\atrefii[4][]{\atrefi[#1]{#2}{#3-#4}} -\newcommand\atrefiii[5][]{\atrefi[#1]{#2}{#3-#4-#5}} -\newcommand\atrefiv[6][]{\atrefi[#1]{#2}{#3-#4-#5-#6}} -\newcommand\trefi[2][]{\atrefi[#1]{#2}{#2}} -\newcommand\trefii[3][]{\atrefi[#1]{#2 #3}{#2-#3}} -\newcommand\trefiii[4][]{\atrefi[#1]{#2 #3 #4}{#2-#3-#4}} -\newcommand\trefiv[5][]{\atrefi[#1]{#2 #3 #4 #5}{#2-#3-#4-#5}} -\newcommand\trefis[2][]{\atrefi[#1]{#2s}{#2}} -\newcommand\trefiis[3][]{\atrefi[#1]{#2 #3s}{#2-#3}} -\newcommand\trefiiis[4][]{\atrefi[#1]{#2 #3 #4s}{#2-#3-#4}} -\newcommand\trefivs[5][]{\atrefi[#1]{#2 #3 #4 #5s}{#2-#3-#4-#5}} -\newcommand\Trefi[2][]{\atrefi[#1]{\capitalize{#2}}{#2}} -\newcommand\Trefii[3][]{\atrefi[#1]{\capitalize{#2 #3}}{#2-#3}} -\newcommand\Trefiii[4][]{\atrefi[#1]{\capitalize{#2 #3 #4}}{#2-#3-#4}} -\newcommand\Trefiv[5][]{\atrefi[#1]{\capitalize{#2 #3 #4 #5}}{#2-#3-#4-#5}} -\newcommand\Trefis[2][]{\atrefi[#1]{\capitalize{#2s}}{#2}} -\newcommand\Trefiis[3][]{\atrefi[#1]{\capitalize{#2 #3s}}{#2-#3}} -\newcommand\Trefiiis[4][]{\atrefi[#1]{\capitalize{#2 #3 #4s}}{#2-#3-#4}} -\newcommand\Trefivs[5][]{\atrefi[#1]{\capitalize{#2 #3 #4 #5s}}{#2-#3-#4-#5}} -\providecommand{\termemph}[1]{#1} -\providecommand{\defemph}[1]{{\textbf{#1}}} -\providecommand{\stDMemph}[1]{{\textbf{#1}}} -\newcommand\term[2][]{\def\@test{#1}% -\ifx\@test\@empty\else -\@ifundefined{module@defs@#1}{\PackageWarning{statements}% -{{\protect\term} specifies module #1 which is not in - scope\MessageBreak import it via e.g. via \protect\importmhmodule}}{} -\fi% -\PackageWarning{statements}% -{Dangling link (\protect\term) for "#2" still needs to be specified}% -\textcolor{blue}{\underline{#2}}} -\newcommand\symref[2]{\@nameuse{mod@symref@#1}{#2}} -\newcommand\defin[2][]{\defi[#1]{#2}% -\PackageWarning{statements}{\protect\defin\space is deprecated, use \protect\defi\space instead}} -\newcommand\twindef[3][]{\defii[#1]{#2}{#3}% -\PackageWarning{statements}{\protect\twindef\space is deprecated, use \protect\defii\space instead}} -\newcommand\atwindef[4][]{\defiii[#1]{#2}{#3}{#4}% -\PackageWarning{statements}{\protect\atwindef\space is deprecated, use \protect\defiii\space instead}} -\newcommand\definalt[3][]{\adefi[#1]{#2}{#3}% -\PackageWarning{statements}{\protect\definalt\space is deprecated, use \protect\adefi\space instead}} -\newcommand\twindefalt[4][]{\adefii[#1]{#2}{#3}{#4}% -\PackageWarning{statements}{\protect\twindefalt\space is deprecated, use \protect\adefii\space instead}} -\newcommand\atwindefalt[5][]{\adefiii[#1]{#2}{#3}{#4}{#5}% -\PackageWarning{statements}{\protect\atwindefalt\space is deprecated, use \protect\adefiii\space instead}} -\newcommand\twinref[3][]{\trefii[#1]{#2}{#3}% -\PackageWarning{statements}{\protect\twinref\space is deprecated, use \protect\trefii\space instead}} -\newcommand\atwinref[4][]{\atrefiii[#1]{#2}{#3}{#4}% -\PackageWarning{statements}{\protect\atwindef\space is deprecated, use \protect\trefiii\space instead}} -\endinput -%% -%% End of file `statements.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/stex-tikzinput.sty b/Master/texmf-dist/tex/latex/stex/stex-tikzinput.sty new file mode 100644 index 00000000000..e77eb73625e --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/stex-tikzinput.sty @@ -0,0 +1,23 @@ +%% +%% This is file `stex-tikzinput.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tikzinput.dtx (with options: `stex') +%% +\ProvidesExplPackage{stex-tikzinput}{2022/02/26}{3.0.1}{stex-tikzinput} +\RequirePackage{stex} +\RequirePackage{tikzinput} + +\newcommand\mhtikzinput[2][]{% + \def\Gin@mhrepos{}\setkeys{Gin}{#1}% + \stex_in_repository:nn\Gin@mhrepos{ + \tikzinput[#1]{\mhpath{##1}{#2}} + } +} +\newcommand\cmhtikzinput[2][]{\begin{center}\mhtikzinput[#1]{#2}\end{center}} + +\endinput +%% +%% End of file `stex-tikzinput.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/stex.cls b/Master/texmf-dist/tex/latex/stex/stex.cls new file mode 100644 index 00000000000..c698e99a024 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/stex.cls @@ -0,0 +1,23 @@ +%% +%% This is file `stex.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% stex-basics.dtx (with options: `cls') +%% + +%%%%%%%%%%%%% basics.dtx %%%%%%%%%%%%% + +\RequirePackage{expl3,l3keys2e} +\ProvidesExplClass{stex}{2022/02/26}{3.0.1}{sTeX document class} +\LoadClass[border=1px,varwidth]{standalone} +\setlength\textwidth{15cm} + +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{stex}} +\ProcessOptions + +\RequirePackage{stex} +\endinput +%% +%% End of file `stex.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/stex.sty b/Master/texmf-dist/tex/latex/stex/stex.sty new file mode 100644 index 00000000000..2c28b1ee36e --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/stex.sty @@ -0,0 +1,5472 @@ +%% +%% This is file `stex.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% stex-basics.dtx (with options: `package') +%% stex-mathhub.dtx (with options: `package') +%% stex-references.dtx (with options: `package') +%% stex-modules.dtx (with options: `package') +%% stex-inheritance.dtx (with options: `package') +%% stex-symbols.dtx (with options: `package') +%% stex-terms.dtx (with options: `package') +%% stex-features.dtx (with options: `package') +%% stex-statements.dtx (with options: `package') +%% stex-proofs.dtx (with options: `package') +%% stex-others.dtx (with options: `package') +%% stex-metatheory.dtx (with options: `package') +%% + +%%%%%%%%%%%%% basics.dtx %%%%%%%%%%%%% + +\RequirePackage{expl3,l3keys2e,ltxcmds} +\ProvidesExplPackage{stex}{2022/02/26}{3.0.1}{sTeX package} + + +\keys_define:nn { stex } { + debug .clist_set:N = \c_stex_debug_clist , + lang .clist_set:N = \c_stex_languages_clist , + mathhub .tl_set_x:N = \mathhub , + sms .bool_set:N = \c_stex_persist_mode_bool , + image .bool_set:N = \c_tikzinput_image_bool, + unknown .code:n = {} +} +\ProcessKeysOptions { stex } +\protected\def\stex{% + \@ifundefined{texorpdfstring}% + {\let\texorpdfstring\@firstoftwo}% + {}% + \texorpdfstring{\raisebox{-.5ex}S\kern-.5ex\TeX}{sTeX}\xspace% +} +\def\sTeX{\stex} +\msg_new:nnn{stex}{error/unknownlanguage}{ + Unknown~language:~#1 +} +\msg_new:nnn{stex}{warning/nomathhub}{ + MATHHUB~system~variable~not~found~and~no~ + \detokenize{\mathhub}-value~set! +} +\msg_new:nnn{stex}{error/deactivated-macro}{ + The~\detokenize{#1}~command~is~only~allowed~in~#2! +} +\cs_new_protected:Nn \stex_debug:nn { + \clist_if_in:NnTF \c_stex_debug_clist { all } { + \exp_args:Nnnx\msg_set:nnn{stex}{debug / #1}{ + \\Debug~#1:~#2\\ + } + \msg_none:nn{stex}{debug / #1} + }{ + \clist_if_in:NnT \c_stex_debug_clist { #1 } { + \exp_args:Nnnx\msg_set:nnn{stex}{debug / #1}{ + \\Debug~#1:~#2\\ + } + \msg_none:nn{stex}{debug / #1} + } + } +} +\clist_if_in:NnTF \c_stex_debug_clist {all} { + \msg_redirect_module:nnn{ stex }{ none }{ term } +}{ + \clist_map_inline:Nn \c_stex_debug_clist { + \msg_redirect_name:nnn{ stex }{ debug / ##1 }{ term } + } +} + +\stex_debug:nn{log}{debug~mode~on} +\RequirePackage{rustex} +\rustex_add_Namespace:nn{stex}{http://kwarc.info/ns/sTeX} +\ifcsname if@latexml\endcsname\else + \expandafter\newif\csname if@latexml\endcsname\@latexmlfalse +\fi +\prg_new_conditional:Nnn \latexml_if: {p, T, F, TF} { + \if@latexml + \prg_return_true: + \else: + \prg_return_false: + \fi: +} +\tl_new:N \l__stex_annotate_arg_tl +\tl_const:Nx \c__stex_annotate_emptyarg_tl { + \rustex_if:TF { + \rustex_direct_HTML:n { \c_ampersand_str lrm; } + }{~} +} +\cs_new_protected:Nn \__stex_annotate_checkempty:n { + \tl_set:Nn \l__stex_annotate_arg_tl { #1 } + \tl_if_empty:NT \l__stex_annotate_arg_tl { + \tl_set_eq:NN \l__stex_annotate_arg_tl \c__stex_annotate_emptyarg_tl + } +} +\bool_new:N \_stex_html_do_output_bool +\bool_set_true:N \_stex_html_do_output_bool + +\prg_new_conditional:Nnn \stex_if_do_html: {p,T,F,TF} { + \bool_if:nTF \_stex_html_do_output_bool + \prg_return_true: \prg_return_false: +} +\cs_new_protected:Nn \stex_suppress_html:n { + \exp_args:Nne \use:nn { + \bool_set_false:N \_stex_html_do_output_bool + #1 + }{ + \stex_if_do_html:T { + \bool_set_true:N \_stex_html_do_output_bool + } + } +} +\rustex_if:TF{ + \cs_new_protected:Nn \stex_annotate:nnn { + \__stex_annotate_checkempty:n { #3 } + \rustex_annotate_HTML:nn { + property="stex:#1" ~ + resource="#2" + } { + \mode_if_vertical:TF{ + \tl_use:N \l__stex_annotate_arg_tl\par + }{ + \tl_use:N \l__stex_annotate_arg_tl + } + } + } + \cs_new_protected:Nn \stex_annotate_invisible:n { + \__stex_annotate_checkempty:n { #1 } + \rustex_annotate_HTML:nn { + stex:visible="false" ~ + style:display="none" + } { + \mode_if_vertical:TF{ + \tl_use:N \l__stex_annotate_arg_tl\par + }{ + \tl_use:N \l__stex_annotate_arg_tl + } + } + } + \cs_new_protected:Nn \stex_annotate_invisible:nnn { + \__stex_annotate_checkempty:n { #3 } + \rustex_annotate_HTML:nn { + property="stex:#1" ~ + resource="#2" ~ + stex:visible="false" ~ + style:display="none" + } { + \mode_if_vertical:TF{ + \tl_use:N \l__stex_annotate_arg_tl\par + }{ + \tl_use:N \l__stex_annotate_arg_tl + } + } + } + \NewDocumentEnvironment{stex_annotate_env} { m m } { + \par + \rustex_annotate_HTML_begin:n { + property="stex:#1" ~ + resource="#2" + } + }{ + \par\rustex_annotate_HTML_end: + } +}{ + \latexml_if:TF { + \cs_new_protected:Nn \stex_annotate:nnn { + \__stex_annotate_checkempty:n { #3 } + \mode_if_math:TF { + \cs:w latexml@annotate@math\cs_end:{#1}{#2}{ + \tl_use:N \l__stex_annotate_arg_tl + } + }{ + \cs:w latexml@annotate@text\cs_end:{#1}{#2}{ + \tl_use:N \l__stex_annotate_arg_tl + } + } + } + \cs_new_protected:Nn \stex_annotate_invisible:n { + \__stex_annotate_checkempty:n { #1 } + \mode_if_math:TF { + \cs:w latexml@invisible@math\cs_end:{ + \tl_use:N \l__stex_annotate_arg_tl + } + } { + \cs:w latexml@invisible@text\cs_end:{ + \tl_use:N \l__stex_annotate_arg_tl + } + } + } + \cs_new_protected:Nn \stex_annotate_invisible:nnn { + \__stex_annotate_checkempty:n { #3 } + \cs:w latexml@annotate@invisible\cs_end:{#1}{#2}{ + \tl_use:N \l__stex_annotate_arg_tl + } + } + \NewDocumentEnvironment{stex_annotate_env} { m m } { + \par\begin{latexml@annotateenv}{#1}{#2} + }{ + \par\end{latexml@annotateenv} + } + }{ + \cs_new_protected:Nn \stex_annotate:nnn {#3} + \cs_new_protected:Nn \stex_annotate_invisible:n {} + \cs_new_protected:Nn \stex_annotate_invisible:nnn {} + \NewDocumentEnvironment{stex_annotate_env} { m m } {}{} + } +} +\prop_const_from_keyval:Nn \c_stex_languages_prop { + en = english , + de = ngerman , + ar = arabic , + bg = bulgarian , + ru = russian , + fi = finnish , + ro = romanian , + tr = turkish , + fr = french +} + +\prop_const_from_keyval:Nn \c_stex_language_abbrevs_prop { + english = en , + ngerman = de , + arabic = ar , + bulgarian = bg , + russian = ru , + finnish = fi , + romanian = ro , + turkish = tr , + french = fr +} +\clist_if_empty:NF \c_stex_languages_clist { + \clist_clear:N \l_tmpa_clist + \clist_map_inline:Nn \c_stex_languages_clist { + \prop_get:NnNTF \c_stex_languages_prop { #1 } \l_tmpa_str { + \clist_put_right:No \l_tmpa_clist \l_tmpa_str + } { + \msg_error:nnx{stex}{error/unknownlanguage}{\l_tmpa_str} + } + } + \stex_debug:nn{lang} {Languages:~\clist_use:Nn \l_tmpa_clist {,~} } + \RequirePackage[\clist_use:Nn \l_tmpa_clist,]{babel} +} +\cs_new_protected:Nn \stex_deactivate_macro:Nn { + \exp_after:wN\let\csname \detokenize{#1} - orig\endcsname#1 + \def#1{ + \msg_error:nnnn{stex}{error/deactivated-macro}{#1}{#2} + } +} +\cs_new_protected:Nn \stex_reactivate_macro:N { + \exp_after:wN\let\exp_after:wN#1\csname \detokenize{#1} - orig\endcsname +} +\protected\def\ignorespacesandpars{ + \begingroup\catcode13=10\relax + \@ifnextchar\par{ + \endgroup\expandafter\ignorespacesandpars\@gobble + }{ + \endgroup + } +} + +%%%%%%%%%%%%% mathhub.dtx %%%%%%%%%%%%% + +\msg_new:nnn{stex}{error/norepository}{ + No~archive~#1~found~in~#2 +} +\msg_new:nnn{stex}{error/notinarchive}{ + Not~currently~in~an~archive,~but~\detokenize{#1}~ + needs~one! +} +\msg_new:nnn{stex}{error/nofile}{ + \detokenize{#1}~could~not~find~file~#2 +} +\msg_new:nnn{stex}{error/twofiles}{ + \detokenize{#1}~found~two~candidates~for~#2 +} +\cs_new_protected:Nn \stex_path_from_string:Nn { + \str_set:Nx \l_tmpa_str { #2 } + \str_if_empty:NTF \l_tmpa_str { + \seq_clear:N #1 + }{ + \exp_args:NNNo \seq_set_split:Nnn #1 / { \l_tmpa_str } + \sys_if_platform_windows:T{ + \seq_clear:N \l_tmpa_tl + \seq_map_inline:Nn #1 { + \seq_set_split:Nnn \l_tmpb_tl \c_backslash_str { ##1 } + \seq_concat:NNN \l_tmpa_tl \l_tmpa_tl \l_tmpb_tl + } + \seq_set_eq:NN #1 \l_tmpa_tl + } + \stex_path_canonicalize:N #1 + } +} + +\cs_new_protected:Nn \stex_path_to_string:NN { + \exp_args:NNe \str_set:Nn #2 { \seq_use:Nn #1 / } +} + +\cs_new:Nn \stex_path_to_string:N { + \seq_use:Nn #1 / +} +\str_const:Nn \c__stex_path_dot_str {.} +\str_const:Nn \c__stex_path_up_str {..} +\cs_new_protected:Nn \stex_path_canonicalize:N { + \seq_if_empty:NF #1 { + \seq_clear:N \l_tmpa_seq + \seq_get_left:NN #1 \l_tmpa_tl + \str_if_empty:NT \l_tmpa_tl { + \seq_put_right:Nn \l_tmpa_seq {} + } + \seq_map_inline:Nn #1 { + \str_set:Nn \l_tmpa_tl { ##1 } + \str_if_eq:NNF \l_tmpa_tl \c__stex_path_dot_str { + \str_if_eq:NNTF \l_tmpa_tl \c__stex_path_up_str { + \seq_if_empty:NTF \l_tmpa_seq { + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \c__stex_path_up_str + } + }{ + \seq_get_right:NN \l_tmpa_seq \l_tmpa_tl + \str_if_eq:NNTF \l_tmpa_tl \c__stex_path_up_str { + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \c__stex_path_up_str + } + }{ + \seq_pop_right:NN \l_tmpa_seq \l_tmpb_tl + } + } + }{ + \str_if_empty:NF \l_tmpa_tl { + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { \l_tmpa_tl } + } + } + } + } + \seq_gset_eq:NN #1 \l_tmpa_seq + } +} +\prg_new_conditional:Nnn \stex_path_if_absolute:N {p, T, F, TF} { + \seq_if_empty:NTF #1 { + \prg_return_false: + }{ + \seq_get_left:NN #1 \l_tmpa_tl + \sys_if_platform_windows:TF{ + \str_if_in:NnTF \l_tmpa_tl {:}{ + \prg_return_true: + }{ + \prg_return_false: + } + }{ + \str_if_empty:NTF \l_tmpa_tl { + \prg_return_true: + }{ + \prg_return_false: + } + } + } +} +\str_new:N\l_stex_kpsewhich_return_str +\cs_new_protected:Nn \stex_kpsewhich:n { + \sys_get_shell:nnN { kpsewhich ~ #1 } { } \l_tmpa_tl + \exp_args:NNo\str_set:Nn\l_stex_kpsewhich_return_str{\l_tmpa_tl} + \tl_trim_spaces:N \l_stex_kpsewhich_return_str +} +\sys_if_platform_windows:TF{ + \begingroup\escapechar=-1\catcode`\\=12 + \exp_args:Nx\stex_kpsewhich:n{-expand-var~\c_percent_str CD\c_percent_str} + \exp_args:NNx\str_replace_all:Nnn\l_stex_kpsewhich_return_str{\c_backslash_str}/ + \exp_args:Nnx\use:nn{\endgroup}{\str_set:Nn\exp_not:N\l_stex_kpsewhich_return_str{\l_stex_kpsewhich_return_str}} +}{ + \stex_kpsewhich:n{-var-value~PWD} +} + +\stex_path_from_string:Nn\c_stex_pwd_seq\l_stex_kpsewhich_return_str +\stex_path_to_string:NN\c_stex_pwd_seq\c_stex_pwd_str +\stex_debug:nn {mathhub} {PWD:~\str_use:N\c_stex_pwd_str} +\seq_gclear_new:N\g__stex_files_stack +\str_set:Nx \c_stex_mainfile_str {\c_stex_pwd_str/\jobname.tex} +\stex_path_from_string:Nn \c_stex_mainfile_seq + \c_stex_mainfile_str +\seq_gclear_new:N\g_stex_currentfile_seq +\cs_new_protected:Nn \stex_filestack_push:n { + \stex_path_from_string:Nn\g_stex_currentfile_seq{#1} + \stex_path_if_absolute:NF\g_stex_currentfile_seq{ + \stex_path_from_string:Nn\g_stex_currentfile_seq{ + \c_stex_pwd_str/#1 + } + } + \seq_gset_eq:NN\g_stex_currentfile_seq\g_stex_currentfile_seq + \exp_args:NNo\seq_gpush:Nn\g__stex_files_stack\g_stex_currentfile_seq +} +\cs_new_protected:Nn \stex_filestack_pop: { + \seq_if_empty:NF\g__stex_files_stack{ + \seq_gpop:NN\g__stex_files_stack\l_tmpa_seq + } + \seq_if_empty:NTF\g__stex_files_stack{ + \seq_gset_eq:NN\g_stex_currentfile_seq\c_stex_mainfile_seq + }{ + \seq_get:NN\g__stex_files_stack\l_tmpa_seq + \seq_gset_eq:NN\g_stex_currentfile_seq\l_tmpa_seq + } +} +\AddToHook{file/before}{ + \stex_filestack_push:n{\CurrentFilePath/\CurrentFile} +} +\AddToHook{file/after}{ + \stex_filestack_pop: +} +\str_if_empty:NTF\mathhub{ + \sys_if_platform_windows:TF{ + \begingroup\escapechar=-1\catcode`\\=12 + \exp_args:Nx\stex_kpsewhich:n{-expand-var~\c_percent_str MATHHUB\c_percent_str} + \exp_args:NNx\str_replace_all:Nnn\l_stex_kpsewhich_return_str{\c_backslash_str}/ + \exp_args:Nnx\use:nn{\endgroup}{\str_set:Nn\exp_not:N\l_stex_kpsewhich_return_str{\l_stex_kpsewhich_return_str}} + }{ + \stex_kpsewhich:n{-var-value~MATHHUB} + } + \str_set_eq:NN\c_stex_mathhub_str\l_stex_kpsewhich_return_str + + \str_if_empty:NTF\c_stex_mathhub_str{ + \msg_warning:nn{stex}{warning/nomathhub} + }{ + \stex_debug:nn{mathhub}{MathHub:~\str_use:N\c_stex_mathhub_str} + \exp_args:NNo \stex_path_from_string:Nn\c_stex_mathhub_seq\c_stex_mathhub_str + } +}{ + \stex_path_from_string:Nn \c_stex_mathhub_seq \mathhub + \stex_path_if_absolute:NF \c_stex_mathhub_seq { + \exp_args:NNx \stex_path_from_string:Nn \c_stex_mathhub_seq { + \c_stex_pwd_str/\mathhub + } + } + \stex_path_to_string:NN\c_stex_mathhub_seq\c_stex_mathhub_str + \stex_debug:nn{mathhub} {MathHub:~\str_use:N\c_stex_mathhub_str} +} +\cs_new_protected:Nn \__stex_mathhub_do_manifest:n { + \prop_if_exist:cF {c_stex_mathhub_#1_manifest_prop} { + \str_set:Nx \l_tmpa_str { #1 } + \prop_new:c { c_stex_mathhub_#1_manifest_prop } + \seq_set_split:NnV \l_tmpa_seq / \l_tmpa_str + \seq_concat:NNN \l_tmpa_seq \c_stex_mathhub_seq \l_tmpa_seq + \__stex_mathhub_find_manifest:N \l_tmpa_seq + \seq_if_empty:NTF \l__stex_mathhub_manifest_file_seq { + \msg_error:nnxx{stex}{error/norepository}{#1}{ + \stex_path_to_string:N \c_stex_mathhub_str + } + } { + \exp_args:No \__stex_mathhub_parse_manifest:n { \l_tmpa_str } + } + } +} +\seq_new:N\l__stex_mathhub_manifest_file_seq +\cs_new_protected:Nn \__stex_mathhub_find_manifest:N { + \seq_set_eq:NN\l_tmpa_seq #1 + \bool_set_true:N\l_tmpa_bool + \bool_while_do:Nn \l_tmpa_bool { + \seq_if_empty:NTF \l_tmpa_seq { + \bool_set_false:N\l_tmpa_bool + }{ + \file_if_exist:nTF{ + \stex_path_to_string:N\l_tmpa_seq/MANIFEST.MF + }{ + \seq_put_right:Nn\l_tmpa_seq{MANIFEST.MF} + \bool_set_false:N\l_tmpa_bool + }{ + \file_if_exist:nTF{ + \stex_path_to_string:N\l_tmpa_seq/META-INF/MANIFEST.MF + }{ + \seq_put_right:Nn\l_tmpa_seq{META-INF} + \seq_put_right:Nn\l_tmpa_seq{MANIFEST.MF} + \bool_set_false:N\l_tmpa_bool + }{ + \file_if_exist:nTF{ + \stex_path_to_string:N\l_tmpa_seq/meta-inf/MANIFEST.MF + }{ + \seq_put_right:Nn\l_tmpa_seq{meta-inf} + \seq_put_right:Nn\l_tmpa_seq{MANIFEST.MF} + \bool_set_false:N\l_tmpa_bool + }{ + \seq_pop_right:NN\l_tmpa_seq\l_tmpa_tl + } + } + } + } + } + \seq_set_eq:NN\l__stex_mathhub_manifest_file_seq\l_tmpa_seq +} +\ior_new:N \c__stex_mathhub_manifest_ior +\cs_new_protected:Nn \__stex_mathhub_parse_manifest:n { + \seq_set_eq:NN \l_tmpa_seq \l__stex_mathhub_manifest_file_seq + \ior_open:Nn \c__stex_mathhub_manifest_ior {\stex_path_to_string:N \l_tmpa_seq} + \ior_map_inline:Nn \c__stex_mathhub_manifest_ior { + \str_set:Nn \l_tmpa_str {##1} + \exp_args:NNoo \seq_set_split:Nnn + \l_tmpb_seq \c_colon_str \l_tmpa_str + \seq_pop_left:NNTF \l_tmpb_seq \l_tmpa_tl { + \exp_args:NNe \str_set:Nn \l_tmpb_tl { + \exp_args:NNo \seq_use:Nn \l_tmpb_seq \c_colon_str + } + \exp_args:No \str_case:nnTF \l_tmpa_tl { + {id} { + \prop_gput:cno { c_stex_mathhub_#1_manifest_prop } + { id } \l_tmpb_tl + } + {narration-base} { + \prop_gput:cno { c_stex_mathhub_#1_manifest_prop } + { narr } \l_tmpb_tl + } + {url-base} { + \prop_gput:cno { c_stex_mathhub_#1_manifest_prop } + { docurl } \l_tmpb_tl + } + {source-base} { + \prop_gput:cno { c_stex_mathhub_#1_manifest_prop } + { ns } \l_tmpb_tl + } + {ns} { + \prop_gput:cno { c_stex_mathhub_#1_manifest_prop } + { ns } \l_tmpb_tl + } + {dependencies} { + \prop_gput:cno { c_stex_mathhub_#1_manifest_prop } + { deps } \l_tmpb_tl + } + }{}{} + }{} + } + \ior_close:N \c__stex_mathhub_manifest_ior +} +\cs_new_protected:Nn \stex_set_current_repository:n { + \stex_require_repository:n { #1 } + \prop_set_eq:Nc \l_stex_current_repository_prop { + c_stex_mathhub_#1_manifest_prop + } +} +\cs_new_protected:Nn \stex_require_repository:n { + \prop_if_exist:cF { c_stex_mathhub_#1_manifest_prop } { + \stex_debug:nn{mathhub}{Opening~archive:~#1} + \__stex_mathhub_do_manifest:n { #1 } + } +} + +\__stex_mathhub_find_manifest:N \c_stex_pwd_seq +\seq_if_empty:NTF \l__stex_mathhub_manifest_file_seq { + \stex_debug:nn{mathhub}{Not~currently~in~a~MathHub~repository} +} { + \__stex_mathhub_parse_manifest:n { main } + \prop_get:NnN \c_stex_mathhub_main_manifest_prop {id} + \l_tmpa_str + \prop_set_eq:cN { c_stex_mathhub_\l_tmpa_str _manifest_prop } + \c_stex_mathhub_main_manifest_prop + \exp_args:Nx \stex_set_current_repository:n { \l_tmpa_str } + \stex_debug:nn{mathhub}{Current~repository:~ + \prop_item:Nn \l_stex_current_repository_prop {id} + } +} +\cs_new_protected:Nn \stex_in_repository:nn { + \str_set:Nx \l_tmpa_str { #1 } + \cs_set:Npn \l_tmpa_cs ##1 { #2 } + \str_if_empty:NTF \l_tmpa_str { + \prop_if_exist:NTF \l_stex_current_repository_prop { + \stex_debug:nn{mathhub}{do~in~current~repository:~\prop_item:Nn \l_stex_current_repository_prop { id }} + \exp_args:Ne \l_tmpa_cs{ + \prop_item:Nn \l_stex_current_repository_prop { id } + } + }{ + \l_tmpa_cs{} + } + }{ + \stex_debug:nn{mathhub}{in~repository:~\l_tmpa_str} + \stex_require_repository:n \l_tmpa_str + \str_set:Nx \l_tmpa_str { #1 } + \exp_args:Nne \use:nn { + \stex_set_current_repository:n \l_tmpa_str + \exp_args:Nx \l_tmpa_cs{\l_tmpa_str} + }{ + \stex_debug:nn{mathhub}{switching~back~to:~ + \prop_if_exist:NTF \l_stex_current_repository_prop { + \prop_item:Nn \l_stex_current_repository_prop { id }:~ + \meaning\l_stex_current_repository_prop + }{ + no~repository + } + } + \prop_if_exist:NTF \l_stex_current_repository_prop { + \stex_set_current_repository:n { + \prop_item:Nn \l_stex_current_repository_prop { id } + } + }{ + \let\exp_not:N\l_stex_current_repository_prop\exp_not:N\undefined + } + } + } +} +\def \mhpath #1 #2 { + \exp_args:Ne \tl_if_empty:nTF{#1}{ + \c_stex_mathhub_str / + \prop_item:Nn \l_stex_current_repository_prop { id } + / source / #2 + }{ + \c_stex_mathhub_str / #1 / source / #2 + } +} +\newif \ifinputref \inputreffalse + +\cs_new_protected:Nn \__stex_mathhub_mhinput:nn { + \stex_in_repository:nn {#1} { + \ifinputref + \input{ \c_stex_mathhub_str / ##1 / source / #2 } + \else + \inputreftrue + \input{ \c_stex_mathhub_str / ##1 / source / #2 } + \inputreffalse + \fi + } +} +\NewDocumentCommand \mhinput { O{} m}{ + \stex_mhinput:nn{ #1 }{ #2 } +} + +\cs_new_protected:Nn \__stex_mathhub_inputref:nn { + \stex_in_repository:nn {#1} { + \bool_lazy_any:nTF { + {\rustex_if_p:} + {\latexml_if_p:} + } { + \str_clear:N \l_tmpa_str + \prop_get:NnNF \l_stex_current_repository_prop { narr } \l_tmpa_str { + \prop_get:NnNF \l_stex_current_repository_prop { ns } \l_tmpa_str {} + } + \stex_annotate_invisible:nnn{inputref}{ + \l_tmpa_str / #2 + }{} + }{ + \begingroup + \inputreftrue + \input{ \c_stex_mathhub_str / ##1 / source / #2 } + \endgroup + } + } +} +\NewDocumentCommand \inputref { O{} m}{ + \__stex_mathhub_inputref:nn{ #1 }{ #2 } +} +\cs_new_protected:Nn \__stex_mathhub_mhbibresource:nn { + \stex_in_repository:nn {#1} { + \addbibresource{ \c_stex_mathhub_str / ##1 / #2 } + } +} +\newcommand\addmhbibresource[2][]{ + \__stex_mathhub_mhbibresource:nn{ #1 }{ #2 } +} +\cs_new_protected:Npn \libinput #1 { + \prop_if_exist:NF \l_stex_current_repository_prop { + \msg_error:nnn{stex}{error/notinarchive}\libinput + } + \prop_get:NnNF \l_stex_current_repository_prop {id} \l_tmpa_str { + \msg_error:nnn{stex}{error/notinarchive}\libinput + } + \seq_clear:N \l__stex_mathhub_libinput_files_seq + \seq_set_eq:NN \l_tmpa_seq \c_stex_mathhub_seq + \seq_set_split:NnV \l_tmpb_seq / \l_tmpa_str + + \bool_while_do:nn { ! \seq_if_empty_p:N \l_tmpb_seq }{ + \str_set:Nx \l_tmpa_str {\stex_path_to_string:N \l_tmpa_seq / meta-inf / lib / #1.tex} + \IfFileExists{ \l_tmpa_str }{ + \seq_put_right:No \l__stex_mathhub_libinput_files_seq \l_tmpa_str + }{} + \seq_pop_left:NN \l_tmpb_seq \l_tmpa_str + \seq_put_right:No \l_tmpa_seq \l_tmpa_str + } + + \str_set:Nx \l_tmpa_str {\stex_path_to_string:N \l_tmpa_seq / lib / #1.tex} + \IfFileExists{ \l_tmpa_str }{ + \seq_put_right:No \l__stex_mathhub_libinput_files_seq \l_tmpa_str + }{} + + \seq_if_empty:NTF \l__stex_mathhub_libinput_files_seq { + \msg_error:nnxx{stex}{error/nofile}{\exp_not:N\libinput}{#1.tex} + }{ + \seq_map_inline:Nn \l__stex_mathhub_libinput_files_seq { + \input{ ##1 } + } + } +} +\NewDocumentCommand \libusepackage {O{} m} { + \prop_if_exist:NF \l_stex_current_repository_prop { + \msg_error:nnn{stex}{error/notinarchive}\libusepackage + } + \prop_get:NnNF \l_stex_current_repository_prop {id} \l_tmpa_str { + \msg_error:nnn{stex}{error/notinarchive}\libusepackage + } + \seq_clear:N \l__stex_mathhub_libinput_files_seq + \seq_set_eq:NN \l_tmpa_seq \c_stex_mathhub_seq + \seq_set_split:NnV \l_tmpb_seq / \l_tmpa_str + + \bool_while_do:nn { ! \seq_if_empty_p:N \l_tmpb_seq }{ + \str_set:Nx \l_tmpa_str {\stex_path_to_string:N \l_tmpa_seq / meta-inf / lib / #2} + \IfFileExists{ \l_tmpa_str.sty }{ + \seq_put_right:No \l__stex_mathhub_libinput_files_seq \l_tmpa_str + }{} + \seq_pop_left:NN \l_tmpb_seq \l_tmpa_str + \seq_put_right:No \l_tmpa_seq \l_tmpa_str + } + + \str_set:Nx \l_tmpa_str {\stex_path_to_string:N \l_tmpa_seq / lib / #2} + \IfFileExists{ \l_tmpa_str.sty }{ + \seq_put_right:No \l__stex_mathhub_libinput_files_seq \l_tmpa_str + }{} + + \seq_if_empty:NTF \l__stex_mathhub_libinput_files_seq { + \msg_error:nnxx{stex}{error/nofile}{\exp_not:N\libusepackage}{#2.sty} + }{ + \int_compare:nNnTF {\seq_count:N \l__stex_mathhub_libinput_files_seq} = 1 { + \seq_map_inline:Nn \l__stex_mathhub_libinput_files_seq { + \usepackage[#1]{ ##1 } + } + }{ + \msg_error:nnxx{stex}{error/twofiles}{\exp_not:N\libusepackage}{#2.sty} + } + } +} + +\AddToHook{begindocument}{ +\ltx@ifpackageloaded{graphicx}{ + \define@key{Gin}{mhrepos}{\def\Gin@mhrepos{#1}} + \newcommand\mhgraphics[2][]{% + \def\Gin@mhrepos{}\setkeys{Gin}{#1}% + \includegraphics[#1]{\mhpath\Gin@mhrepos{#2}}} + \newcommand\cmhgraphics[2][]{\begin{center}\mhgraphics[#1]{#2}\end{center}} + }{} +\ltx@ifpackageloaded{listings}{ + \define@key{lst}{mhrepos}{\def\lst@mhrepos{#1}} + \newcommand\lstinputmhlisting[2][]{% + \def\lst@mhrepos{}\setkeys{lst}{#1}% + \lstinputlisting[#1]{\mhpath\lst@mhrepos{#2}}} + \newcommand\clstinputmhlisting[2][]{\begin{center}\lstinputmhlisting[#1]{#2}\end{center}} + }{} +} + + +%%%%%%%%%%%%% references.dtx %%%%%%%%%%%%% + + +\AddToHook{begindocument}{ +} +\AddToHook{enddocument}{ +} +\str_set:Nn \g__stex_refs_title_tl {Unnamed~Document} + +\NewDocumentCommand \STEXreftitle { m } { + \tl_gset:Nx \g__stex_refs_title_tl { #1 } +} +\str_new:N \l_stex_current_docns_str +\cs_new_protected:Nn \stex_get_document_uri: { + \seq_set_eq:NN \l_tmpa_seq \g_stex_currentfile_seq + \seq_pop_right:NN \l_tmpa_seq \l_tmpb_str + \exp_args:NNno \seq_set_split:Nnn \l_tmpb_seq . \l_tmpb_str + \seq_get_left:NN \l_tmpb_seq \l_tmpb_str + \seq_put_right:No \l_tmpa_seq \l_tmpb_str + + \str_clear:N \l_tmpa_str + \prop_if_exist:NT \l_stex_current_repository_prop { + \prop_get:NnNF \l_stex_current_repository_prop { narr } \l_tmpa_str { + \prop_get:NnNF \l_stex_current_repository_prop { ns } \l_tmpa_str {} + } + } + + \str_if_empty:NTF \l_tmpa_str { + \str_set:Nx \l_stex_current_docns_str { + file:/\stex_path_to_string:N \l_tmpa_seq + } + }{ + \bool_set_true:N \l_tmpa_bool + \bool_while_do:Nn \l_tmpa_bool { + \seq_pop_left:NN \l_tmpa_seq \l_tmpb_str + \exp_args:No \str_case:nnTF { \l_tmpb_str } { + {source} { \bool_set_false:N \l_tmpa_bool } + }{}{ + \seq_if_empty:NT \l_tmpa_seq { + \bool_set_false:N \l_tmpa_bool + } + } + } + + \seq_if_empty:NTF \l_tmpa_seq { + \str_set_eq:NN \l_stex_current_docns_str \l_tmpa_str + }{ + \str_set:Nx \l_stex_current_docns_str { + \l_tmpa_str/\stex_path_to_string:N \l_tmpa_seq + } + } + } +} +\str_new:N \l_stex_current_docurl_str +\cs_new_protected:Nn \stex_get_document_url: { + \seq_set_eq:NN \l_tmpa_seq \g_stex_currentfile_seq + \seq_pop_right:NN \l_tmpa_seq \l_tmpb_str + \exp_args:NNno \seq_set_split:Nnn \l_tmpb_seq . \l_tmpb_str + \seq_get_left:NN \l_tmpb_seq \l_tmpb_str + \seq_put_right:No \l_tmpa_seq \l_tmpb_str + + \str_clear:N \l_tmpa_str + \prop_if_exist:NT \l_stex_current_repository_prop { + \prop_get:NnNF \l_stex_current_repository_prop { docurl } \l_tmpa_str { + \prop_get:NnNF \l_stex_current_repository_prop { narr } \l_tmpa_str { + \prop_get:NnNF \l_stex_current_repository_prop { ns } \l_tmpa_str {} + } + } + } + + \str_if_empty:NTF \l_tmpa_str { + \str_set:Nx \l_stex_current_docurl_str { + file:/\stex_path_to_string:N \l_tmpa_seq + } + }{ + \bool_set_true:N \l_tmpa_bool + \bool_while_do:Nn \l_tmpa_bool { + \seq_pop_left:NN \l_tmpa_seq \l_tmpb_str + \exp_args:No \str_case:nnTF { \l_tmpb_str } { + {source} { \bool_set_false:N \l_tmpa_bool } + }{}{ + \seq_if_empty:NT \l_tmpa_seq { + \bool_set_false:N \l_tmpa_bool + } + } + } + + \seq_if_empty:NTF \l_tmpa_seq { + \str_set_eq:NN \l_stex_current_docurl_str \l_tmpa_str + }{ + \str_set:Nx \l_stex_current_docurl_str { + \l_tmpa_str/\stex_path_to_string:N \l_tmpa_seq + } + } + } +} +\str_const:Nn \c__stex_refs_url_str{URL} +\str_const:Nn \c__stex_refs_ref_str{REF} +\str_new:N \l__stex_refs_curr_label_str +\int_new:N \l__stex_refs_unnamed_counter_int +\cs_new_protected:Nn \stex_ref_new_doc_target:n { + \stex_get_document_uri: + \str_clear:N \l__stex_refs_curr_label_str + \str_set:Nx \l_tmpa_str { #1 } + \str_if_empty:NT \l_tmpa_str { + \int_incr:N \l__stex_refs_unnamed_counter_int + \str_set:Nx \l_tmpa_str {REF\int_use:N \l__stex_refs_unnamed_counter_int} + } + \str_set:Nx \l__stex_refs_curr_label_str { + \l_stex_current_docns_str?\l_tmpa_str + } + \seq_if_exist:cF{g__stex_refs_labels_\l_tmpa_str _seq}{ + \seq_new:c {g__stex_refs_labels_\l_tmpa_str _seq} + } + \seq_if_in:coF{g__stex_refs_labels_\l_tmpa_str _seq}\l__stex_refs_curr_label_str { + \seq_gput_right:co{g__stex_refs_labels_\l_tmpa_str _seq}\l__stex_refs_curr_label_str + } + \stex_if_smsmode:TF { + \stex_get_document_url: + \str_gset_eq:cN {sref_url_\l__stex_refs_curr_label_str _str}\l_stex_current_docurl_str + \str_gset_eq:cN {sref_\l__stex_refs_curr_label_str _type}\c__stex_refs_url_str + }{ + %\iow_now:Nx \c__stex_refs_refs_iow { \l_tmpa_str~=~\expandafter\unexpanded\expandafter{\@currentlabel}~in~\exp_args:No\unexpanded\g__stex_refs_title_tl,} + \exp_args:Nx\label{sref_\l__stex_refs_curr_label_str} + \immediate\write\@auxout{\stexauxadddocref{\l_stex_current_docns_str}{\l_tmpa_str}} + \str_gset:cx {sref_\l__stex_refs_curr_label_str _type}\c__stex_refs_ref_str + } +} +\cs_new_protected:Npn \stexauxadddocref #1 #2 { + \str_set:Nn \l_tmpa_str {#1?#2} + \str_gset_eq:cN{sref_#1?#2_type}\c__stex_refs_ref_str + \seq_if_exist:cF{g__stex_refs_labels_#2_seq}{ + \seq_new:c {g__stex_refs_labels_#2_seq} + } + \seq_if_in:coF{g__stex_refs_labels_#2_seq}\l_tmpa_str { + \seq_gput_right:co{g__stex_refs_labels_#2_seq}\l_tmpa_str + } +} +\AtEndDocument{ + \def\stexauxadddocref#1 #2 {}{} +} +\cs_new_protected:Nn \stex_ref_new_sym_target:n { + \stex_if_smsmode:TF { + \str_if_exist:cF{sref_sym_#1_type}{ + \stex_get_document_url: + \str_gset_eq:cN {sref_sym_url_#1_str}\l_stex_current_docurl_str + \str_gset_eq:cN {sref_sym_#1_type}\c__stex_refs_url_str + } + }{ + \str_if_empty:NF \l__stex_refs_curr_label_str { + \str_gset_eq:cN {sref_sym_#1_label_str}\l__stex_refs_curr_label_str + \immediate\write\@auxout{ + \exp_not:N\expandafter\def\exp_not:N\csname sref_sym_#1_label_str\exp_not:N\endcsname{ + \l__stex_refs_curr_label_str + } + } + } + } +} +\str_new:N \l__stex_refs_indocument_str + +\keys_define:nn { stex / sref } { + linktext .tl_set:N = \l__stex_refs_linktext_tl , + fallback .tl_set:N = \l__stex_refs_fallback_tl , + pre .tl_set:N = \l__stex_refs_pre_tl , + post .tl_set:N = \l__stex_refs_post_tl , +} +\cs_new_protected:Nn \__stex_refs_args:n { + \tl_clear:N \l__stex_refs_linktext_tl + \tl_clear:N \l__stex_refs_fallback_tl + \tl_clear:N \l__stex_refs_pre_tl + \tl_clear:N \l__stex_refs_post_tl + \str_clear:N \l__stex_refs_repo_str + \keys_set:nn { stex / sref } { #1 } +} +\NewDocumentCommand \sref { O{} m}{ + \__stex_refs_args:n { #1 } + \str_if_empty:NTF \l__stex_refs_indocument_str { + \str_set:Nx \l_tmpa_str { #2 } + \exp_args:NNno \seq_set_split:Nnn \l_tmpa_seq ? \l_tmpa_str + \int_compare:nNnTF {\seq_count:N \l_tmpa_seq} = 1 { + \seq_if_exist:cTF{g__stex_refs_labels_\l_tmpa_str _seq}{ + \seq_get_left:cNF {g__stex_refs_labels_\l_tmpa_str _seq} \l_tmpa_str { + \str_clear:N \l_tmpa_str + } + }{ + \str_clear:N \l_tmpa_str + } + }{ + \seq_pop_left:NN \l_tmpa_seq \l_tmpb_str + \seq_pop_right:NN \l_tmpa_seq \l_tmpa_str + \int_set:Nn \l_tmpa_int { \exp_args:Ne \str_count:n {\l_tmpb_str?\l_tmpa_str} } + \seq_if_exist:cTF{g__stex_refs_labels_\l_tmpa_str _seq}{ + \str_set_eq:NN \l_tmpc_str \l_tmpa_str + \str_clear:N \l_tmpa_str + \seq_map_inline:cn {g__stex_refs_labels_\l_tmpc_str _seq} { + \str_if_eq:eeT { \l_tmpb_str?\l_tmpc_str }{ + \str_range:nnn { ##1 }{ -\l_tmpa_int}{ -1 } + }{ + \seq_map_break:n { + \str_set:Nn \l_tmpa_str { ##1 } + } + } + } + }{ + \str_clear:N \l_tmpa_str + } + } + \str_if_empty:NTF \l_tmpa_str { + \tl_if_empty:NTF \l__stex_refs_linktext_tl \l__stex_refs_fallback_tl \l__stex_refs_linktext_tl + }{ + \str_if_eq:cNTF {sref_\l_tmpa_str _type} \c__stex_refs_ref_str { + \tl_if_empty:NTF \l__stex_refs_linktext_tl { + \cs_if_exist:cTF{autoref}{ + \l__stex_refs_pre_tl\exp_args:Nx\autoref{sref_\l_tmpa_str}\l__stex_refs_post_tl + }{ + \l__stex_refs_pre_tl\exp_args:Nx\ref{sref_\l_tmpa_str}\l__stex_refs_post_tl + } + }{ + \ltx@ifpackageloaded{hyperref}{ + \hyperref[sref_\l_tmpa_str]\l__stex_refs_linktext_tl + }{ + \l__stex_refs_linktext_tl + } + } + }{ + \ltx@ifpackageloaded{hyperref}{ + \href{\use:c{sref_url_\l_tmpa_str _str}}{\tl_if_empty:NTF \l__stex_refs_linktext_tl \l__stex_refs_fallback_tl \l__stex_refs_linktext_tl} + }{ + \tl_if_empty:NTF \l__stex_refs_linktext_tl \l__stex_refs_fallback_tl \l__stex_refs_linktext_tl + } + } + } + }{ + % TODO + } +} +\NewDocumentCommand \srefsym { O{} m}{ + \stex_get_symbol:n { #2 } + \__stex_refs_sym_aux:nn{#1}{\l_stex_get_symbol_uri_str} +} + +\cs_new_protected:Nn \__stex_refs_sym_aux:nn { + \str_if_exist:cTF {sref_sym_#2 _label_str }{ + \sref[#1]{\use:c{sref_sym_#2 _label_str}} + }{ + \__stex_refs_args:n { #1 } + \str_if_empty:NTF \l__stex_refs_indocument_str { + \tl_if_exist:cTF{sref_sym_#2 _type}{ + % doc uri in \l_tmpb_str + \str_set:Nx \l_tmpa_str {\use:c{sref_sym_#2 _type}} + \str_if_eq:NNTF \l_tmpa_str \c__stex_refs_ref_str { + % reference + \tl_if_empty:NTF \l__stex_refs_linktext_tl { + \cs_if_exist:cTF{autoref}{ + \l__stex_refs_pre_tl\autoref{sref_sym_#2}\l__stex_refs_post_tl + }{ + \l__stex_refs_pre_tl\ref{sref_sym_#2}\l__stex_refs_post_tl + } + }{ + \ltx@ifpackageloaded{hyperref}{ + \hyperref[sref_sym_#2]\l__stex_refs_linktext_tl + }{ + \l__stex_refs_linktext_tl + } + } + }{ + % URL + \ltx@ifpackageloaded{hyperref}{ + \href{\use:c{sref_sym_url_#2 _str}}{\tl_if_empty:NTF \l__stex_refs_linktext_tl \l__stex_refs_fallback_tl \l__stex_refs_linktext_tl} + }{ + \tl_if_empty:NTF \l__stex_refs_linktext_tl \l__stex_refs_fallback_tl \l__stex_refs_linktext_tl + } + } + }{ + \tl_if_empty:NTF \l__stex_refs_linktext_tl \l__stex_refs_fallback_tl \l__stex_refs_linktext_tl + } + }{ + % TODO + } + } +} +\cs_new_protected:Npn \srefsymuri #1 #2 { + \__stex_refs_sym_aux:nn{linktext={#2}}{#1} +} + +%%%%%%%%%%%%% modules.dtx %%%%%%%%%%%%% + +\msg_new:nnn{stex}{error/unknownmodule}{ + No~module~#1~found +} +\msg_new:nnn{stex}{error/syntax}{ + Syntax~error:~#1 +} +\msg_new:nnn{stex}{error/siglanguage}{ + Module~#1~declares~signature~#2,~but~does~not~ + declare~its~language +} +\msg_new:nnn{stex}{warning/deprecated}{ + #1~is~deprecated;~please~use~#2~instead! +} + +\msg_new:nnn{stex}{error/conflictingmodules}{ + Conflicting~imports~for~module~#1 +} +\str_new:N \l_stex_current_module_str +\seq_new:N \l_stex_all_modules_seq +\prg_new_conditional:Nnn \stex_if_in_module: {p, T, F, TF} { + \str_if_empty:NTF \l_stex_current_module_str + \prg_return_false: \prg_return_true: +} +\prg_new_conditional:Nnn \stex_if_module_exists:n {p, T, F, TF} { + \prop_if_exist:cTF { c_stex_module_#1_prop } + \prg_return_true: \prg_return_false: +} +\cs_new_protected:Nn \stex_add_to_current_module:n { + \tl_gput_right:cn {c_stex_module_\l_stex_current_module_str _code} { #1 } +} +\cs_new_protected:Npn \STEXexport { + \begingroup + \newlinechar=-1\relax + \endlinechar=-1\relax + %\catcode`\ = 9\relax + \expandafter\endgroup\__stex_modules_export:n +} +\cs_new_protected:Nn \__stex_modules_export:n { + \ignorespaces #1 + \stex_add_to_current_module:n { \ignorespaces #1 } + \stex_smsmode_do: +} +\stex_deactivate_macro:Nn \STEXexport {module~environments} +\cs_new_protected:Nn \stex_add_constant_to_current_module:n { + \str_set:Nx \l_tmpa_str { #1 } + \seq_gput_right:co {c_stex_module_\l_stex_current_module_str _constants} { \l_tmpa_str } +} +\cs_new_protected:Nn \stex_add_import_to_current_module:n { + \str_set:Nx \l_tmpa_str { #1 } + \exp_args:Nno + \seq_if_in:cnF{c_stex_module_\l_stex_current_module_str _imports}\l_tmpa_str{ + \seq_gput_right:co{c_stex_module_\l_stex_current_module_str _imports}\l_tmpa_str + } +} +\cs_new_protected:Nn \stex_collect_imports:n { + \seq_clear:N \l_stex_collect_imports_seq + \__stex_modules_collect_imports:n {#1} +} +\cs_new_protected:Nn \__stex_modules_collect_imports:n { + \seq_map_inline:cn {c_stex_module_#1_imports} { + \seq_if_in:NnF \l_stex_collect_imports_seq { ##1 } { + \__stex_modules_collect_imports:n { ##1 } + } + } + \seq_if_in:NnF \l_stex_collect_imports_seq { #1 } { + \seq_put_right:Nx \l_stex_collect_imports_seq { #1 } + } +} +\int_new:N \l__stex_modules_group_depth_int +\tl_new:N \l__stex_modules_aftergroup_tl +\cs_new_protected:Nn \stex_do_up_to_module:n { + \int_compare:nNnTF \l__stex_modules_group_depth_int = \currentgrouplevel { + #1 + }{ + #1 + \expandafter \tl_gset:Nn \expandafter \l__stex_modules_aftergroup_tl \expandafter { \l__stex_modules_aftergroup_tl #1 } + \aftergroup\__stex_modules_aftergroup_do: + } +} +\cs_new_protected:Nn \__stex_modules_aftergroup_do: { + \int_compare:nNnTF \l__stex_modules_group_depth_int = \currentgrouplevel { + \l__stex_modules_aftergroup_tl + \tl_clear:N \l__stex_modules_aftergroup_tl + }{ + \l__stex_modules_aftergroup_tl + \aftergroup\__stex_modules_aftergroup_do: + } +} + +\str_new:N \l_stex_modules_ns_str +\str_new:N \l_stex_modules_subpath_str +\cs_new_protected:Nn \__stex_modules_compute_namespace:nN { + \str_set:Nx \l_tmpa_str { #1 } + \seq_set_eq:NN \l_tmpa_seq #2 + % split off file extension + \seq_pop_right:NN \l_tmpa_seq \l_tmpb_str + \exp_args:NNno \seq_set_split:Nnn \l_tmpb_seq . \l_tmpb_str + \seq_get_left:NN \l_tmpb_seq \l_tmpb_str + \seq_put_right:No \l_tmpa_seq \l_tmpb_str + + \bool_set_true:N \l_tmpa_bool + \bool_while_do:Nn \l_tmpa_bool { + \seq_pop_left:NN \l_tmpa_seq \l_tmpb_str + \exp_args:No \str_case:nnTF { \l_tmpb_str } { + {source} { \bool_set_false:N \l_tmpa_bool } + }{}{ + \seq_if_empty:NT \l_tmpa_seq { + \bool_set_false:N \l_tmpa_bool + } + } + } + + \stex_path_to_string:NN \l_tmpa_seq \l_stex_modules_subpath_str + \str_if_empty:NTF \l_stex_modules_subpath_str { + \str_set_eq:NN \l_stex_modules_ns_str \l_tmpa_str + }{ + \str_set:Nx \l_stex_modules_ns_str { + \l_tmpa_str/\l_stex_modules_subpath_str + } + } +} + +\cs_new_protected:Nn \stex_modules_current_namespace: { + \str_clear:N \l_stex_modules_subpath_str + \prop_if_exist:NTF \l_stex_current_repository_prop { + \prop_get:NnN \l_stex_current_repository_prop { ns } \l_tmpa_str + \__stex_modules_compute_namespace:nN \l_tmpa_str \g_stex_currentfile_seq + }{ + % split off file extension + \seq_set_eq:NN \l_tmpa_seq \g_stex_currentfile_seq + \seq_pop_right:NN \l_tmpa_seq \l_tmpb_str + \exp_args:NNno \seq_set_split:Nnn \l_tmpb_seq . \l_tmpb_str + \seq_get_left:NN \l_tmpb_seq \l_tmpb_str + \seq_put_right:No \l_tmpa_seq \l_tmpb_str + \str_set:Nx \l_stex_modules_ns_str { + file:/\stex_path_to_string:N \l_tmpa_seq + } + } +} +\keys_define:nn { stex / module } { + title .tl_set:N = \smoduletitle , + type .str_set_x:N = \smoduletype , + id .str_set_x:N = \smoduleid , + deprecate .str_set_x:N = \l_stex_module_deprecate_str , + ns .str_set_x:N = \l_stex_module_ns_str , + lang .str_set_x:N = \l_stex_module_lang_str , + sig .str_set_x:N = \l_stex_module_sig_str , + creators .str_set_x:N = \l_stex_module_creators_str , + contributors .str_set_x:N = \l_stex_module_contributors_str , + meta .str_set_x:N = \l_stex_module_meta_str , + srccite .str_set_x:N = \l_stex_module_srccite_str +} + +\cs_new_protected:Nn \__stex_modules_args:n { + \str_clear:N \smoduletitle + \str_clear:N \smoduletype + \str_clear:N \smoduleid + \str_clear:N \l_stex_module_ns_str + \str_clear:N \l_stex_module_deprecate_str + \str_clear:N \l_stex_module_lang_str + \str_clear:N \l_stex_module_sig_str + \str_clear:N \l_stex_module_creators_str + \str_clear:N \l_stex_module_contributors_str + \str_clear:N \l_stex_module_meta_str + \str_clear:N \l_stex_module_srccite_str + \keys_set:nn { stex / module } { #1 } +} + + +\cs_new_protected:Nn \stex_module_setup:nn { + \str_set:Nx \l_stex_module_name_str { #2 } + \__stex_modules_args:n { #1 } + \stex_if_in_module:TF { + % Nested module + \prop_get:cnN {c_stex_module_\l_stex_current_module_str _prop} + { ns } \l_stex_module_ns_str + \str_set:Nx \l_stex_module_name_str { + \prop_item:cn {c_stex_module_\l_stex_current_module_str _prop} + { name } / \l_stex_module_name_str + } + }{ + % not nested: + \str_if_empty:NT \l_stex_module_ns_str { + \stex_modules_current_namespace: + \str_set_eq:NN \l_stex_module_ns_str \l_stex_modules_ns_str + \exp_args:NNNo \seq_set_split:Nnn \l_tmpa_seq + / {\l_stex_module_ns_str} + \seq_pop_right:NN \l_tmpa_seq \l_tmpa_str + \str_if_eq:NNT \l_tmpa_str \l_stex_module_name_str { + \str_set:Nx \l_stex_module_ns_str { + \stex_path_to_string:N \l_tmpa_seq + } + } + } + } + \str_if_empty:NT \l_stex_module_lang_str { + \seq_get_right:NN \g_stex_currentfile_seq \l_tmpa_str + \seq_set_split:NnV \l_tmpa_seq . \l_tmpa_str + \seq_pop_right:NN \l_tmpa_seq \l_tmpa_str % .tex + \seq_pop_left:NN \l_tmpa_seq \l_tmpa_str % <filename> + \seq_if_empty:NF \l_tmpa_seq { %remaining element should be language + \stex_debug:nn{modules} {Language~\l_stex_module_lang_str~ + inferred~from~file~name} + \seq_pop_left:NN \l_tmpa_seq \l_stex_module_lang_str + } + } + + \stex_if_smsmode:F { \str_if_empty:NF \l_stex_module_lang_str { + \prop_get:NVNTF \c_stex_languages_prop \l_stex_module_lang_str + \l_tmpa_str { + \ltx@ifpackageloaded{babel}{ + \exp_args:Nx \selectlanguage { \l_tmpa_str } + }{} + } { + \msg_error:nnx{stex}{error/unknownlanguage}{\l_tmpa_str} + } + }} + \str_if_empty:NTF \l_stex_module_sig_str { + \exp_args:Nnx \prop_gset_from_keyval:cn { + c_stex_module_\l_stex_module_ns_str?\l_stex_module_name_str _prop + } { + name = \l_stex_module_name_str , + ns = \l_stex_module_ns_str , + file = \exp_not:o { \g_stex_currentfile_seq } , + lang = \l_stex_module_lang_str , + sig = \l_stex_module_sig_str , + deprecate = \l_stex_module_deprecate_str , + meta = \l_stex_module_meta_str + } + \seq_clear:c {c_stex_module_\l_stex_module_ns_str?\l_stex_module_name_str _imports} + \seq_clear:c {c_stex_module_\l_stex_module_ns_str?\l_stex_module_name_str _constants} + \tl_clear:c {c_stex_module_\l_stex_module_ns_str?\l_stex_module_name_str _code} + \str_set:Nx\l_stex_current_module_str{\l_stex_module_ns_str?\l_stex_module_name_str} + \str_if_empty:NT \l_stex_module_meta_str { + \str_set:Nx \l_stex_module_meta_str { + \c_stex_metatheory_ns_str ? Metatheory + } + } + \str_if_eq:VnF \l_stex_module_meta_str {NONE} { + \bool_set_true:N \l_stex_in_meta_bool + \exp_args:Nx \stex_add_to_current_module:n { + \bool_set_true:N \l_stex_in_meta_bool + \stex_activate_module:n {\l_stex_module_meta_str} + \bool_set_false:N \l_stex_in_meta_bool + } + \stex_activate_module:n {\l_stex_module_meta_str} + \bool_set_false:N \l_stex_in_meta_bool + } + }{ + \str_if_empty:NT \l_stex_module_lang_str { + \msg_error:nnxx{stex}{error/siglanguage}{ + \l_stex_module_ns_str?\l_stex_module_name_str + }{\l_stex_module_sig_str} + } + + \seq_set_eq:NN \l_tmpa_seq \g_stex_currentfile_seq + \seq_pop_right:NN \l_tmpa_seq \l_tmpa_str + \seq_set_split:NnV \l_tmpb_seq . \l_tmpa_str + \seq_pop_right:NN \l_tmpb_seq \l_tmpa_str % .tex + \seq_pop_left:NN \l_tmpb_seq \l_tmpa_str % <filename> + \str_set:Nx \l_tmpa_str { + \stex_path_to_string:N \l_tmpa_seq / + \l_tmpa_str . \l_stex_module_sig_str .tex + } + \IfFileExists \l_tmpa_str { + \exp_args:No \stex_file_in_smsmode:nn { \l_tmpa_str } { + \str_clear:N \l_stex_current_module_str + \seq_clear:N \l_stex_all_modules_seq + \stex_debug:nn{modules}{Loading~signature~\l_tmpa_str} + } + }{ + \msg_error:nnx{stex}{error/unknownmodule}{for~signature~\l_tmpa_str} + } + \stex_if_smsmode:F { + \stex_activate_module:n { + \l_stex_module_ns_str ? \l_stex_module_name_str + } + } + \str_set:Nx\l_stex_current_module_str{\l_stex_module_ns_str?\l_stex_module_name_str} + } + \str_if_empty:NF \l_stex_module_deprecate_str { + \msg_warning:nnxx{stex}{warning/deprecated}{ + Module~\l_stex_current_module_str + }{ + \l_stex_module_deprecate_str + } + } + \seq_put_right:Nx \l_stex_all_modules_seq { + \l_stex_module_ns_str ? \l_stex_module_name_str + } +} +\cs_new_protected:Nn \__stex_modules_begin_module: { + \stex_reactivate_macro:N \STEXexport + \stex_reactivate_macro:N \importmodule + \stex_reactivate_macro:N \symdecl + \stex_reactivate_macro:N \notation + \stex_reactivate_macro:N \symdef + + \stex_debug:nn{modules}{ + New~module:\\ + Namespace:~\l_stex_module_ns_str\\ + Name:~\l_stex_module_name_str\\ + Language:~\l_stex_module_lang_str\\ + Signature:~\l_stex_module_sig_str\\ + Metatheory:~\l_stex_module_meta_str\\ + File:~\stex_path_to_string:N \g_stex_currentfile_seq + } + + \stex_if_smsmode:F{ + \begin{stex_annotate_env} {theory} { + \l_stex_module_ns_str ? \l_stex_module_name_str + } + + \stex_annotate_invisible:nnn{header}{} { + \stex_annotate:nnn{language}{ \l_stex_module_lang_str }{} + \stex_annotate:nnn{signature}{ \l_stex_module_sig_str }{} + \str_if_eq:VnF \l_stex_module_meta_str {NONE} { + \stex_annotate:nnn{metatheory}{ \l_stex_module_meta_str }{} + } + \str_if_empty:NF \smoduletype { + \stex_annotate:nnn{type}{\smoduletype}{} + } + } + } + \int_set:Nn \l__stex_modules_group_depth_int {\currentgrouplevel} + % TODO: Inherit metatheory for nested modules? +} +\iffalse \end{stex_annotate_env} \fi %^^A make syntax highlighting work again +\cs_new_protected:Nn \__stex_modules_end_module: { + \stex_debug:nn{modules}{Closing~module~\prop_item:cn {c_stex_module_\l_stex_current_module_str _prop} { name }} +} +\iffalse \begin{stex_annotate_env} \fi %^^A make syntax highlighting work again +\NewDocumentEnvironment { smodule } { O{} m } { + \stex_module_setup:nn{#1}{#2} + \par + \stex_if_smsmode:F{ + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \smoduletype { + \tl_if_exist:cT {__stex_modules_smodule_##1_start:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_modules_smodule_##1_start:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_modules_smodule_start: + }{ + \l_tmpa_tl + } + } + \__stex_modules_begin_module: + \str_if_empty:NF \smoduleid { + \stex_ref_new_doc_target:n \smoduleid + } + \stex_smsmode_do: +} { + \__stex_modules_end_module: + \stex_if_smsmode:F { + \end{stex_annotate_env} + \clist_set:No \l_tmpa_clist \smoduletype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_modules_smodule_##1_end:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_modules_smodule_##1_end:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_modules_smodule_end: + }{ + \l_tmpa_tl + } + } +} +\cs_new_protected:Nn \__stex_modules_smodule_start: {} +\cs_new_protected:Nn \__stex_modules_smodule_end: {} + +\newcommand\stexpatchmodule[3][] { + \str_set:Nx \l_tmpa_str{ #1 } + \str_if_empty:NTF \l_tmpa_str { + \tl_set:Nn \__stex_modules_smodule_start: { #2 } + \tl_set:Nn \__stex_modules_smodule_end: { #3 } + }{ + \exp_after:wN \tl_set:Nn \csname __stex_modules_smodule_#1_start:\endcsname{ #2 } + \exp_after:wN \tl_set:Nn \csname __stex_modules_smodule_#1_end:\endcsname{ #3 } + } +} +\NewDocumentCommand \STEXModule { m } { + \exp_args:NNx \str_set:Nn \l_tmpa_str { #1 } + \int_set:Nn \l_tmpa_int { \str_count:N \l_tmpa_str } + \tl_set:Nn \l_tmpa_tl { + \msg_error:nnx{stex}{error/unknownmodule}{#1} + } + \seq_map_inline:Nn \l_stex_all_modules_seq { + \str_set:Nn \l_tmpb_str { ##1 } + \str_if_eq:eeT { \l_tmpa_str } { + \str_range:Nnn \l_tmpb_str { -\l_tmpa_int } { -1 } + } { + \seq_map_break:n { + \tl_set:Nn \l_tmpa_tl { + \stex_invoke_module:n { ##1 } + } + } + } + } + \l_tmpa_tl +} + +\cs_new_protected:Nn \stex_invoke_module:n { + \stex_debug:nn{modules}{Invoking~module~#1} + \peek_charcode_remove:NTF ! { + \__stex_modules_invoke_uri:nN { #1 } + } { + \peek_charcode_remove:NTF ? { + \__stex_modules_invoke_symbol:nn { #1 } + } { + \msg_error:nnx{stex}{error/syntax}{ + ?~or~!~expected~after~ + \c_backslash_str STEXModule{#1} + } + } + } +} + +\cs_new_protected:Nn \__stex_modules_invoke_uri:nN { + \str_set:Nn #2 { #1 } +} + +\cs_new_protected:Nn \__stex_modules_invoke_symbol:nn { + \stex_invoke_symbol:n{#1?#2} +} +\bool_new:N \l_stex_in_meta_bool +\bool_set_false:N \l_stex_in_meta_bool +\cs_new_protected:Nn \stex_activate_module:n { + \stex_debug:nn{modules}{Activating~module~#1} + \seq_if_in:NnT \l_stex_implicit_morphisms_seq { #1 }{ + \msg_error:nnn{stex}{error/conflictingmodules}{ #1 } + } + \exp_args:NNx \seq_if_in:NnF \l_stex_all_modules_seq { #1 } { + \seq_put_right:Nx \l_stex_all_modules_seq { #1 } + \use:c{ c_stex_module_#1_code } + } +} + +%%%%%%%%%%%%% inheritance.dtx %%%%%%%%%%%%% + +\tl_new:N \g_stex_smsmode_allowedmacros_tl +\tl_new:N \g_stex_smsmode_allowedmacros_escape_tl +\seq_new:N \g_stex_smsmode_allowedenvs_seq + +\tl_set:Nn \g_stex_smsmode_allowedmacros_tl { + \makeatletter + \makeatother + \ExplSyntaxOn + \ExplSyntaxOff + \rustexBREAK +} + +\tl_set:Nn \g_stex_smsmode_allowedmacros_escape_tl { + \symdef + \importmodule + \notation + \symdecl + \STEXexport + \inlineass + \inlinedef + \inlineex + \endinput + \setnotation + \copynotation +} + +\exp_args:NNx \seq_set_from_clist:Nn \g_stex_smsmode_allowedenvs_seq { + \tl_to_str:n { + smodule, + copymodule, + interpretmodule, + sdefinition, + sexample, + sassertion, + sparagraph + } +} +\bool_new:N \g__stex_smsmode_bool +\bool_set_false:N \g__stex_smsmode_bool +\prg_new_conditional:Nnn \stex_if_smsmode: { p, T, F, TF } { + \bool_if:NTF \g__stex_smsmode_bool \prg_return_true: \prg_return_false: +} +\cs_new_protected:Nn \__stex_smsmode_in_smsmode:nn { + \vbox_set:Nn \l_tmpa_box { + \bool_set_eq:cN { l__stex_smsmode_#1_bool } \g__stex_smsmode_bool + \bool_gset_true:N \g__stex_smsmode_bool + #2 + \bool_gset_eq:Nc \g__stex_smsmode_bool { l__stex_smsmode_#1_bool } + } + \box_clear:N \l_tmpa_box +} +\quark_new:N \q__stex_smsmode_break + +\cs_new_protected:Nn \stex_file_in_smsmode:nn { + \stex_filestack_push:n{#1} + \__stex_smsmode_in_smsmode:nn{#1} { + #2 + \everyeof{\q__stex_smsmode_break\noexpand} + \expandafter\expandafter\expandafter + \stex_smsmode_do: + \csname @ @ input\endcsname "#1"\relax + } + \stex_filestack_pop: +} +\cs_new_protected:Npn \stex_smsmode_do: { + \stex_if_smsmode:T { + \__stex_smsmode_do:w + } +} +\cs_new_protected:Npn \__stex_smsmode_do:w #1 { + \exp_args:Nx \tl_if_empty:nTF { \tl_tail:n{ #1 }}{ + \expandafter\if\expandafter\relax\noexpand#1 + \expandafter\__stex_smsmode_do_aux:N\expandafter#1 + \else\expandafter\__stex_smsmode_do:w\fi + }{ + \__stex_smsmode_do:w %#1 + } +} +\cs_new_protected:Nn \__stex_smsmode_do_aux:N { + \cs_if_eq:NNF #1 \q__stex_smsmode_break { + \tl_if_in:NnTF \g_stex_smsmode_allowedmacros_tl {#1} { + #1\__stex_smsmode_do:w + }{ + \tl_if_in:NnTF \g_stex_smsmode_allowedmacros_escape_tl {#1} { + #1 + }{ + \cs_if_eq:NNTF \begin #1 { + \__stex_smsmode_check_begin:n + }{ + \cs_if_eq:NNTF \end #1 { + \__stex_smsmode_check_end:n + }{ + \__stex_smsmode_do:w + } + } + } + } + } +} + +\cs_new_protected:Nn \__stex_smsmode_check_begin:n { + \seq_if_in:NxTF \g_stex_smsmode_allowedenvs_seq { \detokenize{#1} }{ + \begin{#1} + }{ + \__stex_smsmode_do:w + } +} +\cs_new_protected:Nn \__stex_smsmode_check_end:n { + \seq_if_in:NxTF \g_stex_smsmode_allowedenvs_seq { \detokenize{#1} }{ + \end{#1}\__stex_smsmode_do:w + }{ + \str_if_eq:nnTF{#1}{document}{\endinput}{\__stex_smsmode_do:w} + } +} + +\cs_new_protected:Nn \stex_import_module_uri:nn { + \str_set:Nx \l_stex_import_archive_str { #1 } + \str_set:Nn \l_stex_import_path_str { #2 } + + \exp_args:NNNo \seq_set_split:Nnn \l_tmpb_seq ? { \l_stex_import_path_str } + \seq_pop_right:NN \l_tmpb_seq \l_stex_import_name_str + \str_set:Nx \l_stex_import_path_str { \seq_use:Nn \l_tmpb_seq ? } + + \stex_modules_current_namespace: + \bool_lazy_all:nTF { + {\str_if_empty_p:N \l_stex_import_archive_str} + {\str_if_empty_p:N \l_stex_import_path_str} + {\stex_if_module_exists_p:n { \l_stex_module_ns_str ? \l_stex_import_name_str } } + }{ + \str_set_eq:NN \l_stex_import_path_str \l_stex_modules_subpath_str + \str_set_eq:NN \l_stex_import_ns_str \l_stex_module_ns_str + }{ + \str_if_empty:NT \l_stex_import_archive_str { + \prop_if_exist:NT \l_stex_current_repository_prop { + \prop_get:NnN \l_stex_current_repository_prop { id } \l_stex_import_archive_str + } + } + \str_if_empty:NTF \l_stex_import_archive_str { + \str_if_empty:NF \l_stex_import_path_str { + \str_set:Nx \l_stex_import_ns_str { + \l_stex_module_ns_str / \l_stex_import_path_str + } + } + }{ + \stex_require_repository:n \l_stex_import_archive_str + \prop_get:cnN { c_stex_mathhub_\l_stex_import_archive_str _manifest_prop } { ns } + \l_stex_import_ns_str + \str_if_empty:NF \l_stex_import_path_str { + \str_set:Nx \l_stex_import_ns_str { + \l_stex_import_ns_str / \l_stex_import_path_str + } + } + } + } +} +\str_new:N \l_stex_import_name_str +\str_new:N \l_stex_import_archive_str +\str_new:N \l_stex_import_path_str +\str_new:N \l_stex_import_ns_str +\cs_new_protected:Nn \stex_import_require_module:nnnn { + \exp_args:Nx \stex_if_module_exists:nF { #1 ? #4 } { + + % archive + \str_set:Nx \l_tmpa_str { #2 } + \str_if_empty:NTF \l_tmpa_str { + \seq_set_eq:NN \l_tmpa_seq \g_stex_currentfile_seq + } { + \stex_path_from_string:Nn \l_tmpb_seq { \l_tmpa_str } + \seq_concat:NNN \l_tmpa_seq \c_stex_mathhub_seq \l_tmpb_seq + \seq_put_right:Nn \l_tmpa_seq { source } + } + + % path + \str_set:Nx \l_tmpb_str { #3 } + \str_if_empty:NTF \l_tmpb_str { + \str_set:Nx \l_tmpa_str { \stex_path_to_string:N \l_tmpa_seq / #4 } + + \ltx@ifpackageloaded{babel} { + \exp_args:NNx \prop_get:NnNF \c_stex_language_abbrevs_prop + { \languagename } \l_tmpb_str { + \msg_error:nnx{stex}{error/unknownlanguage}{\languagename} + } + } { + \str_clear:N \l_tmpb_str + } + + \stex_debug:nn{modules}{Checking~\l_tmpa_str.\l_tmpb_str.tex} + \IfFileExists{ \l_tmpa_str.\l_tmpb_str.tex }{ + \str_gset:Nx \g__stex_importmodule_file_str { \l_tmpa_str.\l_tmpb_str.tex } + }{ + \stex_debug:nn{modules}{Checking~\l_tmpa_str.tex} + \IfFileExists{ \l_tmpa_str.tex }{ + \str_gset:Nx \g__stex_importmodule_file_str { \l_tmpa_str.tex } + }{ + % try english as default + \stex_debug:nn{modules}{Checking~\l_tmpa_str.en.tex} + \IfFileExists{ \l_tmpa_str.en.tex }{ + \str_gset:Nx \g__stex_importmodule_file_str { \l_tmpa_str.en.tex } + }{ + \msg_error:nnx{stex}{error/unknownmodule}{#1?#4} + } + } + } + + } { + \seq_set_split:NnV \l_tmpb_seq / \l_tmpb_str + \seq_concat:NNN \l_tmpa_seq \l_tmpa_seq \l_tmpb_seq + + \ltx@ifpackageloaded{babel} { + \exp_args:NNx \prop_get:NnNF \c_stex_language_abbrevs_prop + { \languagename } \l_tmpb_str { + \msg_error:nnx{stex}{error/unknownlanguage}{\languagename} + } + } { + \str_clear:N \l_tmpb_str + } + + \stex_path_to_string:NN \l_tmpa_seq \l_tmpa_str + + \stex_debug:nn{modules}{Checking~\l_tmpa_str/#4.\l_tmpb_str.tex} + \IfFileExists{ \l_tmpa_str/#4.\l_tmpb_str.tex }{ + \str_gset:Nx \g__stex_importmodule_file_str { \l_tmpa_str/#4.\l_tmpb_str.tex } + }{ + \stex_debug:nn{modules}{Checking~\l_tmpa_str/#4.tex} + \IfFileExists{ \l_tmpa_str/#4.tex }{ + \str_gset:Nx \g__stex_importmodule_file_str { \l_tmpa_str/#4.tex } + }{ + % try english as default + \stex_debug:nn{modules}{Checking~\l_tmpa_str/#4.en.tex} + \IfFileExists{ \l_tmpa_str/#4.en.tex }{ + \str_gset:Nx \g__stex_importmodule_file_str { \l_tmpa_str/#4.en.tex } + }{ + \stex_debug:nn{modules}{Checking~\l_tmpa_str.\l_tmpb_str.tex} + \IfFileExists{ \l_tmpa_str.\l_tmpb_str.tex }{ + \str_gset:Nx \g__stex_importmodule_file_str { \l_tmpa_str.\l_tmpb_str.tex } + }{ + \stex_debug:nn{modules}{Checking~\l_tmpa_str.tex} + \IfFileExists{ \l_tmpa_str.tex }{ + \str_gset:Nx \g__stex_importmodule_file_str { \l_tmpa_str.tex } + }{ + % try english as default + \stex_debug:nn{modules}{Checking~\l_tmpa_str.en.tex} + \IfFileExists{ \l_tmpa_str.en.tex }{ + \str_gset:Nx \g__stex_importmodule_file_str { \l_tmpa_str.en.tex } + }{ + \msg_error:nnx{stex}{error/unknownmodule}{#1?#4} + } + } + } + } + } + } + } + + \exp_args:No \stex_file_in_smsmode:nn { \g__stex_importmodule_file_str } { + \seq_clear:N \l_stex_all_modules_seq + \str_clear:N \l_stex_current_module_str + \str_set:Nx \l_tmpb_str { #2 } + \str_if_empty:NF \l_tmpb_str { + \stex_set_current_repository:n { #2 } + } + \stex_debug:nn{modules}{Loading~\g__stex_importmodule_file_str} + } + + \stex_if_module_exists:nF { #1 ? #4 } { + \msg_error:nnx{stex}{error/unknownmodule}{ + #1?#4~(in~file~\g__stex_importmodule_file_str) + } + } + } + \stex_activate_module:n { #1 ? #4 } +} +\NewDocumentCommand \importmodule { O{} m } { + \stex_import_module_uri:nn { #1 } { #2 } + \stex_debug:nn{modules}{Importing~module:~ + \l_stex_import_ns_str ? \l_stex_import_name_str + } + \stex_if_smsmode:F { + \stex_import_require_module:nnnn + { \l_stex_import_ns_str } { \l_stex_import_archive_str } + { \l_stex_import_path_str } { \l_stex_import_name_str } + \stex_annotate_invisible:nnn + {import} {\l_stex_import_ns_str ? \l_stex_import_name_str} {} + } + \exp_args:Nx \stex_add_to_current_module:n { + \stex_import_require_module:nnnn + { \l_stex_import_ns_str } { \l_stex_import_archive_str } + { \l_stex_import_path_str } { \l_stex_import_name_str } + } + \exp_args:Nx \stex_add_import_to_current_module:n { + \l_stex_import_ns_str ? \l_stex_import_name_str + } + \stex_smsmode_do: + \ignorespacesandpars +} +\stex_deactivate_macro:Nn \importmodule {module~environments} +\NewDocumentCommand \usemodule { O{} m } { + \stex_if_smsmode:F { + \stex_import_module_uri:nn { #1 } { #2 } + \stex_import_require_module:nnnn + { \l_stex_import_ns_str } { \l_stex_import_archive_str } + { \l_stex_import_path_str } { \l_stex_import_name_str } + \stex_annotate_invisible:nnn + {usemodule} {\l_stex_import_ns_str ? \l_stex_import_name_str} {} + } + \stex_smsmode_do: + \ignorespacesandpars +} + +%%%%%%%%%%%%% symbols.dtx %%%%%%%%%%%%% + +\msg_new:nnn{stex}{error/wrongargs}{ + args~value~in~symbol~declaration~for~#1~ + needs~to~be~i,~a,~b~or~B,~but~#2~given +} +\cs_new_protected:Nn \stex_all_symbols:n { + \def \__stex_symdecl_all_symbols_cs ##1 {#1} + \seq_map_inline:Nn \l_stex_all_modules_seq { + \seq_map_inline:cn{c_stex_module_##1_constants}{ + \__stex_symdecl_all_symbols_cs{##1?####1} + } + } +} +\NewDocumentCommand \STEXsymbol { m } { + \stex_get_symbol:n { #1 } + \exp_args:No + \stex_invoke_symbol:n { \l_stex_get_symbol_uri_str } +} +\keys_define:nn { stex / symdecl } { + name .str_set_x:N = \l_stex_symdecl_name_str , + local .bool_set:N = \l_stex_symdecl_local_bool , + args .str_set_x:N = \l_stex_symdecl_args_str , + type .tl_set:N = \l_stex_symdecl_type_tl , + deprecate .str_set_x:N = \l_stex_symdecl_deprecate_str , + align .str_set:N = \l_stex_symdecl_align_str , % TODO(?) + gfc .str_set:N = \l_stex_symdecl_gfc_str , % TODO(?) + specializes .str_set:N = \l_stex_symdecl_specializes_str , % TODO(?) + def .tl_set:N = \l_stex_symdecl_definiens_tl , + assoc .choices:nn = + {bin,binl,binr,pre,conj,pwconj} + {\str_set:Nx \l_stex_symdecl_assoctype_str {\l_keys_choice_tl}} +} + +\bool_new:N \l_stex_symdecl_make_macro_bool + +\cs_new_protected:Nn \__stex_symdecl_args:n { + \str_clear:N \l_stex_symdecl_name_str + \str_clear:N \l_stex_symdecl_args_str + \str_clear:N \l_stex_symdecl_deprecate_str + \str_clear:N \l_stex_symdecl_assoctype_str + \bool_set_false:N \l_stex_symdecl_local_bool + \tl_clear:N \l_stex_symdecl_type_tl + \tl_clear:N \l_stex_symdecl_definiens_tl + + \keys_set:nn { stex / symdecl } { #1 } +} + +\NewDocumentCommand \symdecl { s m O{}} { + \__stex_symdecl_args:n { #3 } + \IfBooleanTF #1 { + \bool_set_false:N \l_stex_symdecl_make_macro_bool + } { + \bool_set_true:N \l_stex_symdecl_make_macro_bool + } + \stex_symdecl_do:n { #2 } + \stex_smsmode_do: +} + +\cs_new_protected:Nn \stex_symdecl_do:nn { + \__stex_symdecl_args:n{#1} + \bool_set_false:N \l_stex_symdecl_make_macro_bool + \stex_symdecl_do:n{#2} +} + +\stex_deactivate_macro:Nn \symdecl {module~environments} +\cs_new_protected:Nn \stex_symdecl_do:n { + \stex_if_in_module:F { + % TODO throw error? some default namespace? + } + + \str_if_empty:NT \l_stex_symdecl_name_str { + \str_set:Nx \l_stex_symdecl_name_str { #1 } + } + + \prop_if_exist:cT { l_stex_symdecl_ + \l_stex_current_module_str ? + \l_stex_symdecl_name_str + _prop + }{ + % TODO throw error (beware of circular dependencies) + } + + \prop_clear:N \l_tmpa_prop + \prop_put:Nnx \l_tmpa_prop { module } { \l_stex_current_module_str } + \seq_clear:N \l_tmpa_seq + \prop_put:Nno \l_tmpa_prop { name } \l_stex_symdecl_name_str + \prop_put:Nno \l_tmpa_prop { type } \l_stex_symdecl_type_tl + + \str_if_empty:NT \l_stex_symdecl_deprecate_str { + \str_if_empty:NF \l_stex_module_deprecate_str { + \str_set_eq:NN \l_stex_symdecl_deprecate_str \l_stex_module_deprecate_str + } + } + \prop_put:Nno \l_tmpa_prop { deprecate } \l_stex_symdecl_deprecate_str + + \exp_args:No \stex_add_constant_to_current_module:n { + \l_stex_symdecl_name_str + } + + % arity/args + \int_zero:N \l_tmpb_int + + \bool_set_true:N \l_tmpa_bool + \str_map_inline:Nn \l_stex_symdecl_args_str { + \token_case_meaning:NnF ##1 { + 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} + {\tl_to_str:n i} { \bool_set_false:N \l_tmpa_bool } + {\tl_to_str:n b} { \bool_set_false:N \l_tmpa_bool } + {\tl_to_str:n a} { + \bool_set_false:N \l_tmpa_bool + \int_incr:N \l_tmpb_int + } + {\tl_to_str:n B} { + \bool_set_false:N \l_tmpa_bool + \int_incr:N \l_tmpb_int + } + }{ + \msg_error:nnxx{stex}{error/wrongargs}{ + \l_stex_current_module_str ? + \l_stex_symdecl_name_str + }{##1} + } + } + \bool_if:NTF \l_tmpa_bool { + % possibly numeric + \str_if_empty:NTF \l_stex_symdecl_args_str { + \prop_put:Nnn \l_tmpa_prop { args } {} + \prop_put:Nnn \l_tmpa_prop { arity } { 0 } + }{ + \int_set:Nn \l_tmpa_int { \l_stex_symdecl_args_str } + \prop_put:Nnx \l_tmpa_prop { arity } { \int_use:N \l_tmpa_int } + \str_clear:N \l_tmpa_str + \int_step_inline:nn \l_tmpa_int { + \str_put_right:Nn \l_tmpa_str i + } + \prop_put:Nnx \l_tmpa_prop { args } { \l_tmpa_str } + } + } { + \prop_put:Nnx \l_tmpa_prop { args } { \l_stex_symdecl_args_str } + \prop_put:Nnx \l_tmpa_prop { arity } + { \str_count:N \l_stex_symdecl_args_str } + } + \prop_put:Nnx \l_tmpa_prop { assocs } { \int_use:N \l_tmpb_int } + + % semantic macro + + \bool_if:NT \l_stex_symdecl_make_macro_bool { + \exp_args:Nx \stex_do_up_to_module:n { + \tl_set:cn { #1 } { \stex_invoke_symbol:n { + \l_stex_current_module_str ? \l_stex_symdecl_name_str + }} + } + + \bool_if:NF \l_stex_symdecl_local_bool { + \exp_args:Nx \stex_add_to_current_module:n { + \tl_set:cn { #1 } { \stex_invoke_symbol:n { + \l_stex_current_module_str ? \l_stex_symdecl_name_str + } } + } + } + } + + \stex_debug:nn{symbols}{New~symbol:~ + \l_stex_current_module_str ? \l_stex_symdecl_name_str^^J + Type:~\exp_not:o { \l_stex_symdecl_type_tl }^^J + Args:~\prop_item:Nn \l_tmpa_prop { args } + } + + % circular dependencies require this: + + \prop_if_exist:cF { + l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_symdecl_name_str + _prop + } { + \prop_set_eq:cN { + l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_symdecl_name_str + _prop + } \l_tmpa_prop + } + + \seq_clear:c { + l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_symdecl_name_str + _notations + } + + \bool_if:NF \l_stex_symdecl_local_bool { + \exp_args:Nx + \stex_add_to_current_module:n { + \seq_clear:c { + l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_symdecl_name_str + _notations + } + \prop_set_from_keyval:cn { + l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_symdecl_name_str + _prop + } { + name = \prop_item:Nn \l_tmpa_prop { name } , + module = \prop_item:Nn \l_tmpa_prop { module } , + type = \prop_item:Nn \l_tmpa_prop { type } , + args = \prop_item:Nn \l_tmpa_prop { args } , + arity = \prop_item:Nn \l_tmpa_prop { arity } , + assocs = \prop_item:Nn \l_tmpa_prop { assocs } + } + } + } + + \stex_if_smsmode:F { + \stex_if_do_html:T { + \stex_annotate_invisible:nnn {symdecl} { + \l_stex_current_module_str ? \l_stex_symdecl_name_str + } { + \tl_if_empty:NF \l_stex_symdecl_type_tl {\stex_annotate_invisible:nnn{type}{}{$\l_stex_symdecl_type_tl$}} + \stex_annotate_invisible:nnn{args}{}{ + \prop_item:Nn \l_tmpa_prop { args } + } + \stex_annotate_invisible:nnn{macroname}{#1}{} + \tl_if_empty:NF \l_stex_symdecl_definiens_tl { + \stex_annotate_invisible:nnn{definiens}{} + {$\l_stex_symdecl_definiens_tl$} + } + \str_if_empty:NF \l_stex_symdecl_assoctype_str { + \stex_annotate_invisible:nnn{assoctype}{\l_stex_symdecl_assoctype_str}{} + } + } + } + } +} +\str_new:N \l_stex_get_symbol_uri_str + +\cs_new_protected:Nn \stex_get_symbol:n { + \tl_if_head_eq_catcode:nNTF { #1 } \relax { + \__stex_symdecl_get_symbol_from_cs:n { #1 } + }{ + % argument is a string + % is it a command name? + \cs_if_exist:cTF { #1 }{ + \cs_set_eq:Nc \l_tmpa_tl { #1 } + \str_set:Nx \l_tmpa_str { \cs_argument_spec:N \l_tmpa_tl } + \str_if_empty:NTF \l_tmpa_str { + \exp_args:Nx \cs_if_eq:NNTF { + \tl_head:N \l_tmpa_tl + } \stex_invoke_symbol:n { + \exp_args:No \__stex_symdecl_get_symbol_from_cs:n { \use:c { #1 } } + }{ + \__stex_symdecl_get_symbol_from_string:n { #1 } + } + } { + \__stex_symdecl_get_symbol_from_string:n { #1 } + } + }{ + % argument is not a command name + \__stex_symdecl_get_symbol_from_string:n { #1 } + % \l_stex_all_symbols_seq + } + } + \str_if_eq:eeF { + \prop_item:cn { + l_stex_symdecl_\l_stex_get_symbol_uri_str _prop + }{ deprecate } + }{}{ + \msg_warning:nnxx{stex}{warning/deprecated}{ + Symbol~\l_stex_get_symbol_uri_str + }{ + \prop_item:cn {l_stex_symdecl_\l_stex_get_symbol_uri_str _prop}{ deprecate } + } + } +} + +\cs_new_protected:Nn \__stex_symdecl_get_symbol_from_string:n { + \tl_set:Nn \l_tmpa_tl { + \msg_set:nnn{stex}{error/unknownsymbol}{ + No~symbol~#1~found! + } + \msg_error:nn{stex}{error/unknownsymbol} + } + \str_set:Nn \l_tmpa_str { #1 } + \int_set:Nn \l_tmpa_int { \str_count:N \l_tmpa_str } + + \stex_all_symbols:n { + \str_if_eq:eeT { \l_tmpa_str }{ \str_range:nnn {##1}{-\l_tmpa_int}{-1}}{ + \seq_map_break:n{\seq_map_break:n{ + \tl_set:Nn \l_tmpa_tl { + \str_set:Nn \l_stex_get_symbol_uri_str { ##1 } + } + }} + } + } + + \l_tmpa_tl +} + +\cs_new_protected:Nn \__stex_symdecl_get_symbol_from_cs:n { + \exp_args:NNx \tl_set:Nn \l_tmpa_tl + { \tl_tail:N \l_tmpa_tl } + \tl_if_single:NTF \l_tmpa_tl { + \exp_args:No \tl_if_head_is_group:nTF \l_tmpa_tl { + \exp_after:wN \str_set:Nn \exp_after:wN + \l_stex_get_symbol_uri_str \l_tmpa_tl + }{ + % TODO + % tail is not a single group + } + }{ + % TODO + % tail is not a single group + } +} +\keys_define:nn { stex / notation } { + lang .tl_set_x:N = \l__stex_notation_lang_str , + variant .tl_set_x:N = \l__stex_notation_variant_str , + prec .str_set_x:N = \l__stex_notation_prec_str , + op .tl_set:N = \l__stex_notation_op_tl , + primary .bool_set:N = \l__stex_notation_primary_bool , + primary .default:n = {true} , + unknown .code:n = \str_set:Nx + \l__stex_notation_variant_str \l_keys_key_str +} + +\cs_new_protected:Nn \_stex_notation_args:n { + \str_clear:N \l__stex_notation_lang_str + \str_clear:N \l__stex_notation_variant_str + \str_clear:N \l__stex_notation_prec_str + \tl_clear:N \l__stex_notation_op_tl + \bool_set_false:N \l__stex_notation_primary_bool + + \keys_set:nn { stex / notation } { #1 } +} +\NewDocumentCommand \notation { s m O{}} { + \_stex_notation_args:n { #3 } + \tl_clear:N \l_stex_symdecl_definiens_tl + \stex_get_symbol:n { #2 } + \tl_set:Nn \l_stex_notation_after_do_tl { + \__stex_notation_final: + \IfBooleanTF#1{ + \stex_setnotation:n {\l_stex_get_symbol_uri_str} + }{} + \stex_smsmode_do: + } + \stex_notation_do:nnnn + { \prop_item:cn {l_stex_symdecl_\l_stex_get_symbol_uri_str _prop } { args } } + { \prop_item:cn { l_stex_symdecl_\l_stex_get_symbol_uri_str _prop } { arity } } + { \l__stex_notation_variant_str \c_hash_str \l__stex_notation_lang_str } +} +\stex_deactivate_macro:Nn \notation {module~environments} +\seq_new:N \l__stex_notation_precedences_seq +\tl_new:N \l__stex_notation_opprec_tl +\int_new:N \l__stex_notation_currarg_int +\tl_new:N \stex_symbol_after_invocation_tl + +\cs_new_protected:Nn \stex_notation_do:nnnn { + \let\l_stex_current_symbol_str\relax + \seq_clear:N \l__stex_notation_precedences_seq + \tl_clear:N \l__stex_notation_opprec_tl + \str_set:Nx \l__stex_notation_args_str { #1 } + \str_set:Nx \l__stex_notation_arity_str { #2 } + \str_set:Nx \__stex_notation_suffix_str { #3 } + + % precedences + \str_if_empty:NTF \l__stex_notation_prec_str { + \int_compare:nNnTF \l__stex_notation_arity_str = 0 { + \tl_set:No \l__stex_notation_opprec_tl { \neginfprec } + }{ + \tl_set:Nn \l__stex_notation_opprec_tl { 0 } + } + } { + \str_if_eq:onTF \l__stex_notation_prec_str {nobrackets}{ + \tl_set:No \l__stex_notation_opprec_tl { \neginfprec } + \int_step_inline:nn { \l__stex_notation_arity_str } { + \exp_args:NNo + \seq_put_right:Nn \l__stex_notation_precedences_seq { \infprec } + } + }{ + \seq_set_split:NnV \l_tmpa_seq ; \l__stex_notation_prec_str + \seq_pop_left:NNTF \l_tmpa_seq \l_tmpa_str { + \tl_set:No \l__stex_notation_opprec_tl { \l_tmpa_str } + \seq_pop_left:NNT \l_tmpa_seq \l_tmpa_str { + \exp_args:NNNo \exp_args:NNno \seq_set_split:Nnn + \l_tmpa_seq {\tl_to_str:n{x} } { \l_tmpa_str } + \seq_map_inline:Nn \l_tmpa_seq { + \seq_put_right:Nn \l_tmpb_seq { ##1 } + } + } + }{ + \int_compare:nNnTF \l__stex_notation_arity_str = 0 { + \tl_set:No \l__stex_notation_opprec_tl { \infprec } + }{ + \tl_set:No \l__stex_notation_opprec_tl { 0 } + } + } + } + } + + \seq_set_eq:NN \l_tmpa_seq \l__stex_notation_precedences_seq + \int_step_inline:nn { \l__stex_notation_arity_str } { + \seq_pop_left:NNF \l_tmpa_seq \l_tmpb_str { + \exp_args:NNo + \seq_put_right:No \l__stex_notation_precedences_seq { + \l__stex_notation_opprec_tl + } + } + } + \tl_clear:N \l_stex_notation_dummyargs_tl + + \int_compare:nNnTF \l__stex_notation_arity_str = 0 { + \exp_args:NNe + \cs_set:Npn \l_stex_notation_macrocode_cs { + \_stex_term_math_oms:nnnn { \l_stex_current_symbol_str } + { \__stex_notation_suffix_str } + { \l__stex_notation_opprec_tl } + { \exp_not:n { #4 } } + } + \l_stex_notation_after_do_tl + }{ + \str_if_in:NnTF \l__stex_notation_args_str b { + \exp_args:Nne \use:nn + { + \cs_generate_from_arg_count:NNnn \l_stex_notation_macrocode_cs + \cs_set:Npn \l__stex_notation_arity_str } { { + \_stex_term_math_omb:nnnn { \l_stex_current_symbol_str } + { \__stex_notation_suffix_str } + { \l__stex_notation_opprec_tl } + { \exp_not:n { #4 } } + }} + }{ + \str_if_in:NnTF \l__stex_notation_args_str B { + \exp_args:Nne \use:nn + { + \cs_generate_from_arg_count:NNnn \l_stex_notation_macrocode_cs + \cs_set:Npn \l__stex_notation_arity_str } { { + \_stex_term_math_omb:nnnn { \l_stex_current_symbol_str } + { \__stex_notation_suffix_str } + { \l__stex_notation_opprec_tl } + { \exp_not:n { #4 } } + } } + }{ + \exp_args:Nne \use:nn + { + \cs_generate_from_arg_count:NNnn \l_stex_notation_macrocode_cs + \cs_set:Npn \l__stex_notation_arity_str } { { + \_stex_term_math_oma:nnnn { \l_stex_current_symbol_str } + { \__stex_notation_suffix_str } + { \l__stex_notation_opprec_tl } + { \exp_not:n { #4 } } + } } + } + } + + \str_set_eq:NN \l__stex_notation_remaining_args_str \l__stex_notation_args_str + \int_zero:N \l__stex_notation_currarg_int + \seq_set_eq:NN \l__stex_notation_remaining_precs_seq \l__stex_notation_precedences_seq + \__stex_notation_arguments: + } +} +\cs_new_protected:Nn \__stex_notation_arguments: { + \int_incr:N \l__stex_notation_currarg_int + \str_if_empty:NTF \l__stex_notation_remaining_args_str { + \l_stex_notation_after_do_tl + }{ + \str_set:Nx \l_tmpa_str { \str_head:N \l__stex_notation_remaining_args_str } + \str_set:Nx \l__stex_notation_remaining_args_str { \str_tail:N \l__stex_notation_remaining_args_str } + \str_if_eq:VnTF \l_tmpa_str a { + \__stex_notation_argument_assoc:n + }{ + \str_if_eq:VnTF \l_tmpa_str B { + \__stex_notation_argument_assoc:n + }{ + \seq_pop_left:NN \l__stex_notation_remaining_precs_seq \l_tmpa_str + \tl_put_right:Nx \l_stex_notation_dummyargs_tl { + { \_stex_term_math_arg:nnn + { \int_use:N \l__stex_notation_currarg_int } + { \l_tmpa_str } + { ####\int_use:N \l__stex_notation_currarg_int } + } + } + \__stex_notation_arguments: + } + } + } +} +\cs_new_protected:Nn \__stex_notation_argument_assoc:n { + + \cs_generate_from_arg_count:NNnn \l_tmpa_cs \cs_set:Npn + {\l__stex_notation_arity_str}{ + #1 + } + \int_zero:N \l_tmpa_int + \tl_clear:N \l_tmpa_tl + \str_map_inline:Nn \l__stex_notation_args_str { + \int_incr:N \l_tmpa_int + \tl_put_right:Nx \l_tmpa_tl { + \str_if_eq:nnTF {##1}{a}{ {} }{ + \str_if_eq:nnTF {##1}{B}{ {} }{ + {\_stex_term_arg:nn{\int_use:N \l_tmpa_int}{################ \int_use:N \l_tmpa_int}} + } + } + } + } + \exp_after:wN\exp_after:wN\exp_after:wN \def + \exp_after:wN\exp_after:wN\exp_after:wN \l_tmpa_cs + \exp_after:wN\exp_after:wN\exp_after:wN ## + \exp_after:wN\exp_after:wN\exp_after:wN 1 + \exp_after:wN\exp_after:wN\exp_after:wN ## + \exp_after:wN\exp_after:wN\exp_after:wN 2 + \exp_after:wN\exp_after:wN\exp_after:wN { + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:n \exp_after:wN \exp_after:wN \exp_after:wN { + \exp_after:wN \l_tmpa_cs \l_tmpa_tl + } + } + + \seq_pop_left:NN \l__stex_notation_remaining_precs_seq \l_tmpa_str + \tl_put_right:Nx \l_stex_notation_dummyargs_tl { { + \_stex_term_math_assoc_arg:nnnn + { \int_use:N \l__stex_notation_currarg_int } + { \l_tmpa_str } + { ####\int_use:N \l__stex_notation_currarg_int } + { \l_tmpa_cs {####1} {####2} } + } } + \__stex_notation_arguments: +} +\cs_new_protected:Nn \__stex_notation_final: { + \exp_args:Nne \use:nn + { + \cs_generate_from_arg_count:cNnn { + stex_notation_ \l_stex_get_symbol_uri_str \c_hash_str + \__stex_notation_suffix_str + _cs + } + \cs_set:Npn \l__stex_notation_arity_str } { { + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:n \exp_after:wN \exp_after:wN \exp_after:wN + { \exp_after:wN \l_stex_notation_macrocode_cs \l_stex_notation_dummyargs_tl \stex_symbol_after_invocation_tl} + } } + + \tl_if_empty:NF \l__stex_notation_op_tl { + \cs_set:cpx { + stex_op_notation_ \l_stex_get_symbol_uri_str \c_hash_str + \__stex_notation_suffix_str + _cs + } { + \_stex_term_oms:nnn { + \l_stex_get_symbol_uri_str \c_hash_str \__stex_notation_suffix_str + }{ + \l_stex_get_symbol_uri_str + }{ \comp{ \exp_args:No \exp_not:n { \l__stex_notation_op_tl } } } + } + } + + \exp_args:Ne + \stex_add_to_current_module:n { + \cs_generate_from_arg_count:cNnn { + stex_notation_ \l_stex_get_symbol_uri_str \c_hash_str + \__stex_notation_suffix_str + _cs + } \cs_set:Npn {\l__stex_notation_arity_str} { + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:n \exp_after:wN \exp_after:wN \exp_after:wN + { \exp_after:wN \l_stex_notation_macrocode_cs \l_stex_notation_dummyargs_tl \stex_symbol_after_invocation_tl} + } + \tl_if_empty:NF \l__stex_notation_op_tl { + \cs_set:cpn { + stex_op_notation_\l_stex_get_symbol_uri_str \c_hash_str + \__stex_notation_suffix_str + _cs + } { + \_stex_term_oms:nnn { + \l_stex_get_symbol_uri_str\c_hash_str \__stex_notation_suffix_str + }{ + \l_stex_get_symbol_uri_str + }{ \comp{ \exp_args:No \exp_not:n { \l__stex_notation_op_tl } } } + } + } + } + %\exp_args:Nx + % \stex_do_up_to_module:n { + \seq_put_right:cx { + l_stex_symdecl_ \l_stex_get_symbol_uri_str + _notations + } { + \__stex_notation_suffix_str + } + % } + + \stex_debug:nn{symbols}{ + Notation~\__stex_notation_suffix_str + ~for~\l_stex_get_symbol_uri_str^^J + Operator~precedence:~\l__stex_notation_opprec_tl^^J + Argument~precedences:~ + \seq_use:Nn \l__stex_notation_precedences_seq {,~}^^J + Notation: \cs_meaning:c { + stex_notation_ \l_stex_get_symbol_uri_str \c_hash_str + \__stex_notation_suffix_str + _cs + } + } + + \exp_args:Ne + \stex_add_to_current_module:n { + \seq_put_right:cn { + l_stex_symdecl_\l_stex_get_symbol_uri_str + _notations + } { \__stex_notation_suffix_str } + } + + \stex_if_smsmode:F { + + % HTML annotations + \stex_if_do_html:T { + \stex_annotate_invisible:nnn { notation } + { \l_stex_get_symbol_uri_str } { + \stex_annotate_invisible:nnn { notationfragment } + { \__stex_notation_suffix_str }{} + \stex_annotate_invisible:nnn { precedence } + { \l__stex_notation_prec_str }{} + + \int_zero:N \l_tmpa_int + \str_set_eq:NN \l__stex_notation_remaining_args_str \l__stex_notation_args_str + \tl_clear:N \l_tmpa_tl + \int_step_inline:nn { \l__stex_notation_arity_str }{ + \int_incr:N \l_tmpa_int + \str_set:Nx \l_tmpb_str { \str_head:N \l__stex_notation_remaining_args_str } + \str_set:Nx \l__stex_notation_remaining_args_str { \str_tail:N \l__stex_notation_remaining_args_str } + \str_if_eq:VnTF \l_tmpb_str a { + \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl { + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int a , + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int b + } } + }{ + \str_if_eq:VnTF \l_tmpb_str B { + \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl { + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int a , + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int b + } } + }{ + \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl { + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int + } } + } + } + } + \stex_annotate_invisible:nnn { notationcomp }{}{ + \str_set:Nx \l_stex_current_symbol_str {\l_stex_get_symbol_uri_str } + $ \exp_args:Nno \use:nn { \use:c { + stex_notation_ \l_stex_current_symbol_str + \c_hash_str \__stex_notation_suffix_str _cs + } } { \l_tmpa_tl } $ + } + } + } + } +} +\keys_define:nn { stex / setnotation } { + lang .tl_set_x:N = \l__stex_notation_lang_str , + variant .tl_set_x:N = \l__stex_notation_variant_str , + unknown .code:n = \str_set:Nx + \l__stex_notation_variant_str \l_keys_key_str +} + +\cs_new_protected:Nn \_stex_setnotation_args:n { + \str_clear:N \l__stex_notation_lang_str + \str_clear:N \l__stex_notation_variant_str + \keys_set:nn { stex / setnotation } { #1 } +} + +\cs_new_protected:Nn \stex_setnotation:n { + \exp_args:Nnx \seq_if_in:cnTF { l_stex_symdecl_#1 _notations } + { \l__stex_notation_variant_str \c_hash_str \l__stex_notation_lang_str }{ + \exp_args:Nnx \seq_remove_all:cn { l_stex_symdecl_#1 _notations } + { \l__stex_notation_variant_str \c_hash_str \l__stex_notation_lang_str } + \exp_args:Nnx \seq_remove_all:cn { l_stex_symdecl_#1 _notations } + { \c_hash_str } + \exp_args:Nnx \seq_put_left:cn { l_stex_symdecl_#1 _notations } + { \l__stex_notation_variant_str \c_hash_str \l__stex_notation_lang_str } + \exp_args:Nx \stex_add_to_current_module:n { + \exp_args:Nnx \seq_remove_all:cn { l_stex_symdecl_#1 _notations } + { \l__stex_notation_variant_str \c_hash_str \l__stex_notation_lang_str } + \exp_args:Nnx \seq_put_left:cn { l_stex_symdecl_#1 _notations } + { \l__stex_notation_variant_str \c_hash_str \l__stex_notation_lang_str } + \exp_args:Nnx \seq_remove_all:cn { l_stex_symdecl_#1 _notations } + { \c_hash_str } + } + \stex_debug:nn {notations}{ + Setting~default~notation~ + {\l__stex_notation_variant_str \c_hash_str \l__stex_notation_lang_str}~for~ + #1 \\ + \expandafter\meaning\csname + l_stex_symdecl_#1 _notations\endcsname + } + }{ + % todo throw error + } +} + +\NewDocumentCommand \setnotation {m m} { + \stex_get_symbol:n { #1 } + \_stex_setnotation_args:n { #2 } + \stex_setnotation:n{\l_stex_get_symbol_uri_str} + \stex_smsmode_do: +} + +\cs_new_protected:Nn \stex_copy_notations:nn { + \stex_debug:nn {notations}{ + Copying~notations~from~#2~to~#1\\ + \seq_use:cn{l_stex_symdecl_#2_notations}{,~} + } + \tl_clear:N \l_tmpa_tl + \int_step_inline:nn { \prop_item:cn {l_stex_symdecl_#2_prop}{ arity } } { + \tl_put_right:Nn \l_tmpa_tl { {## ##1} } + } + \seq_map_inline:cn {l_stex_symdecl_#2_notations}{ + \cs_set_eq:Nc \l_tmpa_cs { stex_notation_ #2 \c_hash_str ##1 _cs } + \edef \l_tmpa_tl { + \exp_after:wN\exp_after:wN\exp_after:wN \exp_not:n + \exp_after:wN\exp_after:wN\exp_after:wN { + \exp_after:wN \l_tmpa_cs \l_tmpa_tl + } + } + \exp_args:Nx + \stex_do_up_to_module:n { + \seq_put_right:cn{l_stex_symdecl_#1_notations}{##1} + \cs_generate_from_arg_count:cNnn { + stex_notation_ #1 \c_hash_str ##1 _cs + } \cs_set:Npn { \prop_item:cn {l_stex_symdecl_#2_prop}{ arity } }{ + \exp_after:wN\exp_not:n\exp_after:wN{\l_tmpa_tl} + } + } + } +} + +\NewDocumentCommand \copynotation {m m} { + \stex_get_symbol:n { #1 } + \str_set_eq:NN \l_tmpa_str \l_stex_get_symbol_uri_str + \stex_get_symbol:n { #2 } + \exp_args:Noo + \stex_copy_notations:nn \l_tmpa_str \l_stex_get_symbol_uri_str + \exp_args:Nx \stex_add_import_to_current_module:n{ + \stex_copy_notations:nn {\l_tmpa_str} {\l_stex_get_symbol_uri_str} + } + \stex_smsmode_do: +} + +\keys_define:nn { stex / symdef } { + name .str_set_x:N = \l_stex_symdecl_name_str , + local .bool_set:N = \l_stex_symdecl_local_bool , + args .str_set_x:N = \l_stex_symdecl_args_str , + type .tl_set:N = \l_stex_symdecl_type_tl , + def .tl_set:N = \l_stex_symdecl_definiens_tl , + op .tl_set:N = \l__stex_notation_op_tl , + lang .str_set_x:N = \l__stex_notation_lang_str , + variant .str_set_x:N = \l__stex_notation_variant_str , + prec .str_set_x:N = \l__stex_notation_prec_str , + assoc .choices:nn = + {bin,binl,binr,pre,conj,pwconj} + {\str_set:Nx \l_stex_symdecl_assoctype_str {\l_keys_choice_tl}}, + unknown .code:n = \str_set:Nx + \l__stex_notation_variant_str \l_keys_key_str +} + +\cs_new_protected:Nn \__stex_notation_symdef_args:n { + \str_clear:N \l_stex_symdecl_name_str + \str_clear:N \l_stex_symdecl_args_str + \str_clear:N \l_stex_symdecl_assoctype_str + \bool_set_false:N \l_stex_symdecl_local_bool + \tl_clear:N \l_stex_symdecl_type_tl + \tl_clear:N \l_stex_symdecl_definiens_tl + \str_clear:N \l__stex_notation_lang_str + \str_clear:N \l__stex_notation_variant_str + \str_clear:N \l__stex_notation_prec_str + \tl_clear:N \l__stex_notation_op_tl + + \keys_set:nn { stex / symdef } { #1 } +} + +\NewDocumentCommand \symdef { m O{} } { + \__stex_notation_symdef_args:n { #2 } + \bool_set_true:N \l_stex_symdecl_make_macro_bool + \stex_symdecl_do:n { #1 } + \tl_set:Nn \l_stex_notation_after_do_tl { + \__stex_notation_final: + \stex_smsmode_do: + } + \str_set:Nx \l_stex_get_symbol_uri_str { + \l_stex_current_module_str ? \l_stex_symdecl_name_str + } + \exp_args:Nx \stex_notation_do:nnnn + { \prop_item:cn {l_stex_symdecl_\l_stex_get_symbol_uri_str _prop } { args } } + { \prop_item:cn { l_stex_symdecl_\l_stex_get_symbol_uri_str _prop } { arity } } + { \l__stex_notation_variant_str \c_hash_str \l__stex_notation_lang_str } +} +\stex_deactivate_macro:Nn \symdef {module~environments} + +\keys_define:nn { stex / vardef } { + name .str_set_x:N = \l__stex_variables_name_str , + args .str_set_x:N = \l__stex_variables_args_str , + type .tl_set:N = \l__stex_variables_type_tl , + def .tl_set:N = \l__stex_variables_def_tl , + op .tl_set:N = \l__stex_variables_op_tl , + prec .str_set_x:N = \l__stex_variables_prec_str , + assoc .choices:nn = + {bin,binl,binr,pre,conj,pwconj} + {\str_set:Nx \l__stex_variables_assoctype_str {\l_keys_choice_tl}}, + bind .choices:nn = + {forall,exists} + {\str_set:Nx \l__stex_variables_bind_str {\l_keys_choice_tl}} +} + +\cs_new_protected:Nn \__stex_variables_args:n { + \str_clear:N \l__stex_variables_name_str + \str_clear:N \l__stex_variables_args_str + \str_clear:N \l__stex_variables_prec_str + \str_clear:N \l__stex_variables_assoctype_str + \str_clear:N \l__stex_variables_bind_str + \tl_clear:N \l__stex_variables_type_tl + \tl_clear:N \l__stex_variables_def_tl + \tl_clear:N \l__stex_variables_op_tl + + \keys_set:nn { stex / vardef } { #1 } +} + +\NewDocumentCommand \__stex_variables_do_simple:nnn { m O{}} { + \__stex_variables_args:n {#2} + \str_if_empty:NT \l__stex_variables_name_str { + \str_set:Nx \l__stex_variables_name_str { #1 } + } + \prop_clear:N \l_tmpa_prop + \prop_put:Nno \l_tmpa_prop { name } \l__stex_variables_name_str + + \int_zero:N \l_tmpb_int + \bool_set_true:N \l_tmpa_bool + \str_map_inline:Nn \l__stex_variables_args_str { + \token_case_meaning:NnF ##1 { + 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} + {\tl_to_str:n i} { \bool_set_false:N \l_tmpa_bool } + {\tl_to_str:n b} { \bool_set_false:N \l_tmpa_bool } + {\tl_to_str:n a} { + \bool_set_false:N \l_tmpa_bool + \int_incr:N \l_tmpb_int + } + {\tl_to_str:n B} { + \bool_set_false:N \l_tmpa_bool + \int_incr:N \l_tmpb_int + } + }{ + \msg_error:nnxx{stex}{error/wrongargs}{ + variable~\l__stex_variables_name_str + }{##1} + } + } + \bool_if:NTF \l_tmpa_bool { + % possibly numeric + \str_if_empty:NTF \l__stex_variables_args_str { + \prop_put:Nnn \l_tmpa_prop { args } {} + \prop_put:Nnn \l_tmpa_prop { arity } { 0 } + }{ + \int_set:Nn \l_tmpa_int { \l__stex_variables_args_str } + \prop_put:Nnx \l_tmpa_prop { arity } { \int_use:N \l_tmpa_int } + \str_clear:N \l_tmpa_str + \int_step_inline:nn \l_tmpa_int { + \str_put_right:Nn \l_tmpa_str i + } + \str_set_eq:NN \l__stex_variables_args_str \l_tmpa_str + \prop_put:Nnx \l_tmpa_prop { args } { \l__stex_variables_args_str } + } + } { + \prop_put:Nnx \l_tmpa_prop { args } { \l__stex_variables_args_str } + \prop_put:Nnx \l_tmpa_prop { arity } + { \str_count:N \l__stex_variables_args_str } + } + \prop_put:Nnx \l_tmpa_prop { assocs } { \int_use:N \l_tmpb_int } + \tl_set:cx { #1 }{ \stex_invoke_variable:n { \l__stex_variables_name_str } } + + \prop_set_eq:cN { l_stex_variable_\l__stex_variables_name_str _prop} \l_tmpa_prop + + \tl_if_empty:NF \l__stex_variables_op_tl { + \cs_set:cpx { + stex_var_op_notation_ \l__stex_variables_name_str _cs + } { + \_stex_term_omv:nn { + var://\l__stex_variables_name_str + }{ \comp{ \exp_args:No \exp_not:n { \l__stex_variables_op_tl } } } + } + } + + \tl_set:Nn \l_stex_notation_after_do_tl { + \exp_args:Nne \use:nn { + \cs_generate_from_arg_count:cNnn { stex_var_notation_\l__stex_variables_name_str _cs } + \cs_set:Npn { \prop_item:Nn \l_tmpa_prop { arity } } + } {{ + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:n \exp_after:wN \exp_after:wN \exp_after:wN + { \exp_after:wN \l_stex_notation_macrocode_cs \l_stex_notation_dummyargs_tl \stex_symbol_after_invocation_tl} + }} + \stex_if_do_html:T { + \stex_annotate_invisible:nnn {vardecl}{\l__stex_variables_name_str}{ + \stex_annotate_invisible:nnn { precedence } + { \l__stex_variables_prec_str }{} + \tl_if_empty:NF \l__stex_variables_type_tl {\stex_annotate_invisible:nnn{type}{}{$\l__stex_variables_type_tl$}} + \stex_annotate_invisible:nnn{args}{}{ \l__stex_variables_args_str } + \stex_annotate_invisible:nnn{macroname}{#1}{} + \tl_if_empty:NF \l__stex_variables_def_tl { + \stex_annotate_invisible:nnn{definiens}{} + {$\l__stex_variables_def_tl$} + } + \str_if_empty:NF \l__stex_variables_assoctype_str { + \stex_annotate_invisible:nnn{assoctype}{\l__stex_variables_assoctype_str}{} + } + \int_zero:N \l_tmpa_int + \str_set_eq:NN \l__stex_variables_remaining_args_str \l__stex_variables_args_str + \tl_clear:N \l_tmpa_tl + \int_step_inline:nn { \prop_item:Nn \l_tmpa_prop { arity } }{ + \int_incr:N \l_tmpa_int + \str_set:Nx \l_tmpb_str { \str_head:N \l__stex_variables_remaining_args_str } + \str_set:Nx \l__stex_variables_remaining_args_str { \str_tail:N \l__stex_variables_remaining_args_str } + \str_if_eq:VnTF \l_tmpb_str a { + \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl { + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int a , + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int b + } } + }{ + \str_if_eq:VnTF \l_tmpb_str B { + \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl { + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int a , + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int b + } } + }{ + \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl { + \c_hash_str \c_hash_str \int_use:N \l_tmpa_int + } } + } + } + } + \stex_annotate_invisible:nnn { notationcomp }{}{ + \str_set:Nx \l_stex_current_symbol_str {var://\l__stex_variables_name_str } + $ \exp_args:Nno \use:nn { \use:c { + stex_var_notation_\l__stex_variables_name_str _cs + } } { \l_tmpa_tl } $ + } + } + } + } + + \stex_notation_do:nnnn { \l__stex_variables_args_str } { \prop_item:Nn \l_tmpa_prop { arity } } {} +} + +\cs_new:Nn \__stex_variables_reset:N { + \tl_if_exist:NTF #1 { + \def \exp_not:N #1 { \exp_args:No \exp_not:n #1 } + }{ + \let \exp_not:N #1 \exp_not:N \undefined + } +} + +\NewDocumentCommand \__stex_variables_do_complex:nn { m m }{ + \clist_set:Nx \l__stex_variables_names { \tl_to_str:n {#1} } + \exp_args:Nnx \use:nn { + % TODO + \stex_annotate_invisible:nnn {vardecls}{\clist_use:Nn\l__stex_variables_names,}{ + #2 + } + }{ + \__stex_variables_reset:N \varnot + \__stex_variables_reset:N \vartype + \__stex_variables_reset:N \vardefi + } +} + +\NewDocumentCommand \vardef { s } { + \IfBooleanTF#1 { + \__stex_variables_do_complex:nn + }{ + \__stex_variables_do_simple:nnn + } +} + +\NewDocumentCommand \svar { O{} m }{ + \tl_if_empty:nTF {#1}{ + \str_set:Nn \l_tmpa_str { #2 } + }{ + \str_set:Nn \l_tmpa_str { #1 } + } + \_stex_term_omv:nn { + var://\l_tmpa_str + }{ \comp{ #2 } } +} + + + +%%%%%%%%%%%%% terms.dtx %%%%%%%%%%%%% + +\msg_new:nnn{stex}{error/nonotation}{ + Symbol~#1~invoked,~but~has~no~notation#2! +} +\msg_new:nnn{stex}{error/notationarg}{ + Error~in~parsing~notation~#1 +} +\msg_new:nnn{stex}{error/noop}{ + Symbol~#1~has~no~operator~notation~for~notation~#2 +} +\msg_new:nnn{stex}{error/notallowed}{ + Symbol~invocation~#1~not~allowed~in~notation~component~of~#2 +} + +\keys_define:nn { stex / terms } { + lang .tl_set_x:N = \l__stex_terms_lang_str , + variant .tl_set_x:N = \l__stex_terms_variant_str , + unknown .code:n = \str_set:Nx + \l__stex_terms_variant_str \l_keys_key_str +} + +\cs_new_protected:Nn \__stex_terms_args:n { + \str_clear:N \l__stex_terms_lang_str + \str_clear:N \l__stex_terms_variant_str + + \keys_set:nn { stex / terms } { #1 } +} + +\cs_new:Nn \__stex_terms_reset:N { + \tl_if_exist:NTF #1 { + \def \exp_not:N #1 { \exp_args:No \exp_not:n #1 } + }{ + \let \exp_not:N #1 \exp_not:N \undefined + } +} + +\bool_new:N \l__stex_terms_allow_semantic_bool +\bool_set_true:N \l__stex_terms_allow_semantic_bool + +\cs_new_protected:Nn \stex_invoke_symbol:n { + \bool_if:NTF \l__stex_terms_allow_semantic_bool { + \str_if_eq:eeF { + \prop_item:cn { + l_stex_symdecl_#1_prop + }{ deprecate } + }{}{ + \msg_warning:nnxx{stex}{warning/deprecated}{ + Symbol~#1 + }{ + \prop_item:cn {l_stex_symdecl_#1_prop}{ deprecate } + } + } + \if_mode_math: + \exp_after:wN \__stex_terms_invoke_math:n + \else: + \exp_after:wN \__stex_terms_invoke_text:n + \fi: { #1 } + }{ + \msg_error:nnxx{stex}{error/notallowed}{#1}{\l_stex_current_symbol_str} + } +} + +\cs_new_protected:Nn \__stex_terms_invoke_text:n { + \peek_charcode_remove:NTF ! { + \__stex_terms_invoke_op_custom:nn {#1} + }{ + \__stex_terms_invoke_custom:nn {#1} + } +} + +\cs_new_protected:Nn \__stex_terms_invoke_math:n { + \peek_charcode_remove:NTF ! { + % operator + \peek_charcode_remove:NTF * { + % custom op + \__stex_terms_invoke_op_custom:nn {#1} + }{ + % op notation + \peek_charcode:NTF [ { + \__stex_terms_invoke_op_notation:nw {#1} + }{ + \__stex_terms_invoke_op_notation:nw {#1}[] + } + } + }{ + \peek_charcode_remove:NTF * { + \__stex_terms_invoke_custom:nn {#1} + % custom + }{ + % normal + \peek_charcode:NTF [ { + \__stex_terms_invoke_notation:nw {#1} + }{ + \__stex_terms_invoke_notation:nw {#1}[] + } + } + } +} + +\cs_new_protected:Nn \__stex_terms_invoke_op_custom:nn { + \exp_args:Nnx \use:nn { + \str_set:Nn \l_stex_current_symbol_str { #1 } + \bool_set_false:N \l__stex_terms_allow_semantic_bool + \_stex_term_oms:nnn {#1 \c_hash_str\c_hash_str}{#1}{ + \comp{ #2 } + } + }{ + \__stex_terms_reset:N \l_stex_current_symbol_str + \bool_set_true:N \l__stex_terms_allow_semantic_bool + } +} + +\cs_new_protected:Nn \__stex_terms_find_notation:nn { + \str_set:Nn \l_stex_current_symbol_str { #1 } + \__stex_terms_args:n { #2 } + \seq_if_empty:cTF { + l_stex_symdecl_ #1 _notations + } { + \msg_error:nnxx{stex}{error/nonotation}{#1}{s} + } { + \bool_lazy_all:nTF { + {\str_if_empty_p:N \l__stex_terms_variant_str} + {\str_if_empty_p:N \l__stex_terms_lang_str} + }{ + \seq_get_left:cN {l_stex_symdecl_#1_notations}\l__stex_terms_variant_str + }{ + \seq_if_in:cxTF {l_stex_symdecl_#1_notations}{ + \l__stex_terms_variant_str \c_hash_str \l__stex_terms_lang_str + }{ + \str_set:Nx \l__stex_terms_variant_str { \l__stex_terms_variant_str \c_hash_str \l__stex_terms_lang_str } + }{ + \msg_error:nnxx{stex}{error/nonotation}{#1}{ + ~\l__stex_terms_variant_str \c_hash_str \l__stex_terms_lang_str + } + } + } + } +} + +\cs_new_protected:Npn \__stex_terms_invoke_op_notation:nw #1 [#2] { + \__stex_terms_find_notation:nn { #1 }{ #2 } + \bool_set_false:N \l__stex_terms_allow_semantic_bool + \cs_if_exist:cTF { + stex_op_notation_ #1 \c_hash_str \l__stex_terms_variant_str _cs + }{ + \use:c{stex_op_notation_ #1 \c_hash_str \l__stex_terms_variant_str _cs} + }{ + \msg_error:nnxx{stex}{error/noop}{#1}{\l__stex_terms_variant_str} + } + \bool_set_true:N \l__stex_terms_allow_semantic_bool +} + +\cs_new_protected:Npn \__stex_terms_invoke_notation:nw #1 [#2] { + \__stex_terms_find_notation:nn { #1 }{ #2 } + \cs_if_exist:cTF { + stex_notation_ #1 \c_hash_str \l__stex_terms_variant_str _cs + }{ + \tl_set:Nx \stex_symbol_after_invocation_tl { + \__stex_terms_reset:N \stex_symbol_after_invocation_tl + \__stex_terms_reset:N \l_stex_current_symbol_str + \bool_set_true:N \l__stex_terms_allow_semantic_bool + } + \bool_set_false:N \l__stex_terms_allow_semantic_bool + \use:c{stex_notation_ #1 \c_hash_str \l__stex_terms_variant_str _cs} + }{ + \msg_error:nnxx{stex}{error/nonotation}{#1}{ + ~\l__stex_terms_variant_str + } + } +} + +\prop_new:N \l__stex_terms_custom_args_prop + +\cs_new_protected:Nn \__stex_terms_invoke_custom:nn { + \exp_args:Nnx \use:nn { + \bool_set_false:N \l__stex_terms_allow_semantic_bool + \str_set:Nn \l_stex_current_symbol_str { #1 } + \prop_clear:N \l__stex_terms_custom_args_prop + \prop_put:Nnn \l__stex_terms_custom_args_prop {currnum} {1} + \prop_get:cnN { + l_stex_symdecl_#1 _prop + }{ args } \l_tmpa_str + \prop_put:Nno \l__stex_terms_custom_args_prop {args} \l_tmpa_str + \tl_set:Nn \arg { \__stex_terms_arg: } + \str_if_empty:NTF \l_tmpa_str { + \_stex_term_oms:nnn {#1}{#1}{#2} + }{ + \str_if_in:NnTF \l_tmpa_str b { + \_stex_term_ombind:nnn {#1}{#1}{#2} + }{ + \str_if_in:NnTF \l_tmpa_str B { + \_stex_term_ombind:nnn {#1}{#1}{#2} + }{ + \_stex_term_oma:nnn {#1}{#1}{#2} + } + } + } + % TODO check that all arguments exist + }{ + \__stex_terms_reset:N \l_stex_current_symbol_str + \__stex_terms_reset:N \arg + \__stex_terms_reset:N \l__stex_terms_custom_args_prop + \bool_set_true:N \l__stex_terms_allow_semantic_bool + } +} + +\NewDocumentCommand \__stex_terms_arg: { s O{} m}{ + \tl_if_empty:nTF {#2}{ + \int_set:Nn \l_tmpa_int {\prop_item:Nn \l__stex_terms_custom_args_prop {currnum}} + \bool_set_true:N \l_tmpa_bool + \bool_do_while:Nn \l_tmpa_bool { + \exp_args:NNx \prop_if_in:NnTF \l__stex_terms_custom_args_prop {\int_use:N \l_tmpa_int} { + \int_incr:N \l_tmpa_int + }{ + \bool_set_false:N \l_tmpa_bool + } + } + }{ + \int_set:Nn \l_tmpa_int { #2 } + \exp_args:NNx \prop_if_in:NnT \l__stex_terms_custom_args_prop {\int_use:N \l_tmpa_int} { + % TODO throw error + } + } + \str_set:Nx \l_tmpa_str {\prop_item:Nn \l__stex_terms_custom_args_prop {args} } + \int_compare:nNnT \l_tmpa_int > {\str_count:N \l_tmpa_str} { + % TODO throw error + } + \IfBooleanTF#1{ + \stex_annotate_invisible:n { + \exp_args:No \_stex_term_arg:nn {\l_stex_current_symbol_str}{#3} + } + }{ + \exp_args:No \_stex_term_arg:nn {\l_stex_current_symbol_str}{#3} + } +} + +\cs_new_protected:Nn \_stex_term_arg:nn { + \exp_args:Nnx \use:nn { + \bool_set_true:N \l__stex_terms_allow_semantic_bool + \stex_annotate:nnn{ arg }{ #1 }{ #2 } + }{ + \bool_set_false:N \l__stex_terms_allow_semantic_bool + } +} + +\cs_new_protected:Nn \_stex_term_math_arg:nnn { + \exp_args:Nnx \use:nn + { \int_set:Nn \l__stex_terms_downprec { #2 } + \_stex_term_arg:nn { #1 }{ #3 } + } + { \int_set:Nn \exp_not:N \l__stex_terms_downprec { \int_use:N \l__stex_terms_downprec } } +} + +\tl_const:Nx \infprec {\int_use:N \c_max_int} +\tl_const:Nx \neginfprec {-\int_use:N \c_max_int} +\int_new:N \l__stex_terms_downprec +\int_set_eq:NN \l__stex_terms_downprec \infprec +\tl_set:Nn \l__stex_terms_left_bracket_str ( +\tl_set:Nn \l__stex_terms_right_bracket_str ) +\cs_new_protected:Nn \__stex_terms_maybe_brackets:nn { + \bool_if:NTF \l__stex_terms_brackets_done_bool { + \bool_set_false:N \l__stex_terms_brackets_done_bool + #2 + } { + \int_compare:nNnTF { #1 } > \l__stex_terms_downprec { + \bool_if:NTF \l_stex_inparray_bool { #2 }{ + \stex_debug:nn{dobrackets}{\number#1 > \number\l__stex_terms_downprec; \detokenize{#2}} + \dobrackets { #2 } + } + }{ #2 } + } +} +\bool_new:N \l__stex_terms_brackets_done_bool +\cs_new_protected:Npn \dobrackets #1 { + %\ThisStyle{\if D\m@switch + % \exp_args:Nnx \use:nn + % { \exp_after:wN \left\l__stex_terms_left_bracket_str #1 } + % { \exp_not:N\right\l__stex_terms_right_bracket_str } + % \else + \exp_args:Nnx \use:nn + { + \bool_set_true:N \l__stex_terms_brackets_done_bool + \int_set:Nn \l__stex_terms_downprec \infprec + \l__stex_terms_left_bracket_str + #1 + } + { + \bool_set_false:N \l__stex_terms_brackets_done_bool + \l__stex_terms_right_bracket_str + \int_set:Nn \l__stex_terms_downprec { \int_use:N \l__stex_terms_downprec } + } + %\fi} +} +\cs_new_protected:Npn \withbrackets #1 #2 #3 { + \exp_args:Nnx \use:nn + { + \tl_set:Nx \l__stex_terms_left_bracket_str { #1 } + \tl_set:Nx \l__stex_terms_right_bracket_str { #2 } + #3 + } + { + \tl_set:Nn \exp_not:N \l__stex_terms_left_bracket_str + {\l__stex_terms_left_bracket_str} + \tl_set:Nn \exp_not:N \l__stex_terms_right_bracket_str + {\l__stex_terms_right_bracket_str} + } +} +\cs_new_protected:Npn \STEXinvisible #1 { + \stex_annotate_invisible:n { #1 } +} +\cs_new_protected:Nn \_stex_term_oms:nnn { + \stex_annotate:nnn{ OMID }{ #2 }{ + \stex_highlight_term:nn { #1 } { #3 } + } +} + +\cs_new_protected:Nn \_stex_term_math_oms:nnnn { + \__stex_terms_maybe_brackets:nn { #3 }{ + \_stex_term_oms:nnn { #1 } { #1\c_hash_str#2 } { #4 } + } +} +\cs_new_protected:Nn \_stex_term_omv:nn { + \stex_annotate:nnn{ OMID }{ #1 }{ + \stex_highlight_term:nn { #1 } { #2 } + } +} +\cs_new_protected:Nn \_stex_term_oma:nnn { + \stex_annotate:nnn{ OMA }{ #2 }{ + \stex_highlight_term:nn { #1 } { #3 } + } +} + +\cs_new_protected:Nn \_stex_term_math_oma:nnnn { + \__stex_terms_maybe_brackets:nn { #3 }{ + \_stex_term_oma:nnn { #1 } { #1\c_hash_str#2 } { #4 } + } +} +\cs_new_protected:Nn \_stex_term_ombind:nnn { + \stex_annotate:nnn{ OMBIND }{ #2 }{ + \stex_highlight_term:nn { #1 } { #3 } + } +} + +\cs_new_protected:Nn \_stex_term_math_omb:nnnn { + \__stex_terms_maybe_brackets:nn { #3 }{ + \_stex_term_ombind:nnn { #1 } { #1\c_hash_str#2 } { #4 } + } +} +\cs_new_protected:Nn \_stex_term_math_assoc_arg:nnnn { + % TODO sequences + \clist_set:Nn \l_tmpa_clist{ #3 } + \int_compare:nNnTF { \clist_count:N \l_tmpa_clist } < 2 { + \tl_set:Nn \l_tmpa_tl { #3 } + }{ + \cs_set:Npn \l_tmpa_cs ##1 ##2 { #4 } + \clist_reverse:N \l_tmpa_clist + \clist_pop:NN \l_tmpa_clist \l_tmpa_tl + + \clist_map_inline:Nn \l_tmpa_clist { + \exp_args:NNNo \exp_args:NNo \tl_set:No \l_tmpa_tl { + \exp_args:Nno + \l_tmpa_cs { ##1 } \l_tmpa_tl + } + } + } + \exp_args:Nnno + \_stex_term_math_arg:nnn{#1}{#2}\l_tmpa_tl +} +\cs_new_protected:Nn \stex_term_custom:nn { + \str_set:Nn \l__stex_terms_custom_uri { #1 } + \str_set:Nn \l_tmpa_str { #2 } + \tl_clear:N \l_tmpa_tl + \int_zero:N \l_tmpa_int + \int_set:Nn \l_tmpb_int { \str_count:N \l_tmpa_str } + \__stex_terms_custom_loop: +} +\cs_new_protected:Nn \__stex_terms_custom_loop: { + \bool_set_false:N \l_tmpa_bool + \bool_while_do:nn { + \str_if_eq_p:ee X { + \str_item:Nn \l_tmpa_str { \l_tmpa_int + 1 } + } + }{ + \int_incr:N \l_tmpa_int + } + + \peek_charcode:NTF [ { + % notation/text component + \__stex_terms_custom_component:w + } { + \int_compare:nNnTF \l_tmpa_int = \l_tmpb_int { + % all arguments read => finish + \__stex_terms_custom_final: + } { + % arguments missing + \peek_charcode_remove:NTF * { + % invisible, specific argument position or both + \peek_charcode:NTF [ { + % visible specific argument position + \__stex_terms_custom_arg:wn + } { + % invisible + \peek_charcode_remove:NTF * { + % invisible specific argument position + \__stex_terms_custom_arg_inv:wn + } { + % invisible next argument + \__stex_terms_custom_arg_inv:wn [ \l_tmpa_int + 1 ] + } + } + } { + % next normal argument + \__stex_terms_custom_arg:wn [ \l_tmpa_int + 1 ] + } + } + } +} +\cs_new_protected:Npn \__stex_terms_custom_arg_inv:wn [ #1 ] #2 { + \bool_set_true:N \l_tmpa_bool + \__stex_terms_custom_arg:wn [ #1 ] { #2 } +} +\cs_new_protected:Npn \__stex_terms_custom_arg:wn [ #1 ] #2 { + \str_set:Nx \l_tmpb_str { + \str_item:Nn \l_tmpa_str { #1 } + } + \str_case:VnTF \l_tmpb_str { + { X } { + \msg_error:nnx{stex}{error/notationarg}{\l__stex_terms_custom_uri} + } + { i } { \__stex_terms_custom_set_X:n { #1 } } + { b } { \__stex_terms_custom_set_X:n { #1 } } + { a } { \__stex_terms_custom_set_X:n { #1 } } % TODO ? + { B } { \__stex_terms_custom_set_X:n { #1 } } % TODO ? + }{}{ + \msg_error:nnx{stex}{error/notationarg}{\l__stex_terms_custom_uri} + } + + \bool_if:nTF \l_tmpa_bool { + \tl_put_right:Nx \l_tmpa_tl { + \stex_annotate_invisible:n { + \_stex_term_arg:nn { \int_eval:n { #1 } } + \exp_not:n { { #2 } } + } + } + } { + \tl_put_right:Nx \l_tmpa_tl { + \_stex_term_arg:nn { \int_eval:n { #1 } } + \exp_not:n { { #2 } } + } + } + + \__stex_terms_custom_loop: +} +\cs_new_protected:Nn \__stex_terms_custom_set_X:n { + \str_set:Nx \l_tmpa_str { + \str_range:Nnn \l_tmpa_str 1 { #1 - 1 } + X + \str_range:Nnn \l_tmpa_str { #1 + 1 } { -1 } + } +} +\cs_new_protected:Npn \__stex_terms_custom_component:w [ #1 ] { + \tl_put_right:Nn \l_tmpa_tl { \comp{ #1 } } + \__stex_terms_custom_loop: +} +\cs_new_protected:Nn \__stex_terms_custom_final: { + \int_compare:nNnTF \l_tmpb_int = 0 { + \exp_args:Nnno \_stex_term_oms:nnn + }{ + \str_if_in:NnTF \l_tmpa_str {b} { + \exp_args:Nnno \_stex_term_ombind:nnn + } { + \exp_args:Nnno \_stex_term_oma:nnn + } + } + { \l__stex_terms_custom_uri } { \l__stex_terms_custom_uri } { \l_tmpa_tl } +} +\cs_new:Nn \stex_capitalize:n { \uppercase{#1} } + +\keys_define:nn { stex / symname } { + pre .tl_set_x:N = \l__stex_terms_pre_tl , + post .tl_set_x:N = \l__stex_terms_post_tl , + root .tl_set_x:N = \l__stex_terms_root_tl +} + +\cs_new_protected:Nn \stex_symname_args:n { + \tl_clear:N \l__stex_terms_post_tl + \tl_clear:N \l__stex_terms_pre_tl + \tl_clear:N \l__stex_terms_root_str + \keys_set:nn { stex / symname } { #1 } +} + +\NewDocumentCommand \symref { m m }{ + \let\compemph_uri_prev:\compemph@uri + \let\compemph@uri\symrefemph@uri + \STEXsymbol{#1}!{ #2 } + \let\compemph@uri\compemph_uri_prev: +} + +\NewDocumentCommand \synonym { O{} m m}{ + \stex_symname_args:n { #1 } + \let\compemph_uri_prev:\compemph@uri + \let\compemph@uri\symrefemph@uri + % TODO + \STEXsymbol{#2}!{\l__stex_terms_pre_tl #3 \l__stex_terms_post_tl} + \let\compemph@uri\compemph_uri_prev: +} + +\NewDocumentCommand \symname { O{} m }{ + \stex_symname_args:n { #1 } + \stex_get_symbol:n { #2 } + \str_set:Nx \l_tmpa_str { + \prop_item:cn { l_stex_symdecl_ \l_stex_get_symbol_uri_str _prop } { name } + } + \exp_args:NNno \str_replace_all:Nnn \l_tmpa_str {-} {~} + + \let\compemph_uri_prev:\compemph@uri + \let\compemph@uri\symrefemph@uri + \exp_args:NNx \use:nn + \stex_invoke_symbol:n { { \l_stex_get_symbol_uri_str }!{ + \l__stex_terms_pre_tl \l_tmpa_str \l__stex_terms_post_tl + } } + \let\compemph@uri\compemph_uri_prev: +} + +\NewDocumentCommand \Symname { O{} m }{ + \stex_symname_args:n { #1 } + \stex_get_symbol:n { #2 } + \str_set:Nx \l_tmpa_str { + \prop_item:cn { l_stex_symdecl_ \l_stex_get_symbol_uri_str _prop } { name } + } + \exp_args:NNno \str_replace_all:Nnn \l_tmpa_str {-} {~} + \let\compemph_uri_prev:\compemph@uri + \let\compemph@uri\symrefemph@uri + \exp_args:NNx \use:nn + \stex_invoke_symbol:n { { \l_stex_get_symbol_uri_str }!{ + \exp_after:wN \stex_capitalize:n \l_tmpa_str + \l__stex_terms_post_tl + } } + \let\compemph@uri\compemph_uri_prev: +} + +\str_new:N \l_stex_current_symbol_str +\cs_new_protected:Nn \stex_highlight_term:nn { + \exp_args:Nnx + \use:nn { + \str_set:Nx \l_stex_current_symbol_str { #1 } + #2 + } { + \str_set:Nx \exp_not:N \l_stex_current_symbol_str + { \l_stex_current_symbol_str } + } +} + +\cs_new_protected:Nn \stex_unhighlight_term:n { + #1 %\iffalse{{\fi}} #1 {{\iffalse}}\fi +} +\cs_new_protected:Npn \comp #1 { + \str_if_empty:NF \l_stex_current_symbol_str { + \rustex_if:TF { + \stex_annotate:nnn { comp }{ \l_stex_current_symbol_str }{ #1 } + }{ + \exp_args:Nnx \compemph@uri { #1 } { \l_stex_current_symbol_str } + } + } +} + +\cs_new_protected:Npn \compemph@uri #1 #2 { + \compemph{ #1 } +} + +\cs_new_protected:Npn \compemph #1 { + #1 +} + +\cs_new_protected:Npn \defemph@uri #1 #2 { + \defemph{#1} +} + +\cs_new_protected:Npn \defemph #1 { + \textbf{#1} +} + +\cs_new_protected:Npn \symrefemph@uri #1 #2 { + \symrefemph{#1} +} + +\cs_new_protected:Npn \symrefemph #1 { + \textbf{#1} +} +\NewDocumentCommand \ellipses {} { \ldots } +\bool_new:N \l_stex_inparray_bool +\bool_set_false:N \l_stex_inparray_bool +\NewDocumentCommand \parray { m m } { + \begingroup + \bool_set_true:N \l_stex_inparray_bool + \begin{array}{#1} + #2 + \end{array} + \endgroup +} + +\NewDocumentCommand \prmatrix { m } { + \begingroup + \bool_set_true:N \l_stex_inparray_bool + \begin{matrix} + #1 + \end{matrix} + \endgroup +} + +\def \maybephline { + \bool_if:NT \l_stex_inparray_bool {\hline} +} + +\def \parrayline #1 #2 { + #1 #2 \bool_if:NT \l_stex_inparray_bool {\\} +} + +\def \pmrow #1 { \parrayline{}{ #1 } } + +\def \parraylineh #1 #2 { + #1 #2 \bool_if:NT \l_stex_inparray_bool {\\\hline} +} + +\def \parraycell #1 { + #1 \bool_if:NT \l_stex_inparray_bool {&} +} +\cs_new_protected:Nn \stex_invoke_variable:n { + \if_mode_math: + \exp_after:wN \__stex_variables_invoke_math:n + \else: + \exp_after:wN \__stex_variables_invoke_text:n + \fi: {#1} +} + +\cs_new_protected:Nn \__stex_variables_invoke_text:n { + %TODO +} + +\cs_new_protected:Nn \__stex_variables_invoke_math:n { + \peek_charcode_remove:NTF ! { + \peek_charcode_remove:NTF ! { + \peek_charcode:NTF [ { + \__stex_variables_invoke_op_custom:nw + }{ + % TODO throw error + } + }{ + \__stex_variables_invoke_op:n { #1 } + } + }{ + \peek_charcode_remove:NTF * { + \__stex_variables_invoke_text:n { #1 } + }{ + \__stex_variables_invoke_math_ii:n { #1 } + } + } +} + +\cs_new_protected:Nn \__stex_variables_invoke_op:n { + \cs_if_exist:cTF { + stex_var_op_notation_ #1 _cs + }{ + \use:c{stex_var_op_notation_ #1 _cs } + }{ + \msg_error:nnxx{stex}{error/noop}{variable~#1}{} + } +} + +\cs_new_protected:Npn \__stex_variables_invoke_math_ii:n #1 { + \cs_if_exist:cTF { + stex_var_notation_#1_cs + }{ + \str_set:Nn \l_stex_current_symbol_str { #1 } + \use:c{stex_var_notation_#1_cs} + }{ + \msg_error:nnxx{stex}{error/nonotation}{variable~#1}{s} + } +} + + +%%%%%%%%%%%%% features.dtx %%%%%%%%%%%%% + +\msg_new:nnn{stex}{error/copymodule/notallowed}{ + Symbol~#1~can~not~be~assigned~in~copymodule~#2 +} +\msg_new:nnn{stex}{error/interpretmodule/nodefiniens}{ + Symbol~#1~not~assigned~in~interpretmodule~#2 +} + +\cs_new_protected:Nn \stex_get_symbol_in_copymodule:n { + \tl_if_head_eq_catcode:nNTF { #1 } \relax { + \__stex_features_get_symbol_from_cs:n { #1 } + }{ + % argument is a string + % is it a command name? + \cs_if_exist:cTF { #1 }{ + \cs_set_eq:Nc \l_tmpa_tl { #1 } + \str_set:Nx \l_tmpa_str { \cs_argument_spec:N \l_tmpa_tl } + \str_if_empty:NTF \l_tmpa_str { + \exp_args:Nx \cs_if_eq:NNTF { + \tl_head:N \l_tmpa_tl + } \stex_invoke_symbol:n { + \exp_args:No \__stex_features_get_symbol_from_cs:n { \use:c { #1 } } + }{ + \__stex_features_get_symbol_from_string:n { #1 } + } + } { + \__stex_features_get_symbol_from_string:n { #1 } + } + }{ + % argument is not a command name + \__stex_features_get_symbol_from_string:n { #1 } + % \l_stex_all_symbols_seq + } + } +} + +\cs_new_protected:Nn \__stex_features_get_symbol_from_string:n { + \str_set:Nn \l_tmpa_str { #1 } + \bool_set_false:N \l_tmpa_bool + \bool_if:NF \l_tmpa_bool { + \tl_set:Nn \l_tmpa_tl { + \msg_set:nnn{stex}{error/unknownsymbol}{ + No~symbol~#1~found! + } + \msg_error:nn{stex}{error/unknownsymbol} + } + \str_set:Nn \l_tmpa_str { #1 } + \int_set:Nn \l_tmpa_int { \str_count:N \l_tmpa_str } + \seq_map_inline:Nn \l__stex_features_copymodule_fields_seq { + \str_set:Nn \l_tmpb_str { ##1 } + \str_if_eq:eeT { \l_tmpa_str } { + \str_range:Nnn \l_tmpb_str { -\l_tmpa_int } { -1 } + } { + \seq_map_break:n { + \tl_set:Nn \l_tmpa_tl { + \str_set:Nn \l_stex_get_symbol_uri_str { + ##1 + } + \__stex_features_get_symbol_check: + } + } + } + } + \l_tmpa_tl + } +} + +\cs_new_protected:Nn \__stex_features_get_symbol_from_cs:n { + \exp_args:NNx \tl_set:Nn \l_tmpa_tl + { \tl_tail:N \l_tmpa_tl } + \tl_if_single:NTF \l_tmpa_tl { + \exp_args:No \tl_if_head_is_group:nTF \l_tmpa_tl { + \exp_after:wN \str_set:Nn \exp_after:wN + \l_stex_get_symbol_uri_str \l_tmpa_tl + \__stex_features_get_symbol_check: + }{ + % TODO + % tail is not a single group + } + }{ + % TODO + % tail is not a single group + } +} + +\cs_new_protected:Nn \__stex_features_get_symbol_check: { + \exp_args:NNno \seq_set_split:Nnn \l_tmpa_seq {?} \l_stex_get_symbol_uri_str + \int_compare:nNnTF {\seq_count:N \l_tmpa_seq} = 3 { + \seq_pop_right:NN \l_tmpa_seq \l_tmpb_str + \str_set:Nx \l_tmpa_str {\seq_use:Nn \l_tmpa_seq ?} + \seq_if_in:NoF \l__stex_features_copymodule_modules_seq \l_tmpa_str { + \msg_error:nnxx{stex}{error/copymodule/notallowed}{\l_stex_get_symbol_uri_str}{ + \l_stex_current_copymodule_name_str\\Allowed:~\seq_use:Nn \l__stex_features_copymodule_modules_seq {,~} + } + } + }{ + \msg_error:nnxx{stex}{error/copymodule/notallowed}{\l_stex_get_symbol_uri_str}{ + \l_stex_current_copymodule_name_str~(inexplicably) + } + } +} + +\cs_new_protected:Nn \stex_copymodule_start:nnnn { + \stex_import_module_uri:nn { #1 } { #2 } + \str_set:Nx \l_stex_current_copymodule_name_str {#3} + \stex_import_require_module:nnnn + { \l_stex_import_ns_str } { \l_stex_import_archive_str } + { \l_stex_import_path_str } { \l_stex_import_name_str } + \stex_collect_imports:n {\l_stex_import_ns_str ?\l_stex_import_name_str } + \seq_set_eq:NN \l__stex_features_copymodule_modules_seq \l_stex_collect_imports_seq + \seq_clear:N \l__stex_features_copymodule_fields_seq + \seq_map_inline:Nn \l__stex_features_copymodule_modules_seq { + \seq_map_inline:cn {c_stex_module_##1_constants}{ + \exp_args:NNx \seq_put_right:Nn \l__stex_features_copymodule_fields_seq { + ##1 ? ####1 + } + } + } + \seq_clear:N \l_tmpa_seq + \exp_args:NNx \prop_set_from_keyval:Nn \l_stex_current_copymodule_prop { + name = \l_stex_current_copymodule_name_str , + module = \l_stex_current_module_str , + from = \l_stex_import_ns_str ?\l_stex_import_name_str , + includes = \l_tmpa_seq , + fields = \l_tmpa_seq + } + \stex_debug:nn{copymodule}{#4~for~module~{\l_stex_import_ns_str ?\l_stex_import_name_str} + as~\l_stex_current_module_str?\l_stex_current_copymodule_name_str} + \stex_debug:nn{copymodule}{modules:\seq_use:Nn \l__stex_features_copymodule_modules_seq {,~}} + \stex_debug:nn{copymodule}{fields:\seq_use:Nn \l__stex_features_copymodule_fields_seq {,~}} + \stex_if_smsmode:F { + \begin{stex_annotate_env} {#4} { + \l_stex_current_module_str?\l_stex_current_copymodule_name_str + } + \stex_annotate_invisible:nnn{from}{\l_stex_import_ns_str ?\l_stex_import_name_str}{} + } + \bool_set_eq:NN \l__stex_features_oldhtml_bool \_stex_html_do_output_bool + \bool_set_false:N \_stex_html_do_output_bool +} +\cs_new_protected:Nn \stex_copymodule_end:n { + \def \l_tmpa_cs ##1 ##2 {#1} + \bool_set_eq:NN \_stex_html_do_output_bool \l__stex_features_oldhtml_bool + \tl_clear:N \l_tmpa_tl + \tl_clear:N \l_tmpb_tl + \prop_get:NnN \l_stex_current_copymodule_prop {fields} \l_tmpa_seq + \seq_map_inline:Nn \l__stex_features_copymodule_modules_seq { + \seq_map_inline:cn {c_stex_module_##1_constants}{ + \tl_clear:N \l_tmpc_tl + \l_tmpa_cs{##1}{####1} + \str_if_exist:cTF {l__stex_features_copymodule_##1?####1_name_str} { + \tl_put_right:Nx \l_tmpa_tl { + \prop_set_from_keyval:cn { + l_stex_symdecl_\l_stex_current_module_str ? \use:c{l__stex_features_copymodule_##1?####1_name_str}_prop + }{ + \exp_after:wN \prop_to_keyval:N \csname + l_stex_symdecl_\l_stex_current_module_str ? \use:c{l__stex_features_copymodule_##1?####1_name_str}_prop + \endcsname + } + \seq_clear:c { + l_stex_symdecl_ + \l_stex_current_module_str ? \use:c{l__stex_features_copymodule_##1?####1_name_str} + _notations + } + } + \tl_put_right:Nx \l_tmpc_tl { + \stex_copy_notations:nn {\l_stex_current_module_str ? \use:c{l__stex_features_copymodule_##1?####1_name_str}}{##1?####1} + \stex_annotate_invisible:nnn{alias}{\use:c{l__stex_features_copymodule_##1?####1_name_str}}{} + } + \seq_put_right:Nx \l_tmpa_seq {\l_stex_current_module_str ? \use:c{l__stex_features_copymodule_##1?####1_name_str}} + \str_if_exist:cT {l__stex_features_copymodule_##1?####1_macroname_str} { + \tl_put_right:Nx \l_tmpc_tl { + \stex_annotate_invisible:nnn{macroname}{\use:c{l__stex_features_copymodule_##1?####1_macroname_str}}{} + } + \tl_put_right:Nx \l_tmpa_tl { + \tl_set:cx {\use:c{l__stex_features_copymodule_##1?####1_macroname_str}}{ + \stex_invoke_symbol:n { + \l_stex_current_module_str ? \use:c{l__stex_features_copymodule_##1?####1_name_str} + } + } + } + } + }{ + \tl_put_right:Nx \l_tmpc_tl { + \stex_copy_notations:nn {\l_stex_current_module_str ? \l_stex_current_copymodule_name_str / ####1 }{##1?####1} + } + \prop_set_eq:Nc \l_tmpa_prop {l_stex_symdecl_ ##1?####1 _prop} + \prop_put:Nnx \l_tmpa_prop { name }{ \l_stex_current_copymodule_name_str / ####1 } + \prop_put:Nnx \l_tmpa_prop { module }{ \l_stex_current_module_str } + \tl_put_right:Nx \l_tmpa_tl { + \prop_set_from_keyval:cn { + l_stex_symdecl_\l_stex_current_module_str ? \l_stex_current_copymodule_name_str / ####1_prop + }{ + \prop_to_keyval:N \l_tmpa_prop + } + \seq_clear:c { + l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_current_copymodule_name_str / ####1 + _notations + } + } + \seq_put_right:Nx \l_tmpa_seq {\l_stex_current_module_str ? \l_stex_current_copymodule_name_str / ####1 } + \str_if_exist:cT {l__stex_features_copymodule_##1?####1_macroname_str} { + \tl_put_right:Nx \l_tmpc_tl { + \stex_annotate_invisible:nnn{macroname}{\use:c{l__stex_features_copymodule_##1?####1_macroname_str}}{} + } + \tl_put_right:Nx \l_tmpa_tl { + \tl_set:cx {\use:c{l__stex_features_copymodule_##1?####1_macroname_str}}{ + \stex_invoke_symbol:n { + \l_stex_current_module_str ? \l_stex_current_copymodule_name_str / ####1 + } + } + } + } + } + \tl_if_exist:cT {l__stex_features_copymodule_##1?####1_def_tl}{ + \tl_put_right:Nx \l_tmpc_tl { + \stex_annotate_invisible:nnn{definiens}{}{$\use:c{l__stex_features_copymodule_##1?####1_def_tl}$} + } + } + \tl_put_right:Nx \l_tmpb_tl { + \stex_annotate:nnn{assignment} {##1?####1} { \l_tmpc_tl } + } + } + } + \prop_put:Nno \l_stex_current_copymodule_prop {fields} \l_tmpa_seq + \tl_put_left:Nx \l_tmpa_tl { + \prop_set_from_keyval:cn { + l_stex_copymodule_ \l_stex_current_module_str?\l_stex_current_copymodule_name_str _prop + }{ + \prop_to_keyval:N \l_stex_current_copymodule_prop + } + } + \exp_args:No \stex_add_to_current_module:n \l_tmpa_tl + \stex_debug:nn{copymodule}{result:\meaning \l_tmpa_tl} + \exp_args:Nx \stex_do_up_to_module:n { + \exp_args:No \exp_not:n \l_tmpa_tl + } + \l_tmpb_tl + \stex_if_smsmode:F { + \end{stex_annotate_env} + } +} + +\NewDocumentEnvironment {copymodule} { O{} m m}{ + \stex_copymodule_start:nnnn { #1 }{ #2 }{ #3 }{ structure } + \stex_deactivate_macro:Nn \symdecl {module~environments} + \stex_deactivate_macro:Nn \symdef {module~environments} + \stex_deactivate_macro:Nn \notation {module~environments} + \stex_reactivate_macro:N \assign + \stex_reactivate_macro:N \renamedecl + \stex_reactivate_macro:N \donotcopy + \stex_smsmode_do: +}{ + \stex_copymodule_end:n {} +} + +\NewDocumentEnvironment {interpretmodule} { O{} m m}{ + \stex_copymodule_start:nnnn { #1 }{ #2 }{ #3 }{ realization } + \stex_deactivate_macro:Nn \symdecl {module~environments} + \stex_deactivate_macro:Nn \symdef {module~environments} + \stex_deactivate_macro:Nn \notation {module~environments} + \stex_reactivate_macro:N \assign + \stex_reactivate_macro:N \renamedecl + \stex_reactivate_macro:N \donotcopy + \stex_smsmode_do: +}{ + \stex_copymodule_end:n { + \tl_if_exist:cF { + l__stex_features_copymodule_##1?##2_def_tl + }{ + \msg_error:nnxx{stex}{error/interpretmodule/nodefiniens}{ + ##1?##2 + }{\l_stex_current_copymodule_name_str} + } + } +} + +\NewDocumentCommand \donotcopy { O{} m}{ + \stex_import_module_uri:nn { #1 } { #2 } + \stex_collect_imports:n {\l_stex_import_ns_str ?\l_stex_import_name_str } + \seq_map_inline:Nn \l_stex_collect_imports_seq { + \seq_remove_all:Nn \l__stex_features_copymodule_modules_seq { ##1 } + \seq_map_inline:cn {c_stex_module_##1_constants}{ + \seq_remove_all:Nn \l__stex_features_copymodule_fields_seq { ##1 ? ####1 } + \bool_lazy_any_p:nT { + { \cs_if_exist_p:c {l__stex_features_copymodule_##1?####1_name_str}} + { \cs_if_exist_p:c {l__stex_features_copymodule_##1?####1_macroname_str}} + { \cs_if_exist_p:c {l__stex_features_copymodule_##1?####1_def_tl}} + }{ + % TODO throw error + } + } + } + + \prop_get:NnN \l_stex_current_copymodule_prop { includes } \l_tmpa_seq + \seq_put_right:Nx \l_tmpa_seq {\l_stex_import_ns_str ?\l_stex_import_name_str } + \prop_put:Nnx \l_stex_current_copymodule_prop {includes} \l_tmpa_seq +} + +\NewDocumentCommand \assign { m m }{ + \stex_get_symbol_in_copymodule:n {#1} + \stex_debug:nn{assign}{defining~{\l_stex_get_symbol_uri_str}~as~\detokenize{#2}} + \tl_set:cn {l__stex_features_copymodule_\l_stex_get_symbol_uri_str _def_tl}{#2} +} + +\keys_define:nn { stex / renamedecl } { + name .str_set_x:N = \l_stex_renamedecl_name_str +} +\cs_new_protected:Nn \__stex_features_renamedecl_args:n { + \str_clear:N \l_stex_renamedecl_name_str + + \keys_set:nn { stex / renamedecl } { #1 } +} + +\NewDocumentCommand \renamedecl { O{} m m}{ + \__stex_features_renamedecl_args:n { #1 } + \stex_get_symbol_in_copymodule:n {#2} + \stex_debug:nn{renamedecl}{renaming~{\l_stex_get_symbol_uri_str}~to~#3} + \str_set:cx {l__stex_features_copymodule_\l_stex_get_symbol_uri_str _macroname_str}{#3} + \str_if_empty:NTF \l_stex_renamedecl_name_str { + \tl_set:cx { #3 }{ \stex_invoke_symbol:n { + \l_stex_get_symbol_uri_str + } } + } { + \str_set:cx {l__stex_features_copymodule_\l_stex_get_symbol_uri_str _name_str}{\l_stex_renamedecl_name_str} + \stex_debug:nn{renamedecl}{@~\l_stex_current_module_str ? \l_stex_renamedecl_name_str} + \prop_set_eq:cc {l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_renamedecl_name_str + _prop + }{l_stex_symdecl_ \l_stex_get_symbol_uri_str _prop} + \seq_set_eq:cc {l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_renamedecl_name_str + _notations + }{l_stex_symdecl_ \l_stex_get_symbol_uri_str _notations} + \prop_put:cnx {l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_renamedecl_name_str + _prop + }{ name }{ \l_stex_renamedecl_name_str } + \prop_put:cnx {l_stex_symdecl_ + \l_stex_current_module_str ? \l_stex_renamedecl_name_str + _prop + }{ module }{ \l_stex_current_module_str } + \exp_args:NNx \seq_put_left:Nn \l__stex_features_copymodule_fields_seq { + \l_stex_current_module_str ? \l_stex_renamedecl_name_str + } + \tl_set:cx { #3 }{ \stex_invoke_symbol:n { + \l_stex_current_module_str ? \l_stex_renamedecl_name_str + } } + } +} + +\stex_deactivate_macro:Nn \assign {copymodules} +\stex_deactivate_macro:Nn \renamedecl {copymodules} +\stex_deactivate_macro:Nn \donotcopy {copymodules} + +\seq_new:N \l_stex_implicit_morphisms_seq +\NewDocumentCommand \implicitmorphism { O{} m m}{ + \stex_import_module_uri:nn { #1 } { #2 } + \stex_debug:nn{implicits}{ + Implicit~morphism:~ + \l_stex_module_ns_str ? \l__stex_features_name_str + } + \exp_args:NNx \seq_if_in:NnT \l_stex_all_modules_seq { + \l_stex_module_ns_str ? \l__stex_features_name_str + }{ + \msg_error:nnn{stex}{error/conflictingmodules}{ + \l_stex_module_ns_str ? \l__stex_features_name_str + } + } + + % TODO + + \seq_put_right:Nx \l_stex_implicit_morphisms_seq { + \l_stex_module_ns_str ? \l__stex_features_name_str + } +} + + +\NewDocumentEnvironment{structural@feature}{ m m m }{ + \stex_if_in_module:F { + \msg_set:nnn{stex}{error/nomodule}{ + Structural~Feature~has~to~occur~in~a~module:\\ + Feature~#2~of~type~#1\\ + In~File:~\stex_path_to_string:N \g_stex_currentfile_seq + } + \msg_error:nn{stex}{error/nomodule} + } + + \str_set:Nx \l_stex_module_name_str { + \prop_item:Nn \l_stex_current_module_prop + { name } / #2 - feature + } + + \str_set:Nx \l_stex_module_ns_str { + \prop_item:Nn \l_stex_current_module_prop + { ns } + } + + \str_clear:N \l_tmpa_str + \seq_clear:N \l_tmpa_seq + \tl_clear:N \l_tmpa_tl + \exp_args:NNx \prop_set_from_keyval:Nn \l_stex_current_module_prop { + origname = #2, + name = \l_stex_module_name_str , + ns = \l_stex_module_ns_str , + imports = \exp_not:o { \l_tmpa_seq } , + constants = \exp_not:o { \l_tmpa_seq } , + content = \exp_not:o { \l_tmpa_tl } , + file = \exp_not:o { \g_stex_currentfile_seq } , + lang = \l_stex_module_lang_str , + sig = \l_tmpa_str , + meta = \l_tmpa_str , + feature = #1 , + } + + \stex_if_smsmode:F { + \begin{stex_annotate_env}{ feature:#1 }{} + \stex_annotate_invisible:nnn{header}{}{ #3 } + } +}{ + \str_set:Nx \l_tmpa_str { + c_stex_feature_ + \prop_item:Nn \l_stex_current_module_prop { ns } ? + \prop_item:Nn \l_stex_current_module_prop { name } + _prop + } + \prop_gset_eq:cN { \l_tmpa_str } \l_stex_current_module_prop + \prop_gset_eq:NN \g_stex_last_feature_prop \l_stex_current_module_prop + \stex_if_smsmode:F { + \end{stex_annotate_env} + } +} + + +\prop_new:N \l_stex_all_structures_prop + +\keys_define:nn { stex / features / structure } { + name .str_set_x:N = \l__stex_features_structure_name_str , +} + +\cs_new_protected:Nn \__stex_features_structure_args:n { + \str_clear:N \l__stex_features_structure_name_str + \keys_set:nn { stex / features / structure } { #1 } +} + +\NewDocumentEnvironment{mathstructure}{ O{} m }{ + \__stex_features_structure_args:n { #1 } + \str_if_empty:NT \l__stex_features_structure_name_str { + \str_set:Nx \l__stex_features_structure_name_str { #2 } + } + \exp_args:Nnnx + \begin{structural@feature}{ structure } + { \l__stex_features_structure_name_str }{} + \seq_clear:N \l_tmpa_seq + \prop_put:Nno \l_stex_current_module_prop { fields } \l_tmpa_seq + \stex_smsmode_do: +}{ + \prop_get:NnN \l_stex_current_module_prop { constants } \l_tmpa_seq + \prop_get:NnN \l_stex_current_module_prop { fields } \l_tmpb_seq + \str_set:Nx \l_tmpa_str { + \prop_item:Nn \l_stex_current_module_prop { ns } ? + \prop_item:Nn \l_stex_current_module_prop { name } + } + \seq_map_inline:Nn \l_tmpa_seq { + \exp_args:NNx \seq_put_right:Nn \l_tmpb_seq { \l_tmpa_str ? ##1 } + } + \prop_put:Nno \l_stex_current_module_prop { fields } { \l_tmpb_seq } + \exp_args:Nnx + \AddToHookNext { env / mathstructure / after }{ + \symdecl{ #2 }[type = \exp_not:N\collection,def={\STEXsymbol{module-type}{ + \_stex_term_math_oms:nnnn { \l_tmpa_str }{}{0}{} + }}, name = \prop_item:Nn \l_stex_current_module_prop { origname }] + \STEXexport { + \prop_put:Nno \exp_not:N \l_stex_all_structures_prop + {\prop_item:Nn \l_stex_current_module_prop { origname }} + {\l_tmpa_str} + \prop_put:Nno \exp_not:N \l_stex_all_structures_prop + {#2}{\l_tmpa_str} + } + } + + \end{structural@feature} + % \g_stex_last_feature_prop +} +\seq_new:N \l__stex_features_structure_field_seq +\str_new:N \l__stex_features_structure_field_str +\str_new:N \l__stex_features_structure_def_tl +\prop_new:N \l__stex_features_structure_prop +\NewDocumentCommand \instantiate { m O{} m }{ + \prop_get:NnN \l_stex_all_structures_prop {#1} \l_tmpa_str + \prop_set_eq:Nc \l__stex_features_structure_prop { + c_stex_feature_\l_tmpa_str _prop + } + \seq_set_from_clist:Nn \l__stex_features_structure_field_seq { #2 } + \seq_map_inline:Nn \l__stex_features_structure_field_seq { + \seq_set_split:Nnn \l_tmpa_seq{=}{ ##1 } + \int_compare:nNnTF {\seq_count:N \l_tmpa_seq} > 1 { + \seq_get_left:NN \l_tmpa_seq \l_tmpa_tl + \exp_args:NNno \seq_set_split:Nnn \l_tmpb_seq + {!} \l_tmpa_tl + \int_compare:nNnTF {\seq_count:N \l_tmpb_seq} > 1 { + \str_set:Nx \l__stex_features_structure_field_str {\seq_item:Nn \l_tmpb_seq 1} + \seq_get_right:NN \l_tmpb_seq \l_tmpb_tl + \seq_get_right:NN \l_tmpa_seq \l_tmpa_tl + }{ + \str_set:Nx \l__stex_features_structure_field_str \l_tmpa_tl + \seq_get_right:NN \l_tmpa_seq \l_tmpa_tl + \exp_args:NNno \seq_set_split:Nnn \l_tmpb_seq{!} + \l_tmpa_tl + \int_compare:nNnTF {\seq_count:N \l_tmpb_seq} > 1 { + \seq_get_left:NN \l_tmpb_seq \l_tmpa_tl + \seq_get_right:NN \l_tmpb_seq \l_tmpb_tl + }{ + \tl_clear:N \l_tmpb_tl + } + } + }{ + \seq_set_split:Nnn \l_tmpa_seq{!}{ ##1 } + \int_compare:nNnTF {\seq_count:N \l_tmpa_seq} > 1 { + \str_set:Nx \l__stex_features_structure_field_str {\seq_item:Nn \l_tmpa_seq 1} + \seq_get_right:NN \l_tmpa_seq \l_tmpb_tl + \tl_clear:N \l_tmpa_tl + }{ + % TODO throw error + } + } + % \l_tmpa_str: name + % \l_tmpa_tl: definiens + % \l_tmpb_tl: notation + \tl_if_empty:NT \l__stex_features_structure_field_str { + % TODO throw error + } + \str_clear:N \l_tmpb_str + + \prop_get:NnN \l__stex_features_structure_prop { fields } \l_tmpa_seq + \seq_map_inline:Nn \l_tmpa_seq { + \seq_set_split:Nnn \l_tmpb_seq ? { ####1 } + \seq_get_right:NN \l_tmpb_seq \l_tmpb_str + \str_if_eq:NNT \l__stex_features_structure_field_str \l_tmpb_str { + \seq_map_break:n { + \str_set:Nn \l_tmpb_str { ####1 } + } + } + } + \prop_get:cnN { l_stex_symdecl_ \l_tmpb_str _prop } {args} + \l_tmpb_str + + \tl_if_empty:NTF \l_tmpb_tl { + \tl_if_empty:NF \l_tmpa_tl { + \exp_args:Nx \use:n { + \symdecl{#3/\l__stex_features_structure_field_str}[args=\l_tmpb_str,def={\exp_args:No\exp_not:n{\l_tmpa_tl}}] + } + } + }{ + \tl_if_empty:NTF \l_tmpa_tl { + \exp_args:Nx \use:n { + \symdef{#3/\l__stex_features_structure_field_str}[args=\l_tmpb_str]\exp_after:wN\exp_not:n\exp_after:wN{\l_tmpb_tl} + } + + }{ + \exp_args:Nx \use:n { + \symdef{#3/\l__stex_features_structure_field_str}[args=\l_tmpb_str,def={\exp_args:No\exp_not:n{\l_tmpa_tl}}] + \exp_after:wN\exp_not:n\exp_after:wN{\l_tmpb_tl} + } + } + } + } + + \tl_clear:N \l__stex_features_structure_def_tl + + \prop_get:NnN \l__stex_features_structure_prop { fields } \l_tmpa_seq + \seq_map_inline:Nn \l_tmpa_seq { + \seq_set_split:Nnn \l_tmpb_seq ? { ##1 } + \seq_get_right:NN \l_tmpb_seq \l_tmpa_str + \exp_args:Nx \use:n { + \tl_put_right:Nn \exp_not:N \l__stex_features_structure_def_tl { + + } + } + + \prop_if_exist:cF { + l_stex_symdecl_ + \prop_item:Nn \l_stex_current_module_prop {ns} ? + \prop_item:Nn \l_stex_current_module_prop {name} ? + #3/\l_tmpa_str + _prop + }{ + \prop_get:cnN { l_stex_symdecl_ ##1 _prop } {args} + \l_tmpb_str + \exp_args:Nx \use:n { + \symdecl{#3/\l_tmpa_str}[args=\l_tmpb_str] + } + } + } + + \symdecl*{#3}[type={\STEXsymbol{module-type}{ + \_stex_term_math_oms:nnnn { + \prop_item:Nn \l__stex_features_structure_prop {ns} ? + \prop_item:Nn \l__stex_features_structure_prop {name} + }{}{0}{} + }}] + + % TODO: -> sms file + + \tl_set:cx{ #3 }{ + \stex_invoke_structure:nnn { + \prop_item:Nn \l_stex_current_module_prop {ns} ? + \prop_item:Nn \l_stex_current_module_prop {name} ? #3 + } { + \prop_item:Nn \l__stex_features_structure_prop {ns} ? + \prop_item:Nn \l__stex_features_structure_prop {name} + } + } + \stex_smsmode_do: +} +\cs_new_protected:Nn \stex_invoke_structure:nnn { + \tl_if_empty:nTF{ #3 }{ + \prop_set_eq:Nc \l__stex_features_structure_prop { + c_stex_feature_ #2 _prop + } + \tl_clear:N \l_tmpa_tl + \prop_get:NnN \l__stex_features_structure_prop { fields } \l_tmpa_seq + \seq_map_inline:Nn \l_tmpa_seq { + \seq_set_split:Nnn \l_tmpb_seq ? { ##1 } + \seq_get_right:NN \l_tmpb_seq \l_tmpa_str + \cs_if_exist:cT { + stex_notation_ #1/\l_tmpa_str \c_hash_str\c_hash_str _cs + }{ + \tl_if_empty:NF \l_tmpa_tl { + \tl_put_right:Nn \l_tmpa_tl {,} + } + \tl_put_right:Nx \l_tmpa_tl { + \stex_invoke_symbol:n {#1/\l_tmpa_str}! + } + } + } + \exp_args:No \mathstruct \l_tmpa_tl + }{ + \stex_invoke_symbol:n{#1/#3} + } +} + +%%%%%%%%%%%%% features.dtx %%%%%%%%%%%%% + + +\def\titleemph#1{\textbf{#1}} +\keys_define:nn {stex / definiendum }{ + pre .tl_set:N = \l__stex_statements_definiendum_pre_tl, + post .tl_set:N = \l__stex_statements_definiendum_post_tl, + root .str_set_x:N = \l__stex_statements_definiendum_root_str, + gfa .str_set_x:N = \l__stex_statements_definiendum_gfa_str +} +\cs_new_protected:Nn \__stex_statements_definiendum_args:n { + \str_clear:N \l__stex_statements_definiendum_root_str + \tl_clear:N \l__stex_statements_definiendum_post_tl + \str_clear:N \l__stex_statements_definiendum_gfa_str + \keys_set:nn { stex / definiendum }{ #1 } +} +\NewDocumentCommand \definiendum { O{} m m} { + \__stex_statements_definiendum_args:n { #1 } + \stex_get_symbol:n { #2 } + \stex_ref_new_sym_target:n \l_stex_get_symbol_uri_str + \str_if_empty:NTF \l__stex_statements_definiendum_root_str { + \tl_if_empty:NTF \l__stex_statements_definiendum_post_tl { + \tl_set:Nn \l_tmpa_tl { #3 } + } { + \str_set:Nx \l__stex_statements_definiendum_root_str { #3 } + \tl_set:Nn \l_tmpa_tl { + \l__stex_statements_definiendum_pre_tl\l__stex_statements_definiendum_root_str\l__stex_statements_definiendum_post_tl + } + } + } { + \tl_set:Nn \l_tmpa_tl { #3 } + } + + % TODO root + \rustex_if:TF { + \stex_annotate:nnn { definiendum } { \l_stex_get_symbol_uri_str } { \l_tmpa_tl } + } { + \exp_args:Nnx \defemph@uri { \l_tmpa_tl } { \l_stex_get_symbol_uri_str } + } +} +\stex_deactivate_macro:Nn \definiendum {definition~environments} + +\NewDocumentCommand \definame { O{} m } { + \__stex_statements_definiendum_args:n { #1 } + % TODO: root + \stex_get_symbol:n { #2 } + \stex_ref_new_sym_target:n \l_stex_get_symbol_uri_str + \str_set:Nx \l_tmpa_str { + \prop_item:cn { l_stex_symdecl_ \l_stex_get_symbol_uri_str _prop } { name } + } + \exp_args:NNno \str_replace_all:Nnn \l_tmpa_str {-} {~} + \rustex_if:TF { + \stex_annotate:nnn { definiendum } { \l_stex_get_symbol_uri_str } { + \l_tmpa_str\l__stex_statements_definiendum_post_tl + } + } { + \defemph@uri { + \l_tmpa_str\l__stex_statements_definiendum_post_tl + } { \l_stex_get_symbol_uri_str } + } +} +\stex_deactivate_macro:Nn \definame {definition~environments} + +\NewDocumentCommand \Definame { O{} m } { + \__stex_statements_definiendum_args:n { #1 } + \stex_get_symbol:n { #2 } + \str_set:Nx \l_tmpa_str { + \prop_item:cn { l_stex_symdecl_ \l_stex_get_symbol_uri_str _prop } { name } + } + \exp_args:NNno \str_replace_all:Nnn \l_tmpa_str {-} {~} + \stex_ref_new_sym_target:n \l_stex_get_symbol_uri_str + \rustex_if:TF { + \stex_annotate:nnn { definiendum } { \l_stex_get_symbol_uri_str } { + \l_tmpa_str\l__stex_statements_definiendum_post_tl + } + } { + \defemph@uri { + \exp_after:wN \stex_capitalize:n \l_tmpa_str\l__stex_statements_definiendum_post_tl + } { \l_stex_get_symbol_uri_str } + } +} +\stex_deactivate_macro:Nn \Definame {definition~environments} + +\NewDocumentCommand \premise { m }{ + \stex_annotate:nnn{ premise }{}{ #1 } +} +\NewDocumentCommand \conclusion { m }{ + \stex_annotate:nnn{ conclusion }{}{ #1 } +} +\NewDocumentCommand \definiens { m }{ + \stex_annotate:nnn{ definiens }{}{ #1 } +} + +\stex_deactivate_macro:Nn \premise {definition,~example~or~assertion~environments} +\stex_deactivate_macro:Nn \conclusion {example~or~assertion~environments} +\stex_deactivate_macro:Nn \definiens {definition~environments} + + +\keys_define:nn {stex / sdefinition }{ + type .str_set_x:N = \sdefinitiontype, + id .str_set_x:N = \sdefinitionid, + name .str_set_x:N = \sdefinitionname, + for .clist_set:N = \l__stex_statements_sdefinition_for_clist , + title .tl_set:N = \sdefinitiontitle +} +\cs_new_protected:Nn \__stex_statements_sdefinition_args:n { + \str_clear:N \sdefinitiontype + \str_clear:N \sdefinitionid + \str_clear:N \sdefinitionname + \clist_clear:N \l__stex_statements_sdefinition_for_clist + \tl_clear:N \sdefinitiontitle + \keys_set:nn { stex / sdefinition }{ #1 } +} + +\NewDocumentEnvironment{sdefinition}{O{}}{ + \__stex_statements_sdefinition_args:n{ #1 } + \stex_reactivate_macro:N \definiendum + \stex_reactivate_macro:N \definame + \stex_reactivate_macro:N \Definame + \stex_reactivate_macro:N \premise + \stex_reactivate_macro:N \definiens + \stex_if_smsmode:F{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_statements_sdefinition_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnnx + \begin{stex_annotate_env}{definition}{\seq_use:Nn \l_tmpa_seq {,}} + \str_if_empty:NF \sdefinitiontype { + \stex_annotate_invisible:nnn{type}{\sdefinitiontype}{} + } + \clist_set:No \l_tmpa_clist \sdefinitiontype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_statements_sdefinition_##1_start:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_statements_sdefinition_##1_start:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_statements_sdefinition_start: + }{ + \l_tmpa_tl + } + } + \stex_ref_new_doc_target:n \sdefinitionid + \stex_smsmode_do: +}{ + \str_if_empty:NF \sdefinitionname { \stex_symdecl_do:nn{}{\sdefinitionname} } + \stex_if_smsmode:F { + \clist_set:No \l_tmpa_clist \sdefinitiontype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_statements_sdefinition_##1_end:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_statements_sdefinition_##1_end:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_statements_sdefinition_end: + }{ + \l_tmpa_tl + } + \end{stex_annotate_env} + } +} +\cs_new_protected:Nn \__stex_statements_sdefinition_start: { + \par\noindent\titleemph{Definition\tl_if_empty:NF \sdefinitiontitle { + ~(\sdefinitiontitle) + }~} +} +\cs_new_protected:Nn \__stex_statements_sdefinition_end: {\par\medskip} + +\newcommand\stexpatchdefinition[3][] { + \str_set:Nx \l_tmpa_str{ #1 } + \str_if_empty:NTF \l_tmpa_str { + \tl_set:Nn \__stex_statements_sdefinition_start: { #2 } + \tl_set:Nn \__stex_statements_sdefinition_end: { #3 } + }{ + \exp_after:wN \tl_set:Nn \csname __stex_statements_sdefinition_#1_start:\endcsname{ #2 } + \exp_after:wN \tl_set:Nn \csname __stex_statements_sdefinition_#1_end:\endcsname{ #3 } + } +} +\keys_define:nn {stex / inlinedef }{ + type .str_set_x:N = \sdefinitiontype, + id .str_set_x:N = \sdefinitionid, + for .clist_set:N = \l__stex_statements_sdefinition_for_clist , + name .str_set_x:N = \sdefinitionname +} +\cs_new_protected:Nn \__stex_statements_inlinedef_args:n { + \str_clear:N \sdefinitiontype + \str_clear:N \sdefinitionid + \str_clear:N \sdefinitionname + \clist_clear:N \l__stex_statements_sdefinition_for_clist + \keys_set:nn { stex / inlinedef }{ #1 } +} +\NewDocumentCommand \inlinedef { O{} m } { + \begingroup + \__stex_statements_inlinedef_args:n{ #1 } + \stex_reactivate_macro:N \definiendum + \stex_reactivate_macro:N \definame + \stex_reactivate_macro:N \Definame + \stex_reactivate_macro:N \premise + \stex_reactivate_macro:N \definiens + \stex_ref_new_doc_target:n \sdefinitionid + \stex_if_smsmode:TF{ + \str_if_empty:NF \sdefinitionname { \stex_symdecl_do:nn{}{\sdefinitionname} } + }{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_statements_sdefinition_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnx + \stex_annotate:nnn{definition}{\seq_use:Nn \l_tmpa_seq {,}}{ + \str_if_empty:NF \sdefinitiontype { + \stex_annotate_invisible:nnn{type}{\sdefinitiontype}{} + } + #2 + \str_if_empty:NF \sdefinitionname { \stex_symdecl_do:nn{}{\sdefinitionname} } + } + } + \endgroup + \stex_smsmode_do: +} + +\keys_define:nn {stex / sassertion }{ + type .str_set_x:N = \sassertiontype, + id .str_set_x:N = \sassertionid, + title .tl_set:N = \sassertiontitle , + for .clist_set:N = \l__stex_statements_sassertion_for_clist , + name .str_set_x:N = \sassertionname +} +\cs_new_protected:Nn \__stex_statements_sassertion_args:n { + \str_clear:N \sassertiontype + \str_clear:N \sassertionid + \str_clear:N \sassertionname + \clist_clear:N \l__stex_statements_sassertion_for_clist + \tl_clear:N \sassertiontitle + \keys_set:nn { stex / sassertion }{ #1 } +} + + +\NewDocumentEnvironment{sassertion}{O{}}{ + \__stex_statements_sassertion_args:n{ #1 } + \stex_reactivate_macro:N \premise + \stex_reactivate_macro:N \conclusion + \stex_if_smsmode:F { + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_statements_sassertion_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnnx + \begin{stex_annotate_env}{assertion}{\seq_use:Nn \l_tmpa_seq {,}} + \str_if_empty:NF \sassertiontype { + \stex_annotate_invisible:nnn{type}{\sassertiontype}{} + } + \clist_set:No \l_tmpa_clist \sassertiontype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_statements_sassertion_##1_start:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_statements_sassertion_##1_start:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_statements_sassertion_start: + }{ + \l_tmpa_tl + } + } + \str_if_empty:NTF \sassertionid { + \str_if_empty:NF \sassertionname { + \stex_ref_new_doc_target:n {} + } + } { + \stex_ref_new_doc_target:n \sassertionid + } + \stex_smsmode_do: +}{ + \str_if_empty:NF \sassertionname { + \stex_symdecl_do:nn{}{\sassertionname} + \stex_ref_new_sym_target:n {\l_stex_current_module_str ? \sassertionname} + } + \stex_if_smsmode:F { + \clist_set:No \l_tmpa_clist \sassertiontype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_statements_sassertion_##1_end:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_statements_sassertion_##1_end:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_statements_sassertion_end: + }{ + \l_tmpa_tl + } + \end{stex_annotate_env} + } +} + +\cs_new_protected:Nn \__stex_statements_sassertion_start: { + \par\noindent\titleemph{Assertion~\tl_if_empty:NF \sassertiontitle { + (\sassertiontitle) + }~} +} +\cs_new_protected:Nn \__stex_statements_sassertion_end: {\par\medskip} + +\newcommand\stexpatchassertion[3][] { + \str_set:Nx \l_tmpa_str{ #1 } + \str_if_empty:NTF \l_tmpa_str { + \tl_set:Nn \__stex_statements_sassertion_start: { #2 } + \tl_set:Nn \__stex_statements_sassertion_end: { #3 } + }{ + \exp_after:wN \tl_set:Nn \csname __stex_statements_sassertion_#1_start:\endcsname{ #2 } + \exp_after:wN \tl_set:Nn \csname __stex_statements_sassertion_#1_end:\endcsname{ #3 } + } +} +\keys_define:nn {stex / inlineass }{ + type .str_set_x:N = \sassertiontype, + id .str_set_x:N = \sassertionid, + for .clist_set:N = \l__stex_statements_sassertion_for_clist , + name .str_set_x:N = \sassertionname +} +\cs_new_protected:Nn \__stex_statements_inlineass_args:n { + \str_clear:N \sassertiontype + \str_clear:N \sassertionid + \str_clear:N \sassertionname + \clist_clear:N \l__stex_statements_sassertion_for_clist + \keys_set:nn { stex / inlineass }{ #1 } +} +\NewDocumentCommand \inlineass { O{} m } { + \begingroup + \stex_reactivate_macro:N \premise + \stex_reactivate_macro:N \conclusion + \__stex_statements_inlineass_args:n{ #1 } + \str_if_empty:NTF \sassertionid { + \str_if_empty:NF \sassertionname { + \stex_ref_new_doc_target:n {} + } + } { + \stex_ref_new_doc_target:n \sassertionid + } + + \stex_if_smsmode:TF{ + \str_if_empty:NF \sassertionname { + \stex_symdecl_do:nn{}{\sassertionname} + \stex_ref_new_sym_target:n {\l_stex_current_module_str ? \sassertionname} + } + }{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_statements_sassertion_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnx + \stex_annotate:nnn{assertion}{\seq_use:Nn \l_tmpa_seq {,}}{ + \str_if_empty:NF \sassertiontype { + \stex_annotate_invisible:nnn{type}{\sassertiontype}{} + } + #2 + \str_if_empty:NF \sassertionname { + \stex_symdecl_do:nn{}{\sassertionname} + \stex_ref_new_sym_target:n {\l_stex_current_module_str ? \sassertionname} + } + } + } + \endgroup + \stex_smsmode_do: +} + +\keys_define:nn {stex / sexample }{ + type .str_set_x:N = \exampletype, + id .str_set_x:N = \sexampleid, + title .tl_set:N = \sexampletitle, + for .clist_set:N = \l__stex_statements_sexample_for_clist, +} +\cs_new_protected:Nn \__stex_statements_sexample_args:n { + \str_clear:N \sexampletype + \str_clear:N \sexampleid + \tl_clear:N \sexampletitle + \clist_clear:N \l__stex_statements_sexample_for_clist + \keys_set:nn { stex / sexample }{ #1 } +} + +\NewDocumentEnvironment{sexample}{O{}}{ + \__stex_statements_sexample_args:n{ #1 } + \stex_reactivate_macro:N \premise + \stex_reactivate_macro:N \conclusion + \stex_if_smsmode:F { + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_statements_sexample_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnnx + \begin{stex_annotate_env}{example}{\seq_use:Nn \l_tmpa_seq {,}} + \str_if_empty:NF \sexampletype { + \stex_annotate_invisible:nnn{type}{\sexampletype}{} + } + \clist_set:No \l_tmpa_clist \sexampletype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_statements_sexample_##1_start:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_statements_sexample_##1_start:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_statements_sexample_start: + }{ + \l_tmpa_tl + } + } + \str_if_empty:NF \sexampleid { + \stex_ref_new_doc_target:n \sexampleid + } + \stex_smsmode_do: +}{ + \str_if_empty:NF \sexamplename { \stex_symdecl_do:nn{}{\sexamplename} } + \stex_if_smsmode:F { + \clist_set:No \l_tmpa_clist \sexampletype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_statements_sexample_##1_end:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_statements_sexample_##1_end:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_statements_sexample_end: + }{ + \l_tmpa_tl + } + \end{stex_annotate_env} + } +} + +\cs_new_protected:Nn \__stex_statements_sexample_start: { + \par\noindent\titleemph{Example~\tl_if_empty:NF \sexampletitle { + (\sexampletitle) + }~} +} +\cs_new_protected:Nn \__stex_statements_sexample_end: {\par\medskip} + +\newcommand\stexpatchexample[3][] { + \str_set:Nx \l_tmpa_str{ #1 } + \str_if_empty:NTF \l_tmpa_str { + \tl_set:Nn \__stex_statements_sexample_start: { #2 } + \tl_set:Nn \__stex_statements_sexample_end: { #3 } + }{ + \exp_after:wN \tl_set:Nn \csname __stex_statements_sexample_#1_start:\endcsname{ #2 } + \exp_after:wN \tl_set:Nn \csname __stex_statements_sexample_#1_end:\endcsname{ #3 } + } +} +\keys_define:nn {stex / inlineex }{ + type .str_set_x:N = \sexampletype, + id .str_set_x:N = \sexampleid, + for .clist_set:N = \l__stex_statements_sexample_for_clist , + name .str_set_x:N = \sexamplename +} +\cs_new_protected:Nn \__stex_statements_inlineex_args:n { + \str_clear:N \sexampletype + \str_clear:N \sexampleid + \str_clear:N \sexamplename + \clist_clear:N \l__stex_statements_sexample_for_clist + \keys_set:nn { stex / inlineex }{ #1 } +} +\NewDocumentCommand \inlineex { O{} m } { + \begingroup + \stex_reactivate_macro:N \premise + \stex_reactivate_macro:N \conclusion + \__stex_statements_inlineex_args:n{ #1 } + \str_if_empty:NF \sexampleid { + \stex_ref_new_doc_target:n \sexampleid + } + \stex_if_smsmode:TF{ + \str_if_empty:NF \sexamplename { \stex_symdecl_do:nn{}{\examplename} } + }{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_statements_sexample_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnx + \stex_annotate:nnn{example}{\seq_use:Nn \l_tmpa_seq {,}}{ + \str_if_empty:NF \sexampletype { + \stex_annotate_invisible:nnn{type}{\sexampletype}{} + } + #2 + \str_if_empty:NF \sexamplename { \stex_symdecl_do:nn{}{\sexamplename} } + } + } + \endgroup + \stex_smsmode_do: +} +\keys_define:nn { stex / sparagraph} { + id .str_set_x:N = \sparagraphid , + title .tl_set:N = \l_stex_sparagraph_title_tl , + type .str_set_x:N = \sparagraphtype , + for .clist_set:N = \l__stex_statements_sparagraph_for_clist , + from .tl_set:N = \sparagraphfrom , + to .tl_set:N = \sparagraphto , + start .tl_set:N = \l_stex_sparagraph_start_tl , + name .str_set:N = \sparagraphname +} + +\cs_new_protected:Nn \stex_sparagraph_args:n { + \tl_clear:N \l_stex_sparagraph_title_tl + \tl_clear:N \sparagraphfrom + \tl_clear:N \sparagraphto + \tl_clear:N \l_stex_sparagraph_start_tl + \str_clear:N \sparagraphid + \str_clear:N \sparagraphtype + \clist_clear:N \l__stex_statements_sparagraph_for_clist + \str_clear:N \sparagraphname + \keys_set:nn { stex / sparagraph }{ #1 } +} +\newif\if@in@omtext\@in@omtextfalse + +\NewDocumentEnvironment {sparagraph} { O{} } { + \stex_sparagraph_args:n { #1 } + \tl_if_empty:NTF \l_stex_sparagraph_start_tl { + \tl_set_eq:NN \sparagraphtitle \l_stex_sparagraph_title_tl + }{ + \tl_set_eq:NN \sparagraphtitle \l_stex_sparagraph_start_tl + } + \@in@omtexttrue + \stex_if_smsmode:F { + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_statements_sparagraph_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnnx + \begin{stex_annotate_env}{paragraph}{\seq_use:Nn \l_tmpa_seq {,}} + \str_if_empty:NF \sparagraphtype { + \stex_annotate_invisible:nnn{type}{\sparagraphtype}{} + } + \str_if_empty:NF \sparagraphfrom { + \stex_annotate_invisible:nnn{from}{\sparagraphfrom}{} + } + \str_if_empty:NF \sparagraphto { + \stex_annotate_invisible:nnn{to}{\sparagraphto}{} + } + \clist_set:No \l_tmpa_clist \sparagraphtype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \sparagraphtype { + \tl_if_exist:cT {__stex_statements_sparagraph_##1_start:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_statements_sparagraph_##1_start:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_statements_sparagraph_start: + }{ + \l_tmpa_tl + } + } + \clist_set:No \l_tmpa_clist \sparagraphtype + \str_if_empty:NTF \sparagraphid { + \str_if_empty:NTF \sparagraphname { + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\tl_to_str:n{symdoc}}{ + \stex_ref_new_doc_target:n {} + } + } { + \stex_ref_new_doc_target:n {} + } + } { + \stex_ref_new_doc_target:n \sparagraphid + } + \exp_args:NNx + \clist_if_in:NnT \l_tmpa_clist {\tl_to_str:n{symdoc}}{ + \clist_map_inline:Nn \l__stex_statements_sparagraph_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \stex_ref_new_sym_target:n \l_stex_get_symbol_uri_str + } + } + } + \stex_smsmode_do: + \ignorespacesandpars +}{ + \str_if_empty:NF \sparagraphname { + \stex_symdecl_do:nn{}{\sparagraphname} + \stex_ref_new_sym_target:n {\l_stex_current_module_str ? \sparagraphname} + } + \stex_if_smsmode:F { + \clist_set:No \l_tmpa_clist \sparagraphtype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_statements_sparagraph_##1_end:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_statements_sparagraph_##1_end:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_statements_sparagraph_end: + }{ + \l_tmpa_tl + } + \end{stex_annotate_env} + } +} + +\cs_new_protected:Nn \__stex_statements_sparagraph_start: { + \par\noindent\tl_if_empty:NTF \l_stex_sparagraph_start_tl { + \tl_if_empty:NF \l_stex_sparagraph_title_tl { + \titleemph{\l_stex_sparagraph_title_tl}:~ + } + }{ + \titleemph{\l_stex_sparagraph_start_tl}~ + } +} +\cs_new_protected:Nn \__stex_statements_sparagraph_end: {\par\medskip} + +\newcommand\stexpatchparagraph[3][] { + \str_set:Nx \l_tmpa_str{ #1 } + \str_if_empty:NTF \l_tmpa_str { + \tl_set:Nn \__stex_statements_sparagraph_start: { #2 } + \tl_set:Nn \__stex_statements_sparagraph_end: { #3 } + }{ + \exp_after:wN \tl_set:Nn \csname __stex_statements_sparagraph_#1_start:\endcsname{ #2 } + \exp_after:wN \tl_set:Nn \csname __stex_statements_sparagraph_#1_end:\endcsname{ #3 } + } +} + +\keys_define:nn { stex / inlinepara} { + id .str_set_x:N = \sparagraphid , + type .str_set_x:N = \sparagraphtype , + for .clist_set:N = \l__stex_statements_sparagraph_for_clist , + from .tl_set:N = \sparagraphfrom , + to .tl_set:N = \sparagraphto , + name .str_set:N = \sparagraphname +} +\cs_new_protected:Nn \__stex_statements_inlinepara_args:n { + \tl_clear:N \sparagraphfrom + \tl_clear:N \sparagraphto + \str_clear:N \sparagraphid + \str_clear:N \sparagraphtype + \clist_clear:N \l__stex_statements_sparagraph_for_clist + \str_clear:N \sparagraphname + \keys_set:nn { stex / inlinepara }{ #1 } +} +\NewDocumentCommand \inlinepara { O{} m } { + \begingroup + \__stex_statements_inlinepara_args:n{ #1 } + \clist_set:No \l_tmpa_clist \sparagraphtype + \str_if_empty:NTF \sparagraphid { + \str_if_empty:NTF \sparagraphname { + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\tl_to_str:n{symdoc}}{ + \stex_ref_new_doc_target:n {} + } + } { + \stex_ref_new_doc_target:n {} + } + } { + \stex_ref_new_doc_target:n \sparagraphid + } + \stex_if_smsmode:TF{ + \str_if_empty:NF \sparagraphname { + \stex_symdecl_do:nn{}{\sparagraphname} + \stex_ref_new_sym_target:n {\l_stex_current_module_str ? \sparagraphname} + } + }{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_statements_sparagraph_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnx + \stex_annotate:nnn{paragraph}{\seq_use:Nn \l_tmpa_seq {,}}{ + \str_if_empty:NF \sparagraphtype { + \stex_annotate_invisible:nnn{type}{\sparagraphtype}{} + } + \str_if_empty:NF \sparagraphfrom { + \stex_annotate_invisible:nnn{from}{\sparagraphfrom}{} + } + \str_if_empty:NF \sparagraphto { + \stex_annotate_invisible:nnn{to}{\sparagraphto}{} + } + \str_if_empty:NF \sparagraphname { + \stex_symdecl_do:nn{}{\sparagraphname} + \stex_ref_new_sym_target:n {\l_stex_current_module_str ? \sparagraphname} + } + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\tl_to_str:n{symdoc}}{ + \clist_map_inline:Nn \l_tmpa_seq { + \stex_ref_new_sym_target:n {##1} + } + } + #2 + } + } + \endgroup + \stex_smsmode_do: +} + + + +%%%%%%%%%%%%% sproof.dtx %%%%%%%%%%%%% + +\keys_define:nn { stex / spf } { + id .str_set_x:N = \spfid, + for .clist_set:N = \l__stex_sproof_spf_for_clist , + from .tl_set:N = \l__stex_sproof_spf_from_tl , + proofend .tl_set:N = \l__stex_sproof_spf_proofend_tl, + type .str_set_x:N = \spftype, + title .tl_set:N = \spftitle, + continues .tl_set:N = \l__stex_sproof_spf_continues_tl, + functions .tl_set:N = \l__stex_sproof_spf_functions_tl, + method .tl_set:N = \l__stex_sproof_spf_method_tl +} +\cs_new_protected:Nn \__stex_sproof_spf_args:n { +\str_clear:N \spfid +\tl_clear:N \l__stex_sproof_spf_for_tl +\tl_clear:N \l__stex_sproof_spf_from_tl +\tl_set:Nn \l__stex_sproof_spf_proofend_tl {\sproof@box} +\str_clear:N \spftype +\tl_clear:N \spftitle +\tl_clear:N \l__stex_sproof_spf_continues_tl +\tl_clear:N \l__stex_sproof_spf_functions_tl +\tl_clear:N \l__stex_sproof_spf_method_tl + \bool_set_false:N \l__stex_sproof_inc_counter_bool +\keys_set:nn { stex / spf }{ #1 } +} +\str_set:Nn\c__stex_sproof_flow_str{inline} +\intarray_new:Nn\l__stex_sproof_counter_intarray{50} +\cs_new_protected:Npn \sproofnumber { + \int_set:Nn \l_tmpa_int {1} + \bool_while_do:nn { + \int_compare_p:nNn { + \intarray_item:Nn \l__stex_sproof_counter_intarray \l_tmpa_int + } > 0 + }{ + \intarray_item:Nn \l__stex_sproof_counter_intarray \l_tmpa_int . + \int_incr:N \l_tmpa_int + } +} +\cs_new_protected:Npn \__stex_sproof_inc_counter: { + \int_set:Nn \l_tmpa_int {1} + \bool_while_do:nn { + \int_compare_p:nNn { + \intarray_item:Nn \l__stex_sproof_counter_intarray \l_tmpa_int + } > 0 + }{ + \int_incr:N \l_tmpa_int + } + \int_compare:nNnF \l_tmpa_int = 1 { + \int_decr:N \l_tmpa_int + } + \intarray_gset:Nnn \l__stex_sproof_counter_intarray \l_tmpa_int { + \intarray_item:Nn \l__stex_sproof_counter_intarray \l_tmpa_int + 1 + } +} + +\cs_new_protected:Npn \__stex_sproof_add_counter: { + \int_set:Nn \l_tmpa_int {1} + \bool_while_do:nn { + \int_compare_p:nNn { + \intarray_item:Nn \l__stex_sproof_counter_intarray \l_tmpa_int + } > 0 + }{ + \int_incr:N \l_tmpa_int + } + \intarray_gset:Nnn \l__stex_sproof_counter_intarray \l_tmpa_int { 1 } +} + +\cs_new_protected:Npn \__stex_sproof_remove_counter: { + \int_set:Nn \l_tmpa_int {1} + \bool_while_do:nn { + \int_compare_p:nNn { + \intarray_item:Nn \l__stex_sproof_counter_intarray \l_tmpa_int + } > 0 + }{ + \int_incr:N \l_tmpa_int + } + \int_decr:N \l_tmpa_int + \intarray_gset:Nnn \l__stex_sproof_counter_intarray \l_tmpa_int { 0 } +} +\def\sproof@box{ + \hbox{\vrule\vbox{\hrule width 6 pt\vskip 6pt\hrule}\vrule} +} +\def\sproofend{ + \tl_if_empty:NF \l__stex_sproof_spf_proofend_tl { + \hfil\null\nobreak\hfill\l__stex_sproof_spf_proofend_tl\par\smallskip + } +} +\def\spf@proofsketch@kw{Proof~Sketch} +\def\spf@proof@kw{Proof} +\def\spf@step@kw{Step} +\AddToHook{begindocument}{ + \ltx@ifpackageloaded{babel}{ + \makeatletter + \clist_set:Nx \l_tmpa_clist {\bbl@loaded} + \clist_if_in:NnT \l_tmpa_clist {ngerman}{ + \input{sproof-ngerman.ldf} + } + \clist_if_in:NnT \l_tmpa_clist {finnish}{ + \input{sproof-finnish.ldf} + } + \clist_if_in:NnT \l_tmpa_clist {french}{ + \input{sproof-french.ldf} + } + \clist_if_in:NnT \l_tmpa_clist {russian}{ + \input{sproof-russian.ldf} + } + \makeatother + }{} +} +\newcommand\spfsketch[2][]{ + \begingroup + \let \premise \stex_proof_premise: + \__stex_sproof_spf_args:n{#1} + \stex_if_smsmode:TF { + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + }{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_sproof_spf_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnx + \stex_annotate:nnn{proofsketch}{\seq_use:Nn \l_tmpa_seq {,}}{ + \str_if_empty:NF \spftype { + \stex_annotate_invisible:nnn{type}{\spftype}{} + } + \clist_set:No \l_tmpa_clist \spftype + \tl_set:Nn \l_tmpa_tl { + \titleemph{ + \tl_if_empty:NTF \spftitle { + \spf@proofsketch@kw + }{ + \spftitle + } + }:~ + } + \clist_map_inline:Nn \l_tmpa_clist { + \exp_args:No \str_if_eq:nnT \c__stex_sproof_flow_str {##1} { + \tl_clear:N \l_tmpa_tl + } + } + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + \l_tmpa_tl #2 \sproofend + } + } + \endgroup + \stex_smsmode_do: +} + +\newenvironment{spfeq}[2][]{ + \__stex_sproof_spf_args:n{#1} + \let \premise \stex_proof_premise: + \stex_if_smsmode:TF { + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + }{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_sproof_spf_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnnx + \begin{stex_annotate_env}{spfeq}{\seq_use:Nn \l_tmpa_seq {,}} + \str_if_empty:NF \spftype { + \stex_annotate_invisible:nnn{type}{\spftype}{} + } + + \clist_set:No \l_tmpa_clist \spftype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_sproof_spfeq_##1_start:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_sproof_spfeq_##1_start:}} + } + \exp_args:No \str_if_eq:nnT \c__stex_sproof_flow_str {##1} { + \tl_set:Nn \l_tmpa_tl {\use:n{}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_sproof_spfeq_start: + }{ + \l_tmpa_tl + }{~#2} + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + \begin{displaymath}\begin{array}{rcll} + } + \stex_smsmode_do: +}{ + \stex_if_smsmode:F { + \end{array}\end{displaymath} + \clist_set:No \l_tmpa_clist \spftype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_sproof_spfeq_##1_end:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_sproof_spfeq_##1_end:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_sproof_spfeq_end: + }{ + \l_tmpa_tl + } + \end{stex_annotate_env} + } +} + +\cs_new_protected:Nn \__stex_sproof_spfeq_start: { + \titleemph{ + \tl_if_empty:NTF \spftitle { + \spf@proof@kw + }{ + \spftitle + } + }: +} +\cs_new_protected:Nn \__stex_sproof_spfeq_end: {\sproofend} + +\newcommand\stexpatchspfeq[3][] { + \str_set:Nx \l_tmpa_str{ #1 } + \str_if_empty:NTF \l_tmpa_str { + \tl_set:Nn \__stex_sproof_spfeq_start: { #2 } + \tl_set:Nn \__stex_sproof_spfeq_end: { #3 } + }{ + \exp_after:wN \tl_set:Nn \csname __stex_sproof_spfeq_#1_start:\endcsname{ #2 } + \exp_after:wN \tl_set:Nn \csname __stex_sproof_spfeq_#1_end:\endcsname{ #3 } + } +} + +\newenvironment{sproof}[2][]{ + \let \premise \stex_proof_premise: + \intarray_gzero:N \l__stex_sproof_counter_intarray + \intarray_gset:Nnn \l__stex_sproof_counter_intarray 1 1 + \__stex_sproof_spf_args:n{#1} + \stex_if_smsmode:TF { + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + }{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_sproof_spf_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnnx + \begin{stex_annotate_env}{sproof}{\seq_use:Nn \l_tmpa_seq {,}} + \str_if_empty:NF \spftype { + \stex_annotate_invisible:nnn{type}{\spftype}{} + } + + \clist_set:No \l_tmpa_clist \spftype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_sproof_sproof_##1_start:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_sproof_sproof_##1_start:}} + } + \exp_args:No \str_if_eq:nnT \c__stex_sproof_flow_str {##1} { + \tl_set:Nn \l_tmpa_tl {\use:n{}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_sproof_sproof_start: + }{ + \l_tmpa_tl + }{~#2} + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + \begin{description} + } + \stex_smsmode_do: +}{ + \stex_if_smsmode:F{ + \end{description} + \clist_set:No \l_tmpa_clist \spftype + \tl_clear:N \l_tmpa_tl + \clist_map_inline:Nn \l_tmpa_clist { + \tl_if_exist:cT {__stex_sproof_sproof_##1_end:}{ + \tl_set:Nn \l_tmpa_tl {\use:c{__stex_sproof_sproof_##1_end:}} + } + } + \tl_if_empty:NTF \l_tmpa_tl { + \__stex_sproof_sproof_end: + }{ + \l_tmpa_tl + } + \end{stex_annotate_env} + } +} + +\cs_new_protected:Nn \__stex_sproof_sproof_start: { + \par\noindent\titleemph{ + \tl_if_empty:NTF \spftype { + \spf@proof@kw + }{ + \spftype + } + }: +} +\cs_new_protected:Nn \__stex_sproof_sproof_end: {\sproofend} + +\newcommand\stexpatchsproof[3][] { + \str_set:Nx \l_tmpa_str{ #1 } + \str_if_empty:NTF \l_tmpa_str { + \tl_set:Nn \__stex_sproof_sproof_start: { #2 } + \tl_set:Nn \__stex_sproof_sproof_end: { #3 } + }{ + \exp_after:wN \tl_set:Nn \csname __stex_sproof_sproof_#1_start:\endcsname{ #2 } + \exp_after:wN \tl_set:Nn \csname __stex_sproof_sproof_#1_end:\endcsname{ #3 } + } +} +\newcommand\spfidea[2][]{ + \__stex_sproof_spf_args:n{#1} + \titleemph{ + \tl_if_empty:NTF \spftype {Proof~Idea}{ + \spftype + }: + }~#2 + \sproofend +} +\newenvironment{spfstep}[1][]{ + \__stex_sproof_spf_args:n{#1} + \stex_if_smsmode:TF { + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + }{ + \@in@omtexttrue + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_sproof_spf_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnnx + \begin{stex_annotate_env}{spfstep}{\seq_use:Nn \l_tmpa_seq {,}} + \str_if_empty:NF \spftype { + \stex_annotate_invisible:nnn{type}{\spftype}{} + } + \clist_set:No \l_tmpa_clist \spftype + \tl_set:Nn \l_tmpa_tl { + \item[\sproofnumber] + \bool_set_true:N \l__stex_sproof_inc_counter_bool + } + \clist_map_inline:Nn \l_tmpa_clist { + \exp_args:No \str_if_eq:nnT \c__stex_sproof_flow_str {##1} { + \tl_clear:N \l_tmpa_tl + } + } + \l_tmpa_tl + \tl_if_empty:NF \spftitle { + {(\titleemph{\spftitle})\enspace} + } + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + } + \stex_smsmode_do: + \ignorespacesandpars +}{ + \bool_if:NT \l__stex_sproof_inc_counter_bool { + \__stex_sproof_inc_counter: + } + \stex_if_smsmode:F { + \end{stex_annotate_env} + } +} +\newenvironment{sproofcomment}[1][]{ + \__stex_sproof_spf_args:n{#1} + \clist_set:No \l_tmpa_clist \spftype + \tl_set:Nn \l_tmpa_tl { + \item[\sproofnumber] + \bool_set_true:N \l__stex_sproof_inc_counter_bool + } + \clist_map_inline:Nn \l_tmpa_clist { + \exp_args:No \str_if_eq:nnT \c__stex_sproof_flow_str {##1} { + \tl_clear:N \l_tmpa_tl + } + } + \l_tmpa_tl +}{ + \bool_if:NT \l__stex_sproof_inc_counter_bool { + \__stex_sproof_inc_counter: + } +} +\newenvironment{subproof}[2][]{ + \__stex_sproof_spf_args:n{#1} + \stex_if_smsmode:TF{ + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + }{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_sproof_spf_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnnx + \begin{stex_annotate_env}{subproof}{\seq_use:Nn \l_tmpa_seq {,}} + \str_if_empty:NF \spftype { + \stex_annotate_invisible:nnn{type}{\spftype}{} + } + + \clist_set:No \l_tmpa_clist \spftype + \tl_set:Nn \l_tmpa_tl { + \item[\sproofnumber] + \bool_set_true:N \l__stex_sproof_inc_counter_bool + } + \clist_map_inline:Nn \l_tmpa_clist { + \exp_args:No \str_if_eq:nnT \c__stex_sproof_flow_str {##1} { + \tl_clear:N \l_tmpa_tl + } + } + \l_tmpa_tl + \tl_if_empty:NF \spftitle { + {(\titleemph{\spftitle})\enspace} + } + {~#2} + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + } + \__stex_sproof_add_counter: + \stex_smsmode_do: +}{ + \__stex_sproof_remove_counter: + \bool_if:NT \l__stex_sproof_inc_counter_bool { + \__stex_sproof_inc_counter: + } + \stex_if_smsmode:F{ + \end{stex_annotate_env} + } +} +\newenvironment{spfcases}[2][]{ + \tl_if_empty:nTF{#1}{ + \begin{subproof}[method=by-cases]{#2} + }{ + \begin{subproof}[#1,method=by-cases]{#2} + } +}{ + \end{subproof} +} +\newenvironment{spfcase}[2][]{ + \__stex_sproof_spf_args:n{#1} + \stex_if_smsmode:TF { + \str_if_empty:NF \spfid { + \stex_ref_new_doc_target:n \spfid + } + }{ + \seq_clear:N \l_tmpa_seq + \clist_map_inline:Nn \l__stex_sproof_spf_for_clist { + \tl_if_empty:nF{ ##1 }{ + \stex_get_symbol:n { ##1 } + \exp_args:NNo \seq_put_right:Nn \l_tmpa_seq { + \l_stex_get_symbol_uri_str + } + } + } + \exp_args:Nnnx + \begin{stex_annotate_env}{spfcase}{\seq_use:Nn \l_tmpa_seq {,}} + \str_if_empty:NF \spftype { + \stex_annotate_invisible:nnn{type}{\spftype}{} + } + \clist_set:No \l_tmpa_clist \spftype + \tl_set:Nn \l_tmpa_tl { + \item[\sproofnumber] + \bool_set_true:N \l__stex_sproof_inc_counter_bool + } + \clist_map_inline:Nn \l_tmpa_clist { + \exp_args:No \str_if_eq:nnT \c__stex_sproof_flow_str {##1} { + \tl_clear:N \l_tmpa_tl + } + } + \l_tmpa_tl + \tl_if_empty:nF{#2}{ + \titleemph{#2}:~ + } + } + \__stex_sproof_add_counter: + \stex_smsmode_do: +}{ + \__stex_sproof_remove_counter: + \bool_if:NT \l__stex_sproof_inc_counter_bool { + \__stex_sproof_inc_counter: + } + \stex_if_smsmode:F{ + \clist_set:No \l_tmpa_clist \spftype + \tl_set:Nn \l_tmpa_tl{\sproofend} + \clist_map_inline:Nn \l_tmpa_clist { + \exp_args:No \str_if_eq:nnT \c__stex_sproof_flow_str {##1} { + \tl_clear:N \l_tmpa_tl + } + } + \l_tmpa_tl + \end{stex_annotate_env} + } +} +\newcommand\spfcasesketch[3][]{ + \begin{spfcase}[#1]{#2}#3\end{spfcase} +} +\keys_define:nn { stex / just }{ + id .str_set_x:N = \l__stex_sproof_just_id_str, + method .tl_set:N = \l__stex_sproof_just_method_tl, + premises .tl_set:N = \l__stex_sproof_just_premises_tl, + args .tl_set:N = \l__stex_sproof_just_args_tl +} +\newenvironment{justification}[1][]{}{} +\newcommand\stex_proof_premise:[2][]{#2} +\newcommand\justarg[2][]{#2} + +%%%%%%%%%%%%% others.dtx %%%%%%%%%%%%% + + % None +\NewDocumentCommand \MSC {m} { + % TODO +} +\@ifpackageloaded{tikzinput}{ + \RequirePackage{stex-tikzinput} +}{} + +%%%%%%%%%%%%% metatheory.dtx %%%%%%%%%%%%% + +\str_const:Nn \c_stex_metatheory_ns_str {http://mathhub.info/sTeX} +\begingroup +\stex_module_setup:nn{ + ns=\c_stex_metatheory_ns_str, + meta=NONE +}{Metatheory} +\stex_reactivate_macro:N \symdecl +\stex_reactivate_macro:N \notation +\stex_reactivate_macro:N \symdef +\ExplSyntaxOff +\csname stex_suppress_html:n\endcsname{ + % is-a (a:A, a \in A, a is an A, etc.) + \symdecl{isa}[args=ai] + \notation{isa}[typed]{#1 \comp{:} #2}{##1 \comp, ##2} + \notation{isa}[in]{#1 \comp\in #2}{##1 \comp, ##2} + \notation{isa}[pred]{#2\comp(#1 \comp)}{##1 \comp, ##2} + + % bind (\forall, \Pi, \lambda etc.) + \symdecl{bind}[args=Bi] + \notation{bind}[forall]{\comp\forall #1.\;#2}{##1 \comp, ##2} + \notation{bind}[Pi]{\comp\prod_{#1}#2}{##1 \comp, ##2} + \notation{bind}[depfun]{\comp( #1 \comp{)\;\to\;} #2}{##1 \comp, ##2} + + % dummy variable + \symdecl{dummyvar} + \notation{dummyvar}[underscore]{\comp\_} + \notation{dummyvar}[dot]{\comp\cdot} + \notation{dummyvar}[dash]{\comp{{\rm --}}} + + %fromto (function space, Hom-set, implication etc.) + \symdecl{fromto}[args=ai] + \notation{fromto}[xarrow]{#1 \comp\to #2}{##1 \comp\times ##2} + \notation{fromto}[arrow]{#1 \comp\to #2}{##1 \comp\to ##2} + + % mapto (lambda etc.) + %\symdecl{mapto}[args=Bi] + %\notation{mapto}[mapsto]{#1 \comp\mapsto #2}{#1 \comp, #2} + %\notation{mapto}[lambda]{\comp\lambda #1 \comp.\; #2}{#1 \comp, #2} + %\notation{mapto}[lambdau]{\comp\lambda_{#1} \comp.\; #2}{#1 \comp, #2} + + % function/operator application + \symdecl{apply}[args=ia] + \notation{apply}[prec=0;0x\infprec,parens]{#1 \comp( #2 \comp)}{##1 \comp, ##2} + \notation{apply}[prec=0;0x\infprec,lambda]{#1 \; #2 }{##1 \; ##2} + + % ``type'' of all collections (sets,classes,types,kinds) + \symdecl{collection} + \notation{collection}[U]{\comp{\mathcal{U}}} + \notation{collection}[set]{\comp{\textsf{Set}}} + + % collection of propositions/booleans/truth values + \symdecl{prop}[name=proposition] + \notation{prop}[prop]{\comp{{\rm prop}}} + \notation{prop}[BOOL]{\comp{{\rm BOOL}}} + + % sequences + \symdecl{seqtype}[args=1] + \notation{seqtype}[kleene]{#1^{\comp\ast}} + + \symdef{sequence-index}[args=2,li,prec=nobrackets]{{#1}_{#2}} + \notation{sequence-index}[ui,prec=nobrackets]{{#1}^{#2}} + + \symdef{aseqdots}[args=a,prec=nobrackets]{#1\comp{,\ellipses}}{##1\comp,##2} + \symdef{aseqfromto}[args=ai,prec=nobrackets]{#1\comp{,\ellipses,}#2}{##1\comp,##2} + \symdef{aseqfromtovia}[args=aii,prec=nobrackets]{#1\comp{,\ellipses,}#2\comp{,\ellipses,}#3}{##1\comp,##2} + + % letin (``let'', local definitions, variable substitution) + \symdecl{letin}[args=bii] + \notation{letin}[let]{\comp{{\rm let}}\;#1\comp{=}#2\;\comp{{\rm in}}\;#3} + \notation{letin}[subst]{#3 \comp[ #1 \comp/ #2 \comp]} + \notation{letin}[frac]{#3 \comp[ \frac{#2}{#1} \comp]} + + % structures + \symdecl*{module-type}[args=1] + \notation{module-type}{\mathtt{MOD} #1} + \symdecl{mathstruct}[name=mathematical-structure,args=a] % TODO + \notation{mathstruct}[angle,prec=nobrackets]{\comp\langle #1 \comp\rangle}{##1 \comp, ##2} + +} + \ExplSyntaxOn + \stex_add_to_current_module:n{ + \let\nappa\apply + \def\nappli#1#2#3#4{\apply{#1}{\naseqli{#2}{#3}{#4}}} + \def\nappui#1#2#3#4{\apply{#1}{\nasequi{#2}{#3}{#4}}} + \def\livar{\csname sequence-index\endcsname[li]} + \def\uivar{\csname sequence-index\endcsname[ui]} + \def\naseqli#1#2#3{\aseqfromto{\livar{#1}{#2}}{\livar{#1}{#3}}} + \def\nasequi#1#2#3{\aseqfromto{\uivar{#1}{#2}}{\uivar{#1}{#3}}} + \def\nappe#1#2#3{\apply{#1}{\aseqfromto{#2}{#3}}} + } +\__stex_modules_end_module: +\endgroup + +\endinput +%% +%% End of file `stex.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/stex/stex.sty b/Master/texmf-dist/tex/latex/stex/stex/stex.sty deleted file mode 100644 index bfe038a120d..00000000000 --- a/Master/texmf-dist/tex/latex/stex/stex/stex.sty +++ /dev/null @@ -1,27 +0,0 @@ -%% -%% This is file `stex.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% stex.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{stex}[2019/03/20 v1.0 Semantic Markup] -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{statements} - \PassOptionsToPackage{\CurrentOption}{structview} - \PassOptionsToPackage{\CurrentOption}{sproofs} - \PassOptionsToPackage{\CurrentOption}{omdoc} - \PassOptionsToPackage{\CurrentOption}{cmath} - \PassOptionsToPackage{\CurrentOption}{dcm}} -\ProcessOptions -\RequirePackage{stex-logo} -\RequirePackage{omdoc} -\RequirePackage{statements} -\RequirePackage{structview} -\RequirePackage{sproof} -\RequirePackage{cmath} -\RequirePackage{dcm} -\endinput -%% -%% End of file `stex.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/structview/structview.sty b/Master/texmf-dist/tex/latex/stex/structview/structview.sty deleted file mode 100644 index a233ce55c13..00000000000 --- a/Master/texmf-dist/tex/latex/stex/structview/structview.sty +++ /dev/null @@ -1,89 +0,0 @@ -%% -%% This is file `structview.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% structview.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{structview}[2019/03/20 v0.9 Structures and Views] -\newif\if@structview@mh@\@structview@mh@false -\DeclareOption{mh}{\@structview@mh@true -\PassOptionsToPackage{\CurrentOption}{modules}} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{modules}} -\ProcessOptions -\if@structview@mh@\RequirePackage{structview-mh}\fi -\RequirePackage{modules} -\newrobustcmd\vassign[3][]{\ifmod@show\ensuremath{#2\mapsto #3}, \fi}% -\newrobustcmd\fassign[4][]{\ifmod@show \ensuremath{#3(#2)\mapsto #4}, \fi}% -\newrobustcmd\tassign[3][]{\ifmod@show \ensuremath{#2\mapsto} #3, \fi}% -\newenvironment{sstructure}[3][]{% - \gdef\@@doit{\importmodule[#1]{#3}}% - \ifmod@show\par\noindent importing module #3 via \@@doit\fi% -}{% - \aftergroup\@@doit\ifmod@show end import\fi% -}% -\newenvironment{importmodulevia}[2][]% -{\PackageError{structview}% - {The {importmodulevia} environment is deprecated}{use the {sstructure} instead!}% - \begin{sstructure}[#1]{missing}{#2}} -{\end{sstructure}} -\srefaddidkey{view} -\addmetakey*{view}{title} -\addmetakey{view}{display} -\addmetakey{view}{loadfrom} -\addmetakey{view}{loadto} -\addmetakey{view}{creators} -\addmetakey{view}{contributors} -\addmetakey{view}{srccite} -\addmetakey{view}{type} -\addmetakey[sms]{view}{ext} -\ifdef{\thesection}{\newcounter{view}[section]}{\newcounter{view}} -\newrobustcmd\view@heading[4]{% - \if@importing% - \else% - \stepcounter{view}% - \edef\@display{#3}\edef\@title{#4}% - \noindent% - \ifx\@display\st@flow% - \else% - {\textbf{View} {\thesection.\theview} from \textsf{#1} to \textsf{#2}}% - \sref@label@id{View \thesection.\theview}% - \ifx\@title\@empty% - \quad% - \else% - \quad(\@title)% - \fi% - \par\noindent% - \fi% - \ignorespaces% - \fi% -}%ifmod@show -\newenvironment{view}[3][]{% keys, from, to - \metasetkeys{view}{#1}% - \sref@target% - \begin{@view}{#2}{#3}% - \view@heading{#2}{#3}{\view@display}{\view@title}% -}{% - \end{@view}% - \ignorespaces% -}% -\ifmod@show\surroundwithmdframed{view}\fi% -\newenvironment{@view}[2]{%from, to - \@importmodule[\view@loadfrom]{#1}{\view@ext}% - \@importmodule[\view@loadto]{#2}{\view@ext}% -}{}% -\newenvironment{viewsketch}[3][]% -{\PackageError{structview}% - {The {viewsketch} environment is deprecated}{use the {view} instead!}% - \begin{view}[#1]{#2}{#3}} -{\end{view}} -\newrobustcmd\obligation[3][]{% - \if@importing% - \else Axiom #2 is proven by \sref{#3}% - \fi% -}% -\endinput -%% -%% End of file `structview.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/tikzinput.sty b/Master/texmf-dist/tex/latex/stex/tikzinput.sty new file mode 100644 index 00000000000..036bde9376a --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/tikzinput.sty @@ -0,0 +1,69 @@ +%% +%% This is file `tikzinput.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tikzinput.dtx (with options: `package') +%% + +%%%%%%%%%%%%% tikzinput.dtx %%%%%%%%%%%%% + +\ProvidesExplPackage{tikzinput}{2022/02/26}{3.0.1}{tikzinput package} +\RequirePackage{l3keys2e} + +\keys_define:nn { tikzinput } { + image .bool_set:N = \c_tikzinput_image_bool, + image .default:n = false , + unknown .code:n = {} +} + +\ProcessKeysOptions { tikzinput } + +\bool_if:NTF \c_tikzinput_image_bool { + \RequirePackage{graphicx} + + \providecommand\usetikzlibrary[]{} + \newcommand\tikzinput[2][]{\includegraphics[#1]{#2}} +}{ + \RequirePackage{tikz} + \RequirePackage{standalone} + + \newcommand \tikzinput [2] [] { + \setkeys{Gin}{#1} + \ifx \Gin@ewidth \Gin@exclamation + \ifx \Gin@eheight \Gin@exclamation + \input { #2 } + \else + \resizebox{!}{ \Gin@eheight }{ + \input { #2 } + } + \fi + \else + \ifx \Gin@eheight \Gin@exclamation + \resizebox{ \Gin@ewidth }{!}{ + \input { #2 } + } + \else + \resizebox{ \Gin@ewidth }{ \Gin@eheight }{ + \input { #2 } + } + \fi + \fi + } +} + +\newcommand \ctikzinput [2] [] { + \begin{center} + \tikzinput [#1] {#2} + \end{center} +} + +\@ifpackageloaded{stex}{ + \RequirePackage{stex-tikzinput} +}{} + + +\endinput +%% +%% End of file `tikzinput.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/tikzinput/tikzinput.sty b/Master/texmf-dist/tex/latex/stex/tikzinput/tikzinput.sty deleted file mode 100644 index 616f00e0cb1..00000000000 --- a/Master/texmf-dist/tex/latex/stex/tikzinput/tikzinput.sty +++ /dev/null @@ -1,40 +0,0 @@ -%% -%% This is file `tikzinput.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% tikzinput.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{tikzinput}[2019/03/20 v1.0 Selective input of TIKZ pictures] -\newif\if@tikzinput@mh@\@tikzinput@mh@false -\DeclareOption{mh}{\@tikzinput@mh@true} -\newif\iftikzinput@image\tikzinput@imagefalse -\DeclareOption{image}{\tikzinput@imagetrue} -\DeclareOption*{} -\ProcessOptions -\if@tikzinput@mh@\RequirePackage{tikzinput-mh}\fi -\iftikzinput@image -\RequirePackage{graphicx} -\providecommand\usetikzlibrary[1]{} -\else -\RequirePackage{tikz} -\RequirePackage{standalone} -\fi -\iftikzinput@image -\newcommand\tikzinput[2][]{\includegraphics[#1]{#2}} -\else -\newcommand\tikzinput[2][]{\setkeys{Gin}{#1}% -\ifx\Gin@ewidth\Gin@exclamation -\ifx\Gin@eheight\Gin@exclamation\input{#2}\else\resizebox{!}{\Gin@eheight}{\input{#2}}\fi -\else -\ifx\Gin@eheight\Gin@exclamation\resizebox{\Gin@ewidth}{!}{\input{#2}} -\else\resizebox{\Gin@ewidth}{\Gin@eheight}{\input{#2}}\fi -\fi} -\fi -\newcommand\ctikzinput[2][]{\begin{center}\tikzinput[#1]{#2}\end{center}} - -\endinput -%% -%% End of file `tikzinput.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty deleted file mode 100644 index 597a36553b9..00000000000 --- a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty +++ /dev/null @@ -1,170 +0,0 @@ -%% -%% This is file `workaddress.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% workaddress.dtx (with options: `package') -%% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{workaddress}[2019/03/20 v0.5 WorkAddress] -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{sref}} -\ProcessOptions -\RequirePackage{sref} -\addmetakey*{wa@person}{id} -\addmetakey*{wa@person}{birthdate} -\addmetakey*{wa@person}{email} -\addmetakey*{wa@person}{url} -\addmetakey*{wa@person}{affiliation} -\addmetakey*{wa@person}{personaltitle} -\addmetakey*{wa@person}{academictitle} -\addmetakey*{wa@person}{department} -\addmetakey*{wa@person}{workaddress} -\addmetakey*{wa@person}{privaddress} -\addmetakey*{wa@person}{worktel} -\addmetakey*{wa@person}{privtel} -\addmetakey*{wa@person}{workfax} -\addmetakey*{wa@person}{privfax} -\addmetakey*{wa@person}{worktelfax} -\addmetakey*{wa@person}{privtelfax} -\def\wa@def#1#2#3#4{\expandafter\xdef\csname wa@#1@#2@#3\endcsname{#4}} -\newcommand\wa@ref[4]{% - \@ifundefined{wa@#2@#3@#4}{% - \ifcase#1 {}\or% - \PackageWarning{workaddress}{reference to undefined #4 of #2 #3\MessageBreak% - you must define a #2 with #3=#4\MessageBreak% - via the macro \protect\WA#2, before you can use it!}% - \or - \PackageWarning{workaddress}{reference to undefined #4 of #2 #3\MessageBreak% - you must define a #2 with #3=#4\MessageBreak% - via the macro \protect\WA#2, before you can use it!}% - ?#2?#3?#4? - \or - \PackageError{workaddress}{reference to undefined #4 of #2 #3}% - {you must define a #2 with #3=#4\MessageBreak% - via the macro \protect\WA#2, before you can use it!} - \else\PackageError{workaddress}{\protect\wa@ref#1 not defined}{} - \fi - }{\csname wa@#2@#3@#4\endcsname}}% -\let\wa@persons=\relax -\newcommand\WAperson[2][]{% - \metasetkeys{wa@person}{#1}% - \ifx\wa@person@id\@empty% - \PackageWarning{workaddress}{key 'id' undefined in WAperson}% - \else% - \wa@def{person}\wa@person@id{id}{\wa@person@id}% redundant, but useful for checking - \wa@def{person}\wa@person@id{name}{#2} - \wa@def{person}\wa@person@id{email}{\wa@person@email} - \wa@def{person}\wa@person@id{birthdate}{\wa@person@birthdate} - \wa@def{person}\wa@person@id{url}{\wa@person@url} - \wa@def{person}\wa@person@id{affiliation}{\wa@person@affiliation} - \wa@def{person}\wa@person@id{workaddress}{\wa@person@workaddress} - \wa@def{person}\wa@person@id{privaddress}{\wa@person@privaddress} - \wa@def{person}\wa@person@id{personaltitle}{\wa@person@personaltitle} - \wa@def{person}\wa@person@id{academictitle}{\wa@person@academictitle} - \wa@def{person}\wa@person@id{department}{\wa@person@department} - \wa@def{person}\wa@person@id{workaddress}{\wa@person@workaddress} - \wa@def{person}\wa@person@id{privaddress}{\wa@person@privaddress} - \wa@def{person}\wa@person@id{worktel}{\wa@person@worktel} - \wa@def{person}\wa@person@id{privtel}{\wa@person@privtel} - \wa@def{person}\wa@person@id{workfax}{\wa@person@workfax} - \wa@def{person}\wa@person@id{privfax}{\wa@person@privfax} - \wa@def{person}\wa@person@id{worktelfax}{\wa@person@worktelfax} - \wa@def{person}\wa@person@id{privtelfax}{\wa@person@privtelfax} - \@ifundefined{wa@persons}{% - \xdef\wa@persons{\wa@person@id}% - }{% - \xdef\wa@persons{\wa@persons,\wa@person@id}% - }% - \fi% -}% -\newcommand\DCMperson[2][]{% - \WAperson[#1]{#2}% - \PackageWarning{workaddress}{\protect\DCMperson\space is deprecated, use \protect\WAperson\space instead} -}% -\addmetakey*{wa@institution}{id} -\addmetakey*{wa@institution}{shortname} -\addmetakey*{wa@institution}{acronym} -\addmetakey*{wa@institution}{url} -\addmetakey*{wa@institution}{partof} -\addmetakey*{wa@institution}{countryshort} -\addmetakey*{wa@institution}{logo} -\addmetakey*{wa@institution}{streetaddress} -\addmetakey*{wa@institution}{townzip} -\addmetakey*{wa@institution}{type} -\addmetakey*{wa@institution}{country} -\let\wa@institutions=\relax -\newcommand\WAinstitution[2][]{% - \metasetkeys{wa@institution}{#1}% - \ifx\wa@institution@id\@empty% - \PackageWarning{workaddress}{key 'id' undefined in WAinstitution}% - \else% - \wa@def{institution}\wa@institution@id{id}{\wa@institution@id}% redundant, but useful for checking - \wa@def{institution}\wa@institution@id{name}{#2} - \wa@def{institution}\wa@institution@id{shortname}{\wa@institution@shortname} - \wa@def{institution}\wa@institution@id{acronym}{\wa@institution@acronym} - \wa@def{institution}\wa@institution@id{url}{\wa@institution@url} - \wa@def{institution}\wa@institution@id{partof}{\wa@institution@partof} - \wa@def{institution}\wa@institution@id{countryshort}{\wa@institution@countryshort} - \wa@def{institution}\wa@institution@id{logo}{\wa@institution@logo} - \wa@def{institution}\wa@institution@id{townzip}{\wa@institution@townzip} - \wa@def{institution}\wa@institution@id{streetaddress}{\wa@institution@streetaddress} - \wa@def{institution}\wa@institution@id{country}{\wa@institution@country} - \wa@def{institution}\wa@institution@id{type}{\wa@institution@type} - \@ifundefined{wa@institutions}{% - \xdef\wa@institutions{\wa@institution@id}% - }{% - \xdef\wa@institutions{\wa@institutions,\wa@institution@id}% - }% - \fi% -}% -\newcommand\DCMinstitution[2][]{% - \WAinstitution[#1]{#2}% - \PackageWarning{workaddress}{\protect\DCMinstitution\space is deprecated, use \protect\WAinstitution\space instead}% -}% -\addmetakey[false]{WAauthorblock}{dept}[true] -\addmetakey[false]{WAauthorblock}{aff}[true] -\addmetakey[false]{WAauthorblock}{url}[true] -\def\@true{true} -\newcounter{authors} -\newcommand\WAauthorblock[2][]{% - \metasetkeys{WAauthorblock}{#1} - {\let\tabularnewline\relax - \@for\@I:=#2\do{\stepcounter{authors}} - \def\@authors{}% - \def\@affs{}% - \def\@depts{}% - \def\@urls{}% - \@for\@I:=#2\do{% - \xdef\@authors{\@authors&\wa@ref2{person}\@I{name}} - \xdef\@@dept{\wa@ref1{person}\@I{department}} - \xdef\@shortname{\csname wa@institution@\@@dept @shortname\endcsname} - \xdef\@dept{\ifx\@shortname\@empty\wa@ref0{institution}\@@dept{name}\else\@shortname\fi} - \xdef\@depts{\@depts&\@dept} - \xdef\@@aff{\wa@ref0{person}\@I{affiliation}} - \xdef\@shortname{\csname wa@institution@\@@aff @shortname\endcsname} - \xdef\@aff{\ifx\@shortname\@empty\wa@ref0{institution}\@@aff{name}\else\@shortname\fi} - \xdef\@affs{\@affs&\@aff} - \xdef\@urls{\@urls&\wa@ref0{person}\@I{url}} - }% - \message{\theauthors authors: \@authors}% - }% - \begin{tabular}[t]{l*{\theauthors}{c}} - \@authors\\ - \ifx\WAauthorblock@dept\@true\@depts\\\fi - \ifx\WAauthorblock@aff\@true\@affs\\\fi - \ifx\WAauthorblock@url\@true\@urls\\\fi - \end{tabular} -}% -\newcommand\wapname[1]{\wa@ref3{person}{#1}{name}} -\newcommand\waptname[1]{\wa@ref3{person}{#1}{personaltitle} \wa@ref3{person}{#1}{name}} -\newcommand\wa@institution@logo[2][]{% - \IfFileExists{\wa@ref2{institution}{#2}{logo}}{% - \includegraphics{\wa@ref2{institution}{#2}{logo}}% - }{% - \fbox{#2 logo}\message{still need logo for #2}% - }% -}% -\endinput -%% -%% End of file `workaddress.sty'. |