%% %% 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'.