diff options
author | Karl Berry <karl@freefriends.org> | 2021-08-15 20:26:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-08-15 20:26:02 +0000 |
commit | 69d90fc4bf7dcd742b62f3ee5bbb803b4bf2f14c (patch) | |
tree | 05fa3c32e765dc4c082f3b5d004a0446b6adf896 /Master/texmf-dist/tex/latex/cryptocode/cryptocode.sty | |
parent | 4efec5365d341d5fa255bab3d3f3f9e9b7e33ec4 (diff) |
cryptocode (15aug21)
git-svn-id: svn://tug.org/texlive/trunk@60249 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/cryptocode/cryptocode.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/cryptocode/cryptocode.sty | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/cryptocode/cryptocode.sty b/Master/texmf-dist/tex/latex/cryptocode/cryptocode.sty index 0dfaf19cbde..ae37539330b 100644 --- a/Master/texmf-dist/tex/latex/cryptocode/cryptocode.sty +++ b/Master/texmf-dist/tex/latex/cryptocode/cryptocode.sty @@ -7,7 +7,7 @@ %% cryptocode.dtx (with options: `cryptocode.sty,package') %% %% cryptocode.dtx -%% Copyright 2020 Mittelbach, Arno +%% Copyright 2021 Mittelbach, Arno %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -27,16 +27,23 @@ \NeedsTeXFormat{LaTeX2e} \DeclareRelease{v0.30}{2018-11-11}{cryptocode-2018-11-11.sty} \DeclareRelease{v0.32}{2020-04-24}{cryptocode-2020-04-24.sty} -\DeclareCurrentRelease{v0.40}{2020-07-10} +\DeclareCurrentRelease{v0.44}{2021-08-15} \ProvidesPackage{cryptocode} - [2020/07/10 v0.40 Cryptocode LaTeX package for typesetting pseudocode, algorithms and protocols as well as cryptographic proofs.] + [2021/08/15 v0.44 Cryptocode LaTeX package for typesetting pseudocode, algorithms and protocols as well as cryptographic proofs.] + \RequirePackage{amsmath} \RequirePackage{mathtools} \newif\if@pc@opt@amsfonts \newif\if@pc@opt@advantage \newif\if@pc@opt@centernot \DeclareOption{operators}{ -\providecommand{\sample}{\hskip2.3pt{\gets\!\!\mbox{\scriptsize${\$}$\normalsize}}\,} +\providecommand\sample{\leftarrow\mathrel{\mkern-2.0mu}\pc@smalldollar} +\newcommand{\pc@smalldollar}{\mathrel{\mathpalette\pc@small@dollar\relax}} +\newcommand{\pc@small@dollar}[2]{% + \vcenter{\hbox{% + $#1\textnormal{\fontsize{0.7\dimexpr\f@size pt}{0}\selectfont\$\hskip-0.05em plus 0.5em}$% + }}% +} \DeclarePairedDelimiter\pc@floor{\lfloor}{\rfloor} \providecommand{\floor}[1]{\pc@floor*{#1}} @@ -356,7 +363,7 @@ } \ExecuteOptions{n} \ProcessOptions\relax -\RequirePackage{etex} + \if@pc@opt@amsfonts \RequirePackage{amsfonts} \fi @@ -442,6 +449,7 @@ \newcommand{\pcparse}{\highlightkeyword{parse}} \newcommand{\pcfail}{\highlightkeyword{fail}} \newcommand{\pcabort}{\highlightkeyword{abort}} +\newcommand{\pcassert}{\highlightkeyword{assert}} \mathchardef\pcmathhyphen ="2D \newcommand{\pccomment}[2][1em]{\hspace{#1}{\mbox{/\!\!/ } \text{\scriptsize#2}}} \newcommand{\pclinecomment}[2][0em]{\hspace{#1}{\mbox{/\!\!/ } \text{\scriptsize#2}}} @@ -485,6 +493,14 @@ %\global\let\@pc@original@label\relax %\global\let\label\relax } +\providecommand{\pcfixcleveref}{ +\AtBeginDocument{% +\pcfixhyperref% +\makeatletter% +\crefformat{@pclinenumber}{line~##2##1##3}% +\crefrangeformat{@pclinenumber}{lines~##3##1##4 to~##5##2##6}% +\makeatother% +}} \newcommand{\pchspace}[1][1em]{\hspace{#1}} \newcommand{\pcvspace}[1][\baselineskip]{\par\vspace{#1}} \newcounter{@pc@stackdepth} @@ -1362,6 +1378,8 @@ $\begin{aligned}#2\end{aligned}$% {\@pc@bbrenv@remfinalequals#1=#2\relax}% } \providecommand{\bbrfirstmessageoffset}{1ex} +\newcommand*\bbrtikzargs{} +\define@key{pcbbrenv}{tikzargs}[]{\renewcommand*\bbrtikzargs{#1}} \newenvironmentx{bbrenv}[3][1={aboveskip=0pt,belowskip=0pt},3=0pt]{% \addtocounter{@bb@env@nestcnt}{1}% \renewcommand{\@bb@lastbox}{#2}% @@ -1378,7 +1396,7 @@ $\begin{aligned}#2\end{aligned}$% \vspace{\@pc@bbrenvaboveskip}% \ifthenelse{\value{@bb@env@nestcnt}=1} {\@pc@ensureremember% -\begin{tikzpicture} +\begin{tikzpicture}[baseline=0pt,\bbrtikzargs] }{\tikz\bgroup} }{% \ifthenelse{\value{@bb@env@nestcnt}=1} @@ -1402,10 +1420,10 @@ $\begin{aligned}#2\end{aligned}$% \newcommand*\@bbrboxnameposoffset{below left=\bbrboxabovesep of phantomname.south west} \newcommand*\bbrboxstyle{draw} \newcommand*\bbrboxafterskip{} -\newcommand*\bbrboxminheight{0cm} +\newcommand*\bbrboxminheight{0pt} \newcommand*\bbrboxminwidth{2cm} -\newcommand*\bbrboxxshift{0cm} -\newcommand*\bbrboxyshift{0cm} +\newcommand*\bbrboxxshift{0pt} +\newcommand*\bbrboxyshift{0pt} \define@key{bbrbox}{abovesep}[]{\renewcommand*\bbrboxabovesep{#1}} \define@key{bbrbox}{name}[]{\renewcommand*\bbrboxname{#1}} \define@key{bbrbox}{namestyle}[]{\renewcommand*\bbrboxnamestyle{#1}} @@ -1440,8 +1458,12 @@ $\begin{aligned}#2\end{aligned}$% \tikzset{BBRBOXNAMESTYLE/.style/.expand once=\bbrboxnamestyle}% \tikzset{BBRBOXNAMEPOSOFFSET/.style/.expand once=\@bbrboxnameposoffset}% +\ifthenelse{\equal{\bbrboxxshift}{} \OR \equal{\bbrboxxshift}{0pt}}{ \coordinate[inner sep=0pt,outer sep=0pt] (\@bb@lastbox-tmpouter) {}; -\node at (\@bb@lastbox-tmpouter) {}; %this empty node seems needed to get the xyshift right. +}{ +\node[inner sep=0pt, outer sep=0pt] (\@bb@lastbox-tmpouter) {}; %this empty node seems needed to get the xyshift right. +} + \node[inner sep=.3333em,anchor=north,BBRBOXSTYLE,minimum height=\bbrboxminheight,below right=\bbrboxyshift and \bbrboxxshift of \@bb@lastbox-tmpouter] (\@bb@lastbox) \bgroup \tikz{ \node[inner sep=0pt,outer sep=0pt,minimum height=0cm] (phantomname) {}; %minimum width @@ -1686,11 +1708,20 @@ $\begin{aligned}#2\end{aligned}$% { \ifthenelse{\equal{#4}{north east}}{\def\@bbr@tmp@bottomanchor{south east}}{} \ifthenelse{\equal{#4}{north west}}{\def\@bbr@tmp@bottomanchor{south west}}{} + +\ifdefempty{\@bbrcomside}{ +\coordinate[#3=-\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.\@bbr@tmp@bottomanchor] (\@bbrcomsidename); +}{ \node[#3=-\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.\@bbr@tmp@bottomanchor,anchor=#6,BBRCOM-SIDESTYLE] (\@bbrcomsidename) {\@bbrcomside}; } +} { +\ifdefempty{\@bbrcomside}{ +\coordinate[#3=\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.#4] (\@bbrcomsidename); +}{ \node[#3=\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.#4,anchor=#6,BBRCOM-SIDESTYLE] (\@bbrcomsidename) {\@bbrcomside}; } +} \path[#2] (\@bbrcomsidename.#6) edge[BBRCOM-EDGESTYLE] node[above,BBRCOM-TOPSTYLE] (\@bbrcomtopname) {\@bbrcomtop} node[below,BBRCOM-BOTTOMSTYLE] (\@bbrcombottomname) {\@bbrcombottom} (\@bb@lastbox.#5|-\@bbrcomsidename) -- (\@bb@lastbox.#5|-\@bbrcomsidename) node[inner sep=0pt,outer sep=0pt,BBRCOM-OSIDESTYLE] (\@bbrcomosidename) {}; \@bb@comfinalize{#8} } @@ -1716,8 +1747,8 @@ $\begin{aligned}#2\end{aligned}$% \bbrmsgto{#2} \bbrmsgspace{\@bbr@intermessage@medskip} } -\newcommandx{\bbrmsgvdots}{% -\bbrmsgtxt[xshift=\@bbrcomlength/2,afterskip=\@bbr@intermessage@skip]{$\vdots$} +\newcommand{\bbrmsgvdots}[1][]{% +\bbrmsgtxt[xshift=\@bbrcomlength/2,afterskip=\@bbr@intermessage@shortskip,#1]{$\vdots$} } \newcommandx{\bbrqryto}[1]{% \@bbrmsg{#1}{<-}{below right}{north east}{east}{west}{\@bb@query@voffset}{\bbrqryspace}{\@bbr@first@query} @@ -1741,6 +1772,9 @@ $\begin{aligned}#2\end{aligned}$% \bbrqryto{#2} \bbrqryspace{\@bbr@intermessage@medskip} } +\newcommand{\bbrqryvdots}[1][]{% +\bbrqrytxt[xshift=\@bbrcomlength/2,afterskip=\@bbr@intermessage@skip,#1]{$\vdots$} +} \newcommand{\@bbroracleqry}[4]{ \@bb@comsetup{#1}{#3}{#4}{\@bbr@first@oraclequery} \ifthenelse{\equal{\@bbrcomfixedboffset}{true}} |