summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty
blob: ae8ac70857819b419c907e652d5011d2438ce142 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
%%
%% This is file `omdoc.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% omdoc.dtx  (with options: `package')
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{omdoc}[2019/03/20 v1.3 OMDoc document Structure]
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=omdoc@sty,prefix=omdoc@sty@}
\DeclareBoolOption{mh}
\DeclareStringOption[article]{class}
\DeclareBoolOption{showignores}
\DeclareStringOption[section]{topsect}
\newcount\section@level
\DeclareDefaultOption{\PassOptionsToPackage{\CurrentOption}{sref}}
\ProcessKeyvalOptions{omdoc@sty}
\ifomdoc@sty@mh\RequirePackage{omdoc-mh}\fi
\RequirePackage{sref}
\RequirePackage{xspace}
\RequirePackage{comment}
\RequirePackage{pathsuris}
\section@level=2
\ifdefstring{\omdoc@sty@class}{book}{\section@level=0}{}
\ifdefstring{\omdoc@sty@class}{report}{\section@level=0}{}
\ifdefstring{\omdoc@sty@topsect}{part}{\section@level=0}{}
\ifdefstring{\omdoc@sty@topsect}{chapter}{\section@level=1}{}
\def\current@section@level{document}%
\newcommand\currentsectionlevel{\lowercase\expandafter{\current@section@level}\xspace}%
\newcommand\Currentsectionlevel{\expandafter\MakeUppercase\current@section@level\xspace}%
\newcommand\at@begin@blindomgroup[1]{}
\newenvironment{blindomgroup}
{\advance\section@level by 1\at@begin@blindomgroup\setion@level}
{\advance\section@level by -1}
\newcommand\omgroup@nonum[2]{%
\ifx\hyper@anchor\@undefined\else\phantomsection\fi%
\addcontentsline{toc}{#1}{#2}\@nameuse{#1}*{#2}}
\newcommand\omgroup@num[2]{%
\edef\@@ID{\sref@id}
\ifx\omgroup@short\@empty% no short title
\@nameuse{#1}{#2}%
\else% we have a short title
\@ifundefined{rdfmeta@sectioning}%
  {\@nameuse{#1}[\omgroup@short]{#2}}%
  {\@nameuse{rdfmeta@#1@old}[\omgroup@short]{#2}}%
\fi%
\sref@label@id@arg{\omdoc@sect@name~\@nameuse{the#1}}\@@ID}
\def\@true{true}
\def\@false{false}
\srefaddidkey{omgroup}
\addmetakey{omgroup}{date}
\addmetakey{omgroup}{creators}
\addmetakey{omgroup}{contributors}
\addmetakey{omgroup}{srccite}
\addmetakey{omgroup}{type}
\addmetakey*{omgroup}{short}
\addmetakey*{omgroup}{display}
\addmetakey[false]{omgroup}{loadmodules}[true]
\newif\if@@num\@@numtrue
\newif\if@mainmatter\@mainmattertrue
\newcommand\at@begin@omgroup[3][]{}
\addmetakey{omdoc@sect}{name}
\addmetakey[false]{omdoc@sect}{clear}[true]
\addmetakey{omdoc@sect}{ref}
\addmetakey[false]{omdoc@sect}{num}[true]
\newcommand\omdoc@sectioning[3][]{\metasetkeys{omdoc@sect}{#1}%
\ifx\omdoc@sect@clear\@true\cleardoublepage\fi%
\if@@num% numbering not overridden by frontmatter, etc.
\ifx\omdoc@sect@num\@true\omgroup@num{#2}{#3}\else\omgroup@nonum{#2}{#3}\fi%
\def\current@section@level{\omdoc@sect@name}%
\else\omgroup@nonum{#2}{#3}%
\fi}% if@@num
\newcommand\omgroup@redefine@addtocontents[1]{%
\edef\@@import{#1}%
\@for\@I:=\@@import\do{%
\edef\@path{\csname module@\@I  @path\endcsname}%
\@ifundefined{tf@toc}\relax%
     {\protected@write\tf@toc{}{\string\@requiremodules{\@path}{sms}}}}
\ifx\hyper@anchor\@undefined% hyperref.sty loaded?
\def\addcontentsline##1##2##3{%
\addtocontents{##1}{\protect\contentsline{##2}{\string\withusedmodules{#1}{##3}}{\thepage}}}
\else% hyperref.sty not loaded
\def\addcontentsline##1##2##3{%
\addtocontents{##1}{\protect\contentsline{##2}{\string\withusedmodules{#1}{##3}}{\thepage}{\@currentHref}}}%
\fi}% hypreref.sty loaded?
\newenvironment{omgroup}[2][]% keys, title
{\metasetkeys{omgroup}{#1}\sref@target%
\ifx\omgroup@display\st@flow\@@numfalse\fi
\if@mainmatter\else\@@numfalse\fi
\ifx\omgroup@loadmodules\@true%
\omgroup@redefine@addtocontents{\@ifundefined{mod@id}\used@modules%
{\@ifundefined{module@\mod@id @path}{\used@modules}\mod@id}}\fi%
\advance\section@level by 1\relax%
\ifcase\section@level%
\or\omdoc@sectioning[name=Part,clear,num]{part}{#2}%
\or\omdoc@sectioning[name=Chapter,clear,num]{chapter}{#2}%
\or\omdoc@sectioning[name=Section,num]{section}{#2}%
\or\omdoc@sectioning[name=Subsection,num]{subsection}{#2}%
\or\omdoc@sectioning[name=Subsubsection,num]{subsubsection}{#2}%
\or\omdoc@sectioning[name=Paragraph,ref=this paragraph]{paragraph}{#2}%
\or\omdoc@sectioning[name=Subparagraph,ref=this subparagraph]{paragraph}{#2}%
\fi% \ifcase
\at@begin@omgroup[#1]\section@level{#2}}% for customization
{\advance\section@level by -1}
\providecommand\printindex{\IfFileExists{\jobname.ind}{\input{\jobname.ind}}{}}
\ifomdoc@sty@showignores
\addmetakey{ignore}{type}
\addmetakey{ignore}{comment}
\newenvironment{ignore}[1][]
{\metasetkeys{ignore}{#1}\textless\ignore@type\textgreater\bgroup\itshape}
{\egroup\textless/\ignore@type\textgreater}
\renewenvironment{ignore}{}{}\else\excludecomment{ignore}\fi
\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}
\newcommand\setSGvar[1]{\@namedef{sTeX@Gvar@#1}}
\newcommand\useSGvar[1]{\@nameuse{sTeX@Gvar@#1}}
\newcommand\ifSGvar[3]{\def\@test{#2}\expandafter\ifx\csname sTeX@Gvar@#1\endcsname\@test #3\fi}
\def\black#1{\textcolor{black}{#1}}
\def\gray#1{\textcolor{gray}{#1}}
\def\blue#1{\textcolor{blue}{#1}}
\def\red#1{\textcolor{red}{#1}}
\def\green#1{\textcolor{green}{#1}}
\def\cyan#1{\textcolor{cyan}{#1}}
\def\magenta#1{\textcolor{magenta}{#1}}
\def\brown#1{\textcolor{brown}{#1}}
\def\yellow#1{\textcolor{yellow}{#1}}
\def\orange#1{\textcolor{orange}{#1}}
\endinput
%%
%% End of file `omdoc.sty'.