diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-30 20:43:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-30 20:43:08 +0000 |
commit | 73e6f2b82d706c6410ea452a77481507df27273a (patch) | |
tree | ae004ba496eb29bb2ad70cbe9948160fbbe39438 /Master/texmf-dist/tex/latex/eolang | |
parent | 65f294f0eabddd4a09f422ce1501797e39143c25 (diff) |
eolang (30oct22)
git-svn-id: svn://tug.org/texlive/trunk@64867 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/eolang')
-rw-r--r-- | Master/texmf-dist/tex/latex/eolang/eolang.sty | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/eolang/eolang.sty b/Master/texmf-dist/tex/latex/eolang/eolang.sty index 8902d48a616..3d3abf67d83 100644 --- a/Master/texmf-dist/tex/latex/eolang/eolang.sty +++ b/Master/texmf-dist/tex/latex/eolang/eolang.sty @@ -31,7 +31,8 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{eolang} -[2022-10-29 0.2.0 Formulas and Graphs for EO Programming Language] +[2022-10-30 0.3.0 Formulas and Graphs for EO Programming Language] + @@ -67,8 +68,12 @@ \iexec[null]{mkdir -p "\eolang@tmpdir/\jobname"}% +\makeatletter\newcounter{eolang@lineno}\makeatother + \RequirePackage{pdftexcmds} -\makeatletter\newcommand\eolang@mdfive[1]{\pdf@filemdfivesum{#1}}\makeatother +\makeatletter +\newcommand\eolang@mdfive[1]{\pdf@filemdfivesum{#1}} +\makeatother \makeatletter \begin{VerbatimOut}{\eolang@tmpdir/eolang-phi.pl} @@ -107,12 +112,15 @@ $tex =~ s/\$/\\xi{}/g; $tex =~ s/-([a-z]+)>/\\mathrel{\\xrightarrow{\\text{\\sffamily\\scshape \1}}}/g; $tex =~ s/!->/\\mathrel{\\phiConst}/g; $tex =~ s/->/\\mathrel{\\mapsto}/g; +$tex =~ s/~>/\\mathrel{\\phiWave}/g; $tex =~ s/:=/\\mathrel{\\vDash}/g; $tex =~ s/..>/\\mathrel{\\phiDotted}/g; -$tex =~ s/\|([^\|]+)\|/\\texttt{\1}{}/g; +$tex =~ s/\|([^\|]+)\|/\\textnormal{\\texttt{\1}}{}/g; $tex =~ s/\[\[/\\llbracket\\mathrel{}/g; $tex =~ s/\]\]/\\mathrel{}\\rrbracket{}/g; if ($env ne 'phiq') { + $tex =~ s/\\begin\{split\}\n/\\begin{split}&/g; + $tex =~ s/\n\s*\\end\{split\}/\\end{split}/g; $tex =~ s/\n\n/\\\\&/g; $tex =~ s/\n/\\\\[-4pt]&/g; $tex =~ s/([^&\s])\s{2}([^\s])/\1 \2/g; @@ -147,20 +155,25 @@ print '\endinput', "\n"; perl "\eolang@tmpdir/eolang-phi.pl" '#1' "\eolang@tmpdir/\jobname/\hash.tex"}% + \setcounter{FancyVerbLine}{\value{eolang@lineno}}% } \newenvironment{phiquation*}% -{\VerbatimEnvironment\begin{VerbatimOut} +{\VerbatimEnvironment% +\setcounter{eolang@lineno}{\value{FancyVerbLine}}% +\begin{VerbatimOut} {\eolang@tmpdir/\jobname/phiquation.tex}} {\end{VerbatimOut}\eolang@process{equation*}} \newenvironment{phiquation}% -{\VerbatimEnvironment\begin{VerbatimOut} +{\VerbatimEnvironment% +\setcounter{eolang@lineno}{\value{FancyVerbLine}}% +\begin{VerbatimOut} {\eolang@tmpdir/\jobname/phiquation.tex}} {\end{VerbatimOut}\eolang@process{equation}} \makeatother -\makeatletter\newcommand\phiq[1]{ +\makeatletter\newcommand\phiq[1]{% \iexec[trace,quiet,stdout=\eolang@tmpdir/\jobname/phiq.tex]{ - /bin/echo '\detokenize{#1}'} + /bin/echo '\detokenize{#1}'}% \def\hash{\eolang@mdfive {\eolang@tmpdir/\jobname/phiq.tex}}% \iexec[null]{cp "\eolang@tmpdir/\jobname/phiq.tex" @@ -185,7 +198,7 @@ if (index($tex, "\t") > 0) { $tex =~ s/^\s+|\s+$//g; $tex =~ s/(\\[a-zA-Z]+)\s+/\1/g; $tex =~ s/\n\s+/\n/g; -$tex =~ s/\|([^\|]+)\|/\\texttt{\1}/g; +$tex =~ s/\|([^\|]+)\|/\\textnormal{\\texttt{\1}}/g; my @cmds = split (/\n/g, $tex); foreach my $t (@cmds) { print '% ', $t, "\n"; @@ -215,7 +228,7 @@ foreach my $c (@cmds) { if (not $opts{'data'} eq '') { my $d = $opts{'data'}; if (index($d, '|') == -1) { - $d = '\texttt{' . $d . '}'; + $d = '\textnormal{\texttt{' . $d . '}}'; } $opts{'box'} = $d; } @@ -281,6 +294,8 @@ print '\end{phicture}', "\n", '\endinput'; "\eolang@tmpdir/eolang-sodg.pl"} \makeatother +\setcounter{FancyVerbLine}{0} + \RequirePackage{tikz} \usetikzlibrary{arrows} \usetikzlibrary{shapes} @@ -318,7 +333,9 @@ print '\end{phicture}', "\n", '\endinput'; font={\scriptsize},color=black] \makeatletter\newenvironment{sodg}% -{\VerbatimEnvironment\begin{VerbatimOut} +{\VerbatimEnvironment% +\setcounter{eolang@lineno}{\value{FancyVerbLine}}% +\begin{VerbatimOut} {\eolang@tmpdir/\jobname/sodg.tex}} {\end{VerbatimOut}% \def\hash{\eolang@mdfive @@ -328,6 +345,7 @@ print '\end{phicture}', "\n", '\endinput'; \iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{ perl "\eolang@tmpdir/eolang-sodg.pl" "\eolang@tmpdir/\jobname/\hash.tex"}% + \setcounter{FancyVerbLine}{\value{eolang@lineno}}% }\makeatother \newcommand\eolang{% @@ -338,11 +356,12 @@ print '\end{phicture}', "\n", '\endinput'; \fi% } +\RequirePackage{hyperref} \newcommand\phic{% \ifdefined\anon% - \anon[$\alpha$-calculus]{$\varphi$-calculus}% + \anon[\texorpdfstring{$\alpha$}{a}-calculus]{\texorpdfstring{$\varphi$}{phi}-calculus}% \else% - $\varphi$-calculus% + \texorpdfstring{$\varphi$}{phi}-calculus% \fi% } @@ -357,6 +376,9 @@ print '\end{phicture}', "\n", '\endinput'; \newcommand\phiConst{% \mathrel{\hspace{.15em}}\mapstochar\mathrel{\hspace{-.15em}}\mapsto} +\newcommand\phiWave{% + \mapstochar\mathrel{\mspace{0.45mu}}\leadsto} + \RequirePackage{trimclip} \RequirePackage{amsfonts} \makeatletter |