diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-25 20:14:00 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-25 20:14:00 +0000 |
commit | 6167a87b968065d467786c31a757fd89871ad3bd (patch) | |
tree | cc3e441a75bfc67326bcf1faadac21ba8cb06f24 | |
parent | e4d598c31f2635d2baf122c23c60531bd3d4b028 (diff) |
eolang (25oct22)
git-svn-id: svn://tug.org/texlive/trunk@64809 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/eolang/README.md | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/eolang/eolang.pdf | bin | 533580 -> 591918 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/eolang/eolang.dtx | 137 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/eolang/eolang.sty | 55 |
4 files changed, 128 insertions, 68 deletions
diff --git a/Master/texmf-dist/doc/latex/eolang/README.md b/Master/texmf-dist/doc/latex/eolang/README.md index 740df01a472..257b0c163e3 100644 --- a/Master/texmf-dist/doc/latex/eolang/README.md +++ b/Master/texmf-dist/doc/latex/eolang/README.md @@ -1,6 +1,6 @@ -[![l3build](https://github.com/yegor256/eolang.sty/actions/workflows/l3build.yml/badge.svg)](https://github.com/yegor256/eolang.sty/actions/workflows/l3build.yml) +[![l3build](https://github.com/objectionary/eolang.sty/actions/workflows/l3build.yml/badge.svg)](https://github.com/objectionary/eolang.sty/actions/workflows/l3build.yml) [![CTAN](https://img.shields.io/ctan/v/eolang.sty)](https://ctan.org/pkg/eolang.sty) -[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/eolang.sty/blob/master/LICENSE.txt) +[![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 diff --git a/Master/texmf-dist/doc/latex/eolang/eolang.pdf b/Master/texmf-dist/doc/latex/eolang/eolang.pdf Binary files differindex ba13e9dcb46..9d25d909818 100644 --- a/Master/texmf-dist/doc/latex/eolang/eolang.pdf +++ b/Master/texmf-dist/doc/latex/eolang/eolang.pdf diff --git a/Master/texmf-dist/source/latex/eolang/eolang.dtx b/Master/texmf-dist/source/latex/eolang/eolang.dtx index b10f1a8c359..1fabdd62821 100644 --- a/Master/texmf-dist/source/latex/eolang/eolang.dtx +++ b/Master/texmf-dist/source/latex/eolang/eolang.dtx @@ -50,7 +50,7 @@ %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{eolang} %<*package> -[2022-10-20 0.0.1 Formulas and Graphs for EO Programming Language] +[2022-10-25 0.0.2 Formulas and Graphs for EO Programming Language] %</package> %<*driver> \documentclass{ltxdoc} @@ -60,7 +60,6 @@ \usepackage{microtype} \usepackage{graphicx} \usepackage[runs=1,dtx]{docshots} -\docshotPrerequisite{eolang.sty} \usepackage{eolang} \usepackage{href-ul} \PageIndex @@ -75,7 +74,7 @@ %</driver> % \fi -% \title{\includegraphics[height=1in]{cactus.pdf} \\ |eolang|: \LaTeX{} Package \\ for Formulas and Graphs \\ of EO Programming Language \\ and $\varphi$-calculus\thanks{The sources are in GitHub at \href{https://github.com/yegor256/eolang.sty}{yegor256/eolang.sty}}} +% \title{\includegraphics[height=1in]{cactus.pdf} \\ |eolang|: \LaTeX{} Package \\ for Formulas and Graphs \\ of EO Programming Language \\ and $\varphi$-calculus\thanks{The sources are in GitHub at \href{https://github.com/objectionary/eolang.sty}{objectionary/eolang.sty}}} % \author{Yegor Bugayenko \\ \texttt{yegor256@gmail.com}} % \date{\filedate, \fileversion} % @@ -98,12 +97,13 @@ % \usepackage{eolang} % \begin{document} % \begin{phiquation*} -% a -> [ -% b -> [ c -> |x|(56), -% \rho -> |hello|(\xi), -% \Delta ~> |01-FE-C3| ]], +% a -> [[ +% ^ !-> $.b, +% b -> [[ c -> |fn|(56), +% @ -> |hello|($), +% \Delta ~> |01-FE-C3| ]]]], -% x -> [ \lambda ~> M_1 ]. +% x -> [[ \alpha_0 -> ? ]] % \end{phiquation*} % \end{document} % \end{docshot} @@ -112,11 +112,35 @@ % The environment |phiquation| lets you write a $\varphi$-calculus expressions % using simple plain-text notation, where: % \begin{itemize}\setlength\itemsep{0em} -% \item ``|->|'' maps to ``$\mapsto$'' (|\mapsto|), -% \item ``|~>|'' maps to ``$\mapstochar\dashrightarrow$'' (|\mapstochar\dashrightarrow|), -% \item ``|[|'' maps to ``$\llbracket$'' (|\llbracket|), -% \item ``|]|'' maps to ``$\rrbracket$'' (|\rrbracket|), -% \item ``$\vert$|abc|$\vert$'' maps to ``\texttt{abc}'' (|\texttt{abc}|). +% \item ``|@|'' maps to ``$\varphi$'' +% (|\varphi|), +% \item ``|^|'' maps to ``$\rho$'' +% (|\rho|), +% \item ``|$|'' maps to ``$\xi$'' +% (|\xi|), +% \item ``|&|'' maps to ``$\sigma$'' +% (|\sigma|), +% \item ``|?|'' maps to ``$\varnothing$'' +% (|\varnothing|), +% \item ``|->|'' maps to ``$\mapsto$'' +% (|\mapsto|), +% \item ``|!->|'' maps to ``$\mapstochar\relbar\mathrel{\mkern-12mu}\mapsto$'' +% (|\mapstochar\relbar\mathrel{\mkern-12mu}\mapsto|), +% \item ``|~>|'' maps to ``$\mapstochar\dashrightarrow$'' +% (|\mapstochar\dashrightarrow|), +% \item ``|[[|'' maps to ``$\llbracket$'' +% (|\llbracket|), +% \item ``|]]|'' maps to ``$\rrbracket$'' +% (|\rrbracket|), +% \item ``$\vert$|abc|$\vert$'' maps to ``\texttt{abc}'' +% (|\texttt{abc}|). +% \end{itemize} +% Also, a few symbols are supported for $\varphi$PU architecture: +% \begin{itemize}\setlength\itemsep{0em} +% \item ``|-abc>|'' maps to ``$\xrightarrow{\text{\sffamily\scshape abc}}$'' +% (|\xrightarrow{\text{\sffamily\scshape abc}}|), +% \item ``|:=|'' maps to ``$\vDash$'' +% (|\vDash|). % \end{itemize} % \DescribeMacro{\phiq} @@ -129,28 +153,28 @@ % \usepackage{eolang} % \begin{document} % A simple object -% \phiq{x -> [\varphi -> y]} +% \phiq{x -> [[@ -> y]]} % is a decorator of % the data object -% \phiq{y -> [\Delta ~> 42]}. +% \phiq{y -> [[\Delta ~> 42]]}. % \end{document} % \end{docshot} -% \DescribeEnv{phigure} -% The environment |phigure| allows you to draw a \href{https://github.com/objectionary/sodg}{SODG} graph: +% \DescribeEnv{sodg} +% The environment |sodg| allows you to draw a \href{https://github.com/objectionary/sodg}{SODG} graph: % \begin{docshot} % \documentclass{article} % \pagestyle{empty} % \usepackage{eolang} % \begin{document} -% \begin{phigure} +% \begin{sodg} % v0 % v1 xy:v0,-2,+1 data:|42| % v0->v1 a:$x$ rho % v2 xy:v0,+1,+1 atom:$\xi.x+1$ % v1->v2 a:|hi| bend:-15 % v2->v0 pi bend:10 -% \end{phigure} +% \end{sodg} % \end{document} % \end{docshot} % The content of the environment is parsed line by line. Markers in each line are @@ -178,38 +202,49 @@ % \section{Implementation} -% \changes{v0.0.1}{2022/10/05}{Initial version} - % First, we include a few packages: % \begin{macrocode} \RequirePackage{stmaryrd} \RequirePackage{amsmath} +\RequirePackage{amssymb} \RequirePackage{amsfonts} \RequirePackage{iexec} \RequirePackage{fancyvrb} % \end{macrocode} % \begin{macro}{\eolang@env} +% \changes{0.0.2}{2022/10/21}{The symbols ``['' and ``]'' replaced with ``[['' and ``]]'' for abstract object brackets, because they conflicted with normal square brackets} +% \changes{0.0.2}{2022/10/21}{New symbol added for basket slots} +% \changes{0.0.2}{2022/10/21}{Parsing of symbols ``@,'' ``\^{},'' and ``\&'' enabled (varphi, rho, and sigma)} % Then, we define |\eolang@env| supplementary command. % It is implemented with the help of |\iexec| from % \href{https://github.com/yegor256/iexec}{iexec} package: % \begin{macrocode} \makeatletter\newcommand\eolang@env[2]{ \iexec[trace]{ - /bin/echo -n '\\begin{#1}\\begin{split} &'; + /bin/echo -n '\\begin{#1}\\begin{split} &' + && /bin/echo -n '\detokenize{#2}' | perl -pe 's/^\\r\\+//g' | perl -pe 's/\\r\\+$//g' + | perl -pe 's/\\?/\\\\varnothing/g' + | perl -pe 's/@/\\\\varphi/g' + | perl -pe 's/&/\\\\sigma/g' + | perl -pe 's/\\^/\\\\rho/g' + | perl -pe 's/\\$/\\\\xi/g' + | perl -pe 's/-([a-z]+)>/\\\\xrightarrow{\\\\text{\\\\sffamily\\\\scshape \\1}}/g' + | perl -pe 's/!->/\\\\mapstochar\\\\relbar\\\\mathrel{\\\\mkern-12mu}\\\\mapsto/g' | perl -pe 's/->/\\\\mapsto/g' + | perl -pe 's/:=/\\\\vDash/g' | perl -pe 's/\unexpanded{~}>/\\\\mapstochar\\\\dashrightarrow/g' | perl -pe 's/\\|([^\\|]+)\\|/\\\\texttt{\\1}/g' - | perl -pe 's/\\[/\\\\llbracket/g' - | perl -pe 's/\\]/\\\\rrbracket/g' + | perl -pe 's/\\[\\[/\\\\llbracket/g' + | perl -pe 's/\\]\\]/\\\\rrbracket/g' | perl -pe 's/\\r\\r/\\\\\\\\ \&/g' | perl -pe 's/\\r/\\\\\\\\[-4pt] \&/g' | perl -pe 's/([^& ]) {2}([^ ])/\\1 \\2/g' | perl -pe 's/ {2}/\\\\quad{}/g' - ; + && /bin/echo -n '\\end{split}\\end{#1}\\endinput' }% }\makeatother @@ -233,17 +268,27 @@ % \end{macro} % \begin{macro}{\phiq} +% \changes{0.0.2}{2022/10/21}{Parsing of additional symbols enabled} % Then, we define |\phiq| command: % \begin{macrocode} \newcommand\phiq[1]{ \iexec[trace]{ - /bin/echo -n '$'; + /bin/echo -n '$' + && /bin/echo -n '\detokenize{#1}' + | perl -pe 's/\\^/\\\\rho/g' + | perl -pe 's/\\$/\\\\xi/g' + | perl -pe 's/&/\\\\sigma/g' + | perl -pe 's/\\?/\\\\varnothing/g' + | perl -pe 's/@/\\\\varphi/g' + | perl -pe 's/!->/\\\\mapstochar\\\\relbar\\\\mathrel{\\\\mkern-12mu}\\\\mapsto/g' | perl -pe 's/->/\\\\mapsto/g' + | perl -pe 's/-([a-z]+)>/\\\\xrightarrow{\\\\text{\\\\sffamily\\\\scshape \\1}}/g' | perl -pe 's/\unexpanded{~}>/\\\\mapstochar\\\\dashrightarrow/g' - | perl -pe 's/\\[/\\\\llbracket/g' - | perl -pe 's/\\]/\\\\rrbracket/g' - ; + | perl -pe 's/:=/\\\\vDash/g' + | perl -pe 's/\\[\\[/\\\\llbracket/g' + | perl -pe 's/\\]\\]/\\\\rrbracket/g' + && /bin/echo -n '$\\endinput' }% } @@ -251,9 +296,10 @@ % \end{macro} % \begin{macro}{Perl} +% \changes{0.0.2}{2022/10/24}{The Perl file now has a fixed name, which doesn't depend on the name of the TeX job. This file may be shared among jobs, no need to make it uniquely named.} % Then, create a Perl script: % \begin{macrocode} -\begin{VerbatimOut}{\jobname.pl.eolang} +\begin{VerbatimOut}{eolang.pl} $tex = $ARGV[0]; $tex =~ s/^\s+|\s+$//g; $tex =~ s/(\\[a-zA-Z]+)\s+/\1/g; @@ -336,13 +382,12 @@ foreach my $c (@cmds) { } print '\end{phig}', "\n", '\endinput'; \end{VerbatimOut} -\message{^^Jeolang: file with Perl script (\jobname.pl.eolang) saved^^J}% -\iexec[trace,stdout=/dev/null]{ - perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g' \jobname.pl.eolang} +\message{^^Jeolang: File with Perl script (eolang.pl) saved^^J}% +\iexec[trace,null]{perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g' eolang.pl} % \end{macrocode} % \end{macro} -% \begin{macro}{phigure} +% \begin{macro}{tikz} % Then, we include |tikz| package and its libraries: % \begin{macrocode} \RequirePackage{tikz} @@ -352,7 +397,6 @@ print '\end{phig}', "\n", '\endinput'; \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{intersections} \usetikzlibrary{positioning} - \usetikzlibrary{backgrounds} \usetikzlibrary{calc} \usetikzlibrary{shapes.arrows} % \end{macrocode} @@ -389,27 +433,28 @@ print '\end{phig}', "\n", '\endinput'; % \end{macrocode} % \end{macro} -% \begin{macro}{phigure} -% Then, create a new environment |figure|, as suggested +% \begin{macro}{sodg} +% \changes{0.0.2}{2022/10/20}{The environment ``phigure'' renamed to ``sodg'' for the sake of better semantic. The graph in the picture is solely a SODG graph, that's why the name ``sodg'' is better.} +% Then, create a new environment |sodg|, as suggested % \href{https://tex.stackexchange.com/questions/661056}{here}: % \begin{macrocode} -\NewDocumentEnvironment{phigure}{b}{% +\NewDocumentEnvironment{sodg}{b}{% \catcode`\ =10 % \catcode`\^^M=5 % \iexec[trace,stdout=\jobname.tex.eolang]{ - perl \jobname.pl.eolang '\detokenize{#1}'}% + perl eolang.pl '\detokenize{#1}'}% }{} -\AddToHook{env/phigure/before}{\bgroup\obeylines\obeyspaces} -\AddToHook{env/phigure/after}{\egroup} +\AddToHook{env/sodg/before}{\bgroup\obeylines\obeyspaces} +\AddToHook{env/sodg/after}{\egroup} % \end{macrocode} % \end{macro} % \Finale -%\clearpage - +% \clearpage % \printbibliography +% \clearpage -%\PrintChanges -%\clearpage -%\PrintIndex +% \PrintChanges +% \clearpage +% \PrintIndex diff --git a/Master/texmf-dist/tex/latex/eolang/eolang.sty b/Master/texmf-dist/tex/latex/eolang/eolang.sty index a3b5b973cb3..ef1b1b19e3c 100644 --- a/Master/texmf-dist/tex/latex/eolang/eolang.sty +++ b/Master/texmf-dist/tex/latex/eolang/eolang.sty @@ -31,8 +31,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{eolang} -[2022-10-20 0.0.1 Formulas and Graphs for EO Programming Language] - +[2022-10-25 0.0.2 Formulas and Graphs for EO Programming Language] @@ -44,26 +43,36 @@ \RequirePackage{stmaryrd} \RequirePackage{amsmath} +\RequirePackage{amssymb} \RequirePackage{amsfonts} \RequirePackage{iexec} \RequirePackage{fancyvrb} \makeatletter\newcommand\eolang@env[2]{ \iexec[trace]{ - /bin/echo -n '\\begin{#1}\\begin{split} &'; + /bin/echo -n '\\begin{#1}\\begin{split} &' + && /bin/echo -n '\detokenize{#2}' | perl -pe 's/^\\r\\+//g' | perl -pe 's/\\r\\+$//g' + | perl -pe 's/\\?/\\\\varnothing/g' + | perl -pe 's/@/\\\\varphi/g' + | perl -pe 's/&/\\\\sigma/g' + | perl -pe 's/\\^/\\\\rho/g' + | perl -pe 's/\\$/\\\\xi/g' + | perl -pe 's/-([a-z]+)>/\\\\xrightarrow{\\\\text{\\\\sffamily\\\\scshape \\1}}/g' + | perl -pe 's/!->/\\\\mapstochar\\\\relbar\\\\mathrel{\\\\mkern-12mu}\\\\mapsto/g' | perl -pe 's/->/\\\\mapsto/g' + | perl -pe 's/:=/\\\\vDash/g' | perl -pe 's/\unexpanded{~}>/\\\\mapstochar\\\\dashrightarrow/g' | perl -pe 's/\\|([^\\|]+)\\|/\\\\texttt{\\1}/g' - | perl -pe 's/\\[/\\\\llbracket/g' - | perl -pe 's/\\]/\\\\rrbracket/g' + | perl -pe 's/\\[\\[/\\\\llbracket/g' + | perl -pe 's/\\]\\]/\\\\rrbracket/g' | perl -pe 's/\\r\\r/\\\\\\\\ \&/g' | perl -pe 's/\\r/\\\\\\\\[-4pt] \&/g' | perl -pe 's/([^& ]) {2}([^ ])/\\1 \\2/g' | perl -pe 's/ {2}/\\\\quad{}/g' - ; + && /bin/echo -n '\\end{split}\\end{#1}\\endinput' }% }\makeatother @@ -81,18 +90,27 @@ \newcommand\phiq[1]{ \iexec[trace]{ - /bin/echo -n '$'; + /bin/echo -n '$' + && /bin/echo -n '\detokenize{#1}' + | perl -pe 's/\\^/\\\\rho/g' + | perl -pe 's/\\$/\\\\xi/g' + | perl -pe 's/&/\\\\sigma/g' + | perl -pe 's/\\?/\\\\varnothing/g' + | perl -pe 's/@/\\\\varphi/g' + | perl -pe 's/!->/\\\\mapstochar\\\\relbar\\\\mathrel{\\\\mkern-12mu}\\\\mapsto/g' | perl -pe 's/->/\\\\mapsto/g' + | perl -pe 's/-([a-z]+)>/\\\\xrightarrow{\\\\text{\\\\sffamily\\\\scshape \\1}}/g' | perl -pe 's/\unexpanded{~}>/\\\\mapstochar\\\\dashrightarrow/g' - | perl -pe 's/\\[/\\\\llbracket/g' - | perl -pe 's/\\]/\\\\rrbracket/g' - ; + | perl -pe 's/:=/\\\\vDash/g' + | perl -pe 's/\\[\\[/\\\\llbracket/g' + | perl -pe 's/\\]\\]/\\\\rrbracket/g' + && /bin/echo -n '$\\endinput' }% } -\begin{VerbatimOut}{\jobname.pl.eolang} +\begin{VerbatimOut}{eolang.pl} $tex = $ARGV[0]; $tex =~ s/^\s+|\s+$//g; $tex =~ s/(\\[a-zA-Z]+)\s+/\1/g; @@ -175,9 +193,8 @@ foreach my $c (@cmds) { } print '\end{phig}', "\n", '\endinput'; \end{VerbatimOut} -\message{^^Jeolang: file with Perl script (\jobname.pl.eolang) saved^^J}% -\iexec[trace,stdout=/dev/null]{ - perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g' \jobname.pl.eolang} +\message{^^Jeolang: File with Perl script (eolang.pl) saved^^J}% +\iexec[trace,null]{perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g' eolang.pl} \RequirePackage{tikz} \usetikzlibrary{arrows} @@ -186,7 +203,6 @@ print '\end{phig}', "\n", '\endinput'; \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{intersections} \usetikzlibrary{positioning} - \usetikzlibrary{backgrounds} \usetikzlibrary{calc} \usetikzlibrary{shapes.arrows} @@ -216,15 +232,14 @@ print '\end{phig}', "\n", '\endinput'; above=2pt,sloped/.append style={transform shape}, font={\scriptsize},color=black] -\NewDocumentEnvironment{phigure}{b}{% +\NewDocumentEnvironment{sodg}{b}{% \catcode`\ =10 % \catcode`\^^M=5 % \iexec[trace,stdout=\jobname.tex.eolang]{ - perl \jobname.pl.eolang '\detokenize{#1}'}% + perl eolang.pl '\detokenize{#1}'}% }{} -\AddToHook{env/phigure/before}{\bgroup\obeylines\obeyspaces} -\AddToHook{env/phigure/after}{\egroup} - +\AddToHook{env/sodg/before}{\bgroup\obeylines\obeyspaces} +\AddToHook{env/sodg/after}{\egroup} |