From fac21618bdcd44d7ca47228c8b856488b12ee6a2 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 26 Oct 2022 03:00:55 +0000 Subject: CTAN sync 202210260300 --- macros/latex/contrib/eolang/README.md | 4 +- macros/latex/contrib/eolang/eolang.dtx | 137 ++++++++++++++++++++++----------- macros/latex/contrib/eolang/eolang.pdf | Bin 533580 -> 591918 bytes 3 files changed, 93 insertions(+), 48 deletions(-) (limited to 'macros/latex/contrib/eolang') diff --git a/macros/latex/contrib/eolang/README.md b/macros/latex/contrib/eolang/README.md index 740df01a47..257b0c163e 100644 --- a/macros/latex/contrib/eolang/README.md +++ b/macros/latex/contrib/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/macros/latex/contrib/eolang/eolang.dtx b/macros/latex/contrib/eolang/eolang.dtx index b10f1a8c35..1fabdd6282 100644 --- a/macros/latex/contrib/eolang/eolang.dtx +++ b/macros/latex/contrib/eolang/eolang.dtx @@ -50,7 +50,7 @@ %\NeedsTeXFormat{LaTeX2e} %\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] % %<*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 @@ % % \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/macros/latex/contrib/eolang/eolang.pdf b/macros/latex/contrib/eolang/eolang.pdf index ba13e9dcb4..9d25d90981 100644 Binary files a/macros/latex/contrib/eolang/eolang.pdf and b/macros/latex/contrib/eolang/eolang.pdf differ -- cgit v1.2.3