Skip to content

Not compatible with new math syntax \( \) #19

@thomwiggers

Description

@thomwiggers

When using the \( \) math syntax, algpseudocodex breaks. So does algpseudocode, but then I have this patch:

%%% fix for usage of \( \) in Algpseudocode
% https://tex.stackexchange.com/questions/669665/use-in-algpseudocode
\newcommand{\algparenthesize}[1]{%
  \if\relax\detokenize{#1}\relax\else(#1)\fi
}
\algdef{SE}[PROCEDURE]{Procedure}{EndProcedure}[2]
 {\algorithmicprocedure\ \textproc{#1}\algparenthesize{#2}}
 {\algorithmicend\ \algorithmicprocedure}
\algdef{SE}[FUNCTION]{Function}{EndFunction}[2]
 {\algorithmicfunction\ \textproc{#1}\algparenthesize{#2}}
 {\algorithmicend\ \algorithmicfunction}
\algrenewcommand\Call[2]{\textproc{#1}\algparenthesize{#2}}
%%% end fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions