diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty | 114 |
1 files changed, 75 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty index 54f275d7c46..8cde99fa719 100644 --- a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty +++ b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty @@ -7,51 +7,87 @@ %% omdoc.dtx (with options: `package') %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{omdoc}[2012/01/28 v1.0 OMDoc document Structure] -\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} -\newif\if@chapter\@chapterfalse -\newif\if@part\@partfalse -\newcount\section@level\section@level=3 +\ProvidesPackage{omdoc}[2016/04/07 v1.2 OMDoc document Structure] \newif\ifshow@ignores\show@ignoresfalse -\def\omdoc@class{article} -\DeclareOption{report}{\def\omdoc@class{report}\section@level=2} -\DeclareOption{book}{\def\omdoc@class{book}\section@level=1} -\DeclareOption{chapter}{\section@level=2\@chaptertrue} -\DeclareOption{part}{\section@level=1\@chaptertrue\@parttrue} \DeclareOption{showignores}{\show@ignorestrue} -\DeclareOption{extrefs}{\PassOptionsToPackage{\CurrentOption}{sref}} +\newcount\section@level\section@level=2 +\DeclareOption{report}{\section@level=0} +\DeclareOption{book}{\section@level=0} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{sref}} \ProcessOptions \RequirePackage{sref} \RequirePackage{xspace} \RequirePackage{comment} -\def\level@section#1{\ifcase#1\or{part}\or{chapter}\or{section}\or{subsection}\or{subsubsection}\or{paragraph}\or{subparagraph}\fi} -\def\Level@Section#1{\ifcase#1\or{Part}\or{Chapter}\or{Section}\or{Subsection}\or{Subsubsection}\or{Paragraph}\or{Subparagraph}\fi} -\def\in@level@section#1{\ifcase#1\or{this document}\or{part}\or{chapter}\or{section}\or{subsection}\or{subsubsection}\or{paragraph}\or{subparagraph}\fi} -\def\In@Level@Section#1{\ifcase#1\or{This document}\or{Part}\or{Chapter}\or{Section}\or{Subsection}\or{Subsubsection}\or{Paragraph}\or{Subparagraph}\fi} -\def\currentsectionlevel{\in@level@section\section@level\xspace} -\def\CurrentSectionLevel{\In@Level@Section\section@level\xspace} +\RequirePackage{pathsuris} +\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]{% +\sref@label@id{\omdoc@sect@name~\@nameuse{the#1}}% +\ifx\omgroup@short\@empty\@nameuse{#1}{#2}% +\else\@ifundefined{rdfmeta@sectioning}{\@nameuse{#1}[\omgroup@short]{#2}}% +{\@nameuse{rdfmeta@#1@old}[\omgroup@short]{#2}}% +\fi} +\def\@true{true} +\def\@false{false} \srefaddidkey{omgroup} -\addmetakey{omgroup}{creators} \addmetakey{omgroup}{date} +\addmetakey{omgroup}{creators} \addmetakey{omgroup}{contributors} +\addmetakey{omgroup}{srccite} \addmetakey{omgroup}{type} \addmetakey*{omgroup}{short} \addmetakey*{omgroup}{display} -\def\at@begin@omgroup#1{} +\addmetakey[false]{omgroup}{loadmodules}[true] +\newif\if@@num\@@numtrue +\newif\if@frontmatter\@frontmatterfalse +\newif\if@backmatter\@backmatterfalse +\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} +\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\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\noindent{\Large\textbf{#2}\\[.3ex]\noindent\ignorespaces}% -\else% -\if@part\ifnum\section@level=1\part{#2}\sref@label@id{Part \thepart}\fi\fi% -\if@chapter\ifnum\section@level=2\chapter{#2}\sref@label@id{Chapter \thechapter}\fi\fi% -\ifnum\section@level=3\section{#2}\sref@label@id{Section \thesection}\fi% -\ifnum\section@level=4\subsection{#2}\sref@label@id{Subsection \thesubsection}\fi% -\ifnum\section@level=5\subsubsection{#2}\sref@label@id{Subsubsection \thesubsubsection}\fi% -\ifnum\section@level=6\paragraph{#2}\sref@label@id{this paragraph}\fi% -\ifnum\section@level=7\subparagraph{#2}\sref@label@id{this subparagraph}\fi% -\at@begin@omgroup\section@level% for customization -\advance\section@level by 1% -\fi}{\advance\section@level by -1} +\ifx\omgroup@display\st@flow\@@numfalse\fi +\if@frontmatter\@@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 +\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}}{}} \ifshow@ignores \addmetakey{ignore}{type} @@ -60,11 +96,15 @@ {\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}} -\def\STRcopy#1{\expandafter\ifx\csname STR@#1\endcsname\relax -\message{STR warning: reference #1 undefined!} -\else\csname STR@#1\endcsname\fi} -\newcommand{\STRsemantics}[3][]{#2\def\@test{#1}\ifx\@test\@empty\STRlabeldef{#1}{#2}\fi} +\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} \def\black#1{\textcolor{black}{#1}} \def\gray#1{\textcolor{gray}{#1}} @@ -76,10 +116,6 @@ \def\brown#1{\textcolor{brown}{#1}} \def\yellow#1{\textcolor{yellow}{#1}} \def\orange#1{\textcolor{orange}{#1}} -\newcommand\hateq{\ensuremath{\hat=}\xspace} -\newcommand\hatequiv{\ensuremath{\hat\equiv}\xspace} -\newcommand\textleadsto{\ensuremath{\leadsto}\xspace} -\newcommand{\baseURI}[2][]{} \endinput %% %% End of file `omdoc.sty'. |