%%
%% This is file `lwarp-parnotes.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx  (with options: `parnotes')
%% This is a generated file.
%% Copyright 2016-2025 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.
%%
\LWR@ProvidesPackagePass{parnotes}[2019/07/23]
\VerifyCommand[lwarp][parnotes]{\PN@parnote@real}{91361D751D6393BA644478FDE4A764DA}

\long\def\PN@parnote@real#1#2{%
    \parnotemark{#1}%
    % Unless this is the first parnote in \PN@text, add a separator first
    \unless\ifx\PN@text\@empty\g@addto@macro\PN@text{\parnoteintercmd}\fi
    % Redefine \@currentlabel to the parnote label, so \label works
    \g@addto@macro\PN@text{%
        \def\@currentlabel{#1}%
        \def\cref@currentlabel{%        lwarp
            [parnotemark][\arabic{parnotemark}][]\theparnotemark%
        }%
    }%
    \g@addto@macro\PN@text{%
        \LWR@textcurrentfont{%          lwarp
            \parnotemark{#1}\nolinebreak\thinspace#2%
        }%
    }%
}

\VerifyCommand[lwarp][parnotes]{\PN@parnotes@real}{AF1257823BFCBC31ADDA4AAE1F3F3710}

\def\PN@parnotes@real{%
\ifPN@inparnotes
\else
    \LWR@stoppars%
    \addtocounter{LWR@spandepth}{1}%
    % We call \par later, so this avoids recursion with \PN@parnotes@auto
    \PN@inparnotestrue
    % Avoid page breaks between a paragraph and its parnotes
    \begin{BlockClass}(note){footnotes}%    lwarp
    \leavevmode\LWR@orignewline%
    {%
        \parnotefmt{\PN@text}%
    }%
    \leavevmode\LWR@orignewline%
    \end{BlockClass}%                       lwarp
    \leavevmode\LWR@orignewline%
    \global\def\PN@text{}%
    %
    % These can be enabled or disabled by package options
    %
    \PN@disable@indent
    \PN@reset@optional
    \PN@inparnotesfalse
    \addtocounter{LWR@spandepth}{-1}%
\fi
}

\newbool{LWR@parnotes@doingauto}
\boolfalse{LWR@parnotes@doingauto}

\VerifyCommand[lwarp][parnotes]{\PN@parnotes@auto}{08CC1722ABA55FA01D64F2B29C919D70}

\def\PN@parnotes@auto{%
    \ifbool{LWR@parnotes@doingauto}{
        \ifx\@currenvir\@PN@autopn
            \unless\ifPN@inparnotes
                \unless\ifx\PN@text\@empty
                    \expandafter\PN@parnotes@real
                \fi
            \fi
        \fi
    }{}%
}
\renewenvironment{autopn}%
    {\booltrue{LWR@parnotes@doingauto}}
    {\PN@parnotes@auto}%
\AtBeginDocument{
    \ifdef{\crefname}{
        \crefname{parnotemark}{paragraph note}{paragraph notes}
        \Crefname{parnotemark}{Paragraph note}{Paragraph notes}
    }{}
}
\apptocmd{\LWR@nullifyfootnotes}{%
    \renewcommand{\parnote}[2][]{}%
    \renewcommand\parnotemark[1]{}%
}{}{}
\begin{warpMathJax}
\providecommand{\parnotename}{parnote}
\appto\LWR@syncnotenumbers{%
    \addtocounter{parnotemark}{-1}% specific to parnotes
    \LWR@synconenotenumber{LWRparnote}{\theparnotemark}%
    \addtocounter{parnotemark}{1}% specific to parnotes
}
\appto\LWR@syncnotenames{\LWR@synconenotename{LWRparnote}{\parnotename}}
\CustomizeMathJax{\def\LWRparnote{1}}
\CustomizeMathJax{\newcommand{\parnote}[2][\LWRparnote]{{}^{\mathrm{#1}}}}
\CustomizeMathJax{\newcommand{\parnotemark}[1][\LWRparnote]{{}^{\mathrm{#1}}}}
\end{warpMathJax}

\endinput
%%
%% End of file `lwarp-parnotes.sty'.
