texlive[65281] Master/texmf-dist: eolang (15dec22)

commits+karl at tug.org commits+karl at tug.org
Thu Dec 15 21:44:04 CET 2022


Revision: 65281
          http://tug.org/svn/texlive?view=revision&revision=65281
Author:   karl
Date:     2022-12-15 21:44:04 +0100 (Thu, 15 Dec 2022)
Log Message:
-----------
eolang (15dec22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/eolang/README.md
    trunk/Master/texmf-dist/doc/latex/eolang/eolang.pdf
    trunk/Master/texmf-dist/source/latex/eolang/eolang.dtx
    trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty

Modified: trunk/Master/texmf-dist/doc/latex/eolang/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/eolang/README.md	2022-12-15 20:43:49 UTC (rev 65280)
+++ trunk/Master/texmf-dist/doc/latex/eolang/README.md	2022-12-15 20:44:04 UTC (rev 65281)
@@ -3,7 +3,7 @@
 [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/objectionary/eolang.sty/blob/master/LICENSE.txt)
 
 This LaTeX package helps you write 𝜑-calculus formulas and
-[SODG](https://github.com/objectionary/sodg) graphs
+draw [SODG](https://github.com/objectionary/sodg) graphs
 for [EO](https://www.eolang.org) programming language.
 
 First, [install it](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages)

Modified: trunk/Master/texmf-dist/doc/latex/eolang/eolang.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/eolang/eolang.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/eolang/eolang.dtx	2022-12-15 20:43:49 UTC (rev 65280)
+++ trunk/Master/texmf-dist/source/latex/eolang/eolang.dtx	2022-12-15 20:44:04 UTC (rev 65281)
@@ -50,7 +50,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{eolang}
 %<*package>
-[2022-11-29 0.8.0 Formulas and Graphs for EO Programming Language]
+[2022-12-15 0.9.0 Formulas and Graphs for EO Programming Language]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -148,6 +148,10 @@
 % \end{itemize}
 % Also, a few symbols are supported for $\varphi$PU architecture:
 % \begin{itemize}\setlength\itemsep{0em}
+%   \item ``|<<|'' maps to ``$\langle$''
+%     (|\langle|),
+%   \item ``|>>|'' maps to ``$\rangle$''
+%     (|\rangle|),
 %   \item ``|-abc>|'' maps to ``$\phiSlot{abc}$''
 %     (|\phiSlot{abc}|),
 %   \item ``|:=|'' maps to ``$\vDash$''
@@ -365,6 +369,9 @@
 % \end{document}
 % \end{docshot}
 
+% \DescribeMacro{\eoAnon}
+% You may want to hide some of the content with the help of the |anonymous| package option. The command |\eoAnon| may help you with this. It has two parameters: one mandatory and one optional. The mandatory one is the content you want to show and the optional one is the substituion we will render if the |anonymous| package option is set.
+
 % \section{Package Options}
 
 % \DescribeMacro{tmpdir}
@@ -392,7 +399,7 @@
 %\fi
 
 % \DescribeMacro{anonymous}
-% You may anonymize |\eolang|, |\XMIR|, and |\phic| commands by using |anonymous| package option:
+% You may anonymize |\eolang|, |\XMIR|, and |\phic| commands by using |anonymous| package option (they all use the |\eoAnon| command mentioned earlier):
 %\iffalse
 %<*verb>
 %\fi
@@ -447,6 +454,39 @@
 % \end{document}
 % \end{docshot}
 
+% You can use the |matrix| environment too, in order to group a few lines:
+% \docshotOptions{firstline=5,lastline=11}
+% \begin{docshot}
+% \documentclass{article}
+% \usepackage{eolang}
+% \pagestyle{empty}
+% \begin{document}
+% \begin{phiquation*}
+% x -> \left\{\begin{matrix} \
+% ? \\
+% [[ L> ^ \times $.\alpha_0 ]] \\
+% [[ D> 42 ]] \
+% \end{matrix}\right\}
+% \end{phiquation*}
+% \end{document}
+% \end{docshot}
+
+% The |cases| environment works too:
+% \docshotOptions{firstline=5,lastline=11}
+% \begin{docshot}
+% \documentclass{article}
+% \usepackage{eolang}
+% \pagestyle{empty}
+% \begin{document}
+% \begin{phiquation*}
+% \beta := \begin{cases} \
+% [ v_2, @ -dtzd> 42 ] \\
+% [ v_{33} ] \
+% \end{cases}
+% \end{phiquation*}
+% \end{document}
+% \end{docshot}
+
 % The |phiquation| environment may be used together with the \href{https://ctan.org/pkg/acmart}{acmart} package:
 % \begin{docshot}
 % \documentclass{acmart}
@@ -538,7 +578,7 @@
 % \begin{phiquation*}
 % [[ b -> ? ]],
 % [[ @ -> TRUE, \Delta ..> 42 ]], \\
-% \Delta = |43-09|.
+% \psi = << \pi, 42 >>.
 % \end{phiquation*}
 % \end{document}
 % \end{docshot}
@@ -714,6 +754,8 @@
 % \changes{0.7.0}{2022/11/17}{New syntax sugar constructs added: \texttt{D>} and \texttt{L>} for \texttt{\char`\\Delta} and \texttt{\char`\\lambda} with a dotted arrow respectively.}
 % \changes{0.7.0}{2022/11/18}{New syntax sugar for $\Phi$, just using capital ``\texttt{Q}'' is enough.}
 % \changes{0.8.0}{2022/11/21}{Inside \texttt{phiquation} any text inside the \texttt{\char`\\text} macro is not processed.}
+% \changes{0.9.0}{2022/12/15}{Proper handling of the \texttt{matrix} environment.}
+% \changes{0.9.0}{2022/12/15}{Parsing of \texttt{<<} and \texttt{>>} implemented.}
 % Then, we create a Perl script for |phiquation| processing using |VerbatimOut| environment from
 % \href{https://ctan.org/pkg/fancyvrb}{fancyvrb}:
 %    \begin{macrocode}
@@ -790,6 +832,7 @@
   $tex =~ s/\n\s*\\end\{split\}/\\end{split}/g;
   $tex =~ s/\n\n/\\\\&/g;
   $tex =~ s/\n/\\phiEOL{}\n&/g;
+  $tex =~ s/\\\\$//g;
   $tex =~ s/\\\\/\\\\\n/g;
   $tex =~ s/([^&\s])\s{2}([^\s])/\1 \2/g;
   $tex =~ s/\s{2}/ \\quad{}/g;
@@ -804,6 +847,16 @@
 	    (0+ at eols) . ' lines are ' . (0+ at leads) . " leads\n";
   }
 }
+if ($macro ne 'phiq') {
+	sub strip_tabs {
+ 	 	my ($env, $tex) = @_;
+		$tex =~ s/&//g;
+	  return "\\begin{$env}" . $tex . "\\end{$env}";
+  }
+  foreach my $e (('matrix', 'cases')) {
+		$tex =~ s/\\begin\{(\Q$e\E\*?)\}(.+)\\end\{\Q$e\E\*?\}/strip_tabs($1, $2)/sge;
+	}
+}
 $tex =~ s/\$/\\xi{}/g;
 $tex =~ s/(?<!\{)\^/\\rho{}/g;
 $tex =~ s/\[\[/\\llbracket\\mathrel{}/g;
@@ -820,6 +873,8 @@
 $tex =~ s/~>/\\mathrel{\\phiWave}/g;
 $tex =~ s/:=/\\mathrel{\\vDash}/g;
 $tex =~ s/\.\.>/\\mathrel{\\phiDotted}/g;
+$tex =~ s/<</\\langle/g;
+$tex =~ s/>>/\\rangle/g;
 $tex =~ s/\|{2,}/|/g;
 $tex =~ s/\|([^\|]+)\|/\\textnormal{\\texttt{\1}}{}/g;
 $tex =~ s/\{TEXT(\d+)\}/'\\text{' . @texts[$1] . '}';/ge;
@@ -1168,7 +1223,7 @@
     }
     if (exists $opts{'data'}) {
       print ',phi-data';
-      if (not $opts{'data'} eq '') {
+      if ($opts{'data'} ne '') {
         my $d = $opts{'data'};
         if (index($d, '|') == -1) {
           $d = '$\Delta\phiDotted\text{' .
@@ -1180,7 +1235,7 @@
       }
     } elsif (exists $opts{'atom'}) {
       print ',phi-atom';
-      if (not $opts{'atom'} eq '') {
+      if ($opts{'atom'} ne '') {
         my $a = $opts{'atom'};
         if (index($a, '$') == -1) {
           $a = '$\lambda\phiDotted{}' . fmt($a) . '$';
@@ -1379,12 +1434,19 @@
 %    \end{macrocode}
 % \end{macro}
 
-% \begin{macro}{\eolang at anon}
+% \begin{macro}{\eoAnon}
 % Then, we define a supplementary command to help us anonymize some content.
-% \changes{0.9.0}{2022/11/29}{New command \texttt{\char`\\eolang at anon} added.}
+% \changes{0.9.0}{2022/11/29}{New command \texttt{\char`\\eoAnon} added.}
 %    \begin{macrocode}
+\RequirePackage{hyperref}
+\pdfstringdefDisableCommands{
+  \def\({}%
+  \def\){}%
+  \def\alpha{alpha}%
+  \def\varphi{phi}%
+}
 \makeatletter
-\NewExpandableDocumentCommand{\eolang at anon}{O{ANONYMIZED}m}{%
+\NewExpandableDocumentCommand{\eoAnon}{O{ANONYMIZED}m}{%
   \ifdefined\eolang at anonymous%
 	  \textcolor{orange}{#1}%
   \else%
@@ -1399,9 +1461,8 @@
 % \changes{0.1.0}{2022/10/25}{New command \texttt{\char`\\eolang} added to print the name of the language in both
 % normal and the anonymous mode of \texttt{acmart}.}
 %    \begin{macrocode}
-\makeatletter\newcommand\eolang{%
-  \eolang at anon[XYZ]{{\sffamily EO}}}
-\makeatother
+\newcommand\eolang{%
+  \eoAnon[XYZ]{{\sffamily EO}}}
 %    \end{macrocode}
 % \end{macro}
 
@@ -1410,10 +1471,8 @@
 % \changes{0.1.0}{2022/10/25}{New command \texttt{\char`\\phic} prints the name of $\varphi$-calculus in both
 % normal and the anonymous mode of \texttt{acmart}.}
 %    \begin{macrocode}
-\RequirePackage{hyperref}
-\makeatletter\newcommand\phic{%
-  \eolang at anon[$\alpha$-cal\-cu\-lus]{$\varphi$-cal\-cu\-lus}}
-\makeatother
+\newcommand\phic{%
+  \eoAnon[\(\alpha\)-cal\-cu\-lus]{\(\varphi\)-cal\-cu\-lus}}
 %    \end{macrocode}
 % \end{macro}
 
@@ -1421,9 +1480,8 @@
 % Then, we define a simple supplementary command to help you print \xmir{}, the name of our XML-based format of program representation.
 % \changes{0.2.0}{2022/10/28}{New command \texttt{\char`\\xmir} prints XMIR in both normal and the anonymous mode of \texttt{acmart}.}
 %    \begin{macrocode}
-\makeatletter\newcommand\xmir{%
-  \eolang at anon[XML$^+$]{XMIR}}
-\makeatother
+\newcommand\xmir{%
+  \eoAnon[XML\(^+\)]{XMIR}}
 %    \end{macrocode}
 % \end{macro}
 

Modified: trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty	2022-12-15 20:43:49 UTC (rev 65280)
+++ trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty	2022-12-15 20:44:04 UTC (rev 65281)
@@ -31,7 +31,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{eolang}
-[2022-11-29 0.8.0 Formulas and Graphs for EO Programming Language]
+[2022-12-15 0.9.0 Formulas and Graphs for EO Programming Language]
 
 
 
@@ -74,6 +74,9 @@
 
 
 
+
+
+
 \RequirePackage{stmaryrd}
 \RequirePackage{amsmath}
 \let\Bbbk\relax\RequirePackage{amssymb}
@@ -175,6 +178,7 @@
   $tex =~ s/\n\s*\\end\{split\}/\\end{split}/g;
   $tex =~ s/\n\n/\\\\&/g;
   $tex =~ s/\n/\\phiEOL{}\n&/g;
+  $tex =~ s/\\\\$//g;
   $tex =~ s/\\\\/\\\\\n/g;
   $tex =~ s/([^&\s])\s{2}([^\s])/\1 \2/g;
   $tex =~ s/\s{2}/ \\quad{}/g;
@@ -189,6 +193,16 @@
     (0+ at eols) . ' lines are ' . (0+ at leads) . " leads\n";
   }
 }
+if ($macro ne 'phiq') {
+sub strip_tabs {
+    my ($env, $tex) = @_;
+$tex =~ s/&//g;
+  return "\\begin{$env}" . $tex . "\\end{$env}";
+  }
+  foreach my $e (('matrix', 'cases')) {
+$tex =~ s/\\begin\{(\Q$e\E\*?)\}(.+)\\end\{\Q$e\E\*?\}/strip_tabs($1, $2)/sge;
+}
+}
 $tex =~ s/\$/\\xi{}/g;
 $tex =~ s/(?<!\{)\^/\\rho{}/g;
 $tex =~ s/\[\[/\\llbracket\\mathrel{}/g;
@@ -205,6 +219,8 @@
 $tex =~ s/~>/\\mathrel{\\phiWave}/g;
 $tex =~ s/:=/\\mathrel{\\vDash}/g;
 $tex =~ s/\.\.>/\\mathrel{\\phiDotted}/g;
+$tex =~ s/<</\\langle/g;
+$tex =~ s/>>/\\rangle/g;
 $tex =~ s/\|{2,}/|/g;
 $tex =~ s/\|([^\|]+)\|/\\textnormal{\\texttt{\1}}{}/g;
 $tex =~ s/\{TEXT(\d+)\}/'\\text{' . @texts[$1] . '}';/ge;
@@ -511,7 +527,7 @@
     }
     if (exists $opts{'data'}) {
       print ',phi-data';
-      if (not $opts{'data'} eq '') {
+      if ($opts{'data'} ne '') {
         my $d = $opts{'data'};
         if (index($d, '|') == -1) {
           $d = '$\Delta\phiDotted\text{' .
@@ -523,7 +539,7 @@
       }
     } elsif (exists $opts{'atom'}) {
       print ',phi-atom';
-      if (not $opts{'atom'} eq '') {
+      if ($opts{'atom'} ne '') {
         my $a = $opts{'atom'};
         if (index($a, '$') == -1) {
           $a = '$\lambda\phiDotted{}' . fmt($a) . '$';
@@ -691,8 +707,15 @@
   \def\eolang at sodgSaveTo{\relax}%
 }\makeatother
 
+\RequirePackage{hyperref}
+\pdfstringdefDisableCommands{
+  \def\({}%
+  \def\){}%
+  \def\alpha{alpha}%
+  \def\varphi{phi}%
+}
 \makeatletter
-\NewExpandableDocumentCommand{\eolang at anon}{O{ANONYMIZED}m}{%
+\NewExpandableDocumentCommand{\eoAnon}{O{ANONYMIZED}m}{%
   \ifdefined\eolang at anonymous%
   \textcolor{orange}{#1}%
   \else%
@@ -700,18 +723,14 @@
   \fi%
 }\makeatother
 
-\makeatletter\newcommand\eolang{%
-  \eolang at anon[XYZ]{{\sffamily EO}}}
-\makeatother
+\newcommand\eolang{%
+  \eoAnon[XYZ]{{\sffamily EO}}}
 
-\RequirePackage{hyperref}
-\makeatletter\newcommand\phic{%
-  \eolang at anon[$\alpha$-cal\-cu\-lus]{$\varphi$-cal\-cu\-lus}}
-\makeatother
+\newcommand\phic{%
+  \eoAnon[\(\alpha\)-cal\-cu\-lus]{\(\varphi\)-cal\-cu\-lus}}
 
-\makeatletter\newcommand\xmir{%
-  \eolang at anon[XML$^+$]{XMIR}}
-\makeatother
+\newcommand\xmir{%
+  \eoAnon[XML\(^+\)]{XMIR}}
 
 \newcommand\phiConst{%
   \mathrel{\hspace{.15em}}%



More information about the tex-live-commits mailing list.