2018-03-05 10:14:49 +00:00
|
|
|
%% Copyright (C) 2018 The University of Sheffield
|
2019-07-28 11:01:58 +00:00
|
|
|
%% 2018 The University of Paris-Saclay
|
2019-06-17 09:06:38 +00:00
|
|
|
%% 2019 The University of Exeter
|
2018-03-05 10:14:49 +00:00
|
|
|
%%
|
|
|
|
%% 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
|
2019-08-15 13:52:15 +00:00
|
|
|
%% version 1.3c of the License, or (at your option) any later version.
|
2018-03-05 10:14:49 +00:00
|
|
|
%% OR
|
|
|
|
%% The 2-clause BSD-style license.
|
2019-08-15 13:52:15 +00:00
|
|
|
%%
|
|
|
|
%% SPDX-License-Identifier: LPPL-1.3c+ OR BSD-2-Clause
|
2018-03-05 10:14:49 +00:00
|
|
|
|
|
|
|
\NeedsTeXFormat{LaTeX2e}\relax
|
2018-06-08 11:54:45 +00:00
|
|
|
\ProvidesPackage{DOF-core}
|
2019-08-15 13:37:04 +00:00
|
|
|
[<isadofltxversion>%
|
2018-03-05 10:14:49 +00:00
|
|
|
Document-Type Support Framework for Isabelle.]
|
|
|
|
|
2018-05-20 08:23:13 +00:00
|
|
|
\RequirePackage{keycommand}
|
2018-09-18 13:29:54 +00:00
|
|
|
\RequirePackage{environ}
|
2018-06-27 07:16:37 +00:00
|
|
|
\RequirePackage{graphicx}
|
2019-01-05 23:07:11 +00:00
|
|
|
\RequirePackage{xspace}
|
2019-03-30 17:18:17 +00:00
|
|
|
\RequirePackage{etoolbox}
|
2018-06-05 00:05:41 +00:00
|
|
|
\RequirePackage{fp}
|
2019-01-05 23:07:11 +00:00
|
|
|
|
2019-08-04 12:25:56 +00:00
|
|
|
\newcommand{\isabelleurl}{UNDEFINED}
|
2019-08-12 07:28:16 +00:00
|
|
|
\newcommand{\dofurl}{UNDEFINED}
|
2019-08-03 20:32:40 +00:00
|
|
|
\newcommand{\dof@isabelleversion}{UNDEFINED}
|
2019-08-04 12:25:56 +00:00
|
|
|
\newcommand{\isabellefullversion}{UNDEFINED\xspace}
|
2019-08-03 20:32:40 +00:00
|
|
|
\newcommand{\dof@version}{UNDEFINED}
|
2019-08-12 06:51:22 +00:00
|
|
|
\newcommand{\dof@artifacturl}{UNDEFINED}
|
2019-08-18 13:05:00 +00:00
|
|
|
\newcommand{\doflatestversion}{UNDEFINED}
|
|
|
|
\newcommand{\isadoflatestdoi}{UNDEFINED}
|
2019-08-19 08:48:45 +00:00
|
|
|
\newcommand{\isadofgenericdoi}{UNDEFINED}
|
2019-08-18 13:05:00 +00:00
|
|
|
\newcommand{\isabellelatestversion}{Isabelle2019}
|
2019-08-03 15:02:54 +00:00
|
|
|
|
2019-08-03 20:32:40 +00:00
|
|
|
%%% CONFIG %%%
|
2019-08-03 15:02:54 +00:00
|
|
|
|
|
|
|
\newcommand{\isabelleversion}{\dof@isabelleversion\xspace}
|
|
|
|
\newcommand{\dofversion}{\dof@version\xspace}
|
2019-08-18 13:05:00 +00:00
|
|
|
\newcommand{\isadofversion}{\dofversion/\isabelleversion}
|
|
|
|
\newcommand{\isadoflatestversion}{\doflatestversion/\isabellelatestversion}
|
2019-08-03 15:02:54 +00:00
|
|
|
\newcommand{\isadofdir}{Isabelle_DOF-\dof@version_\dof@isabelleversion}
|
|
|
|
\newcommand{\isadofdirn}{Isabelle\_DOF-\dof@version\_\dof@isabelleversion}
|
|
|
|
\newcommand{\isadofarchive}{\isadofdir.tar.xz}
|
|
|
|
\newcommand{\isadofarchiven}{\isadofdirn.tar.xz}
|
2019-08-12 06:51:22 +00:00
|
|
|
\newcommand{\isadofarchiveurl}{\dof@artifacturl/\isadofarchive}
|
2019-08-03 15:02:54 +00:00
|
|
|
|
|
|
|
\newcommand{\isadof}{Isabelle/DOF\xspace}
|
2019-01-05 23:07:11 +00:00
|
|
|
|
2019-03-30 16:36:25 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
% begin: newcommand wrapper
|
|
|
|
\newcommand\newisadof[1]{\expandafter\newkeycommand\csname isaDof.#1\endcsname}%
|
|
|
|
\newcommand\renewisadof[1]{\expandafter\renewkeycommand\csname isaDof.#1\endcsname}%
|
|
|
|
\newcommand\provideisadof[1]{\expandafter\providekeycommand\csname isaDof.#1\endcsname}%
|
|
|
|
% end: newcommand wrapper
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
% begin: generic dispatcher
|
2019-03-31 12:34:52 +00:00
|
|
|
\newkeycommand+[\|]\isaDof[env={UNKNOWN},label=,type={dummyT},args={}][1]{%
|
|
|
|
\ifcsname isaDof.\commandkey{type}\endcsname%
|
|
|
|
\csname isaDof.\commandkey{type}\endcsname%
|
|
|
|
[label=\commandkey{label},\commandkey{args}]{#1}%
|
|
|
|
\else\relax\fi%
|
2019-03-30 17:18:17 +00:00
|
|
|
\ifcsname isaDof.\commandkey{env}.\commandkey{type}\endcsname%
|
|
|
|
\csname isaDof.\commandkey{env}.\commandkey{type}\endcsname%
|
|
|
|
[label=\commandkey{label},\commandkey{args}]{#1}%
|
|
|
|
\else%
|
2019-03-30 23:40:01 +00:00
|
|
|
\message{Isabelle/DOF: Using default LaTeX representation for concept %
|
|
|
|
"\commandkey{env}.\commandkey{type}".}%
|
|
|
|
\ifcsname isaDof.\commandkey{env}\endcsname%
|
|
|
|
\csname isaDof.\commandkey{env}\endcsname%
|
|
|
|
[label=\commandkey{label}]{#1}%
|
|
|
|
\else%
|
|
|
|
\errmessage{Isabelle/DOF: No LaTeX representation for concept %
|
|
|
|
"\commandkey{env}.\commandkey{type}" defined and no default %
|
|
|
|
definition for "\commandkey{env}" available either.}%
|
|
|
|
\fi%
|
2019-03-30 17:18:17 +00:00
|
|
|
\fi%
|
2018-03-05 10:14:49 +00:00
|
|
|
}
|
2019-03-30 16:36:25 +00:00
|
|
|
% end: generic dispatcher
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2018-06-05 00:05:41 +00:00
|
|
|
|
2018-10-02 07:08:31 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2019-03-30 23:40:01 +00:00
|
|
|
% begin: text*-dispatcher
|
|
|
|
\NewEnviron{isamarkuptext*}[1][]{\isaDof[env={text},#1]{\BODY}}
|
|
|
|
% end: text*-dispatcher
|
2018-10-02 07:08:31 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
2018-09-18 13:29:54 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2019-03-30 23:40:01 +00:00
|
|
|
% begin: chapter*-dispatcher
|
|
|
|
\NewEnviron{isamarkupchapter*}[1][]{\isaDof[env={chapter},#1]{\BODY}}
|
|
|
|
% end: chapter*-dispatcher
|
2018-09-18 13:29:54 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2018-06-06 11:30:46 +00:00
|
|
|
|
2018-09-18 13:29:54 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2019-03-30 23:40:01 +00:00
|
|
|
% begin: section*-dispatcher
|
|
|
|
\NewEnviron{isamarkupsection*}[1][]{\isaDof[env={section},#1]{\BODY}}
|
|
|
|
% end: section*-dispatcher
|
2018-09-18 13:29:54 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2018-06-10 10:34:14 +00:00
|
|
|
|
2018-09-18 13:29:54 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2019-03-30 23:40:01 +00:00
|
|
|
% begin: subsection*-dispatcher
|
|
|
|
\NewEnviron{isamarkupsubsection*}[1][]{\isaDof[env={subsection},#1]{\BODY}}
|
|
|
|
% end: subsection*-dispatcher
|
2018-09-18 13:29:54 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2018-06-12 07:45:37 +00:00
|
|
|
|
2018-09-18 13:29:54 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2019-03-30 23:40:01 +00:00
|
|
|
% begin: subsubsection*-dispatcher
|
2019-03-31 13:08:52 +00:00
|
|
|
\NewEnviron{isamarkupsubsubsection*}[1][]{\isaDof[env={subsubsection},#1]{\BODY}}
|
2019-03-30 23:40:01 +00:00
|
|
|
% end: subsubsection*-dispatcher
|
2018-09-18 13:29:54 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2018-08-10 12:27:30 +00:00
|
|
|
|
2018-10-30 01:29:15 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2019-03-30 23:40:01 +00:00
|
|
|
% begin: paragraph*-dispatcher
|
|
|
|
\NewEnviron{isamarkupparagraph*}[1][]{\isaDof[env={paragraph},#1]{\BODY}}
|
|
|
|
% end: paragraph*-dispatcher
|
2018-10-30 01:29:15 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
2019-03-30 23:40:01 +00:00
|
|
|
|
2018-10-01 23:36:55 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2019-03-30 23:40:01 +00:00
|
|
|
% begin: text default implementation
|
|
|
|
\newisadof{text}[label=,type=][1]{%
|
2019-04-07 16:42:35 +00:00
|
|
|
\begin{isamarkuptext}\label{\commandkey{label}}%
|
2019-03-30 23:40:01 +00:00
|
|
|
#1
|
|
|
|
\end{isamarkuptext}%
|
|
|
|
}
|
|
|
|
% end: text default implementation
|
2018-10-01 23:36:55 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2019-03-30 23:40:01 +00:00
|
|
|
% begin: chapter/section default implementations
|
|
|
|
\newisadof{chapter}[label=,type=][1]{%
|
|
|
|
\isamarkupfalse\isamarkupchapter{#1}\label{\commandkey{label}}\isamarkuptrue%
|
|
|
|
}
|
|
|
|
\newisadof{section}[label=,type=][1]{%
|
|
|
|
\isamarkupfalse\isamarkupsection{#1}\label{\commandkey{label}}\isamarkuptrue%
|
|
|
|
}
|
|
|
|
\newisadof{subsection}[label=,type=][1]{%
|
|
|
|
\isamarkupfalse\isamarkupsubsection{#1}\label{\commandkey{label}}\isamarkuptrue%
|
|
|
|
}
|
|
|
|
\newisadof{subsubsection}[label=,type=][1]{%
|
|
|
|
\isamarkupfalse\isamarkupsubsubsection{#1}\label{\commandkey{label}}\isamarkuptrue%
|
|
|
|
}
|
|
|
|
\newisadof{paragraph}[label=,type=][1]{%
|
|
|
|
\isamarkupfalse\isamarkupparagraph{#1}\label{\commandkey{label}}\isamarkuptrue%
|
|
|
|
}
|
|
|
|
% end: chapter/section default implementations
|
2018-10-01 23:36:55 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2019-03-30 23:40:01 +00:00
|
|
|
|
2019-06-17 09:06:38 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
% begin: label and ref
|
|
|
|
\newisadof{label}[label=,type=][1]{\label{#1}}
|
|
|
|
\newisadof{ref}[label=,type=][1]{\autoref{#1}}
|
2020-04-10 16:30:33 +00:00
|
|
|
\newisadof{macroDef}[label=,type=][1]{MMM \label{#1}} %% place_holder
|
|
|
|
\newisadof{macroExp}[label=,type=][1]{MMM \autoref{#1}} %% place_holder
|
2019-06-17 09:06:38 +00:00
|
|
|
% end: label and ref
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|