<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% ã‚¨ãƒ³ã‚¸ãƒ³éžä¾å­˜ã®ãƒžã‚¯ãƒ­é›†

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{jlreq-helpers}[2024/02/13 jlreq-helpers]

\ExplSyntaxOn
%. helper1
\newcount\jlreq@tempcnta
\newcount\jlreq@tempcntb
\newcount\jlreq@tempcntc
\newdimen\jlreq@tempdima
\newdimen\jlreq@tempdimb
\newdimen\jlreq@tempdimc
\newskip\jlreq@tempskipa
\newskip\jlreq@tempskipb
\newskip\jlreq@tempskipc
\newif\ifjlreq@tempa
\newif\ifjlreq@tempb
\newif\ifjlreq@tempc
\newbox\jlreq@tempboxa
\newbox\jlreq@tempboxb
\newbox\jlreq@tempboxc
% è¨ˆç®—çµæžœã‚’è¿”ã™ãŸã‚ã®å¤‰æ•°
\newdimen\jlreq@resultdimen
\newskip\jlreq@resultskip
\newbox\jlreq@resultbox
\newif\ifjlreq@result
\newcount\jlreq@resultcnt

\def\jlreq@uniqtoken{\jlreq@uniqtoken@may@be@a@bug}
\def\jlreq@endmark{\jlreq@endmark@may@be@a@bug}
\long\def\jlreq@deleteuntileendmark#1\jlreq@endmark{}

\def\jlreq@expandafter@ii{\expandafter\expandafter\expandafter}
\edef\jlreq@expandafter@iii{\exp_not:o {\jlreq@expandafter@ii}\noexpand\expandafter\exp_not:o {\jlreq@expandafter@ii}}
\edef\jlreq@expandtwice#1{\exp_not:o {\jlreq@expandafter@ii}\noexpand\unexpanded\exp_not:o {\jlreq@expandafter@ii}{#1}}
\edef\jlreq@expand@three#1{\exp_not:o {\jlreq@expandafter@iii}\noexpand\unexpanded\exp_not:o {\jlreq@expandafter@iii}{#1}}

% \jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@ã®å½¢ã§ä½¿ã†
% äºŒå›žå±•é–‹ã™ã‚‹ã¨ï¼Œ#1ã®å…ˆé&nbsp;­ï¼ˆãŸã&nbsp;ã—ç©ºç™½ã¯ç„¡è¦–ã•ã‚Œã‚‹ï¼‰ã‚’å–ã‚Šå‡ºã™ï¼Ž#1ãŒç©ºã®å&nbsp;´åˆã¯\jlreq@uniqtokenï¼Œå…ˆé&nbsp;­ãŒ{ã®å&nbsp;´åˆã¯\bgroupã¨ãªã‚‹
\def\jlreq@endmark@{\jlreq@endmark@@may@be@a@bug} % \jlreq@getfirsttokenã&nbsp;ã‘ã®ãŸã‚ã®endmark
\long\def\jlreq@getfirsttoken#1#{\jlreq@getfirsttoken@#1\bgroup\jlreq@endmark@}
\long\def\jlreq@getfirsttoken@#1#2\jlreq@endmark@#3\jlreq@endmark@{#1}
% ä¸Žãˆã‚‰ã‚ŒãŸãƒˆãƒ¼ã‚¯ãƒ³åˆ—ãŒç©ºã‹ï¼ˆå±•é–‹ã¯ã—ãªã„ã§ãƒã‚§ãƒƒã‚¯ï¼‰
\long\def\jlreq@ifempty#1{\expandafter\ifx\expandafter\relax\detokenize{#1}\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
% #1ã®å…ˆé&nbsp;­ãƒˆãƒ¼ã‚¯ãƒ³ãŒ#2ã‹ï¼ˆãŸã&nbsp;ã—#1ãŒç©ºãªã‚‰ã°#2=\jlreq@uniqtokenï¼Œ#1={ãªã‚‰ã°#2=\bgroupã§TRUEã¨ãªã‚‹ï¼‰
\long\edef\jlreq@iffirsttoken#1#2{%
  % ã‚¹ãƒšãƒ¼ã‚¹ãƒã‚§ãƒƒã‚¯
  \unexpanded{\expandafter\expandafter\expandafter\jlreq@deleteuntileendmark\expandafter\ifx\expandafter}\exp_not:o {\space}\noexpand\detokenize{#1}\unexpanded{\@undefined\jlreq@endmark\expandafter\@firstoftwo\else\jlreq@endmark\expandafter\@secondoftwo\fi}{%
    \noexpand\ifx\exp_not:o {\space}#2\unexpanded{\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}%
  }{%
    \noexpand\jlreq@iffirsttoken@ignorespaces{#1}{#2}%
  }%
}
% ã“ã¡ã‚‰ã¯å…ˆé&nbsp;­ã®ã‚¹ãƒšãƒ¼ã‚¹ã‚’èª­ã¿é£›ã°ã™
\long\def\jlreq@iffirsttoken@ignorespaces#1#2{%
  \expandafter\expandafter\expandafter\ifx\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
}

