texlive[74973] Master/texmf-dist: algpseudocodex (17apr25)
commits+karl at tug.org
commits+karl at tug.org
Thu Apr 17 21:33:44 CEST 2025
Revision: 74973
https://tug.org/svn/texlive?view=revision&revision=74973
Author: karl
Date: 2025-04-17 21:33:44 +0200 (Thu, 17 Apr 2025)
Log Message:
-----------
algpseudocodex (17apr25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/algpseudocodex/algpseudocodex.pdf
trunk/Master/texmf-dist/doc/latex/algpseudocodex/algpseudocodex.tex
trunk/Master/texmf-dist/tex/latex/algpseudocodex/algpseudocodex.sty
Modified: trunk/Master/texmf-dist/doc/latex/algpseudocodex/algpseudocodex.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/algpseudocodex/algpseudocodex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/algpseudocodex/algpseudocodex.tex 2025-04-17 19:33:35 UTC (rev 74972)
+++ trunk/Master/texmf-dist/doc/latex/algpseudocodex/algpseudocodex.tex 2025-04-17 19:33:44 UTC (rev 74973)
@@ -1,5 +1,5 @@
%% algpseudocodex.tex
-%% Copyright 2020-2023 Christian Matt
+%% Copyright 2020-2023, 2025 Christian Matt
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -10,7 +10,7 @@
% version 2008-05-04 or later.
%
% This work has the LPPL maintenance status `maintained'.
-%
+%
% The Current Maintainer of this work is Christian Matt.
%
% This work consists of the files algpseudocodex.sty and algpseudocodex.tex.
@@ -29,7 +29,7 @@
\title{\bf{Algpseudocodex Package Documentation}}
\author{Christian Matt \\ \url{https://github.com/chrmatt/algpseudocodex}}
-\date{\today\\v1.1.2}
+\date{\today\\v1.2.0}
\begin{document}
@@ -244,7 +244,74 @@
\end{algorithmic}
\end{minipage}
+\subsubsection{Structure}
+\begin{minipage}[t]{0.45\textwidth}
+ \begin{verbatim}
+ \Structure{name}
+ \State body
+ \EndStructure
+ \end{verbatim}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{0.45\textwidth}
+ \begin{algorithmic}
+ \Structure{name}
+ \State body
+ \EndStructure
+ \end{algorithmic}
+\end{minipage}
+\subsubsection{Class}
+\begin{minipage}[t]{0.45\textwidth}
+ \begin{verbatim}
+ \Class{name}
+ \State body
+ \EndClass
+ \end{verbatim}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{0.45\textwidth}
+ \begin{algorithmic}
+ \Class{name}
+ \State body
+ \EndClass
+ \end{algorithmic}
+\end{minipage}
+
+\subsubsection{Properties}
+\begin{minipage}[t]{0.45\textwidth}
+ \begin{verbatim}
+ \Properties
+ \State body
+ \EndProperties
+ \end{verbatim}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{0.45\textwidth}
+ \begin{algorithmic}
+ \Properties
+ \State body
+ \EndProperties
+ \end{algorithmic}
+\end{minipage}
+
+\subsubsection{Methods}
+\begin{minipage}[t]{0.45\textwidth}
+ \begin{verbatim}
+ \Methods
+ \State body
+ \EndMethods
+ \end{verbatim}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{0.45\textwidth}
+ \begin{algorithmic}
+ \Methods
+ \State body
+ \EndMethods
+ \end{algorithmic}
+\end{minipage}
+
\subsection{Require and Ensure}
To specify conditions on the inputs and outputs of an algorithm, \verb|\Require| and \verb|\Ensure| can be used.
@@ -684,10 +751,23 @@
\hfill Default: \verb|\textbf{return}|
\item \verb|\algorithmicoutput|
\hfill Default: \verb|\textbf{output}|
+ \item \verb|\algorithmicstructure|
+ \hfill Default: \verb|\textbf{structure}|
+ \item \verb|\algorithmicclass|
+ \hfill Default: \verb|\textbf{class}|
+ \item \verb|\algorithmicproperties|
+ \hfill Default: \verb|\textbf{properties}|
+ \item \verb|\algorithmicmethods|
+ \hfill Default: \verb|\textbf{methods}|
\end{itemize}
\section{Revision History}
+\subsection*{v1.2.0 (2025-04-16)}
+\begin{itemize}
+ \item Added support for classes, structures, properties, and methods.
+\end{itemize}
+
\subsection*{v1.1.2 (2023-04-17)}
\begin{itemize}
\item Fixed issue with resetting value of lineskiplimit.
Modified: trunk/Master/texmf-dist/tex/latex/algpseudocodex/algpseudocodex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/algpseudocodex/algpseudocodex.sty 2025-04-17 19:33:35 UTC (rev 74972)
+++ trunk/Master/texmf-dist/tex/latex/algpseudocodex/algpseudocodex.sty 2025-04-17 19:33:44 UTC (rev 74973)
@@ -1,5 +1,5 @@
%% algpseudocodex.sty
-%% Copyright 2017, 2020-2023 Christian Matt
+%% Copyright 2017, 2020-2023, 2025 Christian Matt
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -10,7 +10,7 @@
% version 2008-05-04 or later.
%
% This work has the LPPL maintenance status `maintained'.
-%
+%
% The Current Maintainer of this work is Christian Matt.
%
% This work consists of the files algpseudocodex.sty and algpseudocodex.tex.
@@ -20,7 +20,7 @@
% Based on Szasz Janos' algpseudocode.sty
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{algpseudocodex}[2023-04-17 v1.1.2 pseudocode typesetting]
+\ProvidesPackage{algpseudocodex}[2025-04-16 v1.2.0 pseudocode typesetting]
\RequirePackage{kvoptions}
\RequirePackage{algorithmicx}
\RequirePackage{etoolbox}
@@ -445,7 +445,7 @@
% Must be followed by \State, \If, \For etc.
% (optional) argument is style of box
\newcommand{\BeginBox}[1][algpxDefaultBox]{%
- \ignorespaces%
+ \ignorespaces%
\FSUnshift{algpx at startNewCodeBoxQueue}{\thealgpx at codeBoxCount}% add to queue; processed by \algpx at startCodeCommand
%globally set tikz style (https://tex.stackexchange.com/a/47918)
\begingroup%
@@ -638,7 +638,7 @@
\setcounter{algpx at tmpCount}{-1}%
}%
\whileboolexpr{test{\ifnumcomp{0}{<}{\FSSize{algpx at indentStack}}}}{%
- \FSPush{algpx at indentStackTmp}{\FSTop{algpx at indentStack}}% copy stack to tmp
+ \FSPush{algpx at indentStackTmp}{\FSTop{algpx at indentStack}}% copy stack to tmp
\stepcounter{algpx at tmpCount}%
% draw line to bottom of page
% set beginning of line to north of page (with x set to beginning of line, see \algpx at checkPageBreak)
@@ -677,7 +677,12 @@
\algnewcommand\algorithmicensure{\textbf{Ensure:}}
\algnewcommand\algorithmicreturn{\textbf{return}}
\algnewcommand\algorithmicoutput{\textbf{output}}
-\algnewcommand\textproc{\textsc}
+\algnewcommand\algorithmicstructure{\textbf{structure}}
+\algnewcommand\algorithmicclass{\textbf{class}}
+\algnewcommand\algorithmicproperties{\textbf{properties}}
+\algnewcommand\algorithmicmethods{\textbf{methods}}
+\algnewcommand\textproc{\textsc}% font for procedure/function names
+\algnewcommand\textstruc{\textsc}% font for structure and class names
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -727,6 +732,26 @@
}{%
\algpx at startEndBlockCommand\algpx at endIndent\algorithmicend\ \algorithmicfunction%
}
+\algdef{SE}[STRUCTURE]{Structure}{EndStructure}[1]{%
+ \algpx at startCodeCommand\algpx at startIndent\algorithmicstructure\ \textstruc{#1}%
+}{%
+ \algpx at startEndBlockCommand\algpx at endIndent\algorithmicend\ \algorithmicstructure%
+}
+\algdef{SE}[CLASS]{Class}{EndClass}[1]{%
+ \algpx at startCodeCommand\algpx at startIndent\algorithmicclass\ \textstruc{#1}%
+}{%
+ \algpx at startEndBlockCommand\algpx at endIndent\algorithmicend\ \algorithmicclass%
+}
+\algdef{SE}[PROPERTIES]{Properties}{EndProperties}{%
+ \algpx at startCodeCommand\algpx at startIndent\algorithmicproperties%
+}{%
+ \algpx at startEndBlockCommand\algpx at endIndent\algorithmicend\ \algorithmicproperties%
+}
+\algdef{SE}[METHODS]{Methods}{EndMethods}{%
+ \algpx at startCodeCommand\algpx at startIndent\algorithmicmethods%
+}{%
+ \algpx at startEndBlockCommand\algpx at endIndent\algorithmicend\ \algorithmicmethods%
+}
\ifbool{algpx at noEnd}{%
\algtext*{EndWhile}%
@@ -735,6 +760,10 @@
\algtext*{EndIf}%
\algtext*{EndProcedure}%
\algtext*{EndFunction}%
+ \algtext*{EndStructure}%
+ \algtext*{EndClass}%
+ \algtext*{EndProperties}%
+ \algtext*{EndMethods}%
%
% end indent line before end command
\pretocmd{\EndWhile}{\algpx at endIndent}{}{}%
@@ -743,6 +772,10 @@
\pretocmd{\EndIf}{\algpx at endIndent}{}{}%
\pretocmd{\EndProcedure}{\algpx at endIndent}{}{}%
\pretocmd{\EndFunction}{\algpx at endIndent}{}{}%
+ \pretocmd{\EndStructure}{\algpx at endIndent}{}{}%
+ \pretocmd{\EndClass}{\algpx at endIndent}{}{}%
+ \pretocmd{\EndProperties}{\algpx at endIndent}{}{}%
+ \pretocmd{\EndMethods}{\algpx at endIndent}{}{}%
}{}%
% execute \algpx at endCodeCommand before \State, \If etc.
@@ -758,6 +791,10 @@
\pretocmd{\Else}{\algpx at endCodeCommand}{}{}
\pretocmd{\Procedure}{\algpx at endCodeCommand}{}{}
\pretocmd{\Function}{\algpx at endCodeCommand}{}{}
+\pretocmd{\Structure}{\algpx at endCodeCommand}{}{}
+\pretocmd{\Class}{\algpx at endCodeCommand}{}{}
+\pretocmd{\Properties}{\algpx at endCodeCommand}{}{}
+\pretocmd{\Methods}{\algpx at endCodeCommand}{}{}
% for end commands that may not be printed, tell endCodeCommand whether we are using noEnd
\ifbool{algpx at noEnd}{%
@@ -767,6 +804,10 @@
\pretocmd{\EndIf}{\algpx at endCodeCommand[1]}{}{}%
\pretocmd{\EndProcedure}{\algpx at endCodeCommand[1]}{}{}%
\pretocmd{\EndFunction}{\algpx at endCodeCommand[1]}{}{}%
+ \pretocmd{\EndStructure}{\algpx at endCodeCommand[1]}{}{}%
+ \pretocmd{\EndClass}{\algpx at endCodeCommand[1]}{}{}%
+ \pretocmd{\EndProperties}{\algpx at endCodeCommand[1]}{}{}%
+ \pretocmd{\EndMethods}{\algpx at endCodeCommand[1]}{}{}%
}{%
\pretocmd{\EndWhile}{\algpx at endCodeCommand[0]}{}{}%
\pretocmd{\EndFor}{\algpx at endCodeCommand[0]}{}{}%
@@ -774,6 +815,10 @@
\pretocmd{\EndIf}{\algpx at endCodeCommand[0]}{}{}%
\pretocmd{\EndProcedure}{\algpx at endCodeCommand[0]}{}{}%
\pretocmd{\EndFunction}{\algpx at endCodeCommand[0]}{}{}%
+ \pretocmd{\EndStructure}{\algpx at endCodeCommand[0]}{}{}%
+ \pretocmd{\EndClass}{\algpx at endCodeCommand[0]}{}{}%
+ \pretocmd{\EndProperties}{\algpx at endCodeCommand[0]}{}{}%
+ \pretocmd{\EndMethods}{\algpx at endCodeCommand[0]}{}{}%
}%
% execute \algpx at startCodeCommand after \State (this is done for loops etc. inside the definitions above)
More information about the tex-live-commits
mailing list.