From 70aaae3b3c98fb6357c846ad54ce2367e9682f50 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 4 Oct 2019 20:57:14 +0000 Subject: latex2e (4oct19) git-svn-id: svn://tug.org/texlive/trunk@52286 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/base/ltpictur.dtx | 154 +++++++++++++++-------- 1 file changed, 101 insertions(+), 53 deletions(-) (limited to 'Master/texmf-dist/source/latex/base/ltpictur.dtx') diff --git a/Master/texmf-dist/source/latex/base/ltpictur.dtx b/Master/texmf-dist/source/latex/base/ltpictur.dtx index 6b84231ab5b..ad82cd477f3 100644 --- a/Master/texmf-dist/source/latex/base/ltpictur.dtx +++ b/Master/texmf-dist/source/latex/base/ltpictur.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2016 +% Copyright (C) 1993-2019 % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % @@ -13,7 +13,7 @@ % The latest version of this license is in % https://www.latex-project.org/lppl.txt % and version 1.3c or later is part of all distributions of LaTeX -% version 2005/12/01 or later. +% version 2008 or later. % % This file has the LPPL maintenance status "maintained". % @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltpictur.dtx} - [2016/03/29 v1.1l LaTeX Kernel (Picture Mode)] + [2019/08/27 v1.1m LaTeX Kernel (Picture Mode)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltpictur.dtx} @@ -95,6 +95,8 @@ % \changes{v0.1e}{1994/05/22}{Use new warning cmds} % \changes{v1.0f}{1994/11/17} % {\cs{@tempa} to \cs{reserved@a}} +% \changes{v1.1m}{2019/08/27}{Remove several unnecessary \cs{gdef} definitions} +% \changes{v1.1m}{2019/08/27}{Make various commands robust} % % \begin{oldcomments} % @@ -196,8 +198,8 @@ % \changes{v1.0h}{1995/05/12}{Macro added for latex/1355} % |#1| should be a |(| (eating any white space before the bracket), % \begin{macrocode} -\long\gdef\picture#1{\pictur@#1} -\gdef\pictur@(#1){% +\long\def\picture#1{\pictur@#1} +\def\pictur@(#1){% \@ifnextchar({\@picture(#1)}{\@picture(#1)(0,0)}} % \end{macrocode} % \end{macro} @@ -205,7 +207,7 @@ % % \begin{macro}{\@picture} % \begin{macrocode} -\gdef\@picture(#1,#2)(#3,#4){% +\def\@picture(#1,#2)(#3,#4){% \@picht#2\unitlength \setbox\@picbox\hb@xt@#1\unitlength\bgroup \hskip -#3\unitlength @@ -221,7 +223,7 @@ % (proposed by John Hobby)} % % \begin{macrocode} -\gdef\endpicture{% +\def\endpicture{% \egroup\hss\egroup \ht\@picbox\@picht\dp\@picbox\z@ \mbox{\box\@picbox}} @@ -233,7 +235,7 @@ % changed 20 Jul 87). % % \begin{macrocode} -\long\gdef\put(#1,#2)#3{% +\long\def\put(#1,#2)#3{% \@killglue\raise#2\unitlength \hb@xt@\z@{\kern#1\unitlength #3\hss}% \ignorespaces} @@ -244,7 +246,7 @@ % \changes{v0.1c}{1994/04/28}{(DPC) Ignore spaces between )(} % |#3| had better be a |(|. % \begin{macrocode} -\gdef\multiput(#1,#2)#3{% +\def\multiput(#1,#2)#3{% \@xdim #1\unitlength \@ydim #2\unitlength \@multiput(} @@ -254,7 +256,7 @@ % \begin{macro}{\multiput} % \changes{v0.1c}{1994/04/28}{(DPC) Macro added} % \begin{macrocode} -\long\gdef\@multiput(#1,#2)#3#4{% +\long\def\@multiput(#1,#2)#3#4{% \@killglue\@multicnt #3\relax \@whilenum \@multicnt >\z@\do {\raise\@ydim\hb@xt@\z@{\kern\@xdim #4\hss}% @@ -266,16 +268,16 @@ % % \begin{macro}{\@killglue} % \begin{macrocode} -\gdef\@killglue{\unskip\@whiledim \lastskip >\z@\do{\unskip}} +\def\@killglue{\unskip\@whiledim \lastskip >\z@\do{\unskip}} % \end{macrocode} % \end{macro} % % \begin{macro}{\thinlines} % \begin{macro}{\thicklines} % \begin{macrocode} -\gdef\thinlines{\let\@linefnt\tenln \let\@circlefnt\tencirc +\DeclareRobustCommand\thinlines{\let\@linefnt\tenln \let\@circlefnt\tencirc \@wholewidth\fontdimen8\tenln \@halfwidth .5\@wholewidth} -\gdef\thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw +\DeclareRobustCommand\thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw \@wholewidth\fontdimen8\tenlnw \@halfwidth .5\@wholewidth} % \end{macrocode} % \end{macro} @@ -283,19 +285,20 @@ % % \begin{macro}{\linethickness} % \begin{macrocode} -\gdef\linethickness#1{\@wholewidth #1\relax \@halfwidth .5\@wholewidth} +\DeclareRobustCommand\linethickness[1] + {\@wholewidth #1\relax \@halfwidth .5\@wholewidth} % \end{macrocode} % \end{macro} % % \begin{macro}{\ishortstack} % \begin{macrocode} -\gdef\shortstack{\@ifnextchar[\@shortstack{\@shortstack[c]}} +\def\shortstack{\@ifnextchar[\@shortstack{\@shortstack[c]}} % \end{macrocode} % \end{macro} % % \begin{macro}{\@ishortstack} % \begin{macrocode} -\gdef\@shortstack[#1]{% +\def\@shortstack[#1]{% \leavevmode \vbox\bgroup \baselineskip-\p@\lineskip 3\p@ @@ -315,22 +318,22 @@ % % \begin{macro}{\@ishortstack} % \begin{macrocode} -\gdef\@ishortstack#1{\ialign{\mb@l {##}\unskip\mb@r\cr #1\crcr}\egroup} +\def\@ishortstack#1{\ialign{\mb@l {##}\unskip\mb@r\cr #1\crcr}\egroup} % \end{macrocode} % \end{macro} % % \begin{macro}{\@stackcr} % \begin{macro}{\@ixstackcr} % \begin{macrocode} -\gdef\@stackcr{\@ifstar\@ixstackcr\@ixstackcr} -\gdef\@ixstackcr{\@ifnextchar[\@istackcr{\cr\ignorespaces}} +\def\@stackcr{\@ifstar\@ixstackcr\@ixstackcr} +\def\@ixstackcr{\@ifnextchar[\@istackcr{\cr\ignorespaces}} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\@istackcr} % \begin{macrocode} -\gdef\@istackcr[#1]{\cr\noalign{\vskip #1}\ignorespaces} +\def\@istackcr[#1]{\cr\noalign{\vskip #1}\ignorespaces} % \end{macrocode} % \end{macro} % @@ -507,7 +510,7 @@ % % \begin{macro}{\line} % \begin{macrocode} -\gdef\line(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax +\def\line(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax \@linelen #3\unitlength \ifdim\@linelen<\z@\@badlinearg\else \ifnum\@xarg =\z@ \@vline @@ -519,7 +522,7 @@ % % \begin{macro}{\@sline} % \begin{macrocode} -\gdef\@sline{% +\def\@sline{% \ifnum\@xarg<\z@ \@negargtrue \@xarg -\@xarg \@yyarg -\@yarg \else \@negargfalse \@yyarg \@yarg \fi \ifnum \@yyarg >\z@ \@tempcnta\@yyarg \else \@tempcnta -\@yyarg \fi @@ -580,7 +583,7 @@ % % \begin{macro}{\@hline} % \begin{macrocode} -\gdef\@hline{\ifnum \@xarg <\z@ \hskip -\@linelen \fi +\def\@hline{\ifnum \@xarg <\z@ \hskip -\@linelen \fi \vrule \@height \@halfwidth \@depth \@halfwidth \@width \@linelen \ifnum \@xarg <\z@ \hskip -\@linelen \fi} % \end{macrocode} @@ -588,7 +591,7 @@ % % \begin{macro}{\@getlinechar} % \begin{macrocode} -\gdef\@getlinechar(#1,#2){\@tempcnta#1\relax\multiply\@tempcnta 8% +\def\@getlinechar(#1,#2){\@tempcnta#1\relax\multiply\@tempcnta 8% \advance\@tempcnta -9\ifnum #2>\z@ \advance\@tempcnta #2\relax\else \advance\@tempcnta -#2\relax\advance\@tempcnta 64 \fi \char\@tempcnta} @@ -597,7 +600,7 @@ % % \begin{macro}{\vector} % \begin{macrocode} -\gdef\vector(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax +\def\vector(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax \@tempcnta \ifnum\@xarg<\z@ -\@xarg\else\@xarg\fi \ifnum\@tempcnta<5\relax \@linelen #3\unitlength @@ -612,7 +615,7 @@ % % \begin{macro}{\@hvector} % \begin{macrocode} -\gdef\@hvector{\@hline\hb@xt@\z@{\@linefnt +\def\@hvector{\@hline\hb@xt@\z@{\@linefnt \ifnum \@xarg <\z@ \@getlarrow(1,0)\hss\else \hss\@getrarrow(1,0)\fi}} % \end{macrocode} @@ -620,13 +623,13 @@ % % \begin{macro}{\@vvector} % \begin{macrocode} -\gdef\@vvector{\ifnum \@yarg <\z@ \@downvector \else \@upvector \fi} +\def\@vvector{\ifnum \@yarg <\z@ \@downvector \else \@upvector \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\@svector} % \begin{macrocode} -\gdef\@svector{\@sline +\def\@svector{\@sline \@tempcnta\@yarg \ifnum\@tempcnta <\z@ \@tempcnta -\@tempcnta\fi \ifnum\@tempcnta <5% \hskip -\wd\@linechar @@ -639,7 +642,7 @@ % \begin{macro}{\@getlarrow} % \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR} % \begin{macrocode} -\gdef\@getlarrow(#1,#2){\ifnum #2=\z@ \@tempcnta 27 % '33 +\def\@getlarrow(#1,#2){\ifnum #2=\z@ \@tempcnta 27 % '33 \else \@tempcnta #1\relax\multiply\@tempcnta \sixt@@n \advance\@tempcnta -9 \@tempcntb #2\relax\multiply\@tempcntb \tw@ @@ -652,7 +655,7 @@ % \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR} % \begin{macro}{\@getrarrow} % \begin{macrocode} -\gdef\@getrarrow(#1,#2){\@tempcntb #2\relax +\def\@getrarrow(#1,#2){\@tempcntb #2\relax \ifnum\@tempcntb <\z@ \@tempcntb -\@tempcntb\relax\fi \ifcase \@tempcntb\relax \@tempcnta 45 % '55 \or @@ -671,13 +674,13 @@ % % \begin{macro}{\@vline} % \begin{macrocode} -\gdef\@vline{\ifnum \@yarg <\z@ \@downline \else \@upline\fi} +\def\@vline{\ifnum \@yarg <\z@ \@downline \else \@upline\fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\@upline} % \begin{macrocode} -\gdef\@upline{% +\def\@upline{% \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth \@height \@linelen \@depth \z@\hss}} % \end{macrocode} @@ -685,7 +688,7 @@ % % \begin{macro}{\@downline} % \begin{macrocode} -\gdef\@downline{% +\def\@downline{% \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth \@height \z@ \@depth \@linelen \hss}} % \end{macrocode} @@ -695,7 +698,7 @@ % \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR} % \changes{v1.1i}{2000/01/15}{Removed space at end-of-line, CAR} % \begin{macrocode} -\gdef\@upvector{\@upline\setbox\@tempboxa\hbox{\@linefnt\char 54}% '66 +\def\@upvector{\@upline\setbox\@tempboxa\hbox{\@linefnt\char 54}% '66 \raise \@linelen \hb@xt@\z@{\lower \ht\@tempboxa\box\@tempboxa\hss}} % \end{macrocode} % \end{macro} @@ -703,7 +706,7 @@ % \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR} % \begin{macro}{\@downvector} % \begin{macrocode} -\gdef\@downvector{\@downline\lower \@linelen +\def\@downvector{\@downline\lower \@linelen \hb@xt@\z@{\@linefnt\char 63 % '77 \hss}} % \end{macrocode} @@ -800,7 +803,7 @@ % % \begin{macro}{\dashbox} % \begin{macrocode} -\gdef\dashbox#1(#2,#3){\leavevmode\hb@xt@\z@{\baselineskip \z@skip +\def\dashbox#1(#2,#3){\leavevmode\hb@xt@\z@{\baselineskip \z@skip \lineskip \z@skip \@dashdim #2\unitlength \@dashcnt \@dashdim \advance\@dashcnt 200 @@ -1081,7 +1084,7 @@ % \begin{macro}{\@getcirc} % \changes{v1.1j}{2003/12/30}{issue warning if circle size can't be met pr/3473} % \begin{macrocode} -\gdef\@getcirc#1{\@tempdima #1\relax \advance\@tempdima 2\p@ +\def\@getcirc#1{\@tempdima #1\relax \advance\@tempdima 2\p@ \@tempcnta\@tempdima \@tempdima 4\p@ \divide\@tempcnta\@tempdima \ifnum \@tempcnta >10\relax @@ -1114,13 +1117,13 @@ % % \begin{macro}{\@put} % \begin{macrocode} -\gdef\@put#1#2#3{\raise #2\hb@xt@\z@{\hskip #1#3\hss}} +\def\@put#1#2#3{\raise #2\hb@xt@\z@{\hskip #1#3\hss}} % \end{macrocode} % \end{macro} % % \begin{macro}{\oval} % \begin{macrocode} -\gdef\oval(#1,#2){\@ifnextchar[{\@oval(#1,#2)}{\@oval(#1,#2)[]}} +\def\oval(#1,#2){\@ifnextchar[{\@oval(#1,#2)}{\@oval(#1,#2)[]}} % \end{macrocode} % \end{macro} % @@ -1146,7 +1149,7 @@ % % \begin{macro}{\@oval} % \begin{macrocode} -\gdef\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen +\def\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue % \end{macrocode} % \changes{v1.1l}{2016/03/29}{initialise tests} @@ -1189,7 +1192,7 @@ % % \begin{macro}{\@ovvert} % \begin{macrocode} -\gdef\@ovvert#1#2{\vbox to\@ovyy{% +\def\@ovvert#1#2{\vbox to\@ovyy{% \if@ovb \@tempcntb \@tempcnta \advance \@tempcntb #1\relax \kern -\@ovro \hbox{\char \@tempcntb}\nointerlineskip \else \kern \@ovri \kern \@ovdy \fi @@ -1209,7 +1212,7 @@ % % \begin{macro}{\@ovhorz} % \begin{macrocode} -\gdef\@ovhorz{\hb@xt@\@ovxx{\kern \@ovro +\def\@ovhorz{\hb@xt@\@ovxx{\kern \@ovro \if@ovr \else \kern \@ovdx \fi % \end{macrocode} % \changes{v1.1l}{2016/03/29} @@ -1232,7 +1235,7 @@ % {Avoid almost zero length leaders}% %\let\if@ovvline\@undefined %\let\if@ovhline\@undefined -%\gdef\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen +%\def\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen % \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue % \@tfor\reserved@a :=#3\do % {\csname @ov\reserved@a false\endcsname}% @@ -1254,7 +1257,7 @@ % \advance\@ovdy\@ovro \ht\@tempboxa\z@ \dp\@tempboxa\z@ % \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}% % \endgroup} -%\gdef\@ovvert#1#2{\vbox to\@ovyy{% +%\def\@ovvert#1#2{\vbox to\@ovyy{% % \if@ovb \@tempcntb \@tempcnta \advance \@tempcntb #1\relax % \kern -\@ovro \hbox{\char \@tempcntb}\nointerlineskip % \else \kern \@ovri \kern \@ovdy \fi @@ -1262,7 +1265,7 @@ % \if@ovt \@tempcntb \@tempcnta \advance \@tempcntb #2\relax % \hbox{\char \@tempcntb}% % \else \kern \@ovdy \kern \@ovro \fi}} -%\gdef\@ovhorz{\hb@xt@\@ovxx{\kern \@ovro +%\def\@ovhorz{\hb@xt@\@ovxx{\kern \@ovro % \if@ovr \else \kern \@ovdx \fi % \leaders \hrule \@height \@wholewidth \hfil % \if@ovl \else \kern \@ovdx \fi @@ -1275,13 +1278,13 @@ % \changes{LaTeX2.09}{1993/08/05} % {(RMS) Added error message if \cs{circle} is used in math mode.} % \begin{macrocode} -\gdef\circle{\@inmatherr\circle\@ifstar\@dot\@circle} +\def\circle{\@inmatherr\circle\@ifstar\@dot\@circle} % \end{macrocode} % \end{macro} % % \begin{macro}{\@circle} % \begin{macrocode} -\gdef\@circle#1{% +\def\@circle#1{% \begingroup \boxmaxdepth \maxdimen \@tempdimb #1\unitlength \ifdim \@tempdimb >15.5\p@ \@getcirc\@tempdimb \@ovro\ht\@tempboxa @@ -1299,13 +1302,13 @@ % \begin{macro}{\@dot} % Internal form of |\circle*|. % \begin{macrocode} -\gdef\@dot#1{\@tempdimb #1\unitlength \@circ\@tempdimb{112}} +\def\@dot#1{\@tempdimb #1\unitlength \@circ\@tempdimb{112}} % \end{macrocode} % \end{macro} % % \begin{macro}{\@circ} % \begin{macrocode} -\gdef\@circ#1#2{\@tempdima #1\relax \advance\@tempdima .5\p@ +\def\@circ#1#2{\@tempdima #1\relax \advance\@tempdima .5\p@ \@tempcnta\@tempdima \@tempdima \p@ \divide\@tempcnta\@tempdima \ifnum\@tempcnta >15\relax \@tempcnta 15\relax \fi @@ -1442,7 +1445,7 @@ % \begin{macro}{\qbeziermax} % The maximum number of points to plot. % \begin{macrocode} -\gdef\qbeziermax{500} +\def\qbeziermax{500} % \end{macrocode} % \end{macro} % @@ -1474,12 +1477,12 @@ % ignore spaces between its arguments. % |#2| should be white space, and |#4| should be |(|. % \begin{macrocode} -\gdef\bezier#1)#2(#3)#4({\@bezier#1)(#3)(} +\def\bezier#1)#2(#3)#4({\@bezier#1)(#3)(} % \end{macrocode} % % \begin{macro}{\@bezier} % \begin{macrocode} -\gdef\@bezier#1(#2,#3)(#4,#5)(#6,#7){% +\def\@bezier#1(#2,#3)(#4,#5)(#6,#7){% \ifnum #1=\z@ \@ovxx #4\unitlength \advance\@ovxx -#2\unitlength @@ -1533,10 +1536,55 @@ \hb@xt@\z@{\kern\@xdim \unhcopy\@tempboxa\hss}% \advance\count@\@ne}}} -% % \end{macrocode} % \end{macro} % \end{macro} % +% As the commands above all use ``picture'' interface we couldn't define them with +% |\DeclareRobustCommand| so we do that now. +% \begin{macrocode} +% +%<*2ekernel|latexrelease> +%\IncludeInRelease{2019/10/01}% +% {\bezier}{Make commands robust}% +\MakeRobust\bezier +\MakeRobust\circle +\MakeRobust\dashbox +\MakeRobust\line +\MakeRobust\linethickness +\MakeRobust\multiput +\MakeRobust\oval +\MakeRobust\put +\MakeRobust\qbezier +\MakeRobust\shortstack +\MakeRobust\thinlines +\MakeRobust\vector +% +%\EndIncludeInRelease +%\IncludeInRelease{0000/00/00}% +% {\bezier}{Make commands robust}% +% +%\kernel@make@fragile\bezier +%\kernel@make@fragile\circle +%\kernel@make@fragile\dashbox +%\kernel@make@fragile\line +%\kernel@make@fragile\linethickness +%\kernel@make@fragile\multiput +%\kernel@make@fragile\oval +%\kernel@make@fragile\put +%\kernel@make@fragile\qbezier +%\kernel@make@fragile\shortstack +%\kernel@make@fragile\thinlines +%\kernel@make@fragile\vector +% +%\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% +% +% \begin{macrocode} +% +% \end{macrocode} +% % \Finale % -- cgit v1.2.3