diff options
Diffstat (limited to 'macros/latex/contrib/stex/source/extensions')
5 files changed, 195 insertions, 203 deletions
diff --git a/macros/latex/contrib/stex/source/extensions/document-structure.dtx b/macros/latex/contrib/stex/source/extensions/document-structure.dtx index b05e4d464c..a73e0fd856 100644 --- a/macros/latex/contrib/stex/source/extensions/document-structure.dtx +++ b/macros/latex/contrib/stex/source/extensions/document-structure.dtx @@ -9,7 +9,7 @@ % % %<*driver> -\def\bibfolder#1{../../lib/bib/#1} +\def\libfolder#1{../../lib/#1} \input{../../doc/stex-docheader} \begin{document} @@ -42,14 +42,14 @@ % % \tableofcontents % -% \input{../../doc/packages/stex-document-structure} -% \fi -% -% % \begin{documentation}\label{pkg:documentstructure:doc} -% +% \begin{sfragment}{The User Interface} +% \input{../../doc/packages/stex-document-structure} +% \end{sfragment} % \end{documentation} % +% \fi +% % \begin{implementation}\label{pkg:documentstructure:impl} % % \begin{sfragment}{document-structure.sty Implementation} @@ -57,7 +57,7 @@ % \begin{macrocode} %<*package> %<@@=document_structure> -\ProvidesExplPackage{document-structure}{2022/05/24}{3.1.0}{Modular Document Structure} +\ProvidesExplPackage{document-structure}{2022/09/14}{3.2.0}{Modular Document Structure} \RequirePackage{l3keys2e} % \end{macrocode} % @@ -72,7 +72,7 @@ \keys_define:nn{ document-structure }{ class .str_set_x:N = \c_document_structure_class_str, - topsect .str_set_x:N = \c_document_structure_topsect_str,, + topsect .str_set_x:N = \c_document_structure_topsect_str, unknown .code:n = { \PassOptionsToClass{\CurrentOption}{stex} \PassOptionsToClass{\CurrentOption}{tikzinput} @@ -98,7 +98,7 @@ \AddToHook{begindocument}{ \ltx@ifpackageloaded{babel}{ \clist_set:Nx \l_tmpa_clist {\bbl@loaded} - \clist_if_in:NnT \l_tmpa_clist {ngerman}{ + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\detokenize{ngerman}}{ \makeatletter\input{document-structure-ngerman.ldf}\makeatother } }{} @@ -223,7 +223,6 @@ srccite .tl_set:N = \l_@@_sfragment_srccite_tl, type .tl_set:N = \l_@@_sfragment_type_tl, short .tl_set:N = \l_@@_sfragment_short_tl, - display .tl_set:N = \l_@@_sfragment_display_tl, intro .tl_set:N = \l_@@_sfragment_intro_tl, imports .tl_set:N = \l_@@_sfragment_imports_tl, loadmodules .bool_set:N = \l_@@_sfragment_loadmodules_bool @@ -236,7 +235,6 @@ \tl_clear:N \l_@@_sfragment_srccite_tl \tl_clear:N \l_@@_sfragment_type_tl \tl_clear:N \l_@@_sfragment_short_tl - \tl_clear:N \l_@@_sfragment_display_tl \tl_clear:N \l_@@_sfragment_imports_tl \tl_clear:N \l_@@_sfragment_intro_tl \bool_set_false:N \l_@@_sfragment_loadmodules_bool diff --git a/macros/latex/contrib/stex/source/extensions/hwexam.dtx b/macros/latex/contrib/stex/source/extensions/hwexam.dtx index e166fd0397..de3538d53f 100644 --- a/macros/latex/contrib/stex/source/extensions/hwexam.dtx +++ b/macros/latex/contrib/stex/source/extensions/hwexam.dtx @@ -10,7 +10,7 @@ % \iffalse % %<*driver> -\def\bibfolder#1{../../lib/bib/#1} +\def\libfolder#1{../../lib/#1} \input{../../doc/stex-docheader} \begin{document} @@ -32,8 +32,10 @@ % \url{http://kwarc.info/kohlhase}} % \maketitle % -%\ifinfulldoc\else -%\begin{abstract} +% \begin{documentation} +%\ifinfulldoc\else +% +%\begin{abstract}{} % The |hwexam| package and class allows individual course assignment sheets and compound % assignment documents using problem files marked up with the |problem| package. % @@ -43,12 +45,11 @@ % \end{abstract} % % \tableofcontents -% +% \begin{sfragment}{The User Intterface} % \input{../../doc/packages/stex-hwexam} +% \end{sfragment} % \fi % -% \begin{documentation} -% % \end{documentation} % %\begin{implementation} @@ -63,13 +64,14 @@ % % \begin{macrocode} %<*package> -\ProvidesExplPackage{hwexam}{2022/05/24}{3.1.0}{homework assignments and exams} +\ProvidesExplPackage{hwexam}{2022/09/14}{3.2.0}{homework assignments and exams} \RequirePackage{l3keys2e} \newif\iftest\testfalse -\DeclareOption{test}{\testtrue} +\DeclareOption{test}{\testtrue\PassOptionsToPackage{\CurrentOption}{problem}} \newif\ifmultiple\multiplefalse \DeclareOption{multiple}{\multipletrue} +\DeclareOption{lang}{\PassOptionsToPackage{\CurrentOption}{problem}} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{problem}} \ProcessOptions % \end{macrocode} @@ -86,9 +88,8 @@ \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\hwexam@testemptypage@kw{This~page~was~intentionally~left~blank~for~extra~space} +\newcommand\hwexam@minutes@kw{minutes} \newcommand\correction@probs@kw{prob.} \newcommand\correction@pts@kw{total} \newcommand\correction@reached@kw{reached} @@ -104,16 +105,16 @@ \ltx@ifpackageloaded{babel}{ \makeatletter \clist_set:Nx \l_tmpa_clist {\bbl@loaded} - \clist_if_in:NnT \l_tmpa_clist {ngerman}{ + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\detokenize{ngerman}}{ \input{hwexam-ngerman.ldf} } - \clist_if_in:NnT \l_tmpa_clist {finnish}{ + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\detokenize{finnish}}{ \input{hwexam-finnish.ldf} } - \clist_if_in:NnT \l_tmpa_clist {french}{ + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\detokenize{french}}{ \input{hwexam-french.ldf} } - \clist_if_in:NnT \l_tmpa_clist {russian}{ + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\detokenize{russian}}{ \input{hwexam-russian.ldf} } \makeatother @@ -265,7 +266,7 @@ }{ \global\setcounter{assignment}{\int_use:N\l_@@_assign_number_int} } - \setcounter{problem}{0} + \setcounter{sproblem}{0} \renewcommand\prob@label[1]{\assignment@number.##1} \def\current@section@level{\document@hwexamtype} %\sref@label@id{\document@hwexamtype \thesection} @@ -416,24 +417,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\testspace} -% \begin{macrocode} -\newcommand\testspace[1]{\iftest\vspace*{#1}\fi} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\testnewpage} -% \begin{macrocode} -\newcommand\testnewpage{\iftest\newpage\fi} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\testemptypage} -% \begin{macrocode} -\newcommand\testemptypage[1][]{\iftest\begin{center}\hwexam@testemptypage@kw\end{center}\vfill\eject\else\fi} -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\@problem} % This macro acts on a problem's record in the |*.aux| file. Here we redefine it (it was % defined to do nothing in |problem.sty|) to generate the correction table. diff --git a/macros/latex/contrib/stex/source/extensions/notesslides.dtx b/macros/latex/contrib/stex/source/extensions/notesslides.dtx index ff06827660..e74693c26b 100644 --- a/macros/latex/contrib/stex/source/extensions/notesslides.dtx +++ b/macros/latex/contrib/stex/source/extensions/notesslides.dtx @@ -11,9 +11,8 @@ % \iffalse % %<*driver> -\def\bibfolder#1{../../lib/bib/#1} +\def\libfolder#1{../../lib/#1} \input{../../doc/stex-docheader} - \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -54,7 +53,9 @@ % see \href{\basedocurl/manual.pdf}{the \sTeX Manual} or the % \href{\basedocurl/stex.pdf}{full \sTeX documentation}. % -% \input{../../doc/packages/stex-slides} +% \begin{sfragment}{The User Interface} +% \input{../../doc/packages/stex-notesslides} +% \end{sfragment} % \fi % % \begin{documentation}\label{pkg:notesslides:doc} @@ -76,7 +77,7 @@ % \begin{macrocode} %<*cls> %<@@=notesslides> -\ProvidesExplClass{notesslides}{2022/05/24}{3.1.0}{notesslides Class} +\ProvidesExplClass{notesslides}{2022/09/14}{3.2.0}{notesslides Class} \RequirePackage{l3keys2e} \keys_define:nn{notesslides / cls}{ @@ -121,7 +122,7 @@ % now we do the same for the |notesslides| package. % \begin{macrocode} %<*package> -\ProvidesExplPackage{notesslides}{2022/05/24}{3.1.0}{notesslides Package} +\ProvidesExplPackage{notesslides}{2022/09/14}{3.2.0}{notesslides Package} \RequirePackage{l3keys2e} \keys_define:nn{notesslides / pkg}{ @@ -208,35 +209,23 @@ \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} +\RequirePackage{bookmark} % \end{macrocode} % % \subsection{Notes and Slides}\label{sec:impl:noteslides} % % For the lecture notes cases, we also provide the |\usetheme| macro that would otherwise -% come from the the |beamer| class. While the latter loads -% |beamertheme|\meta{theme}{.sty}, the notes version loads -% |beamernotestheme|\meta{theme}|.sty|.\ednote{MK: This is not ideal, but I am not sure -% that I want to be able to provide the full theme functionality there.} +% come from the the |beamer| class. % \begin{macrocode} \bool_if:NT \c_@@_notes_bool { - \renewcommand\usetheme[2][]{\usepackage[#1]{beamernotestheme#2}} + \renewcommand\usetheme[2][]{\usepackage[#1]{beamertheme#2}} } - - \NewDocumentCommand \libusetheme {O{} m} { - \bool_if:NTF \c_@@_notes_bool { - \libusepackage[#1]{beamernotestheme#2} - }{ \libusepackage[#1]{beamertheme#2} - } } % \end{macrocode} @@ -485,8 +474,6 @@ \includegraphics[#1]{\mhpath\Gin@mhrepos{#2}} } - - \bool_if:NTF \c_@@_notes_bool { \setlength{\slidelogoheight}{.4cm} }{ @@ -506,10 +493,26 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\author} +% In notes mode, we redefine the |\author| macro so that it does not disregard the +% optional argument (as \pkg{beamerarticle} does). We want to use it to set the source +% later. +% \begin{macrocode} +\bool_if:NT \c_@@_notes_bool { + \def\author{\@dblarg\ns@author} + \long\def\ns@author[#1]#2{% + \def\c_@@_shortauthor{#1}% + \def\@author{#2} + } +} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\setsource} -% |\source| stores the writer's name. By default it is {\it Michael Kohlhase} since he is the main user and designer of this package. |\setsource{|\meta{name}|}| can change the writer's name. +% |\source| stores the writer's name. By default it is {\it Michael Kohlhase} since he +% is the main user and designer of this package. |\setsource{|\meta{name}|}| can change +% the writer's name. % \begin{macrocode} -\def\source{Michael Kohlhase}% customize locally \newrobustcmd{\setsource}[1]{\def\source{#1}} % \end{macrocode} % \end{macro} @@ -521,7 +524,13 @@ % logo. |\setlicensing[|\meta{url}|]{|\meta{logo name}|}| is used for customization, % where ||\meta{url}|| is optional. % \begin{macrocode} -\def\copyrightnotice{\footnotesize\copyright :\hspace{.3ex}{\source}} +\def\copyrightnotice{% + \footnotesize\copyright :\hspace{.3ex}% + \ifcsname source\endcsname\source\else% + \ifcsname c_@@_shortauthor\endcsname\c_@@_shortauthor\else% + \PackageWarning{notesslides}{Author/Source~undefined~in~copyright~notice}% + ?source/author?\fi% + \fi} \newsavebox{\cclogo} \sbox{\cclogo}{\includegraphics[height=\slidelogoheight]{stex-cc_somerights}} \newif\ifcchref\cchreffalse @@ -617,69 +626,6 @@ % \end{macrocode} % \end{macro} % -% \subsection{Colors and Highlighting}\label{sec:impl:highlighting} -% -% We first specify sans serif fonts as the default. -% -% \begin{macrocode} -\sffamily -% \end{macrocode} -% -% Now, we set up an infrastructure for highlighting phrases in slides. Note that we use -% content-oriented macros for highlighting rather than directly using color markup. -% The first thing to to is to adapt the green so that it is dark enough for most beamers -% \begin{macrocode} -\AddToHook{begindocument}{ - \definecolor{green}{rgb}{0,.5,0} - \definecolor{purple}{cmyk}{.3,1,0,.17} -} -% \end{macrocode} -% -% We customize the |\defemph|, |\symrefemph|, |\compemph|, and |\titleemph| macros with -% colors. Furthermore we customize the |\__omtextlec| macro for the appearance of line end -% comments in |\lec|. -% -% \begin{macrocode} -% \def\STpresent#1{\textcolor{blue}{#1}} -\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})} -% \end{macrocode} -% -% I like to use the dangerous bend symbol for warnings, so we provide it here. -% \begin{macro}{\textwarning} -% as the macro can be used quite often we put it into a box register, so that it is only -% loaded once. -% \begin{macrocode} -\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 -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\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} -} -% \end{macrocode} -% % \subsection{Sectioning} % % If the |sectocframes| option is set, then we make section frames. We first define @@ -744,33 +690,48 @@ \ifcase\l_document_structure_section_level_int\or \stepcounter{part} \def\@@label{{\omdoc@part@kw}~\Roman{part}} + \addcontentsline{toc}{part}{\protect\numberline{\thepart}#2} + \pdfbookmark[0]{\thepart\ #2}{part.\thepart} \def\currentsectionlevel{\omdoc@part@kw} \or \stepcounter{chapter} \def\@@label{{\omdoc@chapter@kw}~\arabic{chapter}} + \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#2} + \pdfbookmark[1]{\thechapter\ #2}{chapter.\cs_if_exist:cT{thepart}\thepart.\thechapter} \def\currentsectionlevel{\omdoc@chapter@kw} \or \stepcounter{section} \def\@@label{\part@prefix\arabic{section}} + \addcontentsline{toc}{section}{\protect\numberline{\thesection}#2} + \pdfbookmark[2]{\cs_if_exist:cT{thechapter}{\thechapter.}\thesection\ #2} + {section.\cs_if_exist:cT{thepart}{\thepart}.\cs_if_exist:cT{thechapter}{\thechapter}.\thesection} \def\currentsectionlevel{\omdoc@section@kw} \or \stepcounter{subsection} \def\@@label{\part@prefix\arabic{section}.\arabic{subsection}} + \addcontentsline{toc}{subsection}{\protect\numberline{\thesubsection}#2} + \pdfbookmark[3]{\cs_if_exist:cT{thechapter}{\thechapter.}\thesection.\thesubsection\ #2} + {subsection.\cs_if_exist:cT{thepart}{\thepart}.\cs_if_exist:cT{thechapter}{\thechapter}.\thesection.\thesubsection} \def\currentsectionlevel{\omdoc@subsection@kw} \or \stepcounter{subsubsection} \def\@@label{\part@prefix\arabic{section}.\arabic{subsection}.\arabic{subsubsection}} + \addcontentsline{toc}{subsubsection}{\protect\numberline{\thesubsubsection}#2} + \pdfbookmark[4]{\cs_if_exist:cT{thechapter}{\thechapter.}\thesection.\thesubsection.\thesubsubsection\ #2} + {subsubsection.\cs_if_exist:cT{thepart}{\thepart}.\cs_if_exist:cT{thechapter}{\thechapter}.\thesection.\thesubsection.\thesubsubsection} \def\currentsectionlevel{\omdoc@subsubsection@kw} \or \stepcounter{paragraph} \def\@@label{\part@prefix\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\arabic{paragraph}} + \addcontentsline{toc}{paragraph}{\protect\numberline{\theparagraph}#2} + \pdfbookmark[5]{\cs_if_exist:cT{thechapter}{\thechapter.}\thesection.\thesubsection.\thesubsubsection.\theparagraph\ #2} + {paragraph.\cs_if_exist:cT{thepart}{\thepart}.\cs_if_exist:cT{thechapter}{\thechapter}.\thesection.\thesubsection.\thesubsubsection.\theparagraph} \def\currentsectionlevel{\omdoc@paragraph@kw} \else \def\@@label{} \def\currentsectionlevel{\omdoc@paragraph@kw} \fi% end ifcase - \@@label%\sref@label@id\@@label - \quad #2% + \@@label\quad #2% }% \vfill% \end{frame}% diff --git a/macros/latex/contrib/stex/source/extensions/problem.dtx b/macros/latex/contrib/stex/source/extensions/problem.dtx index 75a34eaf8e..3fcc3215ef 100644 --- a/macros/latex/contrib/stex/source/extensions/problem.dtx +++ b/macros/latex/contrib/stex/source/extensions/problem.dtx @@ -10,7 +10,7 @@ % \iffalse % %<*driver> -\def\bibfolder#1{../../lib/bib/#1} +\def\libfolder#1{../../lib/#1} \input{../../doc/stex-docheader} \RequirePackage[hints,solutions,notes]{problem} @@ -32,6 +32,7 @@ % \maketitle % % \ifinfulldoc\else +% \begin{documentation} % \begin{abstract} % This is the documentation for the \pkg{problem} package. % For a more high-level introduction, @@ -44,12 +45,13 @@ % \end{abstract} % % \tableofcontents -% -% \input{../../doc/packages/stex-problem} +% \begin{sfragment}{User Interface} +% \input{../../doc/packages/stex-problem} +% \ednote{MK: the input does not work! it includes the commented stuff as well. } +% \end{sfragment} +% \end{documentation} % \fi % -% \begin{documentation} -% \end{documentation} % \begin{implementation} % % \section{The Implementation}\label{sec:implementation} @@ -63,8 +65,9 @@ % \begin{macrocode} %<*package> %<@@=problems> -\ProvidesExplPackage{problem}{2022/05/24}{3.1.0}{Semantic Markup for Problems} -\RequirePackage{l3keys2e,stex} +\ProvidesExplPackage{problem}{2022/09/14}{3.2.0}{Semantic Markup for Problems} +\RequirePackage{l3keys2e} +\RequirePackage{amssymb}% for \Box \keys_define:nn { problem / pkg }{ notes .default:n = { true }, @@ -81,7 +84,11 @@ min .bool_set:N = \c_@@_min_bool, boxed .default:n = { true }, boxed .bool_set:N = \c_@@_boxed_bool, - unknown .code:n = {} + test .default:n = { true }, + test .bool_set:N = \c_@@_test_bool, + unknown .code:n = { + \PassOptionsToPackage{\CurrentOption}{stex} + } } \newif\ifsolutions @@ -91,6 +98,7 @@ }{ \solutionsfalse } +\RequirePackage{stex} % \end{macrocode} % % Then we make sure that the necessary packages are loaded (in the right versions). @@ -117,6 +125,8 @@ \def\prob@gnote@kw{Grading} \def\prob@pt@kw{pt} \def\prob@min@kw{min} +\def\prob@correct@kw{Correct} +\def\prob@wrong@kw{Wrong} % \end{macrocode} % \end{macro} % @@ -126,16 +136,16 @@ \ltx@ifpackageloaded{babel}{ \makeatletter \clist_set:Nx \l_tmpa_clist {\bbl@loaded} - \clist_if_in:NnT \l_tmpa_clist {ngerman}{ + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\detokenize{ngerman}}{ \input{problem-ngerman.ldf} } - \clist_if_in:NnT \l_tmpa_clist {finnish}{ + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\detokenize{finnish}}{ \input{problem-finnish.ldf} } - \clist_if_in:NnT \l_tmpa_clist {french}{ + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\detokenize{french}}{ \input{problem-french.ldf} } - \clist_if_in:NnT \l_tmpa_clist {russian}{ + \exp_args:NNx \clist_if_in:NnT \l_tmpa_clist {\detokenize{russian}}{ \input{problem-russian.ldf} } \makeatother @@ -178,8 +188,10 @@ % Then we set up a counter for problems. % \begin{macro}{\numberproblemsin} % \begin{macrocode} -\newcounter{problem}[section] -\newcommand\numberproblemsin[1]{\@addtoreset{problem}{#1}} +\newcounter{sproblem}[section] +\newcommand\numberproblemsin[1]{\@addtoreset{sproblem}{#1}} +\def\theplainsproblem{\arabic{sproblem}} +\def\thesproblem{\thesection.\theplainsproblem} % \end{macrocode} % \end{macro} % @@ -200,10 +212,11 @@ \int_if_exist:NTF \l_@@_prob_refnum_int { \prob@label{\int_use:N \l_@@_prob_refnum_int } }{ - \prob@label\theproblem + \prob@label\theplainsproblem } } } +\def\sproblemautorefname{\prob@problem@kw} % \end{macrocode} % \end{macro} % @@ -216,10 +229,10 @@ \tl_if_exist:NTF \l_@@_inclprob_title_tl { #2 \l_@@_inclprob_title_tl #3 }{ - \tl_if_exist:NTF \l_@@_prob_title_tl { - #2 \l_@@_prob_title_tl #3 - }{ + \tl_if_empty:NTF \l_@@_prob_title_tl { #1 + }{ + #2 \l_@@_prob_title_tl #3 } } } @@ -248,7 +261,7 @@ \newenvironment{sproblem}[1][]{ \_@@_prob_args:n{#1}%\sref@target% \@in@omtexttrue% we are in a statement (for inline definitions) - \stepcounter{problem}\record@problem + \refstepcounter{sproblem}\record@problem \def\current@section@level{\prob@problem@kw} \str_if_empty:NT \l_@@_prob_name_str { @@ -315,7 +328,7 @@ } } \stex_ref_new_doc_target:n \sproblemid - \stex_smsmode_do: + \stex_if_smsmode:TF \stex_smsmode_do: \ignorespacesandpars }{ \__stex_modules_end_module: \stex_if_smsmode:F{ @@ -408,35 +421,18 @@ % \begin{macrocode} \keys_define:nn { problem / solution }{ id .str_set_x:N = \l_@@_solution_id_str , - for .tl_set:N = \l_@@_solution_for_tl , - height .dim_set:N = \l_@@_solution_height_dim , - creators .clist_set:N = \l_@@_solution_creators_clist , - contributors .clist_set:N = \l_@@_solution_contributors_clist , - srccite .tl_set:N = \l_@@_solution_srccite_tl + for .str_set_x:N = \l_@@_solution_for_str , + type .str_set_x:N = \l_@@_solution_type_str , + title .tl_set:N = \l_@@_solution_title_tl } \cs_new_protected:Nn \_@@_solution_args:n { \str_clear:N \l_@@_solution_id_str - \tl_clear:N \l_@@_solution_for_tl - \tl_clear:N \l_@@_solution_srccite_tl - \clist_clear:N \l_@@_solution_creators_clist - \clist_clear:N \l_@@_solution_contributors_clist - \dim_zero:N \l_@@_solution_height_dim + \str_clear:N \l_@@_solution_type_str + \str_clear:N \l_@@_solution_for_str + \tl_clear:N \l_@@_solution_title_tl \keys_set:nn { problem / solution }{ #1 } } % \end{macrocode} -% the next step is to define a helper macro that does what is needed to start a solution. -% \begin{macrocode} -\newcommand\@startsolution[1][]{ - \_@@_solution_args:n { #1 } - \@in@omtexttrue% we are in a statement. - \bool_if:NF \c_@@_boxed_bool { \hrule } - \smallskip\noindent - {\textbf\prob@solution@kw :\enspace} - \begin{small} - \def\current@section@level{\prob@solution@kw} - \ignorespacesandpars -} -% \end{macrocode} % % \begin{macro}{\startsolutions} % for the |\startsolutions| macro we use the |\specialcomment| macro from the |comment| @@ -445,14 +441,20 @@ % \begin{macrocode} \box_new:N \l_@@_solution_box \newenvironment{solution}[1][]{ + \_@@_solution_args:n{#1} \stex_html_backend:TF{ \stex_if_do_html:T{ \begin{stex_annotate_env}{solution}{} + \str_if_empty:NF \l_@@_solution_type_str { + \par\noindent + \stex_annotate_invisible:nnn{typestrings}{\sexampletype}{} + } + \noindent\textbf{Solution\tl_if_empty:NF\l_@@_solution_title_tl{~(\l_@@_solution_title_tl)}: }~ } }{ \setbox\l_@@_solution_box\vbox\bgroup \par\smallskip\hrule\smallskip - \noindent\textbf{Solution:}~ + \noindent\textbf{Solution\tl_if_empty:NF\l_@@_solution_title_tl{~(\l_@@_solution_title_tl)}: }~ } }{ \stex_html_backend:TF{ @@ -463,6 +465,7 @@ \smallskip\hrule \egroup \bool_if:NT \c_@@_solutions_bool { + \strut\par\noindent \box\l_@@_solution_box } } @@ -470,6 +473,7 @@ \newcommand\startsolutions{ \bool_set_true:N \c_@@_solutions_bool + \solutionstrue % \specialcomment{solution}{\@startsolution}{ % \bool_if:NF \c_@@_boxed_bool { % \hrule\medskip @@ -485,19 +489,10 @@ % % \begin{macro}{\stopsolutions} % \begin{macrocode} -\newcommand\stopsolutions{\bool_set_false:N \c_@@_solutions_bool}%\excludecomment{solution}} +\newcommand\stopsolutions{\bool_set_false:N \c_@@_solutions_bool \solutionsfalse}%\excludecomment{solution}} % \end{macrocode} % \end{macro} -% -% so it only remains to start/stop solutions depending on what option was specified. % -% \begin{macrocode} -\ifsolutions - \startsolutions -\else - \stopsolutions -\fi -% \end{macrocode} % % \begin{environment}{exnote} % \begin{macrocode} @@ -550,8 +545,10 @@ } % \end{macrocode} % \end{environment} +% +% \subsection{Markup for Added Value Services}\label{sec:impl:avs} % -% \subsection{Multiple Choice Blocks}\label{sec:impl:mcq} +% \subsubsection{Multiple Choice Blocks}\label{sec:impl:mcq} % % \begin{environment}{mcb} % \ednote{MK: maybe import something better here from a dedicated MC package} @@ -579,8 +576,8 @@ T .bool_set:N = \l_@@_mcc_t_bool , F .default:n = { false } , F .bool_set:N = \l_@@_mcc_f_bool , - Ttext .tl_set:N = \l_@@_mcc_Ttext_str , - Ftext .tl_set:N = \l_@@_mcc_Ftext_str + Ttext .tl_set:N = \l_@@_mcc_Ttext_tl , + Ftext .tl_set:N = \l_@@_mcc_Ftext_tl } \cs_new_protected:Nn \l_@@_mcc_args:n { \str_clear:N \l_@@_mcc_id_str @@ -596,12 +593,12 @@ % % \begin{macro}{\mcc} % \begin{macrocode} -\def\mccTrueText{\textbf{(true)~}} -\def\mccFalseText{\textbf{(false)~}} +\def\mccTrueText{\textbf{\prob@correct@kw!~}} +\def\mccFalseText{\textbf{\prob@wrong@kw!~}} \newcommand\mcc[2][]{ \l_@@_mcc_args:n{ #1 } \item[$\Box$] #2 - \ifsolutions + \bool_if:NT \c_@@_solutions_bool{ \\ \bool_if:NT \l_@@_mcc_t_bool { \tl_if_empty:NTF\l_@@_mcc_Ttext_tl\mccTrueText\l_@@_mcc_Ttext_tl @@ -610,13 +607,27 @@ \tl_if_empty:NTF\l_@@_mcc_Ttext_tl\mccFalseText\l_@@_mcc_Ftext_tl } \tl_if_empty:NF \l_@@_mcc_feedback_tl { - \emph{(\l_@@_mcc_feedback_tl)} + \emph{\l_@@_mcc_feedback_tl} } - \fi + } } %solutions % \end{macrocode} % \end{macro} +% +% \subsubsection{Filling in Concrete Solutions} % +% \begin{macro}{\includeproblem} +% This is embarrasingly simple, but can grow over time. +% \begin{macrocode} +\newcommand\fillinsol[2][]{% + \def\@test{#1} + \quad% + \ifsolutions\textcolor{red}{#1!}\else% + \fbox{\ifx\@test\@empty\phantom{\huge{21}}\else\hspace{#1}\fi}% + \fi} +% \end{macrocode} +% \end{macro} +% % \subsection{Including Problems}\label{sec:impl:includeproblem} % % \begin{macro}{\includeproblem} @@ -780,15 +791,45 @@ %</package> % \end{macrocode} % \end{macro} +% +% \subsection{Testing and Spacing} +% +% \begin{macro}{\testspace} +% \begin{macrocode} +\newcommand\testspace[1]{\bool_if:NT \c_@@_boxed_bool {\vspace*{#1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\testnewpage} +% \begin{macrocode} +\newcommand\testnewpage{\bool_if:NT \c_@@_boxed_bool {\newpage}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\testemptypage} +% \begin{macrocode} +\newcommand\testemptypage[1][]{% +\bool_if:NT \c_@@_boxed_bool {\begin{center}\hwexam@testemptypage@kw\end{center}\vfill\eject\else}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\test*space} +% \begin{macrocode} +\newcommand\testsmallspace{\testspace{1cm}} +\newcommand\testmedspace{\testspace{2cm}} +\newcommand\testbigspace{\testspace{3cm}} +% \end{macrocode} +% \end{macro} +% % \end{implementation} % \ifinfulldoc\else\printbibliography\fi \endinput -% LocalWords: GPL structuresharing STR dtx pts keyval xcomment CPERL DefKeyVal iffalse %%% Local Variables: %%% mode: doctex %%% TeX-master: t %%% End: % \fi +% LocalWords: GPL structuresharing STR dtx pts keyval xcomment CPERL DefKeyVal iffalse % LocalWords: RequirePackage Semiverbatim DefEnvironment OptionalKeyVals soln texttt baz % LocalWords: exnote DefConstructor inclprob NeedsTeXFormat omd.sty textbackslash exfig % LocalWords: stopsolution fileversion filedate maketitle setcounter tocdepth newpage diff --git a/macros/latex/contrib/stex/source/extensions/tikzinput.dtx b/macros/latex/contrib/stex/source/extensions/tikzinput.dtx index fb7bbf76c9..acb6e4bc94 100644 --- a/macros/latex/contrib/stex/source/extensions/tikzinput.dtx +++ b/macros/latex/contrib/stex/source/extensions/tikzinput.dtx @@ -10,7 +10,7 @@ % TODO update copyright % %<*driver> -\def\bibfolder#1{../../lib/bib/#1} +\def\libfolder#1{../../lib/#1} \input{../../doc/stex-docheader} \begin{document} @@ -67,7 +67,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{tikzinput}{2022/05/24}{3.1.0}{tikzinput package} +\ProvidesExplPackage{tikzinput}{2022/09/14}{3.2.0}{tikzinput package} \RequirePackage{l3keys2e} \keys_define:nn { tikzinput } { @@ -130,7 +130,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{stex-tikzinput}{2022/05/24}{3.1.0}{stex-tikzinput} +\ProvidesExplPackage{stex-tikzinput}{2022/09/14}{3.2.0}{stex-tikzinput} \RequirePackage{stex} \RequirePackage{tikzinput} @@ -207,5 +207,14 @@ % % \PrintIndex -% LocalWords: bibfolder jobname.dtx tikzinput.dtx usetikzlibrary Gin@ewidth Gin@eheight -% LocalWords: resizebox ctikzinput mhtikzinput Gin@mhrepos mhpath +% \endinput +% Local Variables: +% mode: doctex +% TeX-master: t +% End: + +% LocalWords: libfolder jobname.dtx tikzinput.dtx usetikzlibrary Gin@ewidth Gin@eheight +% LocalWords: ctikzinput mhpath pgfkeys@spdef pgfutil@empty 1@atcode catcode l_tmpa_str +% LocalWords: pgfutil@InputIfFileExists libusetikzlibrary msg_error:nnn notinarchive +% LocalWords: seq_clear:N seq_set_eq:NN l_tmpa_seq c_stex_mathhub_seq seq_set_split:NnV +% LocalWords: l_tmpb_seq seq_if_empty_p:N tikzlibrary seq_put_right:No seq_pop_left:NN |