summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/structview/structview.sty
blob: a233ce55c13277b0057e0a5d2ef73caf55520772 (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
%%
%% This is file `structview.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% structview.dtx  (with options: `package')
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{structview}[2019/03/20 v0.9 Structures and Views]
\newif\if@structview@mh@\@structview@mh@false
\DeclareOption{mh}{\@structview@mh@true
\PassOptionsToPackage{\CurrentOption}{modules}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{modules}}
\ProcessOptions
\if@structview@mh@\RequirePackage{structview-mh}\fi
\RequirePackage{modules}
\newrobustcmd\vassign[3][]{\ifmod@show\ensuremath{#2\mapsto #3}, \fi}%
\newrobustcmd\fassign[4][]{\ifmod@show \ensuremath{#3(#2)\mapsto #4}, \fi}%
\newrobustcmd\tassign[3][]{\ifmod@show \ensuremath{#2\mapsto} #3, \fi}%
\newenvironment{sstructure}[3][]{%
  \gdef\@@doit{\importmodule[#1]{#3}}%
  \ifmod@show\par\noindent importing module #3 via \@@doit\fi%
}{%
  \aftergroup\@@doit\ifmod@show end import\fi%
}%
\newenvironment{importmodulevia}[2][]%
{\PackageError{structview}%
  {The {importmodulevia} environment is deprecated}{use the {sstructure} instead!}%
  \begin{sstructure}[#1]{missing}{#2}}
{\end{sstructure}}
\srefaddidkey{view}
\addmetakey*{view}{title}
\addmetakey{view}{display}
\addmetakey{view}{loadfrom}
\addmetakey{view}{loadto}
\addmetakey{view}{creators}
\addmetakey{view}{contributors}
\addmetakey{view}{srccite}
\addmetakey{view}{type}
\addmetakey[sms]{view}{ext}
\ifdef{\thesection}{\newcounter{view}[section]}{\newcounter{view}}
\newrobustcmd\view@heading[4]{%
  \if@importing%
  \else%
    \stepcounter{view}%
    \edef\@display{#3}\edef\@title{#4}%
    \noindent%
      \ifx\@display\st@flow%
      \else%
        {\textbf{View} {\thesection.\theview} from \textsf{#1} to \textsf{#2}}%
        \sref@label@id{View \thesection.\theview}%
        \ifx\@title\@empty%
          \quad%
        \else%
          \quad(\@title)%
        \fi%
        \par\noindent%
      \fi%
      \ignorespaces%
  \fi%
}%ifmod@show
\newenvironment{view}[3][]{% keys, from, to
  \metasetkeys{view}{#1}%
  \sref@target%
  \begin{@view}{#2}{#3}%
  \view@heading{#2}{#3}{\view@display}{\view@title}%
}{%
  \end{@view}%
  \ignorespaces%
}%
\ifmod@show\surroundwithmdframed{view}\fi%
\newenvironment{@view}[2]{%from, to
  \@importmodule[\view@loadfrom]{#1}{\view@ext}%
  \@importmodule[\view@loadto]{#2}{\view@ext}%
}{}%
\newenvironment{viewsketch}[3][]%
{\PackageError{structview}%
  {The {viewsketch} environment is deprecated}{use the {view} instead!}%
  \begin{view}[#1]{#2}{#3}}
{\end{view}}
\newrobustcmd\obligation[3][]{%
  \if@importing%
  \else Axiom #2 is proven by \sref{#3}%
  \fi%
}%
\endinput
%%
%% End of file `structview.sty'.