Isabelle_DOF/Isabelle_DOF-Ontologies/CENELEC_50128/DOF-CENELEC_50128.sty

221 lines
7.7 KiB
TeX

%% Copyright (C) 2019 University of Exeter
%% 2018 University of Paris-Saclay
%% 2018 The University of Sheffield
%%
%% License:
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1.3c of the License, or (at your option) any later version.
%% OR
%% The 2-clause BSD-style license.
%%
%% SPDX-License-Identifier: LPPL-1.3c+ OR BSD-2-Clause
\NeedsTeXFormat{LaTeX2e}\relax
\ProvidesPackage{DOF-cenelec_50128}
[00/00/0000 Document-Type Support Framework for Isabelle (CENELEC 50128).]
\RequirePackage{DOF-COL}
\usepackage{etex}
\ifdef{\reserveinserts}{\reserveinserts{28}}{}
\usepackage[many]{tcolorbox}
\usepackage{marginnote}
% Index setup
\usepackage{index}
\makeindex
\AtEndDocument{\printindex}
\newcommand{\DOFindex}[2]{%
\marginnote{\normalfont\textbf{#1}: #2}%
\expandafter\index\expandafter{\expanded{#2 (#1)}}%
}%
%% SRAC
\providecolor{SRAC}{named}{green}
\ifcsdef{DeclareNewTOC}{%
\DeclareNewTOC[%
owner=\jobname,
type=SRAC,%
types=SRACs,%
listname={List of SRACs}%
]{tos}
\setuptoc{tos}{chapteratlist}
\AtEndEnvironment{frontmatter}{\listofSRACs}
}{}
\newtheorem{SRAC}{SRAC}
\tcolorboxenvironment{SRAC}{
boxrule=0pt
,boxsep=0pt
,colback={white!90!SRAC}
,enhanced jigsaw
,borderline west={2pt}{0pt}{SRAC}
,sharp corners
,before skip=10pt
,after skip=10pt
,breakable
}
\newcommand{\SRACautorefname}{SRAC}
\newisadof{textDOTCENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTSRAC}%
[label=,type=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTlevel=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTreferentiable=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTvariants=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTisUNDERSCOREconcerned=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTSRACDOTformalUNDERSCORErepr=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTSRACDOTassumptionUNDERSCOREkind=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTECDOTassumptionUNDERSCOREkind=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTassumptionDOTassumptionUNDERSCOREkind=%
][1]{%
\begin{isamarkuptext}%
\ifthenelse{\equal{\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}{}}{%
\begin{SRAC}%
\addxcontentsline{tos}{chapter}[]{\autoref{\commandkey{label}}}%
}{%
\begin{SRAC}[\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}]%
\addxcontentsline{tos}{chapter}[]{\autoref{\commandkey{label}}: \commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}%
\DOFindex{SRAC}{\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}%
}\label{\commandkey{label}}%
#1%
\end{SRAC}
\end{isamarkuptext}%
}
% EC
\providecolor{EC}{named}{blue}
\ifcsdef{DeclareNewTOC}{%
\DeclareNewTOC[%
owner=\jobname,
type=EC,%
types=ECs,%
listname={List of ECs}%
]{toe}
\setuptoc{toe}{chapteratlist}
\AtEndEnvironment{frontmatter}{\listofECs}
}{}
\newtheorem{EC}{EC}
\tcolorboxenvironment{EC}{
boxrule=0pt
,boxsep=0pt
,colback={white!90!EC}
,enhanced jigsaw
,borderline west={2pt}{0pt}{EC}
,sharp corners
,before skip=10pt
,after skip=10pt
,breakable
}
\newcommand{\ECautorefname}{EC}
\newisadof{textDOTCENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTEC}%
[label=,type=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTlevel=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTreferentiable=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTvariants=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTisUNDERSCOREconcerned=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTSRACDOTformalUNDERSCORErepr=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTSRACDOTassumptionUNDERSCOREkind=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTECDOTassumptionUNDERSCOREkind=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTassumptionDOTassumptionUNDERSCOREkind=%
][1]{%
\begin{isamarkuptext}%
\ifthenelse{\equal{\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}{}}{%
\begin{EC}%
\addxcontentsline{tos}{chapter}[]{\autoref{\commandkey{label}}}%
}{%
\begin{EC}[\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}]%
\addxcontentsline{toe}{chapter}[]{\autoref{\commandkey{label}}: \commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}%
\DOFindex{EC}{\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}%
}\label{\commandkey{label}}%
#1%
\end{EC}
\end{isamarkuptext}%
}
% assumptions
\providecolor{assumption}{named}{orange}
\newtheorem{assumption}{assumption}
\tcolorboxenvironment{assumption}{
boxrule=0pt
,boxsep=0pt
,colback={white!90!assumption}
,enhanced jigsaw
,borderline west={2pt}{0pt}{assumption}
,sharp corners
,before skip=10pt
,after skip=10pt
,breakable
}
\newcommand{\assumptionautorefname}{assumption}
\newisadof{textDOTCENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTassumption}%
[label=,type=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTlevel=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTreferentiable=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTvariants=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTisUNDERSCOREconcerned=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTSRACDOTformalUNDERSCORErepr=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTSRACDOTassumptionUNDERSCOREkind=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTassumptionDOTassumptionUNDERSCOREkind=%
][1]{%
\begin{isamarkuptext}%
\ifthenelse{\equal{\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}{}}{%
\begin{assumption}%
}{%
\begin{assumption}[\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}]%
\DOFindex{assumption}{\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}%
}\label{\commandkey{label}}%
#1%
\end{assumption}
\end{isamarkuptext}%
}
% hypotheses
\providecolor{hypothesis}{named}{teal}
\newtheorem{hypothesis}{hypothesis}
\tcolorboxenvironment{hypothesis}{
,boxrule=0pt
,boxsep=0pt
,colback={white!90!hypothesis}
,enhanced jigsaw
,borderline west={2pt}{0pt}{hypothesis}
,sharp corners
,before skip=10pt
,after skip=10pt
,breakable
}
\newcommand{\hypothesisautorefname}{hypothesis}
\newisadof{textDOTCENELECUNDERSCOREFIVEZEROONETWOEIGHTDOThypothesis}%
[label=,type=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTlevel=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTreferentiable=%
,IsaUNDERSCORECOLDOTtextUNDERSCOREelementDOTvariants=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTisUNDERSCOREconcerned=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTSRACDOTformalUNDERSCORErepr=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTSRACDOThypothesisUNDERSCOREkind=%
,CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOThypothesisDOThypUNDERSCOREtype=%
][1]{%
\begin{isamarkuptext}%
\ifthenelse{\equal{\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}{}}{%
\begin{hypothesis}%
}{%
\begin{hypothesis}[\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}]%
\DOFindex{hypothesis}{\commandkey{CENELECUNDERSCOREFIVEZEROONETWOEIGHTDOTrequirementDOTlongUNDERSCOREname}}%
}\label{\commandkey{label}}%
#1%
\end{hypothesis}
\end{isamarkuptext}%
}