%% %% This is file `verifycommand.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% verifycommand.dtx (with options: `package') %% This is a generated file. %% Copyright 2024 Brian Dunn %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.3 or later is part of all distributions of LaTeX %% version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{verifycommand} [2025/03/07 v1.11 Verify definitions have not changed.] \RequirePackage{etoolbox} \RequirePackage{iftex} \newbool{VERCMDenable} \booltrue{VERCMDenable} \DeclareOption{disable}{% \boolfalse{VERCMDenable}% \typeout{----}% \typeout{Package verifycommand: Turned off by option 'disable'.}% \typeout{----}% } \ProcessOptions\relax \catcode`\&=0 &catcode`&\=12 &def&VERCMD@backslash{\} &catcode`&\=0 \catcode`\&=4 \newcommand{\VERCMD@mdfivesum}[1]{% \PackageError{verifycommand} {No MD5 macro was found} {% Verifycommand must find the macros \protect\pdfmdfivesum\space or \protect\mdfivesum.% } } \ifdef{\pdfmdfivesum} {\let\VERCMD@mdfivesum\pdfmdfivesum} {} \ifLuaTeX \RequirePackage{pdftexcmds} \let\VERCMD@mdfivesum\pdf@mdfivesum \fi \ifXeTeX \@ifundefined{pdffivesum}{} {\let\VERCMD@mdfivesum\pdfmdfivesum} \@ifundefined{mdfivesum}{} {\let\VERCMD@mdfivesum\mdfivesum} \fi \def\VERCMD@mdfive#1{% \edef\VERCMD@temp{\VERCMD@mdfivesum{\meaning#1}}% } \newcommand*{\VERCMD@whatchanged}{} \newbool{VERCMD@this@ltxcmd} \boolfalse{VERCMD@this@ltxcmd} \newbool{VERCMD@failed@ltxcmd} \boolfalse{VERCMD@failed@ltxcmd} \newcommand*{\VERCMD@addchanged}[2]{% \ifdefempty{\VERCMD@whatchanged}% {}% {\apptocmd{\VERCMD@whatchanged}{^^J}{}{}}% \apptocmd{\VERCMD@whatchanged}{% (verifycommand)\space\space#2^^J% \space\space\space\space\space\space\space\space\space\space% \space\space\space\space\space\space\space\space\space(#1)% }{}{}% \ifbool{VERCMD@this@ltxcmd}{% \apptocmd{\VERCMD@whatchanged}{ *}{}{}% \booltrue{VERCMD@failed@ltxcmd}% }{}% \boolfalse{VERCMD@this@ltxcmd}% } \AtEndDocument{ \ifdefempty{\VERCMD@whatchanged}{}{% \typeout{--------------------------------}% \typeout{Package verifycommand Warning: Definitions have changed.}% \typeout{Patches for the following macros may need to be updated.}% \typeout{See the previous warnings for line numbers.}% \typeout{}% \typeout{Syntax:\space\space Patching pkg -> Defining pkg: Macro (checksum)}% \typeout{-----}% \typeout{\VERCMD@whatchanged} \typeout{-----}% \typeout{Look for updates to these packages.} \ifbool{VERCMD@failed@ltxcmd}{ \typeout{Any of the above marked with a * may be due to changes in LaTeX internals,} \typeout{the most recently known of which was 2023/12/01.} \typeout{If so, look for updates for the LaTeX sytem as well.} }{} \typeout{--------------------------------} } } \def\VERCMD@ProgWarning#1{% \GenericWarning{% \@spaces\@spaces }{% Warning: #1% }% } \newcommand*{\VERCMDWarning}[3]{% \ifblank{#1}% {% \VERCMD@ProgWarning{% A definition has changed:\MessageBreak \ifblank{#2}{}{#2: }\string#3\MessageBreak (\VERCMD@temp)\MessageBreak }% \expandafter\VERCMD@addchanged% \expandafter{\VERCMD@temp}{\string#3}% }% {% \PackageWarning{#1}{% A definition has changed:\MessageBreak% \ifblank{#2}{}{#2: }% \string#3\MessageBreak% (\VERCMD@temp)\MessageBreak% }% \expandafter\VERCMD@addchanged% \expandafter{\VERCMD@temp}{#1 -> \ifblank{#2}{}{#2: }\string#3}% }% } \ExplSyntaxOn \newbool{VERCMD@passed} \newbool{VERCMD@failed} \newcommand*{\TestVerifyCommands} { \boolfalse{VERCMD@passed} \boolfalse{VERCMD@failed} } \newcommand*{\IfVerifyCommandPassed} {% \ifbool{VERCMD@passed}% {\let\VERCMD@tempa\@firstoftwo}% {\let\VERCMD@tempa\@secondoftwo}% \VERCMD@tempa% } \newcommand*{\IfVerifyCommandFailed} {% \ifbool{VERCMD@failed}% {\let\VERCMD@tempa\@firstoftwo}% {\let\VERCMD@tempa\@secondoftwo}% \VERCMD@tempa% } \NewDocumentCommand{\IfVerifyCommand}{O{} O{} m m}{% \ifbool{VERCMDenable}{% \edef\VERCMD@temp{Unknown~definition}% \boolfalse{VERCMD@this@ltxcmd} \ifcsdef{\cs_to_str:N #3~code}% {% \booltrue{VERCMD@this@ltxcmd}% \expandafter\VERCMD@mdfive% \csname \cs_to_str:N #3~code\endcsname% }% {% \ifcsdef{\VERCMD@backslash\cs_to_str:N #3~}% {% \expandafter\VERCMD@mdfive% \csname \cs_to_str:N #3~code\endcsname% }% {% \ifcsdef{\cs_to_str:N #3~}% {% \expandafter\VERCMD@mdfive% \csname \cs_to_str:N #3~\endcsname% }% {% \ifcsdef{\VERCMD@backslash\cs_to_str:N #3}% {% \expandafter\VERCMD@mdfive% \csname % \VERCMD@backslash% \cs_to_str:N #3% \endcsname% }% {% \ifdef{#3}% {\VERCMD@mdfive#3}% {}% }% }% }% }% \ifdefstring{\VERCMD@temp}{#4}% {% \booltrue{VERCMD@passed}% \let\VERCMD@tempa\@firstoftwo% }% {% \booltrue{VERCMD@failed}% \let\VERCMD@tempa\@secondoftwo% }% }% if package enabled {\let\VERCMD@tempa\@firstoftwo}% if package not enabled \VERCMD@tempa% } \NewDocumentCommand{\VerifyCommand}{O{} O{} m m}{% \ifblank{#1}{% #1 blank \IfVerifyCommand{#3}{#4}{}{\VERCMDWarning{}{}{#3}}% }% #1 blank {% #1 given \ifblank{#2}{% #2 blank \IfVerifyCommand[#1]{#3}{#4}{}{\VERCMDWarning{#1}{}{#3}}% }% #2 blank {% #2 given \IfVerifyCommand[#1][#2]{#3}{#4}{}{\VERCMDWarning{#1}{#2}{#3}}% }% #2 given }% #1 given } \NewDocumentCommand{\IfVerifyEnvironmentBegin}{O{} O{} m m}{% \ifbool{VERCMDenable}{% \edef\VERCMD@temp{Unknown~definition}% \boolfalse{VERCMD@this@ltxcmd} \ifcsdef{environment~#3~code}% {% \booltrue{VERCMD@this@ltxcmd}% \expandafter\VERCMD@mdfive% \csname environment~#3~code\endcsname% }% {% \ifcsdef{\VERCMD@backslash#3}% {% \expandafter\VERCMD@mdfive% \csname \VERCMD@backslash#3\endcsname% }% {% \ifcsdef{#3}% {\expandafter\VERCMD@mdfive\csname #3\endcsname}% {}% }% }% \ifdefstring{\VERCMD@temp}{#4}% {% \booltrue{VERCMD@passed}% \let\VERCMD@tempa\@firstoftwo% }% {% \booltrue{VERCMD@failed}% \let\VERCMD@tempa\@secondoftwo% }% }% if package enabled {\let\VERCMD@tempa\@firstoftwo}% if package not enabled \VERCMD@tempa% } \NewDocumentCommand{\IfVerifyEnvironmentEnd}{O{} O{} m m}{% \ifbool{VERCMDenable}{% \edef\VERCMD@temp{Unknown~definition}% \boolfalse{VERCMD@this@ltxcmd} \ifcsdef{environment~#3~end~aux~}% {% \booltrue{VERCMD@this@ltxcmd}% \expandafter\VERCMD@mdfive \csname environment~#3~end~aux~\endcsname% }% {% \ifcsdef{end#3}% {% \expandafter\VERCMD@mdfive% \csname end#3\endcsname% }% {}% }% \ifdefstring{\VERCMD@temp}{#4}% {% \booltrue{VERCMD@passed}% \let\VERCMD@tempa\@firstoftwo% }% {% \booltrue{VERCMD@failed}% \let\VERCMD@tempa\@secondoftwo% }% }% if package enabled {\let\VERCMD@tempa\@firstoftwo}% if package not enabled \VERCMD@tempa% } \NewDocumentCommand{\VerifyEnvironment}{O{} O{} m m m}{% \ifblank{#1}{% #1 blank \IfVerifyEnvironmentBegin{#3}{#4}% {}% {\VERCMDWarning{}{}{#3}}% }% #1 blank {% #1 given \ifblank{#2}{% #2 blank \IfVerifyEnvironmentBegin[#1]{#3}{#4}% {}% {\VERCMDWarning{#1}{}{#3}}% }% #2 blank {% #2 given \IfVerifyEnvironmentBegin[#1][#2]{#3}{#4}% {}% {\VERCMDWarning{#1}{#2}{#3}}% }% #2 given }% #1 given \ifblank{#1}{% #1 blank \IfVerifyEnvironmentEnd{#3}{#5}% {}% {\VERCMDWarning{}{}{(end)#3}}% }% #1 blank {% #1 given \ifblank{#2}{% #2 blank \IfVerifyEnvironmentEnd[#1]{#3}{#5}% {}% {\VERCMDWarning{#1}{}{(end)#3}}% }% #2 blank {% #2 given \IfVerifyEnvironmentEnd[#1][#2]{#3}{#5}% {}% {\VERCMDWarning{#1}{#2}{(end)#3}}% }% #2 given }% #1 given } \ExplSyntaxOff \endinput %% %% End of file `verifycommand.sty'.