summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/smglom/smglom.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/stex/smglom/smglom.dtx')
-rw-r--r--Master/texmf-dist/source/latex/stex/smglom/smglom.dtx128
1 files changed, 112 insertions, 16 deletions
diff --git a/Master/texmf-dist/source/latex/stex/smglom/smglom.dtx b/Master/texmf-dist/source/latex/stex/smglom/smglom.dtx
index 6f01a92ae46..4063a66d03e 100644
--- a/Master/texmf-dist/source/latex/stex/smglom/smglom.dtx
+++ b/Master/texmf-dist/source/latex/stex/smglom/smglom.dtx
@@ -10,11 +10,12 @@
%
% \iffalse
%<package|cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<cls>\ProvidesClass{smglom}[2016/04/07 v0.1 Semantic Multilingual Glossary for Math]
-%<sty>\ProvidesPackage{smglom}[2016/04/07 v0.1 Semantic Multilingual Glossary for Math]
+%<cls>\ProvidesClass{smglom}[2019/03/20 v0.1 Semantic Multilingual Glossary for Math]
+%<sty>\ProvidesPackage{smglom}[2019/03/20 v0.1 Semantic Multilingual Glossary for Math]
%
%<*driver>
\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
\usepackage{url,array,omdoc,omtext,float}
\usepackage[show]{ed}
\usepackage[hyperref=auto,style=alphabetic]{biblatex}
@@ -29,8 +30,10 @@
\floatstyle{boxed}
\newfloat{exfig}{thp}{lop}
\floatname{exfig}{Example}
-\def\tracissue#1{\cite{sTeX:online}, \hyperlink{hstp://trac.kwarc.info/sTeX/ticket/#1}{issue #1}}
-\begin{document}\DocInput{smglom.dtx}\end{document}
+\def\githubissue#1{\cite{sTeX:github:on}, \hyperlink{hstp://trac.kwarc.info/sTeX/ticket/#1}{issue #1}}
+\begin{document}
+\DocInput{smglom.dtx}
+\end{document}
%</driver>
% \fi
%
@@ -42,12 +45,13 @@
%
% \MakeShortVerb{\|}
%
-% \def\omdoc{OMDoc}
-% \def\latexml{{\LaTeX}ML}
+% \def\omdoc{OMDoc\xspace}
+% \def\smglom{SMGloM\xspace}
+% \def\latexml{{\LaTeX}ML\xspace}
% \title{{\texttt{smglom.cls/sty}}: Semantic Multilingual Glossary for Math}
% \author{Michael Kohlhase\\
-% Jacobs University, Bremen\\
-% \url{http://kwarc.info/kohlhase}}
+% FAU Erlangen-N\"urnberg\\
+% \url{http://kwarc.info/kohlhase}}
% \maketitle
%
% \begin{abstract}
@@ -73,6 +77,50 @@
% them on to these.
% \end{omgroup}
%
+% \begin{omgroup}[id=user:modules]{Convenience Macros for \protect\smglom Modules}
+% \ednote{document them}
+% \end{omgroup}
+%
+% \begin{omgroup}[id=user:relations]{Terminological Relations}
+% \ednote{document them}
+% \end{omgroup}
+%
+% \begin{omgroup}[id=user:alignments]{Namespaces and Alignments}
+% \ednote{MK: maybe this should go into some other module; it seems awfully
+% foundational.} In \smglom, we often want to align the content of glossary modules to
+% formalizations, e.g. to take advantage of type declarations there. The
+% \DescribeMacro{\symalign}|\symalign| macro takes two regular arguments: the first is
+% the name symbol declared in the current module (e.g. by a |\symi|), and the second the
+% URI name of a symbol in an external theory in the form \meta{theory}|?|\meta{name}.
+%
+% As full MMT URIs are of the form \meta{URI}|?|\meta{theory}|?|\meta{name}, we need a
+% way to specify the \meta{URI}. We adopt the system of \textbf{namespaces} of in MMT:
+% the \DescribeMacro{\namespace} macro declares a namespace URI. If the optional
+% argument is given, then this is a namespace abbreviation declaration, which can be
+% used later, for instance in |\symalign| that takes an optional first argument: the
+% namespace of the external theory.
+%
+% The situation below is typical. We first declare the namespace abbreviation |sets| and
+% then use the \DescribeMacro{\modalign}|\modalign| macro to specify that the external
+% theory |sets:?ESet| is the default alignment target, i.e. any symbol that in the local
+% |emptyset| module is aligned by default to the symbol with the same name in the
+% external |sets:?ESet| theory.
+%
+% \begin{verbatim}
+% \begin{modsig}[creators=miko]{emptyset}
+% \gimport{set}
+% \namespace[sets]{http://mathhub.info/MitM/smglom/sets}
+% \modalign[sets]{ESet}
+%
+% \symdef{eset}{\emptyset}
+% \symi{non-empty}
+% \symalign{non-empty}{ESet?non_empty}
+% \end{modsig}
+% \end{verbatim}
+%
+% The default alignment breaks down for the symbol |non-empty|, so we specify an
+% alignment to the symbol |Eset?non_empty| via |\symalign|.
+% \end{omgroup}
% \end{omgroup}
%
% \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography}\newpage
@@ -126,7 +174,7 @@
% \end{macrocode}
% \end{omgroup}
%
-% \begin{omgroup}[id=sec:module-defs]{For Module Definitions} %
+% \begin{omgroup}[id=impl:modules]{Convenience Macros for \protect\smglom Modules}
% \begin{macro}{\gimport}
% Just a shortcut, we have a starred and unstarred version, the first one is conservative.
% For example, if we execute:\newline
@@ -170,8 +218,7 @@
% \begin{macro}{guse}
% just a shortcut
% \begin{macrocode}
-\newrobustcmd\guse[2][]{%
- \def\@test{#1}%
+\newrobustcmd\guse[2][]{\def\@test{#1}%
\edef\mh@@repos{\mh@currentrepos}%
\ifx\@test\@empty%
\usemhmodule[repos=\mh@@repos,ext=tex,path=#2]{#2}%
@@ -184,6 +231,27 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{environment}{gstructure}
+% we essentially copy over the definition of |mhstructure|, but adapt it to the \smglom
+% situation.
+% \begin{macrocode}
+\newenvironment{gstructure}[3][]{\def\@test{#1}%
+ \xdef\mh@@@repos{\mh@currentrepos}%
+ \ifx\@test\@empty%
+ \gdef\@@doit{\importmhmodule[repos=\mh@@@repos,path=#3,ext=tex]{#3}}%
+ \else%
+ \gdef\@@doit{\importmhmodule[repos=#1,path=#3,ext=tex]{#3}}%
+ \fi%
+ \ifmod@show\par\noindent structure import "#2" from module #3 \@@doit\fi%
+ \ignorespacesandpars}
+{\aftergroup\@@doit\ifmod@show end import\fi%
+ \ignorespacesandparsafterend}
+% \end{macrocode}
+% \end{environment}
+% \end{omgroup}
+%
+% \begin{omgroup}[id=impl:relations]{Terminological Relations}
+%
% \begin{macro}{*nym}
% \begin{macrocode}
\newrobustcmd\hypernym[3][]{\if@importing\else\par\noindent #2 is a hypernym of #3\fi}%
@@ -200,6 +268,27 @@
% \end{macro}
% \end{omgroup}
%
+% \begin{omgroup}[id=impl:alignments]{Namespaces and Alignments}
+%
+% \begin{macro}{\namespace}
+% \begin{macrocode}
+\newcommand\namespace[2][]{\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\modalign}
+% \begin{macrocode}
+\newcommand\modalign[2][]{\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\symalign}
+% \begin{macrocode}
+\newcommand\symalign[3][]{\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+% \end{omgroup}
+%
% \begin{omgroup}[id=sec:langbindings]{For Language Bindings}
%
% Here we adapt the |smultiling| functionality to the special situation, where the module
@@ -209,7 +298,7 @@
% The |gviewsig| environment is just a layer over the |mhviewsig| environment with the keys
% suitably adapted.
% \begin{macrocode}
-\newenvironment{gviewsig}[4][]{%
+\newenvironment{gviewsig}[4][]{% keys, id, from, to
\def\test{#1}%
\ifx\@test\@empty%
\begin{mhviewsig}[frompath=#3,topath=#4]{#2}{#3}{#4}%
@@ -228,7 +317,7 @@
% The |gviewnl| environment is just a layer over the |mhviewnl| environment with the
% keys suitably adapted.
% \begin{macrocode}
-\newenvironment{gviewnl}[5][]{%
+\newenvironment{gviewnl}[5][]{% keys, id, lang, from, to
\def\@test{#1}\ifx\@test\@empty%
\begin{mhviewnl}[frompath=#4,topath=#5]{#2}{#3}{#4}{#5}%
\else%
@@ -250,7 +339,7 @@
% \end{macro}
% \end{omgroup}
%
-% \begin{omgroup}{Authoring States}
+% \begin{omgroup}{Authoring States, etc}
% We add a key to the module environment.
% \begin{macrocode}
\addmetakey{module}{state}%
@@ -295,8 +384,15 @@
%%% End:
% \fi
-% LocalWords: iffalse cls smglo smglo.dtx omdoc latexml texttt smlog.cls sref SMGloM
+% LocalWords: iffalse cls smglo smglo.dtx omdoc latexml texttt smlog.cls sref SMGloM ifx
% LocalWords: maketitle newpage tableofcontents newpage omgroup ednote ltxml smglom.dtx
% LocalWords: printbibliography showmeta metakeys amstext ginput newrobustcmd sproof cmath
% LocalWords: module-defs gimport renewrobustcmd langbindings gle newenvironment amsfonts
-% LocalWords: doctex NeedsTeXFormat langfiles ngerman smultiling
+% LocalWords: doctex NeedsTeXFormat langfiles ngerman smultiling xspace formalizations
+% LocalWords: symalign symalign symi textbf modalign modalign ESet emptyset initialize
+% LocalWords: stex impl:modules unstarred numberfields mh@currentrepos mh@repos 1,ext
+% LocalWords: importmhmodule mhcurrentrepos conservative,repos tex,path guse gstructure
+% LocalWords: ignorespacesandpars usemhmodule mhstructure xdef gdef 3,ext 1,path nym
+% LocalWords: ifmod@show noindent aftergroup ignorespacesandparsafterend impl:relations
+% LocalWords: impl:alignments newcommand begingroup catcode`_ gviewsig mhviewsig
+% LocalWords: 3,topath gviewnl mhviewnl 4,topath gincludeview addmetakey