From 2b006ec0e0cafe12255f874f9c44786ab6f38901 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 20 Mar 2019 22:31:24 +0000
Subject: stex (20mar19)

git-svn-id: svn://tug.org/texlive/trunk@50489 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/latex/stex/smultiling/smultiling.sty       | 76 ++++++++++++++++++----
 1 file changed, 62 insertions(+), 14 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/stex/smultiling/smultiling.sty')

diff --git a/Master/texmf-dist/tex/latex/stex/smultiling/smultiling.sty b/Master/texmf-dist/tex/latex/stex/smultiling/smultiling.sty
index 582fe5dbd4d..1db482dc0b6 100644
--- a/Master/texmf-dist/tex/latex/stex/smultiling/smultiling.sty
+++ b/Master/texmf-dist/tex/latex/stex/smultiling/smultiling.sty
@@ -7,7 +7,7 @@
 %% smultiling.dtx  (with options: `sty')
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{smultiling}[2016/04/06 v0.1 Multilingual Support for sTeX]
+\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
@@ -17,22 +17,46 @@
 \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\ignorespacesandpars}
+\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[1]{\if@importing\else Symbol: \textsf{#1}\fi\ignorespacesandpars}
-\newcommand\@symi@star[1]{\if@importing\else Primary Symbol: \textsf{#1}\fi\ignorespacesandpars}
+\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[2]{\if@importing\else Symbol: \textsf{#1-#2}\fi\ignorespacesandpars}
-\newcommand\@symii@star[2]{\if@importing\else Primary Symbol: \textsf{#1-#2}\fi\ignorespacesandpars}
+\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[3]{\if@importing\else Symbol: \textsf{#1-#2-#3}\fi\ignorespacesandpars}
-\newcommand\@symiii@star[3]{\if@importing\else Primary Symbol: \textsf{#1-#2-#3}\fi\ignorespacesandpars}
+\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}
@@ -41,24 +65,48 @@
 \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{viewsketch}[id=#2.#3,ext=tex]{#4}{#5}\else%
-  \begin{viewsketch}[id=#2.#3,#1,ext=tex]{#4}{#5}\fi%
+  \begin{view}[id=#2.#3,ext=tex]{#4}{#5}\else%
+  \begin{view}[id=#2.#3,#1,ext=tex]{#4}{#5}\fi%
   \ignorespacesandpars}
-  {\end{viewsketch}\ignorespacesandparsafterend}
+  {\end{view}\ignorespacesandparsafterend}
 \def\@instring#1#2{TT\fi\begingroup\edef\x{\endgroup\noexpand\in@{#1}{#2}}\x\ifin@}
-\newcommand\mtrefi[2][]{\if\@instring{?}{#1}\@mtref #1\relax{#2}\else\termref[cd=#1]{#2}\fi}
-\def\@mtref#1?#2\relax{\termref[cd=#1,name=#2]}
+\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
 %%
-- 
cgit v1.2.3

