summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pict2e
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-09-03 21:12:16 +0000
committerKarl Berry <karl@freefriends.org>2020-09-03 21:12:16 +0000
commit5b6bf18f27971a2f41534049ce3c26179b94c990 (patch)
treeb92228dd33cd0ec95ee7e1ea67a5505d56e46efe /Master/texmf-dist/tex/latex/pict2e
parent253ee34e8aebfb8731d657b1fa4ef2c22f9e7f52 (diff)
pict2e (3sep20)
git-svn-id: svn://tug.org/texlive/trunk@56257 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pict2e')
-rw-r--r--Master/texmf-dist/tex/latex/pict2e/pict2e.sty94
1 files changed, 67 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/pict2e/pict2e.sty b/Master/texmf-dist/tex/latex/pict2e/pict2e.sty
index 63e27730da3..eb360b93b52 100644
--- a/Master/texmf-dist/tex/latex/pict2e/pict2e.sty
+++ b/Master/texmf-dist/tex/latex/pict2e/pict2e.sty
@@ -24,7 +24,7 @@
%% This work consists of all files listed in `manifest.txt'.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{pict2e}[2020/06/20 v0.3e Improved picture commands (HjG,RN,JT)]
+\ProvidesPackage{pict2e}[2020/08/16 v0.4a Improved picture commands (HjG,RN,JT)]
\edef\Gin@codes{%
\catcode`\noexpand\^^A\the\catcode`\^^A\relax
\catcode`\noexpand\"\the\catcode`\"\relax
@@ -34,6 +34,8 @@
\@makeother\"%
\@makeother\!%
\@makeother\:%
+\def\@defaultunitsset#1#2#3{%
+ \@defaultunits#1\dimexpr#2#3\relax\relax\@nnil}
\newcommand*\pIIe@mode{-1}
\newcommand*\pIIe@code[1]{}
\providecommand*\Gin@driver{}
@@ -388,7 +390,7 @@
\begingroup
\pIIe@checkslopeargsline{#1}{#2}%
\@tempdima=#1pt\relax \@tempdimb=#2pt\relax
- \@linelen #3\unitlength
+ \@defaultunitsset\@linelen{#3}\unitlength
\ifdim\@linelen<\z@ \@badlinearg \else
\pIIe@sline
\pIIe@moveto\z@\z@
@@ -423,10 +425,10 @@
\begingroup
\pIIe@checkslopeargsvector{#1}{#2}%
\@tempdima=#1pt\relax \@tempdimb=#2pt\relax
- \@linelen#3\unitlength
+ \@defaultunitsset\@linelen{#3}\unitlength
\ifdim\@linelen<\z@ \@badlinearg \else
\pIIe@sline
- \@linelen#3\unitlength
+ \@defaultunitsset\@linelen{#3}\unitlength
\pIIe@pyth{\@tempdima}{\@tempdimb}\dimen@
\ifdim\@tempdima=\z@ \else
\ifdim\@tempdimb=\z@ \else
@@ -492,7 +494,7 @@
\def\@circle#1{\begingroup \@tempswafalse\pIIe@circ{#1}}
\def\@dot#1{\begingroup \@tempswatrue\pIIe@circ{#1}}
\newcommand*\pIIe@circ[1]{%
- \@tempdima#1\unitlength
+ \@defaultunitsset\@tempdima{#1}\unitlength
\ifdim\@tempdima<\z@ \pIIe@badcircarg \fi
\divide\@tempdima\tw@
\pIIe@circle\@tempdima
@@ -525,7 +527,8 @@
{The radius of a circle, dot, arc or oval corner must be greater than zero.}}%
\newcommand*\maxovalrad{20pt}
\newcommand*\pIIe@defaultUL[2]{%
- \afterassignment\pIIe@def@UL\dimen@#2\unitlength\relax{#1}{#2}}
+ \@defaultunitsset\dimen@{#2}\unitlength
+ \edef#1{\the\dimen@}}
\newcommand*\pIIe@def@UL{}
\def\pIIe@def@UL#1\relax#2#3{%
\edef#2{\the\dimen@}}
@@ -537,8 +540,8 @@
\ifdim\pIIe@maxovalrad<\z@ \pIIe@badcircarg \fi
\pIIe@oval}
\def\@oval(#1,#2)[#3]{%
- \@ovxx#1\unitlength \divide\@ovxx\tw@
- \@ovyy#2\unitlength \divide\@ovyy\tw@
+ \@defaultunitsset\@ovxx{#1}\unitlength \divide\@ovxx\tw@
+ \@defaultunitsset\@ovyy{#2}\unitlength \divide\@ovyy\tw@
\@tempdimc \ifdim\@ovyy>\@ovxx \@ovxx \else \@ovyy \fi
\ifdim\pIIe@maxovalrad<\@tempdimc \@tempdimc\pIIe@maxovalrad\relax \fi
\@xdim\@ovxx \advance\@xdim-\@tempdimc
@@ -574,9 +577,12 @@
\ifnum #1=\z@
\@killglue
\begingroup
- \@ovxx#2\unitlength \@ovyy#3\unitlength
- \@ovdx#4\unitlength \@ovdy#5\unitlength
- \@xdim#6\unitlength \@ydim#7\unitlength
+ \@defaultunitsset\@ovxx{#2}\unitlength
+ \@defaultunitsset\@ovyy{#3}\unitlength
+ \@defaultunitsset\@ovdx{#4}\unitlength
+ \@defaultunitsset\@ovdy{#5}\unitlength
+ \@defaultunitsset\@xdim{#6}\unitlength
+ \@defaultunitsset\@ydim{#7}\unitlength
\pIIe@bezier@QtoC\@ovxx\@ovdx\@ovro
\pIIe@bezier@QtoC\@ovyy\@ovdy\@ovri
\pIIe@bezier@QtoC\@xdim\@ovdx\@clnwd
@@ -654,10 +660,12 @@
\def\pIIe@arc@@(#1,#2)#3{%
\if@tempswa
\pIIe@moveto\z@\z@
- \pIIe@arc{\z@}{\z@}{#3\unitlength}{#1}{#2}%
+ \@defaultunitsset\@tempdimc{#3}\unitlength
+ \pIIe@arc{\z@}{\z@}{\@tempdimc}{#1}{#2}%
\pIIe@closepath\pIIe@fillGraph
\else
- \pIIe@arc[1]{\z@}{\z@}{#3\unitlength}{#1}{#2}%
+ \@defaultunitsset\@tempdimc{#3}\unitlength
+ \pIIe@arc[1]{\z@}{\z@}{\@tempdimc}{#1}{#2}%
\pIIe@strokeGraph
\fi}
\ifx\undefined\arc
@@ -669,12 +677,16 @@
\def\Line(#1,#2)(#3,#4){\polyline(#1,#2)(#3,#4)}
\def\polyline(#1,#2){%
\@killglue
- \pIIe@moveto{#1\unitlength}{#2\unitlength}%
+ \@defaultunitsset\@tempdimc{#1}\unitlength
+ \@defaultunitsset\@tempdimb{#2}\unitlength
+ \pIIe@moveto{\@tempdimc}{\@tempdimb}%
\@ifnextchar\lp@r{\@polyline}{\PackageWarning{pict2e}%
{Polygonal lines require at least two vertices!}%
\ignorespaces}}
\def\@polyline(#1,#2){%
- \pIIe@lineto{#1\unitlength}{#2\unitlength}%
+ \@defaultunitsset\@tempdimc{#1}\unitlength
+ \@defaultunitsset\@tempdimb{#2}\unitlength
+ \pIIe@lineto{\@tempdimc}{\@tempdimb}%
\@ifnextchar\lp@r{\@polyline}{\pIIe@strokeGraph\ignorespaces}}
\def\Vector(#1,#2)(#3,#4){\polyvector(#1,#2)(#3,#4)}
\def\polyvector(#1,#2){%
@@ -683,8 +695,10 @@
\PackageWarning{pict2e}%
{Polygonal vectors require at least two vertices!}\ignorespaces}}
\def\@polyvector(#1,#2)(#3,#4){%
- \@xdim#1\unitlength \@tempdima=#3\unitlength
- \@ydim#2\unitlength \@tempdimb=#4\unitlength
+ \@defaultunitsset\@xdim{#1}\unitlength
+ \@defaultunitsset\@tempdima{#3}\unitlength
+ \@defaultunitsset\@ydim{#2}\unitlength
+ \@defaultunitsset\@tempdimb{#4}\unitlength
\advance\@tempdima-\@xdim \advance\@tempdimb-\@ydim
\ifdim\@tempdima=\z@ \@linelen\@tempdimb \else
\ifdim\@tempdimb=\z@ \@linelen\@tempdima \else
@@ -702,31 +716,49 @@
\@ifstar{\begingroup\@tempswatrue\@polygon}%
{\begingroup\@tempswafalse\@polygon}}
\def\@polygon(#1,#2){%
- \pIIe@moveto{#1\unitlength}{#2\unitlength}%
+ \@defaultunitsset\@tempdimc{#1}\unitlength
+ \@defaultunitsset\@tempdimb{#2}\unitlength
+ \pIIe@moveto{\@tempdimc}{\@tempdimb}%
\@ifnextchar\lp@r{\@@polygon}{\PackageWarning{pict2e}%
{Polygons require at least two vertices!}%
\ignorespaces}}
- \def\@@polygon(#1,#2){\pIIe@lineto{#1\unitlength}{#2\unitlength}%
+ \def\@@polygon(#1,#2){%
+ \@defaultunitsset\@tempdimc{#1}\unitlength
+ \@defaultunitsset\@tempdimb{#2}\unitlength
+ \pIIe@lineto{\@tempdimc}{\@tempdimb}%
\@ifnextchar\lp@r{\@@polygon}{\pIIe@closepath
\if@tempswa\pIIe@fillGraph\else\pIIe@strokeGraph\fi
\endgroup
\ignorespaces}}
\def\moveto(#1,#2){%
\@killglue
- \pIIe@moveto{#1\unitlength}{#2\unitlength}%
+ \@defaultunitsset\@tempdimc{#1}\unitlength
+ \@defaultunitsset\@tempdimb{#2}\unitlength
+ \pIIe@moveto{\@tempdimc}{\@tempdimb}%
\ignorespaces}
\def\lineto(#1,#2){%
\@killglue
- \pIIe@lineto{#1\unitlength}{#2\unitlength}%
+ \@defaultunitsset\@tempdimc{#1}\unitlength
+ \@defaultunitsset\@tempdimb{#2}\unitlength
+ \pIIe@lineto{\@tempdimc}{\@tempdimb}%
\ignorespaces}
\def\curveto(#1,#2)(#3,#4)(#5,#6){%
\@killglue
- \pIIe@curveto{#1\unitlength}{#2\unitlength}{#3\unitlength}{#4\unitlength}%
- {#5\unitlength}{#6\unitlength}%
+ \@defaultunitsset\@tempdimc{#1}\unitlength
+ \@defaultunitsset\@tempdimb{#2}\unitlength
+ \@defaultunitsset\@tempdima{#3}\unitlength
+ \@defaultunitsset\dimen@{#4}\unitlength
+ \@defaultunitsset\@ovxx{#5}\unitlength
+ \@defaultunitsset\@ovyy{#6}\unitlength
+ \pIIe@curveto{\@tempdimc}{\@tempdimb}{\@tempdima}{\dimen@}%
+ {\@ovxx}{\@ovyy}%
\ignorespaces}
\newcommand*\circlearc[6][0]{%
\@killglue
- \pIIe@arc[#1]{#2\unitlength}{#3\unitlength}{#4\unitlength}{#5}{#6}%
+ \@defaultunitsset\@tempdimc{#2}\unitlength
+ \@defaultunitsset\@tempdimb{#3}\unitlength
+ \@defaultunitsset\@tempdima{#4}\unitlength
+ \pIIe@arc[#1]{\@tempdimc}{\@tempdimb}{\@tempdima}{#5}{#6}%
\ignorespaces}
\def\closepath{\pIIe@closepath}
\def\strokepath{\pIIe@strokeGraph}
@@ -753,9 +785,17 @@
\def\pIIe@@cbezier#1)#2(#3)#4(#5)#6({\@cbezier#1)(#3)(#5)(}%
\def\@cbezier[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9){%
\@killglue
- \pIIe@moveto{#2\unitlength}{#3\unitlength}%
- \pIIe@curveto{#4\unitlength}{#5\unitlength}%
- {#6\unitlength}{#7\unitlength}{#8\unitlength}{#9\unitlength}%
+ \@defaultunitsset\@tempdimc{#2}\unitlength
+ \@defaultunitsset\@tempdimb{#3}\unitlength
+ \pIIe@moveto{\@tempdimc}{\@tempdimb}%
+ \@defaultunitsset\@tempdimc{#4}\unitlength
+ \@defaultunitsset\@tempdimb{#5}\unitlength
+ \@defaultunitsset\@tempdima{#6}\unitlength
+ \@defaultunitsset\dimen@{#7}\unitlength
+ \@defaultunitsset\@ovxx{#8}\unitlength
+ \@defaultunitsset\@ovyy{#9}\unitlength
+ \pIIe@curveto{\@tempdimc}{\@tempdimb}%
+ {\@tempdima}{\dimen@}{\@ovxx}{\@ovyy}%
\pIIe@strokeGraph
\ignorespaces}%
}