\whatsnote_provide_module:n { layout } % \bool_if:NT \g__whatsnote_darkmode_bool % { % \pagecolor{black!90} % \hook_gput_code:nnn { env/document/before } { . } % { \color{gray!5}\global\let\default@color\current@color } % } \def\@makechapterhead#1 { \vspace*{ -25\p@ } { \parindent \z@ \raggedright \normalfont \int_compare:nNnT { \c@secnumdepth } > { \m@ne } { \if@mainmatter \parbox { 16ex } { \centering \@setfontsize\HUGE{30}{40} \normalfont\bfseries \textcolor{darkgray}{\thechapter} \vskip6\p@ \normalsize \bfseries\sffamily\scshape \textcolor{darkgray}{\@chapapp} } \fi } \interlinepenalty\@M \hspace*{2.5ex} \parbox { \dim_eval:n { \linewidth - 21ex } } { \huge \bfseries #1 } \par\nobreak \vskip 45\p@ } } \def\@makeschapterhead#1 { \renewcommand*{\thesection}{\arabic{section}} \renewcommand*{\theproblem}{\arabic{problem}} \setcounter{section}{0} \setcounter{problem}{0} \vspace*{-35\p@} { \centering \parindent \z@ \normalfont \interlinepenalty\@M \huge \bfseries #1\par\nobreak \vskip 30\p@ } } \box_new:N \l__whats_left_box \box_new:N \l__whats_right_box \box_new:N \l__whats_seg_box \keys_define:nn { whats / textfig } { lefthand~ratio .fp_set:N = \l__whats_left_ratio_fp , lefthand~ratio .initial:n = .64 , lefthand~width .dim_set:N = \l__whats_left_dim , righthand~ratio .fp_set:N = \l__whats_right_ratio_fp , righthand~ratio .initial:n = .32 , righthand~width .dim_set:N = \l__whats_right_dim , sidebyside~gap .dim_set:N = \l__whats_gap_dim , sidebyside~gap .initial:n = .02\linewidth , before~left .tl_set:N = \l__whats_before_left_tl , before~right .tl_set:N = \l__whats_before_right_tl , } \cs_new_protected:Npn \textfigsplit { %% Width is too small! Abort! \dim_compare:nNnT \l__whats_right_dim > { 10sp } { \__whats_textfig_end_save: \__whats_textfig_save:NN \l__whats_right_box \l__whats_right_dim \l__whats_before_right_tl \ignorespaces } } \NewDocumentEnvironment{textfig}{ O{} } { \medskip \keys_set:nn { whats / textfig } {#1} \__whats_calc_width: \__whats_textfig_save:NN \l__whats_left_box \l__whats_left_dim \l__whats_before_left_tl \ignorespaces } { \__whats_textfig_end_save: \__whats_textfig_typeset: \medskip } \cs_new:Npn \__whats_calc_width: { \bool_lazy_and:nnTF { \dim_compare_p:nNn \l__whats_left_dim = \c_zero_dim } { \dim_compare_p:nNn \l__whats_right_dim = \c_zero_dim } { \bool_lazy_and:nnTF { \fp_compare_p:nNn { abs ( \l__whats_left_ratio_fp ) } < { 0.0001 } } { \fp_compare_p:nNn { abs ( \l__whats_right_ratio_fp ) } < { 0.0001 } } { \dim_set:Nn \l__whats_left_dim { 0.5\linewidth - 0.5\l__whats_gap_dim } \dim_set:Nn \l__whats_right_dim { \l__whats_left_dim } } { \fp_compare:nNnTF { abs ( \l__whats_left_ratio_fp ) } < { 0.0001 } { \dim_set:Nn \l__whats_right_dim { \fp_use:N \l__whats_right_ratio_fp \dimexpr \linewidth - \l__whats_gap_dim \relax } \dim_set:Nn \l__whats_left_dim { \linewidth - \l__whats_gap_dim - \l__whats_right_dim } } { \dim_set:Nn \l__whats_left_dim { \fp_use:N \l__whats_left_ratio_fp \dimexpr \linewidth - \l__whats_gap_dim \relax } \dim_set:Nn \l__whats_right_dim { \linewidth - \l__whats_gap_dim - \l__whats_left_dim } } } } { \dim_compare:nNnTF \l__whats_left_dim = \c_zero_dim { \dim_set:Nn \l__whats_left_dim { \linewidth - \l__whats_gap_dim - \l__whats_right_dim } } { \dim_set:Nn \l__whats_right_dim { \linewidth - \l__whats_gap_dim - \l__whats_left_dim } } } } \cs_new:Npn \__whats_textfig_save:NN #1 #2 { \hbox_set:Nw #1 \minipage {#2} \setlength{\parindent}{0pt} } \cs_new:Npn \__whats_textfig_end_save: { \endminipage \hbox_set_end: } \cs_new:Npn \__whats_textfig_typeset: { \hbox_to_wd:nn { \linewidth } { \hbox_unpack_drop:N \l__whats_left_box \hss \hbox_unpack_drop:N \l__whats_right_box } } \RequirePackage{ tasks, multirow, multicol } \settasks { label = \sffamily\Alph*., item-indent = 2.5em, label-offset = .5pt } \RequirePackage[inline]{enumitem} \RequirePackage{fancyhdr} \endinput