%%
%% This is file `smultiling.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% smultiling.dtx  (with options: `sty')
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{smultiling}[2019/03/20 v0.2 Multilingual Support for sTeX]
\newif\if@smultiling@mh@\@smultiling@mh@false
\DeclareOption{mh}{\@smultiling@mh@true}
\newif\if@langfiles\@langfilesfalse
\DeclareOption{langfiles}{\@langfilestrue}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{modules}}
\ProcessOptions
\if@smultiling@mh@\RequirePackage{smultiling-mh}\fi
\RequirePackage{etoolbox}
\RequirePackage{structview}
\newenvironment{modsig}[2][]{\def\@test{#1}%
\ifx\@test\@empty\begin{module}[id=#2]\else\begin{module}[id=#2,#1]\fi%
\expandafter\gdef\csname mod@#2@multiling\endcsname{true}%
\ignorespacesandpars}
{\end{module}\ignorespacesandparsafterend}
\renewcommand\mod@component[1]{%
\expandafter\ifx\csname mod@#1@multiling\endcsname\@true%
\@ifundefined{smultiling@language}{}
{.\smultiling@language}%
\fi}
\newcommand\sTeXlanguage[1]{\def\smultiling@language{#1}}
\sTeXlanguage{en}
\newenvironment{viewsig}[4][]{\def\@test{#1}\ifx\@test\@empty%
  \begin{view}[id=#2,ext=tex]{#3}{#4}\else\begin{view}[id=#2,#1,ext=tex]{#3}{#4}\fi%
  \ignorespacesandpars}
  {\end{view}\ignorespacesandparsafterend}
\define@key{symi}{noverb}[all]{}%
\define@key{symi}{align}[WithTheSymbolOfTheSameName]{}%
\define@key{symi}{specializes}{}%
\define@key{symi}{noalign}[true]{}%
\newcommand\symi{\@ifstar\@symi@star\@symi}
\newcommand\@symi[2][]{\metasetkeys{symi}{#1}%
  \if@importing\else\par\noindent Symbol: \textsf{#2}\fi\ignorespacesandpars}
\newcommand\@symi@star[2][]{\metasetkeys{symi}{#1}%
  \if@importing\else\par\noindent Primary Symbol: \textsf{#2}\fi\ignorespacesandpars}
\newcommand\symii{\@ifstar\@symii@star\@symii}
\newcommand\@symii[3][]{\metasetkeys{symi}{#1}%
  \if@importing\else\par\noindent Symbol: \textsf{#2-#3}\fi\ignorespacesandpars}
\newcommand\@symii@star[3][]{\metasetkeys{symi}{#1}%
  \if@importing\else\par\noindent Primary Symbol: \textsf{#2-#3}\fi\ignorespacesandpars}
\newcommand\symiii{\@ifstar\@symiii@star\@symiii}
\newcommand\@symiii[4][]{\metasetkeys{symi}{#1}%
  \if@importing\else\par\noindent Symbol: \textsf{#2-#3-#4}\fi\ignorespacesandpars}
\newcommand\@symiii@star[4][]{\metasetkeys{symi}{#1}%
  \if@importing\else\par\noindent Primary Symbol: \textsf{#2-#3-#4}\fi\ignorespacesandpars}
\newcommand\symiv{\@ifstar\@symiv@star\@symiv}
\newcommand\@symiv[5][]{\metasetkeys{symi}{#1}%
  \if@importing\else\par\noindent Symbol: \textsf{#2-#3-#4-#5}\fi\ignorespacesandpars}
\newcommand\@symiv@star[5][]{\metasetkeys{symi}{#1}%
  \if@importing\else\par\noindent Primary Symbol: \textsf{#2-#3-#4-#5}\fi\ignorespacesandpars}
\addmetakey{modnl}{load}
\addmetakey*{modnl}{title}
\addmetakey*{modnl}{creators}
\addmetakey*{modnl}{contributors}
\addmetakey{modnl}{srccite}
\addmetakey{modnl}{primary}[yes]
\newenvironment{modnl}[3][]{\metasetkeys{modnl}{#1}%
  \def\@test{#1}\ifx\@test\@empty\begin{module}[id=#2.#3]\else\begin{module}[id=#2.#3,#1]\fi%
  \def\smultiling@language{#3}%
  \if@langfiles\importmodule[load=#2,ext=tex]{#2}\else
  \ifx\modnl@load\@empty\importmodule{#2}\else\importmodule[ext=tex,load=\modnl@load]{#2}\fi%
  \fi%
  \ignorespacesandpars}
{\end{module}\ignorespacesandparsafterend}
\newenvironment{viewnl}[5][]{\def\@test{#1}\ifx\@test\@empty%
  \begin{view}[id=#2.#3,ext=tex]{#4}{#5}\else%
  \begin{view}[id=#2.#3,#1,ext=tex]{#4}{#5}\fi%
  \ignorespacesandpars}
  {\end{view}\ignorespacesandparsafterend}
\def\@instring#1#2{TT\fi\begingroup\edef\x{\endgroup\noexpand\in@{#1}{#2}}\x\ifin@}
\def\@mtref#1?#2\relax{\@@mtref{#1}{#2}}
\newcommand\@@mtref[3]{\def\@@cd{#1}\def\@@name{#2}%
\ifx\@@cd\@empty%
\ifx\@@name\@empty\termref[]{#3}\else\termref[name=\@@name]{#3}\fi%
\else%
\ifx\@@name\@empty\termref[cd=\@@cd]{#3}\else\termref[cd=\@@cd,name=\@@name]{#3}\fi%
\fi}
\newcommand\mtref[2][]{\if\@instring{?}{#1}\@mtref #1\relax{#2}\else\termref[cd=#1]{#2}\fi}
\newcommand\mtrefi[2][]{\if\@instring{?}{#1}\@mtref #1\relax{#2}%
\else\termref[cd=#1]{#2}\fi}
\newcommand\mtrefis[2][]{\mtrefi[#1]{#2s}}
\newcommand\Mtrefi[2][]{\if\@instring{?}{#1}\@mtref #1\relax{\capitalize{#2}}%
\else\termref[cd=#1]{\capitalize{#2}}\fi}
\newcommand\Mtrefis[2][]{\Mtrefi[#1]{#2s}}
\newcommand\mtrefii[3][]{\mtrefi[#1]{#2 #3}}
\newcommand\mtrefiis[3][]{\mtrefi[#1]{#2 #3s}}
\newcommand\Mtrefii[3][]{\Mtrefi[#1]{#2 #3a}}
\newcommand\Mtrefiis[3][]{\Mtrefi[#1]{#2 #3s}}
\newcommand\mtrefiii[4][]{\mtrefi[#1]{#2 #3 #4}}
\newcommand\Mtrefiiis[4][]{\Mtrefi[#1]{#2 #3 #4s}}
\newcommand\Mtrefiii[4][]{\Mtrefi[#1]{#2 #3 #4}}
\newcommand\mtrefiiis[4][]{\mtrefi[#1]{#2 #3 #4s}}
\newcommand\mtrefiv[5][]{\mtrefi[#1]{#2 #3 #4 #5}}
\newcommand\mtrefivs[5][]{\mtrefi[#1]{#2 #3 #4 #5s}}
\newcommand\Mtrefiv[5][]{\Mtrefi[#1]{#2 #3 #4 #5}}
\newcommand\Mtrefivs[5][]{\Mtrefi[#1]{#2 #3 #4 #5s}}
\addmetakey{symi}{gfc}
\addmetakey{symdef}{gfc}%
\addmetakey{definiendum}{gfa}
\addmetakey{definiendum}{gfl}
\newcommand\ttl[1]{\red{TTL: #1}}
\endinput
%%
%% End of file `smultiling.sty'.
