summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/eolang
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-01-11 21:37:18 +0000
committerKarl Berry <karl@freefriends.org>2024-01-11 21:37:18 +0000
commit2505811299c20ae6982ca150f0b025a8ba5cbc57 (patch)
treed0091de1aac5fb6379786361148f3b70b1384359 /Master/texmf-dist/tex/latex/eolang
parent422a9561d7b31d8521f301d02079985de68b22fc (diff)
eolang (11jan24)
git-svn-id: svn://tug.org/texlive/trunk@69391 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/eolang')
-rw-r--r--Master/texmf-dist/tex/latex/eolang/eolang.sty79
1 files changed, 53 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/latex/eolang/eolang.sty b/Master/texmf-dist/tex/latex/eolang/eolang.sty
index 20bb060b24e..ae8a572fa2d 100644
--- a/Master/texmf-dist/tex/latex/eolang/eolang.sty
+++ b/Master/texmf-dist/tex/latex/eolang/eolang.sty
@@ -7,7 +7,7 @@
%% eolang.dtx (with options: `package')
%% (The MIT License)
%%
-%% Copyright (c) 2021-2023 Yegor Bugayenko
+%% Copyright (c) 2021-2024 Yegor Bugayenko
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the 'Software'), to deal
@@ -31,7 +31,8 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{eolang}
-[2024-01-02 0.17.1 Formulas and Graphs for EO Programming Language]
+[2024-01-11 0.18.0 Formulas and Graphs for EO Programming Language]
+
@@ -84,7 +85,7 @@
\RequirePackage{amsmath}
\let\Bbbk\relax\RequirePackage{amssymb}
\RequirePackage{fancyvrb}
-\RequirePackage{iexec}
+\ifdefined\eolang@noshell\else\RequirePackage{iexec}\fi
\RequirePackage{pgfopts}
\RequirePackage{ifluatex}
@@ -95,25 +96,34 @@
tmpdir/.default=_eolang\ifxetex-xe\else\ifluatex-lua\fi\fi,
nocomments/.store in=\eolang@nocomments,
anonymous/.store in=\eolang@anonymous,
+ noshell/.store in=\eolang@noshell,
tmpdir
}
\ProcessPgfPackageOptions{/eolang}
-\RequirePackage{shellesc}
+\makeatletter
+\ifdefined\eolang@noshell\else\RequirePackage{shellesc}\fi
\IfFileExists
{\eolang@tmpdir/\jobname}
{\message{eolang: Temporary directory "\eolang@tmpdir/\jobname"
already exists^^J}}
- {%
- \ifnum\ShellEscapeStatus=1%
- \iexec[null]{mkdir -p "\eolang@tmpdir/\jobname"}%
- \else%
+ {
+ \ifdefined\eolang@noshell
\message{eolang: Temporary directory "\eolang@tmpdir/\jobname"
- is not created, because -shell-escape is not set, and
- it doesn't exist, most probably the compilation
- will fail later^^J}%
- \fi%
+ is not created, because of the "noshell" package option,
+ most probably the compilation will fail later^^J}
+ \else
+ \ifnum\ShellEscapeStatus=1
+ \iexec[null]{mkdir -p "\eolang@tmpdir/\jobname"}
+ \else
+ \message{eolang: Temporary directory "\eolang@tmpdir/\jobname"
+ is not created, because -shell-escape is not set, and
+ it doesn't exist, most probably the compilation
+ will fail later^^J}
+ \fi
+ \fi
}
+\makeatother
\makeatletter\newcounter{eolang@lineno}\makeatother
@@ -123,6 +133,11 @@
\makeatother
\makeatletter
+\ifdefined\eolang@noshell
+ \message{eolang: Perl script is not going to be created,
+ at "\eolang@tmpdir/\jobname-phi.pl" because of the "noshell"
+ package option^^J}
+\else
\openin 15=\eolang@tmpdir/\jobname-phi.pl
\ifeof 15
\message{eolang: Perl script is going to be created,
@@ -133,7 +148,7 @@
$macro = $ARGV[0];
open(my $fh, '<', $ARGV[1]);
my $tex; { local $/; $tex = <$fh>; }
-print "% This file is auto-generated by 0.17.1\n";
+print "% This file is auto-generated by 0.18.0\n";
print '% There are ', length($tex),
' chars in the input: ', $ARGV[1], "\n";
print '% ---', "\n";
@@ -269,7 +284,7 @@ $tex =~ s/\|{2,}/|/g;
$tex =~ s/\|([^\|]+)\|/\\textnormal{\\texttt{\1}}{}/g;
$tex =~ s/\{TEXT(\d+)\}/'\\text{' . @texts[$1] . '}';/ge;
if ($macro eq 'phiq') {
- print '$' if ($tex ne '');
+ print '\(' if ($tex ne '');
} else {
print '\begin{', $macro, "}\n";
if (not($align)) {
@@ -286,7 +301,7 @@ if ($gathered and not($align)) {
}
print $tex;
if ($macro eq 'phiq') {
- print '$' if ($tex ne '');
+ print '\)' if ($tex ne '');
} else {
if (not($align)) {
if ($gathered) {
@@ -306,6 +321,7 @@ print '\endinput';
"\eolang@tmpdir/\jobname-phi.pl"^^J}
\fi
\closein 15
+\fi
\makeatother
\makeatletter
@@ -320,12 +336,16 @@ print '\endinput';
\message{eolang: File "#1" already exists ^^J}%
\input{#1}}
{%
- \ifnum\ShellEscapeStatus=1\else%
- \message{eolang: The -shell-escape command line
- option is not provided, most probably compilation
- will fail now:^^J}%
+ \ifdefined\eolang@noshell%
+ \message{eolang: Shell processing is disabled^^J}%
+ \else%
+ \ifnum\ShellEscapeStatus=1\else%
+ \message{eolang: The -shell-escape command line
+ option is not provided, most probably compilation
+ will fail now:^^J}%
+ \fi%
+ #2%
\fi%
- #2%
}%
}
\makeatother
@@ -334,15 +354,15 @@ print '\endinput';
\def\hash{\eolang@mdfive
{\eolang@tmpdir/\jobname/phiquation.tex}-\the\inputlineno}%
\eolang@ifabsent
- {\eolang@tmpdir/\jobname/\hash-post.tex}
+ {\eolang@tmpdir/\jobname/\hash-phiquation-post.tex}
{%
\iexec[null]{cp "\eolang@tmpdir/\jobname/phiquation.tex"
- "\eolang@tmpdir/\jobname/\hash.tex"}%
+ "\eolang@tmpdir/\jobname/\hash-phiquation.tex"}%
\message{Start parsing 'phi' at line no. \the\inputlineno^^J}
- \iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{
+ \iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-phiquation-post.tex]{
perl "\eolang@tmpdir/\jobname-phi.pl"
'#1'
- "\eolang@tmpdir/\jobname/\hash.tex"
+ "\eolang@tmpdir/\jobname/\hash-phiquation.tex"
\ifdefined\eolang@nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi
\ifdefined\eolang@phiSaveTo > \eolang@phiSaveTo\fi}%
}%
@@ -379,6 +399,7 @@ print '\endinput';
perl \eolang@tmpdir/\jobname-phi.pl 'phiq'
"\eolang@tmpdir/\jobname/\hash-phiq.tex"
\ifdefined\eolang@nocomments | perl -pe 's/\%.*(\\n|$)//g' \fi}%
+ \message{eolang: Parsed `phiq' at line no. \the\inputlineno^^J}%
}%
\ifdefined\eolang@nodollar\else\catcode`\$\active\fi%
}\makeatother
@@ -392,6 +413,11 @@ print '\endinput';
\fi
\makeatletter
+\ifdefined\eolang@noshell
+\message{eolang: Perl script is not going to be created
+ at "\eolang@tmpdir/\jobname-sodg.pl", because of the
+ "noshell" package option^^J}
+\else
\openin 15=\eolang@tmpdir/\jobname-sodg.pl
\ifeof 15
\message{eolang: Perl script is going to be created,
@@ -677,6 +703,7 @@ print '\endinput';
"\eolang@tmpdir/\jobname-sodg.pl"^^J}
\fi
\closein 15
+\fi
\makeatother
\setcounter{FancyVerbLine}{0}
@@ -789,11 +816,11 @@ print '\endinput';
{\eolang@tmpdir/\jobname/\hash-sodg-post.tex}
{%
\iexec[null]{cp "\eolang@tmpdir/\jobname/sodg.tex"
- "\eolang@tmpdir/\jobname/\hash.tex"}%
+ "\eolang@tmpdir/\jobname/\hash-sodg.tex"}%
\message{eolang: Start parsing `sodg' at line no. \the\inputlineno^^J}
\iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-sodg-post.tex]{
perl "\eolang@tmpdir/\jobname-sodg.pl"
- "\eolang@tmpdir/\jobname/\hash.tex"
+ "\eolang@tmpdir/\jobname/\hash-sodg.tex"
\ifdefined\eolang@nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi
\ifdefined\eolang@sodgSaveTo > \eolang@sodgSaveTo\fi}%
}