summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls
blob: 76455b2bb4f97b3681c5d0a24443ad35aee02a8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%%
%% This is file `omdoc.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% 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}
\RequirePackage{etoolbox}
\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
\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
\endinput
%%
%% End of file `omdoc.cls'.