summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/platex/base/plext.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/platex/base/plext.dtx')
-rw-r--r--Master/texmf-dist/source/platex/base/plext.dtx101
1 files changed, 76 insertions, 25 deletions
diff --git a/Master/texmf-dist/source/platex/base/plext.dtx b/Master/texmf-dist/source/platex/base/plext.dtx
index 639d28f1e9a..89c777796af 100644
--- a/Master/texmf-dist/source/platex/base/plext.dtx
+++ b/Master/texmf-dist/source/platex/base/plext.dtx
@@ -3,7 +3,7 @@
%
% Copyright 2001 ASCII Corporation.
% Copyright (c) 2010 ASCII MEDIA WORKS
-% Copyright (c) 2016-2017 Japanese TeX Development Community
+% Copyright (c) 2016-2018 Japanese TeX Development Community
%
% This file is part of the pLaTeX2e system (community edition).
% -------------------------------------------------------------
@@ -60,6 +60,23 @@
% \changes{v1.2g}{2017/05/04}{Use \cs{setlength}, so that
% calc extensions apply}
% \changes{v1.2h}{2017/07/21}{$BI=$H<~0O$H$NB7$(0LCV$r$5$i$K=$@5(B}
+% \changes{v1.2i}{2018/09/09}{Made caption an error outside a float: latex/2815
+% (sync with ltfloat 1999/04/19 v1.1u)}
+% \changes{v1.2i}{2018/09/09}{$B=D?t<0%G%#%l%/%7%g%s$NO"?t;z(B}
+% \changes{v1.2i}{2018/09/09}{Moved the code associated with
+% \cs{@mkpream} into the group provided by the box,
+% for robustness (latex/2183)
+% (sync with lttab.dtx 1996/10/21 v1.1i)}
+% \changes{v1.2i}{2018/09/09}{Use \cs{set@typeset@protect}
+% (sync with lttab.dtx 1996/10/21 v1.1i)}
+% \changes{v1.2i}{2018/09/09}{Check for hmode to see if something
+% went wrong during parsing (pr/2884)
+% (sync with lttab.dtx 1998/11/13 v1.1m)}
+% \changes{v1.2i}{2018/09/09}{$B0BA4$N$?$a!"(B\cs{DeclareLayoutCaption}$B$G(B
+% $BDj5A$9$kFbItL?Na$r(B\cs{...@layoutcaption}$B$+$i(B
+% \cs{...@layoutc@ption}$B$XJQ99(B}
+% \changes{v1.2j}{2018/09/20}{Change \cs{@stabular} to \cs{p@stabular},
+% to avoid conflict with \textsf{stabular} package}
% \fi
%
% \iffalse
@@ -68,7 +85,7 @@
\ProvidesFile{plext.dtx}
%</driver>
%<package>\ProvidesPackage{plext}
- [2017/07/21 v1.2h pLaTeX package file (community edition)]
+ [2018/09/20 v1.2j pLaTeX package file (community edition)]
%<*driver>
\documentclass{jltxdoc}
\usepackage{plext}
@@ -182,7 +199,7 @@
%
\def\tabular{\let\@halignto\@empty\X@tabular}
\@namedef{tabular*}{\@ifnextchar<%>
- {\@stabular}{\@stabular<Z>}}
+ {\p@stabular}{\p@stabular<Z>}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -203,15 +220,17 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@stabular}
+% \begin{macro}{\p@stabular}
% \begin{macro}{\p@tabular}
% $B%"%9%?%j%9%/7A<0$N>l9g$O!"AHJ}8~%*%W%7%g%s$N8e$m$KI}$r;XDj$7$^$9!#(B
% \changes{v1.1d}{1995/11/10}{\cs{@tabular} to \cs{p@tabular}}
% \changes{v1.2a}{2016/08/20}{tabular$B4D6-A0$NM>J,$J(B\cs{xkanjiskip}$B$r:o=|(B}
% \changes{v1.2c}{2016/11/19}{Use \cs{setlength}, so that
% calc extensions apply (sync with lttab.dtx v1.1j)}
+% \changes{v1.2j}{2018/09/20}{Change \cs{@stabular} to \cs{p@stabular},
+% to avoid conflict with \textsf{stabular} package}
% \begin{macrocode}
-\def\@stabular<#1>#2{%
+\def\p@stabular<#1>#2{%
\setlength\dimen@{#2}%
\edef\@halignto{to\the\dimen@}\p@tabular<#1>}
\def\p@tabular<#1>{\leavevmode \null\hbox \bgroup $\let\@acol\@tabacol
@@ -232,11 +251,19 @@
%
% \begin{macro}{\p@array}
% tabular$B4D6-$H(Barray$B4D6-$NFbIt7A<0$G$9!#(B
+% \changes{v1.1c}{1995/09/11}{Add \cs{adjustbaseline}.}
% \changes{v1.1d}{1995/11/10}{\cs{@array} to \cs{p@array}}
% \changes{v1.2a}{2016/08/20}{$B2#AH$G(B\texttt{<t>}$B$r;XDj$7$?>l9g$K(B
% \cs{@arstrutbox}$B$rM>7W$K(B\cs{hbox}$B$KF~$l$F$$$?$N$r=$@5(B}
-% \begin{macrocode}
-\def\p@array<#1>[#2]#3{\setbox\@arstrutbox\hbox{%
+% \changes{v1.2i}{2018/09/09}{Moved the code associated with
+% \cs{@mkpream} into the group provided by the box,
+% for robustness (latex/2183)
+% (sync with lttab.dtx 1996/10/21 v1.1i)}
+% \begin{macrocode}
+\def\p@array<#1>[#2]#3{%
+ \fork@array@option<#1>[#2]\@begin@alignbox
+ \bgroup\box@dir\adjustbaseline
+ \setbox\@arstrutbox\hbox{%
\iftdir
\if #1y\relax\yoko
\vrule\@height\arraystretch\ht\strutbox
@@ -257,18 +284,25 @@
\@depth\arraystretch\dp\strutbox \@width\z@
\fi
\fi}%
- \fork@array@option<#1>[#2]%
\@mkpream{#3}\edef\@preamble{\ialign \noexpand\@halignto
\bgroup \tabskip\z@skip \@arstrut \@preamble \tabskip\z@skip \cr}%
\let\@startpbox\@@startpbox \let\@endpbox\@@endpbox
\let\tabularnewline\\%
% \end{macrocode}
-% \changes{v1.1c}{1995/09/11}{Add \cs{adjustbaseline}.}
+% \changes{v1.2i}{2018/09/09}{Use \cs{set@typeset@protect}
+% (sync with lttab.dtx 1996/10/21 v1.1i)}
% \begin{macrocode}
- \@begin@alignbox\bgroup\box@dir\adjustbaseline
\let\par\@empty
- \let\@sharp##\let\protect\relax
- \lineskip\z@skip\baselineskip\z@skip\@preamble}
+ \let\@sharp##%
+ \set@typeset@protect
+ \lineskip\z@skip\baselineskip\z@skip
+% \end{macrocode}
+% \changes{v1.2i}{2018/09/09}{Check for hmode to see if something
+% went wrong during parsing (pr/2884)
+% (sync with lttab.dtx 1998/11/13 v1.1m)}
+% \begin{macrocode}
+ \ifhmode \@preamerr\z@ \@@par\fi
+ \@preamble}
% \end{macrocode}
% \end{macro}
%
@@ -518,21 +552,24 @@
% `|(12zw)|'$B$H;XDj$r$9$k$H!"4A;z(B12$BJ8;zJ,$ND9$5$G@^$jJV$5$l$^$9!#(B
% `|(\floatwidth)|'$B$H;XDj$r$9$k$H!"(B
% $B%-%c%W%7%g%s$NI}$O%U%m!<%H%*%V%8%'%/%H$NI}$H$J$j$^$9!#(B
-% $B$3$l$,%G%U%)%k%H$G$9!#$J$*!"(B`|(\floatheigt)|'$B$H;XDj$r$9$k$H!"(B
+% $B$3$l$,%G%U%)%k%H$G$9!#$J$*!"(B`|(\floatheight)|'$B$H;XDj$r$9$k$H!"(B
% $B%-%c%W%7%g%s$NI}$O%U%m!<%H%*%V%8%'%/%H$N9b$5$H$J$j$^$9!#(B
%
% \meta{pos1}$B$H(B\meta{pos2}$B$K$O!"%-%c%W%7%g%s$r=PNO$9$k0LCV$r;XDj$7$^$9!#(B
% \meta{pos1}$B$O!"(B`|c|', `|t|', `|b|'$B$N$$$:$l$+$G$9!#(B
% \meta{pos2}$B$O!"(B`|u|', `|d|', `|l|', `|r|'$B$N$$$:$l$+$G$9!#(B
% $B%G%U%)%k%H$O!"(B|figure|$B%?%$%W$,(B`|cd|'$B!"(B|table|$B%?%$%W$O(B`|cu|'$B$G$9!#(B
+% \changes{v1.2i}{2018/09/09}{$B0BA4$N$?$a!"(B\cs{DeclareLayoutCaption}$B$G(B
+% $BDj5A$9$kFbItL?Na$r(B\cs{...@layoutcaption}$B$+$i(B
+% \cs{...@layoutc@ption}$B$XJQ99(B}
% \begin{macrocode}
\def\DeclareLayoutCaption#1<#2>(#3)[#4#5]{%
\expandafter
- \ifx\csname #1@layoutcaption\endcsname\relax \else
+ \ifx\csname #1@layoutc@ption\endcsname\relax \else
\@latex@info{Redeclaring capiton layout setting of '#1'}%
\fi
\expandafter
- \gdef\csname #1@layoutcaption\endcsname{%
+ \gdef\csname #1@layoutc@ption\endcsname{%
\if Z\caption@dir\def\caption@dir{#2}\fi
\ifdim\captionwidth=\z@ \captionwidth=#3\relax\fi
\if Z\caption@posa\def\caption@posa{#4}\fi
@@ -586,14 +623,25 @@
% $B;XDj$r$7$^$9!#0LCV$N;XDj$O(B|\layoutcaption|$B%3%^%s%I$G9T$J$$$^$9!#(B
% |\layoutcaption|$B%3%^%s%I$,>JN,$5$l$?>l9g$O!"(B|\DeclareLayoutCaption|$B%3%^%s%I(B
% $B$G@_Dj$5$l$F$$$k%G%U%)%k%HCM$,;H$o$l$^$9!#(B
+% \changes{v1.2i}{2018/09/09}{Made caption an error outside a float: latex/2815
+% (sync with ltfloat 1999/04/19 v1.1u)}
% \begin{macrocode}
-\def\pcaption{\refstepcounter\@captype \@dblarg{\@pcaption\@captype}}
+\def\pcaption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\pcaption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\@pcaption\@captype}}%
+}
%
\long\def\@pcaption#1[#2]#3{%
\addcontentsline{\csname ext@#1\endcsname}{#1}{%
\protect\numberline{\csname the#1\endcsname}{\ignorespaces#2}}%
\ifvoid\@floatbox
- \latex@error{Use with `\protect\layoutfloat'.}\@eha
+ \@latex@error{Use \noexpand\pcaption with `\string\layoutfloat'}\@eha
\fi
\make@pcaptionbox{#3}%
\@pboxswfalse
@@ -601,12 +649,13 @@
\if l\caption@posb\box\@captionbox\kern\captionfloatsep\fi
\if t\caption@posa\vtop
\else\if b\caption@posa\vbox
- \else\ifmmode\vcenter \else\@pboxswtrue $\vcenter \fi\fi\fi
+ \else\@pboxswtrue $\vcenter \fi\fi
{\if u\caption@posb\box\@captionbox\kern\captionfloatsep\fi
\unvbox\@floatbox
\if d\caption@posb\kern\captionfloatsep\box\@captionbox\fi}%
+ \if@pboxsw \m@th$\fi
\if r\caption@posb\kern\captionfloatsep\box\@captionbox\fi
- \if@pboxsw \m@th$\fi \if r\float@pos\else\hss\fi}}%
+ \if r\float@pos\else\hss\fi}}%
\par\vskip.25\baselineskip
\box\@tempboxa}
% \end{macrocode}
@@ -626,12 +675,12 @@
% \changes{v1.1h}{1996/03/13}{typo: \cs{@latex@warning}.}
% \begin{macrocode}
\expandafter
- \ifx\csname\@captype @layoutcaption\endcsname\relax
- \@latex@warning{Default caption layout of `\@captype' unknown.}%
+ \ifx\csname\@captype @layoutc@ption\endcsname\relax
+ \@latex@warning{Default caption layout of `\@captype' unknown}%
\def\caption@dir{Z}\captionwidth\z@
\def\caption@posa{Z}\def\caption@posb{Z}%
\else
- \csname \@captype @layoutcaption\endcsname
+ \csname \@captype @layoutc@ption\endcsname
\fi
% \end{macrocode}
% $B<!$K!"AH$_J}8~$r@_Dj$7$^$9!#(B
@@ -665,7 +714,7 @@
\if@tempswa \@tempdima\ht0 \else\@tempdima\wd0 \fi
\ifdim\@tempdima>\captionwidth \@tempdima\captionwidth \fi
\@pboxswfalse
- \setbox0\hbox{\if@rotsw\ifmmode\@rotswfalse \else $\fi\fi
+ \setbox0\hbox{\if@rotsw $\fi
\if u\caption@posb\vbox
\else\if d\caption@posb\vbox
\else\if t\caption@posa\vtop
@@ -1227,13 +1276,14 @@
% |\@@rensuji|$B$,(B|\rensuji|$B$NFbIt7A<0$G$9!#(B
% \changes{v1.2b}{2016/11/07}{$B2#AH$GCJMn$NF,$K(B\cs{rensuji}$B$r;H$($k(B
% $B$h$&$K(B\cs{leavevmode}$B$rDI2C$7$F=$@5(B}
+% \changes{v1.2i}{2018/09/09}{$B=D?t<0%G%#%l%/%7%g%s$NO"?t;z(B}
% \begin{macrocode}
\DeclareRobustCommand\rensuji{%
\@ifstar{\not@advancelinetrue\@rensuji}{\@rensuji}}
\def\@rensuji{\@ifnextchar[{\@@rensuji}{\@@rensuji[c]}}
\def\@@rensuji[#1]#2{%
\ifvmode\leavevmode\fi
- \ifydir\hbox{#2}\else
+ \iftdir\ifmdir\hbox{#2}\else
\hskip\rensujiskip
\ifnot@advanceline\not@advancelinefalse\else
\setbox\z@\hbox{\yoko#2}%
@@ -1248,7 +1298,8 @@
\else\vtop{\hbox to1zw{\yoko#2\hss}}%
\fi\fi
\hskip\rensujiskip
-\fi}
+ \fi\else\hbox{#2}\fi
+}
% \end{macrocode}
% \end{macro}
% \end{macro}