% \iffalse meta-comment
%
% This is file `exppl2e.sty', for experimental pLaTeX2e.
%
% Copyright (c) 2016 Japanese TeX Development Community
%
% This file is part of the pLaTeX2e system (community edition).
% -------------------------------------------------------------
%
% ====================================================================
%   $B3+H/<T$NJ}$X(B (2016-06-29 aminophen)
%
% $B$3$N%U%!%$%k$N%3!<%I$r<B:]$K%+!<%M%k$K<h$jF~$l$k$H$-!"C1=c$K%+%C%H!&(B
% $B%Z!<%9%H$G(B dtx $B%U%!%$%k$XA^F~$7$^$9!#%Z!<%9%H$7$?(B dtx $B%U%!%$%k$+$i(B
% ltx / sty $B%U%!%$%kEy$r@8@.$7$?$"$H$K$O!"I,$:(B
%   * $B%U%)!<%^%C%H:n@.$K;H$o$l$k(B ltx $B%U%!%$%k$,0U?^$I$*$jJQ99$5$l$?$+(B
%   * platexrelease.sty $B$K?7$?$J%V%m%C%/$,0l$D$@$1DI2C$5$l$?$+(B
%     $B!JNc30E*$K(B 0000/00/00 $B$NF|IU$,4^$^$l$k>l9g$O!"%V%m%C%/$,Fs$D$+!K(B
% $B$r3NG'$7$^$9!#(B
% ====================================================================
%
%%%%%%%% ^^A driver-like trick using catcode difference
%
% This file `exppl2e.sty' is a normal LaTeX package, so
%   \RequirePackage{exppl2e}
% and
%   \usepackage{exppl2e}
% works. However, it can also be typeset alone:
%   platex exppl2e.sty
% for convenience.
%
%<*hack>
\ifx\undefined\@undefined\relax
% case 1: This file must be a normal package
  \NeedsTeXFormat{pLaTeX2e}
  \ProvidesPackage{exppl2e}
                [2016/06/29 v1.0b Experimental pLaTeX2e features]
  \PackageWarningNoLine{exppl2e}{%
      This is the unstable, experimental part of pLaTeX2e.\MessageBreak
      This package may contain:\MessageBreak
       * future patches to pLaTeX\MessageBreak
       * experimental new features\MessageBreak
      Please note that these can be removed without any\MessageBreak
      announcement at some point in the future, and may\MessageBreak
      also have some critical bugs. We appreciate any\MessageBreak
      reports and comments. Thank you for your cooperation}
  \RequirePackage[latest]{platexrelease}
\else
% case 2: This file pretends to be a document
  \documentclass{jltxdoc}
  \title{Experimental p\LaTeXe}
  \author{Japanese \TeX\ Development Community}
  \begin{document}
    \maketitle
    \DocInput{exppl2e.sty}
  \end{document}
