diff --git a/CHANGELOG.md b/CHANGELOG.md index 71ee4ccb039c21e910f54b09307bebc719ca3239..82a1863062a514cbb14f9d43672c5cdd2c9640a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ All notable changes to this project will be documented in this file. - option `abstract` - `abstract=keywords|nokeywords` to enable/disable the display of keywords after the abstract - `abstract=totoc|notoc` to add the abstract to the TOC +- extenx KOMA option `toc` + - `toc=totoc|notoc` to add toc to itself + - `toc=abstrct|noabstract` as alias for `abstract=totoc` and `abstract=notoc` ## [3.0] diff --git a/src/HsH-article.cls b/src/HsH-article.cls index 4c23aeb1189b13df15eafb16f2b6a7eae7591ece..59d25ab4ae36e9afc76fd5de01cf00c20009133b 100644 --- a/src/HsH-article.cls +++ b/src/HsH-article.cls @@ -153,6 +153,37 @@ \endgroup \fi } +\DefineFamilyKey{HsH}{toc}{% + \begingroup + \FamilySetNumerical{HsH}{toc}{@tempa}{% + {totoc}{0},{toc}{0},% + {notoc}{1},{nottotoc}{1},% + {abstract}{2},% + {noabstract}{3},% + }{#1} + \ifx\FamilyKeyState\FamilyKeyStateProcessed + \aftergroup\FamilyKeyStateProcessed + \ifcase\@tempa% 0 + \endgroup + \AtEndOfClass{\setuptoc{toc}{totoc}} + \or% 1 + \endgroup + \AtEndOfClass{\unsettoc{toc}{totoc}} + \or% 2 + \endgroup + \FamilyExecuteOptions{HsH}{abstract=totoc} + \or% 3 + \endgroup + \FamilyExecuteOptions{HsH}{abstract=nottotoc} + \else% should never be + \endgroup + \fi + \else + \endgroup + \HsH@Options@PassToParrent{toc=#1} + \FamilyKeyStateProcessed + \fi +} \DefineFamilyKey{HsH}{twoside}[semi]{% \HsH@Options@PassToParrent{twoside=#1,BCOR=1cm} \FamilyKeyStateProcessed diff --git a/src/HsH-classes.dtx b/src/HsH-classes.dtx index 333d070a43f3542d21d9a5409d7ec33b3521c27d..e1d4c9f0e38781e7689c91a38e2e9bd7db5947fd 100644 --- a/src/HsH-classes.dtx +++ b/src/HsH-classes.dtx @@ -263,6 +263,16 @@ http://www.latex-project.org/lppl.txt % \item[notoc] The abstract will \emph{not} be listed in the table of contentes. % \end{options} % +% \DescribeOption{toc} +% The \opt{toc=\meta{opt}} option configures what is listed in the table of contents. +% \begin{options} +% \item[totoc] The table of contentes will list itself. +% \item[notoc] The table of contentes will \emph{not} list itself. +% \item[abstract] The abstract will be listed in the table of contentes. +% \item[noabstract] The abstract will \emph{not} be listed in the table of contentes. +% \item[\dots] see \href{http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#table.3.5}{\KOMAScript{} manual, Table 3.5} for more options +% \end{options} +% % \paragraph{Often relevant \KOMAScript\ options} % The following options are implemented by the parrent classes and only listed here % for completness. For more detils, see \href{http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf?page=239#chapter.3}{its manual}. @@ -690,6 +700,43 @@ http://www.latex-project.org/lppl.txt % \end{macrocode} % \end{option} % +% \begin{option}{toc} +% The \opt{toc} option is a \KOMAScript options we just extend. Options for the abstract and toc are added. +% \begin{macrocode} +\DefineFamilyKey{HsH}{toc}{% + \begingroup + \FamilySetNumerical{HsH}{toc}{@tempa}{% + {totoc}{0},{toc}{0},% + {notoc}{1},{nottotoc}{1},% + {abstract}{2},% + {noabstract}{3},% + }{#1} + \ifx\FamilyKeyState\FamilyKeyStateProcessed + \aftergroup\FamilyKeyStateProcessed + \ifcase\@tempa% 0 + \endgroup + \AtEndOfClass{\setuptoc{toc}{totoc}} + \or% 1 + \endgroup + \AtEndOfClass{\unsettoc{toc}{totoc}} + \or% 2 + \endgroup + \FamilyExecuteOptions{HsH}{abstract=totoc} + \or% 3 + \endgroup + \FamilyExecuteOptions{HsH}{abstract=nottotoc} + \else% should never be + \endgroup + \fi + \else + \endgroup + \HsH@Options@PassToParrent{toc=#1} + \FamilyKeyStateProcessed + \fi +} +% \end{macrocode} +% \end{option} +% % For the \opt{twoside} option we only redefine the default, everyting else is % handled by the parrent class. % \begin{macrocode} @@ -1334,7 +1381,6 @@ http://www.latex-project.org/lppl.txt % \end{macrocode} % % \subsubsection{Page layout} -% % \begin{macrocode} %<*!standalone> \areaset[current]{0.75\paperwidth}{0.8\paperheight} diff --git a/src/HsH-classes.pdf b/src/HsH-classes.pdf index 62c6ae4648fc9a280d90d284a39a4eef44546fc0..d8658378e80ede5cd72ede4124c8a027071c9848 100644 --- a/src/HsH-classes.pdf +++ b/src/HsH-classes.pdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7489922caaea27cbd74442ffe49cb6998c4e1d6a43ea1cedde8f00e0f938e1ca -size 313847 +oid sha256:f8ded54f026e76b9a601a3e11c36b02ade14144ceba8415fe2bcaa6494fcd2d7 +size 315327 diff --git a/src/HsH-report.cls b/src/HsH-report.cls index 904809685fac8aca916da3284a8ade7ba1be8a20..9582d332d5446bf6a717480b7c1e82d5e175e757 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -153,6 +153,37 @@ \endgroup \fi } +\DefineFamilyKey{HsH}{toc}{% + \begingroup + \FamilySetNumerical{HsH}{toc}{@tempa}{% + {totoc}{0},{toc}{0},% + {notoc}{1},{nottotoc}{1},% + {abstract}{2},% + {noabstract}{3},% + }{#1} + \ifx\FamilyKeyState\FamilyKeyStateProcessed + \aftergroup\FamilyKeyStateProcessed + \ifcase\@tempa% 0 + \endgroup + \AtEndOfClass{\setuptoc{toc}{totoc}} + \or% 1 + \endgroup + \AtEndOfClass{\unsettoc{toc}{totoc}} + \or% 2 + \endgroup + \FamilyExecuteOptions{HsH}{abstract=totoc} + \or% 3 + \endgroup + \FamilyExecuteOptions{HsH}{abstract=nottotoc} + \else% should never be + \endgroup + \fi + \else + \endgroup + \HsH@Options@PassToParrent{toc=#1} + \FamilyKeyStateProcessed + \fi +} \DefineFamilyKey{HsH}{twoside}[semi]{% \HsH@Options@PassToParrent{twoside=#1,BCOR=1cm} \FamilyKeyStateProcessed