% #1ãŒ\jlreq@endmarkã‹
\long\def\jlreq@ifendmark#1{\jlreq@iffirsttoken{#1}{\jlreq@endmark}}

% æ¡ä»¶ï¼Ž\jlreq@if{\ifnum\@count=1 \fi}{&lt;TRUE&gt;}{&lt;FALSE&gt;}ã¿ãŸã„ã«ä½¿ã†
\def\jlreq@if@endmark{\jlreq@if@endmark}
\long\def\jlreq@if#1{\jlreq@if@#1\jlreq@if@endmark}
\@gobbletwo\if\if
\long\def\jlreq@if@#1\fi\jlreq@if@endmark{#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}

% #1ã®å…ˆé&nbsp;­ãŒå¼•æ•°ãªã—ã®ãƒžã‚¯ãƒ­ã‹
\long\def\jlreq@ifmacro@noargument#1{%
  \jlreq@ifempty{#1}{\@secondoftwo}{%
    \jlreq@iffirsttoken{#1}{~}{\@secondoftwo}{%
      \expandafter\expandafter\expandafter\jlreq@ifmacro@noargument@\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@
}}}
\long\def\jlreq@ifmacro@noargument@#1{\expandafter\jlreq@ifmacro@noargument@@\expandafter{\meaning #1}}
\def\@tempa#1{%
  \def\jlreq@ifmacro@noargument@@##1{\jlreq@ifmacro@noargument@@@##1#1\noexpand\jlreq@endmark}
  \def\jlreq@ifmacro@noargument@@@##1#1##2\jlreq@endmark{\jlreq@ifempty{##1}}
}
\edef\jlreq@do{\noexpand\@tempa{\detokenize{macro:-&gt;}}}
\jlreq@do
% ã“ã¡ã‚‰ã¯å˜ã«ãƒžã‚¯ãƒ­ã‹
\def\@tempa#1{%
  \long\def\jlreq@ifmacro##1{\jlreq@ifempty{##1}{\@secondoftwo}{\expandafter\jlreq@ifmacro@i\meaning##1#1\jlreq@endmark}}
  \long\def\jlreq@ifmacro@i##1#1##2\jlreq@endmark{\jlreq@ifempty{##1}}
}
\edef\jlreq@do{\noexpand\@tempa{\detokenize{macro:}}}
\jlreq@do



% #1ï¼ˆskipãƒ¬ã‚¸ã‚¹ã‚¿ï¼‰ãŒ0ã‹ï¼ˆå±•é–‹ä¸å¯ï¼‰ï¼Ž
\newcommand*\jlreq@ifgluezero[1]{%
  \begingroup
    \edef\@tempa{\the#1}%
    \edef\@tempb{\detokenize{0.0pt}}%
    \edef\jlreq@do{\ifx\@tempa\@tempb\noexpand\@firstoftwo\else\noexpand\@secondoftwo\fi}%
  \expandafter\endgroup
  \jlreq@do
}

% #1ãŒ#2ã§çµ‚ã‚ã‚‹ã‹ï¼ˆå±•é–‹ä¸å¯ï¼‰
\newcommand*{\jlreq@ifendswith}[2]{%
  \jlreq@ifempty{#2}{\@firstoftwo}{%
    \begingroup
      \def\jlreq@tempa##1#2\jlreq@uniqtoken##2\jlreq@endmark{%
        \edef\jlreq@do{\jlreq@ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}%
      }%
      \jlreq@tempa#1\jlreq@uniqtoken#2\jlreq@uniqtoken\jlreq@endmark
    \expandafter\endgroup
    \jlreq@do
  }%
}
% #1ãŒ#2ã§å§‹ã¾ã‚‹ã‹ï¼ˆå±•é–‹ä¸å¯ï¼‰
\newcommand*{\jlreq@ifstartswith}[2]{%
  \jlreq@ifempty{#2}{\@firstoftwo}{%
    \jlreq@ifempty{#1}{\@secondoftwo}{%
      \begingroup
        \def\jlreq@tempa##1#2##2\jlreq@endmark{%
          \edef\jlreq@do{\jlreq@ifempty{##1}{\noexpand\@firstoftwo}{\noexpand\@secondoftwo}}%
        }%
        \jlreq@tempa#1#2\jlreq@endmark
      \expandafter\endgroup
      \jlreq@do
    }%
  }%
}
% #1ãŒ#2ã‚’å«ã‚€ã‹ï¼ˆå±•é–‹ä¸å¯ï¼‰{}å†…ã«#2ãŒã‚ã£ã¦ã‚‚FALSEåˆ¤å®šï¼Ž
\newcommand*{\jlreq@ifcontains}[2]{%
  \jlreq@ifempty{#2}{\@firstoftwo}{%
    \begingroup
      \def\jlreq@tempa##1#2##2\jlreq@endmark{%
        \edef\jlreq@do{\jlreq@ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}%
      }%
      \jlreq@tempa#1#2\jlreq@endmark
    \expandafter\endgroup
    \jlreq@do
  }%
}

