%% %% This is file `notesslides.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% notesslides.dtx (with options: `package') %% \ProvidesExplPackage{notesslides}{2023/03/19}{3.3.0}{notesslides Package} \RequirePackage{l3keys2e} \keys_define:nn{notesslides / pkg}{ 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 , topsect .str_set_x:N = \c_notesslides_topsect_str, unknown .code:n = { \PassOptionsToPackage{\CurrentOption}{stex} \PassOptionsToPackage{\CurrentOption}{tikzinput} } } \ProcessKeysOptions{ notesslides / pkg } \RequirePackage{stex} \stex_if_html_backend:T { \bool_set_true:N\c_notesslides_notes_bool } \cs_set:Npn \sectiontitleemph #1 { \textbf{\Large #1} } \newif\ifnotes \bool_if:NTF \c_notesslides_notes_bool { \notestrue \PassOptionsToPackage{usenames,dvipsnames,svgnames}{xcolor} \RequirePackage[noamsthm,hyperref]{beamerarticle} \RequirePackage{mdframed} \str_if_empty:NTF \c_notesslides_topsect_str{ %\setsectionlevel{section} } { \exp_args:No \setsectionlevel \c_notesslides_topsect_str } }{ \notesfalse \cs_new_protected:Nn \__notesslides_do_sectocframes: { \cs_set_protected:Nn \__notesslides_do_label:n { \str_case:nnF{##1}{ {part} { \tl_set:Nx\l__notesslides_num{\thepart} \tl_set:cx{@ @ label}{ \cs_if_exist:NTF\parttitlename{\exp_not:N\parttitlename}{\exp_not:N\partname}{}~\l__notesslides_num\\} } {chapter} { \tl_set:Nx\l__notesslides_num{\thechapter} \tl_set:cx{@ @ label}{ \cs_if_exist:NTF\chaptertitlename{\exp_not:N\chaptertitlename}{\exp_not:N\chaptername}{}~\l__notesslides_num\\} } {section} { \tl_set:Nx\l__notesslides_num{\cs_if_exist:NT\thechapter{\thechapter.}\thesection} \tl_set:cx{@ @ label}{\l__notesslides_num\quad} } {subsection} { \tl_set:Nx\l__notesslides_num{\cs_if_exist:NT\thechapter{\thechapter.}\thesection.\thesubsection} \tl_set:cx{@ @ label}{\l__notesslides_num\quad} } {subsubsection} { \tl_set:Nx\l__notesslides_num{\cs_if_exist:NT\thechapter{\thechapter.}\thesection.\thesubsection.\thesubsubsection} \tl_set:cx{@ @ label}{\l__notesslides_num\quad} } {paragraph} { \tl_set:Nx\l__notesslides_num{\cs_if_exist:NT\thechapter{\thechapter.}\thesection.\thesubsection.\thesubsubsection.\theparagraph} \tl_set:cx{@ @ label}{\l__notesslides_num\quad} } }{ \tl_set:Nx\l__notesslides_num{\cs_if_exist:NT\thechapter{\thechapter.}\thesection.\thesubsection.\thesubsubsection.\theparagraph.\thesubparagraph} \tl_set:cx{@ @ label}{\l__notesslides_num\quad} } } \cs_set_protected:Nn \_sfragment_do_level:nn { \tl_if_exist:cT{c@##1}{\stepcounter{##1}} \addcontentsline{toc}{##1}{\protect\numberline{\use:c{the##1}}##2} \__notesslides_do_label:n{##1} \pdfbookmark[\int_use:N \l_stex_docheader_sect]{\l__notesslides_num\ ##2}{##1.\l__notesslides_num} \begin{frame}[noframenumbering] \vfill\centering \sectiontitleemph{ \use:c{@ @ label} ##2 } \end{frame} \int_incr:N \l_stex_docheader_sect \tl_set:Nn \stex_current_section_level{##1} } } \AtBeginDocument{ \str_if_empty:NTF \c_notesslides_topsect_str { \setsectionlevel{section} } { \exp_args:No \setsectionlevel \c_notesslides_topsect_str \exp_args:No \str_if_eq:nnTF \c_notesslides_topsect_str {chapter} { \__notesslides_define_chapter: }{ \exp_args:No \str_if_eq:nnT \c_notesslides_topsect_str {part} { \__notesslides_define_chapter: \__notesslides_define_part: } } } } \bool_if:NT \c_notesslides_sectocframes_bool { \__notesslides_do_sectocframes: } } \cs_new_protected:Nn \__notesslides_define_chapter: { \cs_if_exist:NF \chaptername { \cs_set_protected:Npn \chaptername {Chapter} } \cs_if_exist:NF \chapter { \cs_set_protected:Npn \chapter {INVALID} } \cs_if_exist:NF \c@chapter { \newcounter{chapter}\counterwithin*{section}{chapter} } } \cs_new_protected:Nn \__notesslides_define_part: { \cs_if_exist:NF \partname { \cs_set_protected:Npn \partname {Part} } \cs_if_exist:NF \part { \cs_set_protected:Npn \part {INVALID} } \cs_if_exist:NF \c@part { \newcounter{part}\counterwithin*{chapter}{part} } } \def \c__notesslides_document_str{document} \newcommand\afterprematurestop{} \def\prematurestop@endsfragment{ \unless\ifx\@currenvir\c__notesslides_document_str \expandafter\expandafter\expandafter\end\expandafter\expandafter\expandafter{\expandafter\@currenvir\expandafter} \expandafter\prematurestop@endsfragment \fi } \providecommand\prematurestop{ \stex_if_html_backend:F{ \message{Stopping~sTeX~processing~prematurely} \prematurestop@endsfragment \afterprematurestop \end{document} } } \bool_if:NT \c_notesslides_notes_bool { \renewcommand\usetheme[2][]{\usepackage[#1]{beamertheme#2}} } \NewDocumentCommand \libusetheme {O{} m} { \libusepackage[#1]{beamertheme#2} } \newlength{\slidewidth}\setlength{\slidewidth}{13.5cm} \newlength{\slideheight}\setlength{\slideheight}{9cm} \ifnotes \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 } } \stex_keys_define:nnnn{notesslides / frame}{ \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 }{ 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 } }, unknown .code:n = {} }{} \cs_new_protected:Nn \__notesslides_setup_itemize: { \def\itemize@level{outer} \def\itemize@outer{outer} \def\itemize@inner{inner} %\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} } } \stex_if_html_backend:TF { \cs_new_protected:Nn \__notesslides_frame_box_begin: { \vbox\bgroup \begin{stex_annotate_env}{shtml:frame={}} \mdf@patchamsthm\notesslidesfont } \cs_new_protected:Nn \__notesslides_frame_box_end: { %^^A \notesslides@slidelabel \medskip\par\noindent\tiny\notesslidesfooter \end{stex_annotate_env}\egroup } }{ \cs_new_protected:Nn \__notesslides_frame_box_begin: { \begin{mdframed}[ linewidth=\slideframewidth, skipabove=1ex, skipbelow=1ex, userdefinedwidth=\slidewidth, align=center ]\notesslidesfont } \cs_new_protected:Nn \__notesslides_frame_box_end: { \medskip\par\noindent\tiny\notesslidesfooter%^^A\notesslides@slidelabel \end{mdframed} } } \renewenvironment{frame}[1][]{ \stex_keys_set:nn{notesslides / frame}{#1} \stepcounter{framenumber} \renewcommand\newpage{\addtocounter{framenumber}{1}} \def\@currentlabel{\theframenumber} \str_if_empty:NF \l__notesslides_frame_label_str { \label{\l__notesslides_frame_label_str} } \__notesslides_setup_itemize: \__notesslides_frame_box_begin: }{ \__notesslides_frame_box_end: } \renewcommand{\frametitle}[1]{ \stexdoctitle { #1 } \notesslidestitleemph{#1}\medskip } \newcommand\pause{} \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 \bool_if:NTF \c_notesslides_notes_bool { \renewenvironment{note}{\ignorespaces}{} }{ \renewenvironment{note}{\setbox \l_tmpa_box\vbox\bgroup}{\egroup} } \cs_new_protected:Nn \__notesslides_notes_env:nnnn { \bool_if:NTF \c_notesslides_notes_bool { \newenvironment{#1}#2{#3}{#4} }{ \newenvironment{#1}#2{ \cs_set:Npn \__notesslides_eat: ####1 \end ####2 { \str_if_eq:nnTF{#1}{####2}{ \end{#1} }{ \__notesslides_eat: } } \__notesslides_eat: %\setbox\l_tmpa_box\vbox\bgroup#3 }{ %#4\egroup } } } \__notesslides_notes_env:nnnn{nparagraph}{[1][]}{\begin{sparagraph}[#1]}{\end{sparagraph}} \__notesslides_notes_env:nnnn{nfragment}{[2][]}{\begin{sfragment}[#1]{#2}}{\end{sfragment}} \__notesslides_notes_env:nnnn{ndefinition}{[1][]}{\begin{sdefinition}[#1]}{\end{sdefinition}} \__notesslides_notes_env:nnnn{nassertion}{[1][]}{\begin{sassertion}[#1]}{\end{sassertion}} \__notesslides_notes_env:nnnn{nproof}{[2][]}{\begin{sproof}[#1]{#2}}{\end{sproof}} \__notesslides_notes_env:nnnn{nexample}{[1][]}{\begin{sexample}[#1]}{\end{sexample}} \RequirePackage{graphicx} \NewDocumentCommand\frameimage{s O{} m}{ \IfBooleanTF #1 { \begin{frame}[plain] }{ \begin{frame} } \bool_if:NTF \c_notesslides_notes_bool { \slidewidth=\dimexpr\slidewidth-(2\slideframewidth)\relax }{ \slidewidth=\textwidth\relax } \def\Gin@ewidth{}\setkeys{Gin}{#2} \tl_if_empty:NTF \Gin@ewidth { \mhgraphics[width=\slidewidth,#2]{#3} }{ \mhgraphics[#2]{#3} } \end{frame} } \cs_set_eq:NN\__notesslides_inputref:\inputref \cs_set_protected:Npn\inputref{\@ifstar\ninputref\__notesslides_inputref:} \bool_if:NTF \c_notesslides_notes_bool { \newcommand\ninputref[2][]{ \__notesslides_inputref:[#1]{#2} } }{ \newcommand\ninputref[2][]{} } \def\notesslidestitleemph#1{ {\Large\bf\sf#1} \vskip0.1\baselineskip \leaders\vrule width \textwidth \vskip0.4pt% \nointerlineskip } \def\notesslidesfooter{} \let\notesslidesfont\sffamily \bool_if:NT \c_notesslides_notes_bool { \def\author{\@dblarg\ns@author} \long\def\ns@author[#1]#2{% \tl_if_empty:nTF{#1}{ \def\beamer@shortauthor{#2} }{ \def\beamer@shortauthor{#1} } \def\@author{#2} } \def\title{\@dblarg\ns@title} \long\def\ns@title[#1]#2{% \tl_if_empty:nTF{#1}{ \def\beamer@shorttitle{#2} }{ \def\beamer@shorttitle{#1} } \def\@title{#2} \stexdoctitle{#2} } \def\insertshortauthor{ \hbox\bgroup\def\\{}\cs_if_exist:NT\beamer@shortauthor\beamer@shortauthor\egroup } \def\insertshorttitle{ \hbox\bgroup\def\\{}\cs_if_exist:NT\beamer@shorttitle\beamer@shorttitle\egroup } \stex_if_html_backend:TF{ \def\insertframenumber{\stex_annotate:nn{shtml:framenumber={}}{}} }{ \def\insertframenumber{\@arabic\c@framenumber} } \def\insertshortdate{\today} } \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][]{ \tl_gput_right:Nn\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, archive .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 } \tl_if_empty:NF\printexcursions {\IfInputref{}{\begin{note} \begin{sfragment}{Excursions}% TODO pass on id \ifdefempty\l__notesslides_excursion_intro_tl{}{ \exp_args:NNe \use:nn \inputref{[\l__notesslides_excursion_mhrepos_str]{ \l__notesslides_excursion_intro_tl }} } \printexcursions% \end{sfragment} \end{note}}} } \ifcsname beameritemnestingprefix\endcsname\else\def\beameritemnestingprefix{}\fi \prop_new:N \g__notesslides_variables_prop \cs_set_protected:Npn \setSGvar #1 #2 { \prop_gput:Nnn \g__notesslides_variables_prop {#1}{#2} } \cs_set_protected:Npn \useSGvar #1 { \prop_item:Nn \g__notesslides_variables_prop {#1} } \cs_set_protected:Npn \ifSGvar #1 #2 #3 { \prop_get:NnNF \g__notesslides_variables_prop {#1} \l__notesslides_tmp { \PackageError{document-structure} {The sTeX Global variable #1 is undefined} {set it with \protect\setSGvar}\TODO better error } \tl_if_eq:NnT \l__notesslides_tmp {#2}{ #3 } } \endinput %% %% End of file `notesslides.sty'.