diff options
author | Norbert Preining <norbert@preining.info> | 2022-11-30 03:01:25 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-11-30 03:01:25 +0000 |
commit | cb9bbbf5f4fdb303e5da460ebf17b50811d06a6a (patch) | |
tree | 56df1557b5fe16b5c9850a957e81ac160ddcb91b /macros/latex/contrib/eolang/eolang.dtx | |
parent | d3420ed49446361fef055ad7f989ff41ce7362b6 (diff) |
CTAN sync 202211300301
Diffstat (limited to 'macros/latex/contrib/eolang/eolang.dtx')
-rw-r--r-- | macros/latex/contrib/eolang/eolang.dtx | 90 |
1 files changed, 61 insertions, 29 deletions
diff --git a/macros/latex/contrib/eolang/eolang.dtx b/macros/latex/contrib/eolang/eolang.dtx index 8a9469e0d7..402bcd4b8f 100644 --- a/macros/latex/contrib/eolang/eolang.dtx +++ b/macros/latex/contrib/eolang/eolang.dtx @@ -50,7 +50,7 @@ %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{eolang} %<*package> -[2022-11-28 0.7.1 Formulas and Graphs for EO Programming Language] +[2022-11-29 0.8.0 Formulas and Graphs for EO Programming Language] %</package> %<*driver> \documentclass{ltxdoc} @@ -251,10 +251,24 @@ % \DescribeMacro{\phic} % \DescribeMacro{\xmir} % There is also a no-argument command |\eolang| to help you print the name of -% \eolang{} language. It understands the |anonymous| mode of \href{https://ctan.org/pkg/acmart}{acmart} and prints itself +% \eolang{} language. It understands the |anonymous| package option and prints itself % differently, to double-blind your paper. There is also |\phic| command to print % the name of \phic{}, also sensitive to |anonymous| mode. The macro |\xmir| prints "XMIR". -% \docshotOptions{firstline=4,lastline=10} +% \docshotOptions{firstline=3,lastline=10} +% \begin{docshot} +% \documentclass{acmart} +% \thispagestyle{empty} +% \usepackage[anonymous]{eolang} +% \begin{document} +% In our research we use \eolang{}, \\ +% an experimental object-oriented \\ +% dataflow language, \phic{}, as its \\ +% formal foundation, and \xmir{} --- \\ +% its XML-based presentation. +% \end{document} +% \end{docshot} +% Without the |anonymous| option there will be no orange color: +% \docshotOptions{firstline=3,lastline=10} % \begin{docshot} % \documentclass[anonymous]{acmart} % \thispagestyle{empty} @@ -377,6 +391,18 @@ %</verb> %\fi +% \DescribeMacro{anonymous} +% You may anonymize |\eolang|, |\XMIR|, and |\phic| commands by using |anonymous| package option: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\usepackage[anonymous]{eolang} +\end{verbatim} +%\iffalse +%</verb> +%\fi + % \section{More Examples} % The |phiquation| environment treats ends of line as signals to start @@ -633,6 +659,7 @@ % Then, we process package options: % \changes{0.1.0}{2022/10/26}{Parsing of package options introduced.} % \changes{0.6.0}{2022/11/14}{Package option \texttt{nocomments} added in order to enable comments suppression in temporary \texttt{.tex} files (may be pretty important for \texttt{.dtx} documents).} +% \changes{0.8.0}{2022/11/29}{The \texttt{anonymous} package option added.} % \begin{macrocode} \RequirePackage{pgfopts} \RequirePackage{ifluatex} @@ -642,9 +669,10 @@ tmpdir/.store in=\eolang@tmpdir, tmpdir/.default=_eolang\ifxetex-xe\else\ifluatex-lua\fi\fi, nocomments/.store in=\eolang@nocomments, + anonymous/.store in=\eolang@anonymous, tmpdir } -\ProcessPgfOptions{/eolang} +\ProcessPgfPackageOptions{/eolang} % \end{macrocode} % Then, we make a directory where all temporary files will be kept: @@ -766,11 +794,11 @@ if ($macro ne 'phiq') { $tex =~ s/([^&\s])\s{2}([^\s])/\1 \2/g; $tex =~ s/\s{2}/ \\quad{}/g; $tex = '&' . $tex; - my $lead = '[^\s]+\s(->|:=|=)'; + my $lead = '[^\s]+\s(?:->|:=|=)'; my @leads = $tex =~ /&${lead}/g; my @eols = $tex =~ /&/g; - if (0+@leads == 0+@eols && 0+@eols > 0) { - $tex =~ s/&${lead}/\1&/g; + if (0+@leads == 0+@eols && 0+@eols > 1) { + $tex =~ s/&(${lead})/\1&/g; $gathered = 0; print '% The "gathered" is NOT used because all ' . (0+@eols) . ' lines are ' . (0+@leads) . " leads\n"; @@ -853,6 +881,7 @@ print '\endinput'; {\eolang@tmpdir/\jobname/phiquation.tex}}% \iexec[null]{cp "\eolang@tmpdir/\jobname/phiquation.tex" "\eolang@tmpdir/\jobname/\hash.tex"}% + \message{Start parsing 'phi' at line no. \the\inputlineno^^J} \iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{ perl "\eolang@tmpdir/eolang-phi.pl" '#1' @@ -1337,6 +1366,7 @@ print '\endinput'; \iexec[null]{cp "\eolang@tmpdir/\jobname/sodg.tex" "\eolang@tmpdir/\jobname/\hash.tex"}% \catcode`\$=3 % + \message{Start parsing `sodg' at line no. \the\inputlineno^^J} \iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{ perl "\eolang@tmpdir/eolang-sodg.pl" "\eolang@tmpdir/\jobname/\hash.tex" @@ -1349,18 +1379,29 @@ print '\endinput'; % \end{macrocode} % \end{macro} +% \begin{macro}{\eolang@anon} +% Then, we define a supplementary command to help us anonymize some content. +% \changes{0.9.0}{2022/11/29}{New command \texttt{\char`\\eolang@anon} added.} +% \begin{macrocode} +\makeatletter +\NewExpandableDocumentCommand{\eolang@anon}{O{ANONYMIZED}m}{% + \ifdefined\eolang@anonymous% + \textcolor{orange}{#1}% + \else% + #2% + \fi% +}\makeatother +% \end{macrocode} +% \end{macro} + % \begin{macro}{\eolang} % Then, we define a simple supplementary command to help you print \eolang{}, the name of our language. % \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} -\newcommand\eolang{% - \ifdefined\anon% - \anon[XYZ]{{\sffamily EO}}% - \else% - {\sffamily EO}% - \fi% -} +\makeatletter\newcommand\eolang{% + \eolang@anon[XYZ]{{\sffamily EO}}} +\makeatother % \end{macrocode} % \end{macro} @@ -1370,14 +1411,9 @@ print '\endinput'; % normal and the anonymous mode of \texttt{acmart}.} % \begin{macrocode} \RequirePackage{hyperref} -\newcommand\phic{% - \ifdefined\anon% - \anon[\texorpdfstring{$\alpha$}{a}-cal\-cu\-lus] - {\texorpdfstring{$\varphi$}{phi}-cal\-cu\-lus}% - \else% - \texorpdfstring{$\varphi$}{phi}-cal\-cu\-lus% - \fi% -} +\makeatletter\newcommand\phic{% + \eolang@anon[$\alpha$-cal\-cu\-lus]{$\varphi$-cal\-cu\-lus}} +\makeatother % \end{macrocode} % \end{macro} @@ -1385,13 +1421,9 @@ print '\endinput'; % 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} -\newcommand\xmir{% - \ifdefined\anon% - \anon[XML$^+$]{XMIR}% - \else% - XMIR% - \fi% -} +\makeatletter\newcommand\xmir{% + \eolang@anon[XML$^+$]{XMIR}} +\makeatother % \end{macrocode} % \end{macro} |