\fi %     ^^A   In case 2, this \fi comes after \end{document}
%</hack>  ^^A   so it has no effect.
% \fi     ^^A   This \fi corresponds to \iffalse, and another
%         ^^A   \fi is required for \ifx, see below;)
%
%%%%%%%% ^^A trick end
%
% \fi
%
%
% \emph{$BCm0U(B}$B!'$3$l$O(BExperimental$B$J(Bp\LaTeXe{}$B!"$9$J$o$A(Bunstable$B$J(B
% $B<B83E*(Bp\LaTeX{}$B%3!<%I$rDs6!$9$k%Q%C%1!<%8$G$9!#(B
%
%
% \section{$B$3$N%Q%C%1!<%8$NL\E*(B}
%
% $B%3!<%I$NITMQ0U$J2~JQ$OB(%(%s%P%0$K$D$J$,$j!"MxMQ<T$NB?$$(Bp\LaTeX{}$B$d(B
% up\LaTeX{}$B$G$OFC$K1F6A$,Bg$-$$$H;W$o$l$^$9!#$=$N0lJ}$G!"(Bunstable$B$J$b$N(B
% $B$b$J$k$Y$/<j7Z$K%F%9%H$7$FD:$-$?$$$H$b9M$($^$9!#(B
%
% $B$3$N%Q%C%1!<%8(B\file{exppl2e.sty}$B$O!"%+!<%M%k(B(stable)$B$K>-Mh4^$a$k(B
% $B$3$H$rA[Dj$7$?(Bunstable$B$J<B83E*%3!<%I$rG[I[$9$k$3$H$rL\E*$K:n@.$7$^$7$?!#(B
% $B%F%9%H$r$h$m$7$/$*4j$$$7$^$9!#(B
%
%
% \section{$B<B83E*%3!<%I$NFI$_$3$_$+$?(B}
%
% $B%G%U%)%k%H$NG[I[$G$O!"<B83E*$J%3!<%I$OL58z2=$5$l$F$$$^$9!#(B
% $B<B83E*$J(Bp\LaTeXe{}$B$r;n$7$?$$>l9g$O!"0J2<$N$$$:$l$+$NJ}K!$r;H$$$^$9!'(B
%
% \subsection{$B>/$7$@$1;n$7$F$_$?$$>l9g(B}
%
% $B%Q%C%1!<%8(B\file{exppl2e.sty}$B$rFI$_9~$_$^$9!#$?$@$7!"(B|\usepackage|$BL?Na(B
% $B$r;H$&$N$G$O$J$/!"J8=q%/%i%9$h$j(B\emph{$BA0(B}$B$KFI$_9~$s$G$*$/$N$,L5Fq$G$9!#(B
% \begin{verbatim}
%   \RequirePackage{exppl2e}
%   \documentclass{article}
% \end{verbatim}
%
% \subsection{$B>o$K<B83E*%3!<%I$r;HMQ$7$?$$>l9g(B}
%
% $B$3$N%Q%C%1!<%8$H0l=o$K%$%s%9%H!<%k$5$l$k?7$7$$(Bp\LaTeX{}$B$O!"$*;H$$$N(B
% \texttt{platex}$B$J$I$N%W%m%0%i%`$,8+$D$1$k$3$H$N$G$-$k>l=j!J4JC1$J$N(B
% $B$O%+%l%s%H%G%#%l%/%H%j!"$"$k$$$O(B|$TEXMFLOCAL/tex|$B0J2<$NE,@Z$J>l=j!K(B
% $B$K(B\file{platex.cfg}$B$H$$$&%U%!%$%k$,$"$l$P!"5/F0;~$K$=$l$rFI$_9~$_(B
% $B$^$9!#$3$N5!G=$rMxMQ$9$k$H!"0J2<$NFbMF$N(B\file{platex.cfg}$B$rMQ0U$7(B
% $B$F$*$/$@$1$G!"<+F0E*$KKh2s(B\file{exppl2e.sty}$B$,FI$_9~$^$l$^$9!#(B
% \begin{verbatim}
% \RequirePackage{exppl2e}
% \end{verbatim}
%
%
% \section{$B$3$N%I%-%e%a%s%H$K$D$$$F(B}
%
% $B%3%_%e%K%F%#HG(Bp\LaTeX{}$B$,G[I[$9$k$[$+$N(Bsty$B%U%!%$%k$H$O0[$J$j!"(B
% $B<B<AE*$K$O(B\file{exppl2e.sty}$B$O(Bdtx$B%U%!%$%k$HF1Ey$G$9!#$9$J$o$A!"(B
% $B%3!<%I$H0l=o$K(Bdtx$B8_49%I%-%e%a%s%H$,4^$^$l$F$$$^$9!#$3$N%I%-%e%a%s%H(B
% $B$rAHHG$9$k$K$O(B
% \begin{verbatim}
%   # platex exppl2e.sty
% \end{verbatim}
% $B$r<B9T$7$^$9!#(B
%
%
% \section{$B%3!<%I(B}
%
% $B$3$3$+$i(Bp\LaTeXe{}$B$N(Bexperimental$B%3!<%IK\BN$G$9!#(B
%
%
% \section{PDF$B$N%V%C%/%^!<%/$H%"%/%;%s%HJ8;z(B}
%
% \begin{macro}{\pltx@isletter}
% \changes{v???}{????/??/??}{PDF$B$N$7$*$j$K%"%/%;%s%HJ8;z$,4^$^$l$k>l9g$KBP1~(B}
%    \begin{macrocode}
%<platexrelease>\plIncludeInRelease{????/??/??}{\pltx@isletter}
%<platexrelease>                   {Support PD1 encoding}%
%<*pldefs|platexrelease>
\def\pltx@mark{\pltx@mark@}
\let\pltx@scanstop\relax
\long\def\pltx@cond#1\fi{%
  #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
\def\pltx@pdfencA{PD1}
\def\pltx@composite@chkenc{%
  \ifx\pltx@pdfencA\f@encoding
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi}
\long\def\pltx@isletter#1{%
  \expandafter\pltx@isletter@i#1\pltx@scanstop}
\long\def\pltx@isletter@i#1\pltx@scanstop{%
  \pltx@cond\ifx\pltx@mark#1\pltx@mark\fi{\@firstoftwo}%
    {\pltx@isletter@ii\pltx@scanstop#1\pltx@scanstop{}#1\pltx@mark}}
\long\def\pltx@isletter@ii#1\pltx@scanstop#{%
  \pltx@cond\ifx\pltx@mark#1\pltx@mark\fi%
    {\pltx@isletter@iii}{\pltx@isletter@iv}}
\long\def\pltx@isletter@iii#1\pltx@mark{\@secondoftwo}
\long\def\pltx@isletter@iv#1#2#3\pltx@mark{%
  \pltx@cond\ifx\pltx@mark#3\pltx@mark\fi{%
    \pltx@cond{\ifnum0\ifcat A\noexpand#21\fi\ifcat=\noexpand#21\fi>\z@}\fi
      {\@firstoftwo}{\pltx@composite@chkenc}%
  }{\pltx@composite@chkenc}}
%</pldefs|platexrelease>
%<platexrelease>\plEndIncludeInRelease
%<platexrelease>\plIncludeInRelease{2016/06/10}{\pltx@isletter}
%<platexrelease>                   {Added \pltx@isletter}%
%<platexrelease>\def\pltx@mark{\pltx@mark@}
%<platexrelease>\let\pltx@scanstop\relax
%<platexrelease>\long\def\pltx@cond#1\fi{%
%<platexrelease>  #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
%<platexrelease>\long\def\pltx@isletter#1{%
%<platexrelease>  \expandafter\pltx@isletter@i#1\pltx@scanstop}
%<platexrelease>\long\def\pltx@isletter@i#1\pltx@scanstop{%
%<platexrelease>  \pltx@cond\ifx\pltx@mark#1\pltx@mark\fi{\@firstoftwo}%
%<platexrelease>    {\pltx@isletter@ii\pltx@scanstop#1\pltx@scanstop{}#1\pltx@mark}}
%<platexrelease>\long\def\pltx@isletter@ii#1\pltx@scanstop#{%
%<platexrelease>  \pltx@cond\ifx\pltx@mark#1\pltx@mark\fi%
%<platexrelease>    {\pltx@isletter@iii}{\pltx@isletter@iv}}
%<platexrelease>\long\def\pltx@isletter@iii#1\pltx@mark{\@secondoftwo}
%<platexrelease>\long\def\pltx@isletter@iv#1#2#3\pltx@mark{%
%<platexrelease>  \pltx@cond\ifx\pltx@mark#3\pltx@mark\fi{%
%<platexrelease>    \pltx@cond{\ifnum0\ifcat A\noexpand#21\fi\ifcat=\noexpand#21\fi>\z@}\fi
%<platexrelease>      {\@firstoftwo}{\@secondoftwo}%
%<platexrelease>  }{\@secondoftwo}}
%<platexrelease>\plEndIncludeInRelease
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@text@composite@x}
% \changes{v???}{????/??/??}{v1.6e$B$G$$$C$?$s%Q%C%A$r=|5n$7$?%3!<%I$r:FF3F~(B}
%    \begin{macrocode}
%<platexrelease>\plIncludeInRelease{????/??/??}{\@text@composite@x}
%<platexrelease>                   {Fix for non-zero baselineshift}%
%<*pldefs|platexrelease>
\def\@text@composite@x#1#2{%
  \ifx#1\relax
    #2%
  \else\pltx@isletter{#1}{#1}{%
    \begingroup
    \setbox\z@\hbox\bgroup%
      \ybaselineshift\z@\tbaselineshift\z@
      #1%
      \g@tlastchart@\@tempcntb
      \xdef\pltx@composite@temp{\noexpand\@tempcntb=\the\@tempcntb\relax}%
      \aftergroup\pltx@composite@temp
    \egroup
%    \end{macrocode}
%    \begin{macrocode}
    \ifnum\@tempcntb<\z@
      \@tempdima=\iftdir
          \ifmdir
            \ifmmode\tbaselineshift\else\ybaselineshift\fi
          \else
            \tbaselineshift
          \fi
        \else
          \ybaselineshift
        \fi
      \@tempcntb=\@cclvi
    \else\@tempdima=\z@
    \fi
%    \end{macrocode}
% $B%"%/%;%s%H$,IU$/!VK\BN$NJ8;z!W$,2$J8J8;z$H?dB,$5$l$k>l9g$K$O!"(B
% $B0lC6?t<0%b!<%I$KF~$k$3$H$K$h$C$F(B\cs{xkanjiskip}$B$,A08e$KF~$k$h$&$K$7$^$9!#(B
% $BI,MW$J$i!"?t<0%b!<%I$NA08e$K(B\cs{null}$B$rJd$C$F(B\cs{xkanjiskip}$B$NA^F~$rM^@)$7$^$9!#(B
%    \begin{macrocode}
    \ifnum\@tempcntb<\@cclvi
      \ifnum\@tempcntb>\m@ne\ifnum\@tempcntb<\@cclvi
        \ifodd\xspcode\@tempcntb\else\leavevmode\hbox{}\fi
      \fi\fi
      \begingroup\mathsurround\z@$%
        \ifx\textbaselineshiftfactor\@undefined\else
          \textbaselineshiftfactor\z@\fi
        \box\z@
      $\endgroup%
      \ifnum\@tempcntb>\m@ne\ifnum\@tempcntb<\@cclvi
        \ifnum\xspcode\@tempcntb<2\hbox{}\fi
      \fi\fi
%    \end{macrocode}
%    \begin{macrocode}
    \else
      \ifdim\@tempdima=\z@{\ybaselineshift\z@\tbaselineshift\z@#1}%
      \else\lower\@tempdima\box\z@\fi
    \fi
    \endgroup}%
  \fi
}
%</pldefs|platexrelease>
%<platexrelease>\plEndIncludeInRelease
%    \end{macrocode}
% \end{macro}
%
\endinput