% @removeelementã®æ‹¬å¼§ãŒã‚ã£ã¦ã‚‚å‹•ãã‹ã‚‚ã—ã‚Œãªã„ç‰ˆ
% #2ã‹ã‚‰#1ã‚’æ¶ˆã—ã¦#3ã«å…¥ã‚Œã‚‹
\newcommand*{\jlreq@helper@removeelement}[3]{%
  \begingroup
    \edef\jlreq@tempa{\unexpanded{#1}}% æ¶ˆã—ãŸã„ã‚„ã¤
    \def\jlreq@tempb{}% æ¶ˆã—ã¦ã„ãªã„åˆ†ã‚’æ”¾ã‚Šè¾¼ã‚“ã§ã„ã
    \jlreq@tempatrue% æœ€åˆã®\jlreq@tempbã¸ã®è¿½åŠ&nbsp;ã‹ï¼Ž
    \jlreq@helper@removeelement@#2,\jlreq@endmark,%
    \edef\jlreq@do{\unexpanded{\def#3}{\exp_not:o {\jlreq@tempb}}}%
  \expandafter\endgroup
  \jlreq@do
}
\def\jlreq@helper@removeelement@#1,{%
  \jlreq@ifendmark{#1}{}{%
    \edef\@tempa{\unexpanded{#1}}%
    \ifx\jlreq@tempa\@tempa\expandafter\@gobble\else\expandafter\@firstofone\fi{%
      \tl_put_right:Nx \jlreq@tempb{\ifjlreq@tempa\else,\fi\unexpanded{#1}}%
      \jlreq@tempafalse
    }%
    \jlreq@helper@removeelement@
  }%
}

% ç©ºç™½ã‚’ç„¡è¦–ã—ãªã„\@ifnextchar
\newcommand{\jlreq@ifnextchar}[3]{%
  \let\reserved@d=#1%
  \edef\reserved@a{\unexpanded{#2}}%
  \edef\reserved@b{\unexpanded{#3}}%
  \futurelet\jlreq@nextchar\jlreq@ifnextchar@
}
\def\jlreq@ifnextchar@{%
  \ifx\jlreq@nextchar\reserved@d\let\reserved@b\reserved@a\fi
  \reserved@b
}
% ç©ºç™½ã‚’ç„¡è¦–ã—ãªã„\@ifsart
\newcommand*{\jlreq@ifstar}[2]{\jlreq@ifnextchar *{\edef\reserved@a*{\unexpanded{#1}}\reserved@a}{#2}}

% ã‚«ãƒ³ãƒžã§åŒºåˆ‡ã£ã¦ï¼Œãã®å‰ã¨å¾Œã‚ã‚’\jlreq@resulta,\jlreq@resultbã«å…¥ã‚Œã‚‹
% ã‚‚ã—ã‚«ãƒ³ãƒžãŒãªã„å&nbsp;´åˆã¯\ifjlreq@resultãŒfalseã«ãªã‚‹ï¼Ž
\newcommand*{\jlreq@helper@dividebycomma}[1]{\jlreq@helper@dividebycomma@#1,\jlreq@endmark}
\long\def\jlreq@helper@dividebycomma@#1,#2\jlreq@endmark{%
  \jlreq@helper@trim{#1}{\jlreq@resulta}%
  \jlreq@helper@trim{#2}{\jlreq@resultb}%
  \jlreq@if{\ifx\jlreq@resultb\@empty\fi}{%
    \jlreq@resultfalse
  }{%
    \jlreq@resulttrue
    \expandafter\def\expandafter\jlreq@resultb\expandafter{\jlreq@helper@removelastcomma#2\jlreq@endmark}%
    \expandafter\jlreq@helper@trim\expandafter{\jlreq@resultb}{\jlreq@resultb}%
  }%
}
\long\def\jlreq@helper@removelastcomma#1,\jlreq@endmark{#1}

% vbox #1ã®æœ€å¾Œã‚’\jlreq@resultboxã«å…¥ã‚Œã‚‹
% #1ã®æœ€å¾Œã®è¡Œã¯æ¶ˆãˆã‚‹
\newcommand*{\jlreq@getlastbox}[1]{%
  \setbox#1=\vbox{\unvbox#1\relax
    \unskip\unskip\unpenalty\global\setbox\jlreq@resultbox=\lastbox}%
  \ifhbox\jlreq@resultbox
    \global\setbox\jlreq@resultbox=\hbox{%
      \unhbox\jlreq@resultbox\unskip\unskip\unpenalty}%
  \else
    \global\setbox\jlreq@resultbox=\copy\voidb@x
  \fi
}

% ã‚­ãƒ¼æŒ‡å®šã—ãªã„keyvalï¼ˆç‹¬è‡ªå®Ÿè£…ï¼‰
% \jlreq@parsekeyval@nokey{&lt;action&gt;}{&lt;parseå¯¾è±¡&gt;}
% actionå†…ã§ã¯#1=key, #2=val
% \ifjlreq@parsekeyval@nokey@novalue{&lt;true code&gt;}{&lt;false code&gt;}ã§valueãŒãªã„ã‹åˆ¤å®šã§ãã‚‹ï¼Ž
% *ã¤ãã¯&lt;parseå¯¾è±¡&gt;ã‚’ä¸€å›žã&nbsp;ã‘å±•é–‹ã™ã‚‹ï¼Ž
\def\jlreq@parsekeyval@nokey{\@ifstar{\jlreq@parsekeyval@nokey@{*}}{\jlreq@parsekeyval@nokey@{}}}
\newcommand{\jlreq@parsekeyval@nokey@}[3]{%
  \begingroup
    \long\def\jlreq@do{}%
    \long\def\jlreq@parsekeyval@nokey@execute##1##2{#2}%
    \jlreq@ifempty{#1}{%
      \jlreq@parsekeyval@nokey@i@wuniq\jlreq@uniqtoken#3,\jlreq@endmark,%
    }{%
      \expandafter\jlreq@parsekeyval@nokey@i@wuniq\expandafter\jlreq@uniqtoken#3,\jlreq@endmark,%
    }%
  \expandafter\endgroup
  \jlreq@do
}
\long\def\jlreq@parsekeyval@nokey@i@wuniq#1,{\expandafter\jlreq@parsekeyval@nokey@i\expandafter{\@gobble#1}}
\long\def\jlreq@parsekeyval@nokey@i#1{\jlreq@ifendmark{#1}{}{\jlreq@parsekeyval@nokey@ii@wuniq\jlreq@uniqtoken#1=\jlreq@endmark}}
\long\def\jlreq@parsekeyval@nokey@ii@wuniq#1=#2\jlreq@endmark{\expandafter\jlreq@parsekeyval@nokey@ii\expandafter{\@gobble#1}{#2}}%
\long\def\jlreq@parsekeyval@nokey@ii#1#2{%
  \jlreq@ifempty{#2}{\jlreq@parsekeyval@nokey@iii{*}{#2}{#1}}{%
    \edef\jlreq@tempa{%
      \noexpand\jlreq@parsekeyval@nokey@iii{}{\jlreq@parsekeyval@nokey@removeequal{#2}}{\unexpanded{#1}}%
    }%
    \jlreq@tempa
  }%
}
% valueãŒä¸Žãˆã‚‰ã‚Œã¦ã„ãªã„å&nbsp;´åˆã¯#1=*ã«ãªã‚‹ï¼Žãã†ã§ãªã‘ã‚Œã°#1ã¯ç©º
\long\def\jlreq@parsekeyval@nokey@iii#1#2#3{%
  \jlreq@remove@spaceandbracket{#2}{\jlreq@tempa}%
  \jlreq@remove@spaceandbracket{#3}{\jlreq@tempb}%
  \ifx\jlreq@tempb\@empty\else
    \edef\@tempa{\noexpand\jlreq@parsekeyval@nokey@iv{#1}{\exp_not:o {\jlreq@tempb}}{\exp_not:o {\jlreq@tempa}}}%
    \@tempa
  \fi
  \jlreq@parsekeyval@nokey@i@wuniq\jlreq@uniqtoken
}
\long\def\jlreq@parsekeyval@nokey@iv#1#2#3{%
  \tl_put_right:Nx \jlreq@do{%
    \unexpanded{\let\ifjlreq@parsekeyval@nokey@novalue}\jlreq@ifempty{#1}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}%
    \exp_not:o {\jlreq@parsekeyval@nokey@execute{#2}{#3}}%
  }%
}
\long\def\jlreq@parsekeyval@nokey@removeequal#1{\jlreq@parsekeyval@nokey@removeequal@\jlreq@uniqtoken#1\jlreq@endmark}
\long\def\jlreq@parsekeyval@nokey@removeequal@#1=\jlreq@endmark{\expandafter\unexpanded\expandafter{\@gobble#1}}

% #1ã®å…ˆé&nbsp;­ã®ã‚¹ãƒšãƒ¼ã‚¹ã‚’å‰Šé™¤ã—ï¼Œ#2ã«å…¥ã‚Œã‚‹ï¼Ž
\long\def\jlreq@helper@trim#1#2{\edef#2{\tl_trim_spaces:n{#1}}}

\long\def\jlreq@remove@spaceandbracket#1#2{%
  \begingroup
    \jlreq@helper@trim{#1}{\jlreq@tempa}%
    \edef\jlreq@do{\unexpanded{\jlreq@remove@spaceandbracket@{#2}}\exp_not:o {\jlreq@tempa}\noexpand\jlreq@endmark}%
  \expandafter\endgroup
  \jlreq@do
}
\long\def\jlreq@remove@spaceandbracket@#1#2\jlreq@endmark{\edef#1{\unexpanded{#2}}}

% \jlreq@switch{str}{
%   {str}{abcd}
%   {str1}{xyz}
%}[default: input = #1] -&gt; abcd
%ã¾ãŸã¯
%
% \jlreq@switch{str}{
%   {str}{abcd}
%   {str1}{xyz}
%   {default} % ã“ã“ã¯#1ã‚’å—ã‘ä»˜ã‘ãªã„ï¼ˆãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ãƒˆãƒ¼ã‚¯ãƒ³ã‚’å—ã‘ä»˜ã‘ãŸã„å&nbsp;´åˆã®ãŸã‚ï¼‰ï¼Ž
%} -&gt; abcd
% strã¯\edefã§å±•é–‹ã•ã‚Œã‚‹ãŒï¼Œ\jlreq@switch*ã®å&nbsp;´åˆã¯å±•é–‹ã•ã‚Œãªã„ï¼Ž
% ç¬¬ä¸€å¼•æ•°ã¯\jlreq@tempaã«å…¥ã‚Œã¦ãŠãï¼Ž
\long\def\jlreq@helper@switch@executeoption#1[#2]{%
  \begingroup
    \def\jlreq@do##1{#2}%
  \expandafter\endgroup
  \jlreq@do{#1}%
}
\long\def\jlreq@helper@removeoption[#1]{}
\newcommand{\jlreq@switch}{\@ifstar{\jlreq@switch@{*}}{\jlreq@switch@{}}}
\newcommand{\jlreq@switch@}[3]{%
  \begingroup
    \let\jlreq@do\@undefined
    \edef\jlreq@tempa{\jlreq@ifempty{#1}{#2}{\unexpanded{#2}}}% ãƒ«ãƒ¼ãƒ—ä¸­ãšã£ã¨ä¿å­˜ã™ã‚‹
    \jlreq@helper@switch@{#1}#3\jlreq@endmark
    \ifx\jlreq@do\@undefined
      \edef\jlreq@do{\unexpanded{\jlreq@ifnextchar[{\jlreq@helper@switch@executeoption{#2}}{}}}%
    \else
      \tl_put_right:Nn \jlreq@do{\@ifnextchar[{\jlreq@helper@removeoption}{}}%
    \fi
  \expandafter\endgroup
  \jlreq@do
}
\long\def\jlreq@helper@switch@#1#2{%
  \jlreq@ifendmark{#2}{}{\jlreq@helper@switch@@{#1}{#2}}%
}

\long\def\jlreq@helper@switch@@#1#2#3{%
  \jlreq@ifendmark{#3}{%
    \edef\jlreq@do{\unexpanded{#2}}%
  }{%
    \edef\jlreq@tempb{\jlreq@ifempty{#1}{#2}{\unexpanded{#2}}}%
    \jlreq@if{\ifx\jlreq@tempa\jlreq@tempb\fi}{%
      \edef\jlreq@do{\unexpanded{#3}}%
      \jlreq@deleteuntileendmark
    }{%
      \jlreq@helper@switch@{#1}%
    }%
  }%
}

% ã‚ªãƒ¬ã‚ªãƒ¬ãƒ©ãƒ™ãƒ«â€¦â€¦
% \jlreq@reference@ref{ãƒ©ãƒ™ãƒ«å}{ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå€¤}
\def\jlreq@reference@ref#1{\jlreq@if{\expandafter\unless\expandafter\ifx\csname jlreq@reference@#1\endcsname\relax\fi}{\csname jlreq@reference@#1\endcsname}}
% \jlreq@reference@label{ãƒ©ãƒ™ãƒ«å}{å€¤}
\long\def\jlreq@reference@label#1#2{\protected@write\@auxout{}{\string\@newl@bel{jlreq@reference}{#1}{#2}}}%
\long\def\jlreq@reference@immediate@write#1#2{\immediate\write\@auxout{\string\@newl@bel{jlreq@reference}{#1}{#2}}}%
\long\def\jlreq@reference@ifexist#1{\jlreq@if{\expandafter\unless\expandafter\ifx\csname jlreq@reference@#1\endcsname\relax\fi}}

% è‡ªå‹•ç”Ÿæˆã•ã‚Œã‚‹ãƒ©ãƒ™ãƒ«ç”¨ã®ç•ªå·
\newcount\jlreq@reference@count
\jlreq@reference@count=0

% ç¾åœ¨ã®ãƒšãƒ¼ã‚¸ã‚’å¾—ã‚‹
\newcount\jlreq@currentpage
\newcommand*{\jlreq@setcurrentpage}{%
  \global\advance\jlreq@reference@count by 1
  \jlreq@reference@label{jlreq@currentpage.\the\jlreq@reference@count}{\noexpand\arabic{page}}%
  \global\jlreq@currentpage=\jlreq@reference@ref{jlreq@currentpage.\the\jlreq@reference@count}{\the\c@page}\relax
}

% å…ˆé&nbsp;­ã«ã‚ã‚‹ãƒžã‚¯ãƒ­ã‚’å±•é–‹ã—ã¾ãã£ãŸçµæžœã®å…ˆé&nbsp;­ã‚’#2ã«å…¥ã‚Œã‚‹ï¼Ž
\newcommand{\jlreq@getfirsttoken@expandmacros}[2]{%
  \jlreq@iffirsttoken{#1}{~}{\def#2{~}}{%
    \jlreq@ifempty{#1}{\def#2{}}{%
      \jlreq@ifmacro@noargument{#1}{%
        \expandafter\jlreq@getfirsttoken@expandmacros\expandafter{#1}{#2}%
      }{%
        \expandafter\expandafter\expandafter\jlreq@getfirsttoken@expandmacros@\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@{#2}%
      }%
    }%
  }%
}
\long\def\jlreq@getfirsttoken@expandmacros@#1#2{\def#2{#1}}

\long\def\jlreq@helper@checktokenlist#1#2{%
  \jlreq@ifendmark{#2}{\@firstoftwo}%
  {%
    \jlreq@if{\ifnum0#1{#2}&gt;0~\fi}%
      {\jlreq@helper@checktokenlist{#1}}%
      {\expandafter\@secondoftwo\jlreq@deleteuntileendmark}%
  }%
}
\def\jlreq@helper@chknumlist#1{\ifx#101\fi\ifx#111\fi\ifx#121\fi\ifx#131\fi\ifx#141\fi\ifx#151\fi\ifx#161\fi\ifx#171\fi\ifx#181\fi\ifx#191\fi}
\def\jlreq@helper@chkfloatlist#1{\jlreq@helper@chknumlist{#1}\ifx#1.1\fi}
% #1ãŒ[0-9\.]*ã«å½“ã¦ã¯ã¾ã‚‹ã‹ï¼Ž
\newcommand*{\jlreq@iffloat}[1]{\jlreq@helper@checktokenlist{\jlreq@helper@chkfloatlist}#1\jlreq@endmark}
\newcommand*{\jlreq@ifnumber}[1]{\jlreq@helper@checktokenlist{\jlreq@helper@chknumlist}#1\jlreq@endmark}

% \jlreq@ifprimitive#1#2#3: #1ãŒprimitiveãªã‚‰ã°#2ã‚’ï¼Œãã†ã§ãªã‘ã‚Œã°#3ã‚’å®Ÿè¡Œã™ã‚‹
% ï¼ˆ\if(pdf)primitiveã‚’é¿ã‘ã‚‹ã‚ˆã†ã«ã—ã¦ã„ã‚‹ï¼Žï¼‰
\newcommand*{\jlreq@ifprimitive}[1]{%
  \begingroup
    \edef\@tempa{\string#1}%
    \edef\@tempb{\meaning#1}%
  \expandafter\endgroup
  \ifx\@tempa\@tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
}

\newcommand*{\jlreq@helper@guessengine}{%
  \token_if_primitive:NTF \directlua {
    \let\jlreq@result=l
  }{
    \let\jlreq@result=p
    \token_if_primitive:NT \ucs {
      \int_compare:nT { \ucs"FA4A = "FA4A } {
        \let\jlreq@result=u
      }
    }
  }
}

% #1ã‚’\@undefinedã«ï¼Œæ—¢ã«\@undefinedãªã‚‰ã°#2{#1}ã‚’å‘¼ã¶
\newcommand*{\jlreq@helper@undefcs}[2]{%
  \@ifundefined{\expandafter\@gobble\string #1}{#2{#1}}{\cs_undefine:N #1}%
}
% \ifç‰ˆ
\newcommand*{\jlreq@helper@undefif}[2]{%
  \@ifundefined{\expandafter\@gobble\string #1}{%
    \edef\@tempa{\expandafter\@gobble\string#1}%
    \edef\@tempa{\expandafter\@gobbletwo\@tempa}%
    \cs_undefine:N #1%
    \cs_undefine:c {\@tempa true}
    \cs_undefine:c {\@tempa false}
  }%
}

% ç´™ã‚µã‚¤ã‚ºä¸€è¦§
\@namedef{jlreq@helper@papersizelist@a0paper}{{841mm}{1189mm}}
\@namedef{jlreq@helper@papersizelist@a1paper}{{594mm}{841mm}}
\@namedef{jlreq@helper@papersizelist@a2paper}{{420mm}{594mm}}
\@namedef{jlreq@helper@papersizelist@a3paper}{{297mm}{420mm}}
\@namedef{jlreq@helper@papersizelist@a4paper}{{210mm}{297mm}}
\@namedef{jlreq@helper@papersizelist@a5paper}{{148mm}{210mm}}
\@namedef{jlreq@helper@papersizelist@a6paper}{{105mm}{148mm}}
\@namedef{jlreq@helper@papersizelist@a7paper}{{74mm}{105mm}}
\@namedef{jlreq@helper@papersizelist@a8paper}{{52mm}{74mm}}
\@namedef{jlreq@helper@papersizelist@a9paper}{{37mm}{52mm}}
\@namedef{jlreq@helper@papersizelist@a10paper}{{26mm}{37mm}}

\@namedef{jlreq@helper@papersizelist@b0paper}{{1000mm}{1414mm}}
\@namedef{jlreq@helper@papersizelist@b1paper}{{707mm}{1000mm}}
\@namedef{jlreq@helper@papersizelist@b2paper}{{500mm}{707mm}}
\@namedef{jlreq@helper@papersizelist@b3paper}{{353mm}{500mm}}
\@namedef{jlreq@helper@papersizelist@b4paper}{{250mm}{353mm}}
\@namedef{jlreq@helper@papersizelist@b5paper}{{176mm}{250mm}}
\@namedef{jlreq@helper@papersizelist@b6paper}{{125mm}{176mm}}
\@namedef{jlreq@helper@papersizelist@b7paper}{{88mm}{125mm}}
\@namedef{jlreq@helper@papersizelist@b8paper}{{63mm}{88mm}}
\@namedef{jlreq@helper@papersizelist@b9paper}{{44mm}{63mm}}
\@namedef{jlreq@helper@papersizelist@b10paper}{{31mm}{44mm}}

\@namedef{jlreq@helper@papersizelist@b0j}{{1030mm}{1456mm}}
\@namedef{jlreq@helper@papersizelist@b1j}{{728mm}{1030mm}}
\@namedef{jlreq@helper@papersizelist@b2j}{{515mm}{728mm}}
\@namedef{jlreq@helper@papersizelist@b3j}{{364mm}{515mm}}
\@namedef{jlreq@helper@papersizelist@b4j}{{257mm}{364mm}}
\@namedef{jlreq@helper@papersizelist@b5j}{{182mm}{257mm}}
\@namedef{jlreq@helper@papersizelist@b6j}{{128mm}{182mm}}
\@namedef{jlreq@helper@papersizelist@b7j}{{91mm}{128mm}}
\@namedef{jlreq@helper@papersizelist@b8j}{{64mm}{91mm}}
\@namedef{jlreq@helper@papersizelist@b9j}{{45mm}{64mm}}
\@namedef{jlreq@helper@papersizelist@b10j}{{32mm}{45mm}}

\@namedef{jlreq@helper@papersizelist@c2paper}{{458mm}{648mm}}
\@namedef{jlreq@helper@papersizelist@c3paper}{{324mm}{458mm}}
\@namedef{jlreq@helper@papersizelist@c4paper}{{229mm}{324mm}}
\@namedef{jlreq@helper@papersizelist@c5paper}{{162mm}{229mm}}
\@namedef{jlreq@helper@papersizelist@c6paper}{{114mm}{162mm}}
\@namedef{jlreq@helper@papersizelist@c7paper}{{81mm}{114mm}}
\@namedef{jlreq@helper@papersizelist@c8paper}{{57mm}{81mm}}

\@namedef{jlreq@helper@papersizelist@a4var}{{210mm}{283mm}}
\@namedef{jlreq@helper@papersizelist@b5var}{{182mm}{230mm}}

\@namedef{jlreq@helper@papersizelist@letterpaper}{{8.5in}{11in}}
\@namedef{jlreq@helper@papersizelist@legalpaper}{{8.5in}{14in}}
\@namedef{jlreq@helper@papersizelist@executivepaper}{{7.25in}{10.5in}}
\@namedef{jlreq@helper@papersizelist@hagaki}{{100mm}{148mm}}

\@namedef{jlreq@helper@papersizelist@ansiapaper}{{8.5in}{11in}}
\@namedef{jlreq@helper@papersizelist@ansibpaper}{{11in}{17in}}
\@namedef{jlreq@helper@papersizelist@ansicpaper}{{17in}{22in}}
\@namedef{jlreq@helper@papersizelist@ansidpaper}{{22in}{34in}}
\@namedef{jlreq@helper@papersizelist@ansiepaper}{{34in}{44in}}


% #1Ã·#2ã‚’\jlreq@resultdimenã«å…¥ã‚Œã‚‹ï¼Žï¼ˆ#1,#2ã¯å¯¸æ³•ã‚’ä¸Žãˆã‚‹ï¼Žï¼‰
\newcommand*{\jlreq@helper@divide}[2]{%
  \begingroup
    \@tempdima=\dimexpr#1\relax\@tempdimb=\dimexpr#2\relax
    % åˆ†æ¯ã‚’æ­£ã«ã™ã‚‹
    \ifdim\@tempdimb&lt;0pt \@tempdima=-\@tempdima\@tempdimb=-\@tempdimb\fi
    % \jlreq@tempdima*\@tempdimb &lt;= \@tempdima &lt; (\jlreq@tempdima + 1)*\@tempdimb
    % ã¨ãªã‚‹æ•´æ•°\jlreq@tempdimaã‚’æœã—ï¼Œ\jlreq@tempdimb=\jlreq@tempdima + 1ã¨ã™ã‚‹
    \jlreq@tempdima=0pt
    \ifdim\@tempdima&lt;0pt
      \loop\ifdim\strip@pt\jlreq@tempdima\@tempdimb&gt;\@tempdima\advance\jlreq@tempdima by -1pt\repeat
    \else
      \loop\ifdim\strip@pt\jlreq@tempdima\@tempdimb&lt;\@tempdima\advance\jlreq@tempdima by 1pt\repeat
      \ifdim\strip@pt\jlreq@tempdima\@tempdimb=\@tempdima\else\advance\jlreq@tempdima by -1pt\fi
    \fi
    \jlreq@tempdimb=\dimexpr\jlreq@tempdima + 1pt\relax
    % \jlreq@tempdimaã¨\jlreq@tempdimbã§æŒŸã‚“ã§ã„ãäºŒåˆ†æ³•
    \jlreq@tempcnta=0 % ç„¡é™ãƒ«ãƒ¼ãƒ—ã‚’é¿ã‘ã‚‹ãŸã‚ã®ã‚«ã‚¦ãƒ³ã‚¿
    \loop\ifnum\numexpr\ifdim\dimexpr\jlreq@tempdimb - \jlreq@tempdima\relax&gt;1sp 1\else0\fi*\ifnum\jlreq@tempcnta&lt;100~1\else 0\fi\relax=1
      \jlreq@tempdimc=\dimexpr(\jlreq@tempdima+\jlreq@tempdimb)/2\relax
      \ifdim\strip@pt\jlreq@tempdimc\@tempdimb&gt;\@tempdima\jlreq@tempdimb=\jlreq@tempdimc
      \else\jlreq@tempdima=\jlreq@tempdimc\fi
      \advance\jlreq@tempcnta by 1\relax
    \repeat
    \edef\jlreq@do{\noexpand\jlreq@resultdimen=\the\jlreq@tempdima\noexpand\relax}%
  \expandafter\endgroup
  \jlreq@do
}


\def\jlreq@helper@swap#1#2{%
  \let\jlreq@helper@swaptoken=#1%
  \let#1=#2%
  \let#2=\jlreq@helper@swaptoken
  \let\jlreq@helper@swaptoken=\@undefined
}
\def\jlreq@helper@swap@register#1#2{%
  \edef\jlreq@helper@swaptoken{\the#1}%
  #1=#2%
  #2=\jlreq@helper@swaptoken\relax
  \let\jlreq@helper@swaptoken=\@undefined
}
\ExplSyntaxOff

\endinput

</pre></body></html>