diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls index 76455b2bb4f..0b339f1841e 100644 --- a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls +++ b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls @@ -7,44 +7,48 @@ %% omdoc.dtx (with options: `cls') %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesClass{omdoc}[2016/04/07 v1.2 OMDoc Documents] -\def\omdoc@class{article} -\DeclareOption{report}{\def\omdoc@class{report}% - \PassOptionsToPackage{\CurrentOption}{omdoc} - \PassOptionsToPackage{\CurrentOption}{stex}} -\newif\ifclass@book\class@bookfalse -\DeclareOption{book}{\def\omdoc@class{book}\class@booktrue% - \PassOptionsToPackage{\CurrentOption}{omdoc} - \PassOptionsToPackage{\CurrentOption}{stex}} -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\omdoc@class} - \PassOptionsToPackage{\CurrentOption}{omdoc} - \PassOptionsToPackage{\CurrentOption}{stex}} -\ProcessOptions -\LoadClass{\omdoc@class} +\ProvidesClass{omdoc}[2019/03/20 v1.3 OMDoc Documents] \RequirePackage{etoolbox} +\RequirePackage{kvoptions} +\SetupKeyvalOptions{family=omdoc@cls,prefix=omdoc@cls@} +\DeclareStringOption[article]{class} +\AddToKeyvalOption*{class}{\PassOptionsToPackage{class=\omdoc@cls@class}{omdoc}} +\DeclareVoidOption{report}{\def\omdoc@cls@class{report}% +\ClassWarning{omdoc}{the option 'report' is deprecated, use 'class=report', instead}} +\DeclareVoidOption{book}{\def\omdoc@cls@class{book}% +\ClassWarning{omdoc}{the option 'part' is deprecated, use 'class=book', instead}} +\DeclareVoidOption{bookpart}{\def\omdoc@cls@class{book}% +\PassOptionsToPackage{topsect=chapter}{omdoc}% +\ClassWarning{omdoc}{the option 'bookpart' is deprecated, use 'class=book,topsect=chapter', instead}} +\def\@omdoc@cls@docopt{} +\DeclareDefaultOption{% +\ifx\@omdoc@cls@docopt\@empty% +\xdef\@omdoc@cls@docopt{\CurrentOption}% +\else\xappto\@omdoc@cls@docopt{,\CurrentOption}% +\fi}% +\PassOptionsToPackage{\CurrentOption}{omdoc} +\PassOptionsToPackage{\CurrentOption}{stex} +\ProcessKeyvalOptions{omdoc@cls} +\LoadClass[\@omdoc@cls@docopt]{\omdoc@cls@class} \RequirePackage{omdoc} \RequirePackage{stex} \srefaddidkey{document} \newcommand\documentkeys[1]{\metasetkeys{document}{#1}} \let\orig@document=\document -\srefaddidkey{document} \renewcommand{\document}[1][]{\metasetkeys{document}{#1}\orig@document} -\ifclass@book -\renewenvironment{frontmatter} -{\@frontmattertrue\cleardoublepage\@mainmatterfalse\pagenumbering{roman}} -{\@frontmatterfalse\setcounter{page}{1}\pagenumbering{arabic}} -\else +\ifcsdef{frontmatter}% to redefine if necessary + {\cslet{orig@frontmatter}{\frontmatter}\cslet{frontmatter}{\relax}} + {\cslet{orig@frontmatter}{\clearpage\@mainmatterfalse\pagenumbering{roman}}} +\ifcsdef{backmatter}% to redefine if necessary + {\cslet{orig@backmatter}{\backmatter}\cslet{backmatter}{\relax}} + {\cslet{orig@backmatter}{\clearpage\@mainmatterfalse\pagenumbering{roman}}} \newenvironment{frontmatter} -{\@frontmattertrue\pagenumbering{roman}} -{\@frontmatterfalse\setcounter{page}{1}\pagenumbering{arabic}} -\fi -\ifclass@book -\renewenvironment{backmatter} -{\cleardoublepage\@mainmatterfalse\@backmattertrue} -{\@backmatterfalse} -\else -\newenvironment{backmatter}{\@backmattertrue}{\@backmatterfalse} -\fi +{\orig@frontmatter} +{\ifcsdef{mainmatter}{}{\clearpage\@mainmattertrue\pagenumbering{arabic}}} +\newenvironment{backmatter} +{\orig@backmatter} +{\ifcsdef{mainmatter}{}{\clearpage\@mainmattertrue\pagenumbering{arabic}}} +\pagenumbering{arabic} \endinput %% %% End of file `omdoc.cls'. |