diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-09 23:57:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-09 23:57:25 +0000 |
commit | b00d598c405e2f58e2be6d3511013787b40954dd (patch) | |
tree | 8e5a25852a4e6992de5095fcc97cf5e52cc53de6 /Master/texmf-dist/tex/latex/xypdf | |
parent | 6f566f4c50f0a9f580b47c6c30b0f58531baaacf (diff) |
xypdf 1.2 (8apr10)
git-svn-id: svn://tug.org/texlive/trunk@17777 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xypdf')
-rw-r--r-- | Master/texmf-dist/tex/latex/xypdf/xypdf.sty | 738 |
1 files changed, 474 insertions, 264 deletions
diff --git a/Master/texmf-dist/tex/latex/xypdf/xypdf.sty b/Master/texmf-dist/tex/latex/xypdf/xypdf.sty index 904dc3cc8c5..39b96dbc1b1 100644 --- a/Master/texmf-dist/tex/latex/xypdf/xypdf.sty +++ b/Master/texmf-dist/tex/latex/xypdf/xypdf.sty @@ -39,12 +39,15 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xypdf} - [2010/03/30 v1.1 PDF output for the Xy-pic package] + [2010/04/08 v1.2 PDF output for the Xy-pic package] \@ifpackageloaded{xy}\relax {\PackageError{xypdf}{Load the Xy-pic package before this package} {Insert `\string\usepackage[<options>]{xy}' before `\string\usepackage{xypdf}'}} \xywithoption{ps}{\PackageError{xypdf}{Do not load Xy-pic with a Postscript backend}{}} +\ifx\unexpanded\@undefined +\PackageError{xypdf}{eTeX is needed for the xypdf package}{} +\fi \RequirePackage{ifpdf} \newcommand*\xypdfon{} \newcommand*\xypdfoff{} @@ -59,23 +62,99 @@ \let\xP@hook\@undefined \let\xP@tempvar\@undefined \let\@tempa\@undefined +\let\next@\undefined \let\xP@gobblepart\@undefined \let\xP@endgobble\@undefined } -\@ifdefinable\xP@literal\relax \ifpdf -\let\xP@literal\pdfliteral +\newcommand*\xP@literal[1]{\pdfsave\pdfliteral{#1}\pdfrestore} +\newcommand*\xP@cm[5]{\pdfsave +\pdfsetmatrix{#1 #2 #3 #4}#5\pdfrestore +} \else -\def\xP@literal{\PackageWarning{xypdf}{The produced DVI file is NOT PORTABLE. Convert it with^^Jdvipdfm(x) to the PDF format but do not expect the DVI itself to be displayed^^Jcorrectly\@gobble}\global\let\xP@literal\xP@literal@ +\newcommand*\xP@literal{\PackageWarning{xypdf}{The produced DVI file is NOT PORTABLE. Convert it with^^Jdvipdfm(x) to the PDF format but do not expect the DVI file itself to be^^Jdisplayed correctly\@gobble}\global\let\xP@literal\xP@literal@ \xP@literal } -\newcommand*\xP@literal@[1]{\special{pdf:literal #1}} +\newcommand*\xP@literal@[1]{\special{pdf:content #1}} +\newcommand*\xP@cm[5]{\special{pdf:btrans matrix #1 #2 #3 #4 0 0}#5\special{pdf:etrans}} +\fi +\ifx\pdfdecimaldigits\@undefined +\newcommand*\xP@digits{2} +\else +\@ifdefinable\xP@digits\relax +\xdef\xP@digits{\the\pdfdecimaldigits} +\ifnum\pdfdecimaldigits<2 +\PackageWarning{xypdf}{The precision in \string\pdfdecimaldigits\space is only \xP@digits\space +decimals.^^JIt is recommended to set \string\pdfdecimaldigits\space to 2 or 3 for best output quality\@gobble} +\fi \fi -\newcommand*\xP@dim[1]{\xP@EARPT\dimexpr(#1)*800/803\relax\space} +\newcommand*\xP@dim[1]{\expandafter\xP@removePT\the\dimexpr(#1)*800/803\relax\space} +\newcommand*\xP@precdim[1]{\xP@EARPT\dimexpr(#1)*800/803\relax\space} \newcommand*\xP@EARPT{\expandafter\removePT@\the} \newcommand*\xP@coor[1]{\xP@dim{#1}\xP@dim} +\@ifdefinable\xP@removePT\relax +{\catcode`\p=12\catcode`\t=12\gdef\xP@removePT#1pt{\xP@removePT@#10000@}} +\@ifdefinable\xP@removePT@\relax +\ifcase\xP@digits +\def\xP@removePT@#1.#2#3@{\ifnum#2<5 +#1\else +\the\numexpr-\if-#1-\else-#1+\fi\@ne\relax +\fi +} +\or +\def\xP@removePT@#1#2.#3#4#5@{\ifnum#4<5 +#1#2\if#30\else +.#3\fi +\else +\expandafter\xP@removePT +\the\dimexpr#1#2.#3pt+\if#1--\fi.12pt\relax +\fi +} +\or +\def\xP@removePT@#1#2.#3#4#5#6@{\ifnum#5<5 +#1#2\if#40\if#30\else +.#3\fi +\else +.#3#4\fi +\else +\expandafter\xP@removePT +\the\dimexpr#1#2.#3#4pt+\if#1--\fi786sp\relax +\fi +} +\or +\def\xP@removePT@#1#2.#3#4#5#6#7@{\ifnum#6<5 +#1#2\if#50\if#40\if#30\else +.#3\fi +\else +.#3#4\fi +\else +.#3#4#5\fi +\else +\expandafter\xP@removePT +\the\dimexpr#1#2.#3#4#5pt+\if#1--\fi79sp\relax +\fi +} +\or +\def\xP@removePT@#1#2.#3#4#5#6#7#8@{\ifnum#7<5 +#1#2\if#60\if#50\if#40\if#30\else +.#3\fi +\else +.#3#4\fi +\else +.#3#4#5\fi +\else +.#3#4#5#6\fi +\else +\expandafter\xP@removePT +\the\dimexpr#1#2.#3#4#5#6pt+\if#1--\fi8sp\relax +\fi +} +\else +\let\xP@dim\xP@precdim +\fi \AtBeginDocument{{\setbox0\hbox{$ $}}\@ifdefinable\xP@lw\relax -\edef\xP@lw{\xP@dim{\fontdimen8\textfont3}}\PackageInfo{xypdf}{Line width: \the\fontdimen8\textfont3 }} +\@ifdefinable\xP@preclw\relax +\edef\xP@preclw{\the\fontdimen8\textfont3}\edef\xP@lw{\xP@dim\xP@preclw}\PackageInfo{xypdf}{Line width: \xP@preclw}} \xP@hook{solid@} \newcommand*\xP@solid@{\straight@\xP@solidSpread} \@ifdefinable\xP@solidSpread\relax @@ -90,36 +169,56 @@ \xP@stroke{\xP@coor\X@p\Y@p m \xP@coor\X@c\Y@c l}\fi }} \newcommand*\xP@pattern{} -\newcommand*\xP@setsolidpat{\def\xP@pattern{1 J 1 j []0 d }} -\newcommand*\xP@stroke[1]{\xP@literal{q \xP@lw w \xP@pattern#1 S Q}} +\newcommand*\xP@setsolidpat{\def\xP@pattern{1 J 1 j []0 d}\global\let\xP@lastpattern\xP@solidmacro +} +\newcommand*\xP@stroke[1]{\xP@literal{\xP@lw w \xP@pattern\space#1 S}} \xP@hook{dash@} \newcommand\xP@dash@{\line@\def\Connect@@{\straight@\xP@dashedSpread}} \@ifdefinable\xP@dashedSpread\relax \def\xP@dashedSpread#1\repeat@{{\xP@veclen \ifdim\@tempdimb>\z@ \xP@setdashpat +\xP@savec \xP@stroke{\xP@coor\X@p\Y@p m \xP@coor\X@c\Y@c l}\fi }} -\newcommand*\xP@setdashpat{\edef\xP@pattern{1 J 1 j [\ifdim\@tempdimb>\xydashl@ -\xP@dim{\@tempdimb/(2*\numexpr(\@tempdimb+\xydashl@)/(2*\xydashl@)\relax-1)}\fi -]0 d }} +\newcommand*\xP@setdashpat{\xP@testcont\xP@dashmacro +\ifxP@splinecont +{\count@\numexpr2*((\@tempdimb-\xydashl@/3)/(2*\xydashl@))\relax +\xdef\@gtempa{\ifnum\count@>\z@\xP@dim{\@tempdimb/\count@}\fi}}\edef\xP@pattern{1 J 1 j [\@gtempa]\ifx\@gtempa\empty0 \else\@gtempa\fi d}\else +\edef\xP@pattern{1 J 1 j [\ifdim\@tempdimb>\xydashl@ +\xP@dim{\@tempdimb/(2*((\@tempdimb+\xydashl@)/(2*\xydashl@))-1)}\fi +]0 d}\fi +\global\let\xP@lastpattern\xP@dashmacro +} \xP@hook{point@} \newcommand*\xP@point@{\xP@zerodot\egroup\Invisible@false \Hidden@false\def\Leftness@{.5}\def\U@pness@{.5}\ctipEdge@ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@\xP@dottedSpread}} -\newcommand*\xP@zerodotpattern{\def\xP@pattern{2 J [0 2]0 d }} -\newcommand*\xP@zerodot{\xP@zerodotpattern -\xP@stroke{0 0 m 1 0 l}} +\newcommand*\xP@zerodot{\hb@xt@\z@{\hss +\vbox to\z@{\vss\hrule\@width\xP@preclw\@height\xP@preclw\vss}\hss}} \@ifdefinable\xP@dottedSpread\relax \def\xP@dottedSpread#1\repeat@{{\xP@veclen \ifdim\@tempdimb>\z@ \xP@setdottedpat +\xP@savec \xP@stroke{\xP@coor\X@p\Y@p m \xP@coor\X@c\Y@c l}\fi }} -\newcommand*\xP@setdottedpat{\edef\xP@pattern{2 J [\ifdim\@tempdimb>\xP@lw bp -0 \xP@dim{\@tempdimb/\numexpr\@tempdimb/131072+1\relax}\fi -]0 d -}} +\newcommand*\xP@setdottedpat{\xP@testcont\xP@dotmacro +\ifxP@splinecont +\@tempdima\dimexpr\@tempdimb/(\@tempdimb/131072+1)-\xP@preclw\relax +\edef\xP@pattern{0 J [\ifdim\@tempdima>\z@ +\xP@precdim\xP@preclw\xP@precdim\@tempdima +\fi +]\xP@precdim{\xP@preclw+1sp}d}\else +\advance\@tempdimb-\xP@preclw +\ifdim\@tempdimb<\z@\@tempdimb\z@\fi +\@tempdima\dimexpr\@tempdimb/(\@tempdimb/131072+1)-\xP@preclw\relax +\edef\xP@pattern{0 J [\ifdim\@tempdima>\z@ +\xP@lw\xP@dim\@tempdima +\fi +]0 d}\fi +\global\let\xP@lastpattern\xP@dotmacro +} \newcommand*\xP@abs[1]{\ifdim#1<\z@\multiply#1\m@ne\fi} \ifx\ifpdfabsdim\@undefined \newcommand*\xP@ifabsless[2]{\ifdim\ifdim#1<\z@-\fi#1<\ifdim#2<\z@-\fi#2} @@ -128,7 +227,6 @@ \newcommand*\xP@ifabsless[2]{\ifpdfabsdim#1<#2} \@gobble\fi \fi -\newcommand*\xP@ifabsless@[4]{\xP@ifabsless{\dimexpr#1\relax}{\dimexpr#2\relax}#3\else#4\fi} \newcommand*\xP@swapdim[2]{\@tempdima#1#1#2#2\@tempdima} \newcommand*\xP@swapnum[2]{\@tempcnta#1#1#2#2\@tempcnta} \newcommand*\xP@max[2]{\ifdim#1>#2#1\else#2\fi} @@ -193,18 +291,31 @@ \ifnum\@tempcnta<\tw@\@tempcnta\tw@\fi \@tempdima\dimexpr\d@X/\@tempcnta\relax \@tempdimc\dimexpr\d@Y/\@tempcnta\relax +\xP@testcont\xP@oddsquigglemacro +\ifxP@splinecont +\def\xP@squigsign{-}\else +\let\xP@squigsign\empty +\fi \count@\z@ \loop \xP@append\toks@{\xP@coor{\X@p+\d@X*\count@/\@tempcnta+(\@tempdima --\ifodd\count@-\fi\@tempdimc)*147546029/534618434}{\Y@p+\d@Y*\count@/\@tempcnta+(\@tempdimc -+\ifodd\count@-\fi\@tempdima)*147546029/534618434}}\advance\count@\@ne +-\xP@squigsign\ifodd\count@-\fi\@tempdimc)*147546029/534618434}{\Y@p+\d@Y*\count@/\@tempcnta+(\@tempdimc ++\xP@squigsign\ifodd\count@-\fi\@tempdima)*147546029/534618434}}\advance\count@\@ne \xP@append\toks@{\xP@coor{\X@p+\d@X*\count@/\@tempcnta-(\@tempdima --\ifodd\count@-\fi\@tempdimc)*147546029/534618434}{\Y@p+\d@Y*\count@/\@tempcnta-(\@tempdimc -+\ifodd\count@-\fi\@tempdima)*147546029/534618434}\xP@coor{\X@p+\d@X*\count@/\@tempcnta}{\Y@p+\d@Y*\count@/\@tempcnta}c }\ifnum\count@<\@tempcnta +-\xP@squigsign\ifodd\count@-\fi\@tempdimc)*147546029/534618434}{\Y@p+\d@Y*\count@/\@tempcnta-(\@tempdimc ++\xP@squigsign\ifodd\count@-\fi\@tempdima)*147546029/534618434}\xP@coor{\X@p+\d@X*\count@/\@tempcnta}{\Y@p+\d@Y*\count@/\@tempcnta}c }\ifnum\count@<\@tempcnta \repeat \xP@setsolidpat +\global\expandafter\let\expandafter\xP@lastpattern +\ifodd\numexpr\count@\if\xP@squigsign-+1\fi\relax +\xP@oddsquigglemacro +\else +\xP@evensquigglemacro +\fi +\xP@savec \xP@stroke{\the\toks@}\fi }} +\newcommand*\xP@squigsign{} \newcommand*\xP@append[2]{{\edef\@tempa{#1{\the#1#2}}\expandafter}\@tempa } \xP@hook{circhar@@} @@ -230,23 +341,22 @@ } \newcommand*\xP@optionerror[1]{\PackageError{xypdf}{Load the Xy-pic "#1" option before the xypdf package}{}} \@ifdefinable\xP@gobblepart\relax -\long\def\xP@gobblepart#1\xP@endgobble{} +\def\xP@gobblepart#1\xP@endgobble{} \newcommand*\xP@endgobble{\relax} \xP@optionalsection{rotate} \newcommand*\xP@scale[2]{\setboxz@h{\hskip\L@p \hskip-\R@p -\lower\U@p\hbox{\xP@literal{q #1\space0 0 #2\space0 0 cm}\raise\U@p\hb@xt@\z@{\hskip-\L@p\boxz@\hss}\xP@literal{Q}}}} -\newcommand\xP@rotate{\xP@rotate@\xP@trigfromdir +\lower\U@p\hbox{\xP@cm{#1}00{#2}{\raise\U@p\hb@xt@\z@{\hskip-\L@p\boxz@\hss}}}}\global\let\xP@lastpattern\empty } +\newcommand\xP@rotate{\xP@rotate@\xP@trigfromdir} \@ifdefinable\xP@specialrotate\relax -\def\xP@specialrotate#1@@{\xP@rotate@\xP@trig{#1\p@}} +\def\xP@specialrotate#1@@{\xP@rotate@\xP@trig{#1pt}} \newcommand*\xP@rotate@[2]{\setboxz@h{#1{#2}\hskip\L@p \hskip-\R@p -\lower\U@p\hbox{\xP@literal{q \cosDirection\space -\sinDirection\space -\if-\sinDirection\else-\sinDirection\fi\space -\cosDirection\space -0 0 cm}\raise\U@p\hb@xt@\z@{\hskip-\L@p\boxz@\hss}\xP@literal{Q}}}} +\lower\U@p\hbox{\xP@cm\cosDirection\sinDirection +{\if-\sinDirection\else-\sinDirection\fi}\cosDirection +{\raise\U@p\hb@xt@\z@{\hskip-\L@p\boxz@\hss}}}}\global\let\xP@lastpattern\empty +} \CheckCommand*\xyRotate@@[1]{\xyundefinedRotate@{rotate}{#1}@@} \let\xyRotate@@\xP@rotate \def\@tempa#1@@{\xyundefinedRotate@{special rotate}{#1}@@} @@ -412,6 +522,8 @@ \xP@tempvar\xP@oldpar\X@ybase \xP@tempvar\xP@lastpar\Y@ybase \xP@tempvar\xP@tempvel@\X@min +\xP@tempvar\xP@parinc\Y@min +\xP@tempvar\xP@squiglen\almostz@ \xP@tempvar\xP@scaleone\K@ \xP@tempvar\xP@scaletwo\KK@ \xP@tempvar\xP@scalethree\Direction @@ -425,7 +537,8 @@ \ifdim\dimen5<\dimen7 \xP@preparespline \ifdim\@tempdimb>\z@ -#1\xP@stroke{\xP@coor\X@p\Y@p m \xP@coor\L@c\U@c\xP@coor\R@c\D@c\xP@coor\X@c\Y@c c}\fi +#1\xP@stroke{\xP@coor\X@p\Y@p m \xP@coor\L@c\U@c\xP@coor\R@c\D@c\xP@coor\X@c\Y@c c}\xP@savec +\fi \fi } \newcommand*\xP@preparespline{\ifx\splineinfo@\squineinfo@ @@ -463,62 +576,59 @@ \fi }\@gtempa } -\newcommand*\xP@bezierlength{{\@tempdimb\z@ +\newcommand*\xP@bezierlength{{\xP@inibigdim +\@tempdimb\z@ \xP@parA\z@ \xP@velocity\z@\xP@velA -\xP@parC.5\p@ +\xP@parC.5\xP@bigdim \xP@velocity\xP@parC\xP@velC -\xP@velocity\p@\xP@velE +\xP@velocity\xP@bigdim\xP@velE \xP@oldpartlen\dimexpr(\xP@velA+4\xP@velC+\xP@velE)/6\relax -\xP@tolerance\xP@max{1sp}{\dimexpr\xP@oldpartlen/\p@\relax}\xP@arclength\xP@parC\xP@velC\p@\xP@velE\xP@oldpartlen +\xP@tolerance\xP@max{1sp}{\dimexpr\xP@oldpartlen/100000\relax}\xP@arclength\xP@parC\xP@velC\xP@bigdim\xP@velE\xP@oldpartlen \global\dimen@i\@tempdimb }\@tempdimb\dimen@i } \newcommand*\xP@velocity[2]{{\@tempdima\dimexpr#1\relax -\xP@velocity@ +\xP@tangent \global\dimen@i\@tempdimb }#2\dimen@i } -\newcommand*\xP@velocity@{\L@p\dimexpr\L@c-\X@p\relax -\U@p\dimexpr\U@c-\Y@p\relax -\d@X3\dimexpr((\X@c+(\L@c-\R@c)*3-\X@p)*\@tempdima/\p@ -+(\R@c-\L@p-\L@c)*2)*\@tempdima/\p@+\L@p\relax -\d@Y3\dimexpr((\Y@c+(\U@c-\D@c)*3-\Y@p)*\@tempdima/\p@ -+(\D@c-\U@p-\U@c)*2)*\@tempdima/\p@+\U@p\relax +\newcommand*\xP@tangent{\d@X3\xP@precbeziertan\X@p\L@c\R@c\X@c\@tempdima +\d@Y3\xP@precbeziertan\Y@p\U@c\D@c\Y@c\@tempdima \xP@veclen } -\newcommand*\xP@velocity@@{\R@p\dimexpr\xP@xb-\xP@xa\relax -\D@p\dimexpr\xP@yb-\xP@ya\relax -\d@X3\dimexpr((\xP@xd+(\xP@xb-\xP@xc)*3-\xP@xa)*\@tempdima/\p@ -+(\xP@xc-\R@p-\xP@xb)*2)*\@tempdima/\p@+\R@p\relax -\d@Y3\dimexpr((\xP@yd+(\xP@yb-\xP@yc)*3-\xP@ya)*\@tempdima/\p@ -+(\xP@yc-\D@p-\xP@yb)*2)*\@tempdima/\p@+\D@p\relax +\newcommand*\xP@tangentvec[1]{{\@tempdima#1\relax +\xP@tangent +\ifdim\@tempdimb=\z@ +\L@p\dimexpr\X@c-\X@p+(\L@c-\R@c)*3\relax +\U@p\dimexpr\Y@c-\Y@p+(\U@c-\D@c)*3\relax +\d@X\dimexpr\L@p*\@tempdima/\xP@bigdim+(\X@p-2\L@c+\R@c)\relax +\d@Y\dimexpr\U@p*\@tempdima/\xP@bigdim+(\Y@p-2\U@c+\D@c)\relax \xP@veclen -} -\newcommand*\xP@normalvec[2]{{\@tempdima#1\relax -\@tempdimc#2\relax -\xP@velocity@ \ifdim\@tempdimb=\z@ -\d@X\dimexpr\xP@xd+(\xP@xb-\xP@xc)*3-\xP@xa\relax -\d@Y\dimexpr\xP@yd+(\xP@yb-\xP@yc)*3-\xP@ya\relax +\d@X\L@p +\d@Y\U@p \xP@veclen \ifdim\@tempdimb=\z@ -\PackageError{xypdf}{Cannot determine a tangent vector to a curve}{}\@tempdimb\p@ +\PackageWarning{xypdf}{Cannot determine a tangent vector to a curve}\@tempdimb\p@ +\fi \fi \fi -\global\dimen@i\dimexpr\@tempdimc*\d@Y/\@tempdimb\relax -\global\dimen3\dimexpr-\@tempdimc*\d@X/\@tempdimb\relax +\global\dimen@i\d@X +\global\dimen3\d@Y +\global\dimen5\@tempdimb }\d@X\dimen@i \d@Y\dimen3\relax +\@tempdimb\dimen5\relax } \newcommand*\xP@arclength[5]{\xP@parE#3\xP@velE#4\xP@parC#1\xP@velC#2\xP@oldpartlen#5\xP@parB\dimexpr(\xP@parC+\xP@parA)/2\relax \xP@velocity\xP@parB\xP@velB \xP@parD\dimexpr(\xP@parE+\xP@parC)/2\relax \xP@velocity\xP@parD\xP@velD \xP@lenA -\dimexpr(\xP@velA+4\xP@velB+\xP@velC)*(\xP@parC-\xP@parA)/393216\relax +\dimexpr(\xP@velA+4\xP@velB+\xP@velC)/6*(\xP@parC-\xP@parA)/\xP@bigdim\relax \xP@lenB -\dimexpr(\xP@velC+4\xP@velD+\xP@velE)*(\xP@parE-\xP@parC)/393216\relax +\dimexpr(\xP@velC+4\xP@velD+\xP@velE)/6*(\xP@parE-\xP@parC)/\xP@bigdim\relax \xP@partlen\dimexpr\xP@lenA+\xP@lenB\relax {\@tempdima\dimexpr\xP@oldpartlen-\xP@partlen\relax \expandafter}\ifdim\ifdim\@tempdima<\z@-\fi\@tempdima>\xP@tolerance @@ -576,8 +686,8 @@ \DN@{\splineset@@}\fi \ifInvisible@\DN@{}\fi \next@ } \xP@hook{xysplinespecialcases@} \newcommand*\xP@xysplinespecialcases@{\ifx\empty\xycrvdrop@ -\ifx\empty\xycrvconn@ \DN@{\splinesolid@}\else \DN@{ \dir{-}}\ifx\next@\xycrvconn@ \DN@{\splinesolid@}\else \DN@{ \dir 2{-}}\ifx\next@\xycrvconn@ \DN@{\splinedoubled@}\else \DN@{ \dir{=}}\ifx\next@\xycrvconn@ \DN@{\splineribboned@}\else \DN@{ \dir {2.}}\ifx\next@\xycrvconn@ \DN@{\splinedoubled@}\else \DN@{ \dir 3{-}}\ifx\next@\xycrvconn@ \DN@{\splinetrebled@}\else \DN@{ \dir {3.}}\ifx\next@\xycrvconn@ \DN@{\splinetrebled@}\else \DN@{ \dir{--}}\ifx\next@\xycrvconn@ \DN@{\splinedashed@}\else \DN@{ \dir{.}}\ifx\next@\xycrvconn@ \DN@{\splinedotted@}\else \DN@{ \dir{:}}\ifx\next@\xycrvconn@ \DN@{\splinedbldotted@}\else \DN@{ \dir3{.}}\ifx\next@\xycrvconn@ \DN@{\xP@splinetrbldotted}\else \DN@{ \dir2{--}}\ifx\next@\xycrvconn@ \DN@{\xP@splinedbldashed}\else \DN@{ \dir3{--}}\ifx\next@\xycrvconn@ \DN@{\xP@splinetrbldashed}\else \DN@{ \dir{~}}\ifx\next@\xycrvconn@ \DN@{\xP@splinesquiggled}\else \DN@{ \dir2{~}}\ifx\next@\xycrvconn@ \DN@{\xP@splinedblsquiggled}\else \DN@{ \dir3{~}}\ifx\next@\xycrvconn@ \DN@{\xP@splinetrblsquiggled}\else \ifdim\splinetol@>\z@ \else \splinedefaulttol@ \fi -\DN@{\splineset@@}\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi +\ifx\empty\xycrvconn@ \DN@{\splinesolid@}\else \DN@{ \dir{-}}\ifx\next@\xycrvconn@ \DN@{\splinesolid@}\else \DN@{ \dir 2{-}}\ifx\next@\xycrvconn@ \DN@{\splinedoubled@}\else \DN@{ \dir{=}}\ifx\next@\xycrvconn@ \DN@{\splineribboned@}\else \DN@{ \dir {2.}}\ifx\next@\xycrvconn@ \DN@{\splinedoubled@}\else \DN@{ \dir 3{-}}\ifx\next@\xycrvconn@ \DN@{\splinetrebled@}\else \DN@{ \dir {3.}}\ifx\next@\xycrvconn@ \DN@{\splinetrebled@}\else \DN@{ \dir{--}}\ifx\next@\xycrvconn@ \DN@{\splinedashed@}\else \DN@{ \dir{.}}\ifx\next@\xycrvconn@ \DN@{\splinedotted@}\else \DN@{ \dir{:}}\ifx\next@\xycrvconn@ \DN@{\splinedbldotted@}\else \DN@{ \dir2{.}}\ifx\next@\xycrvconn@ \DN@{\splinedbldotted@}\else \DN@{ \dir3{.}}\ifx\next@\xycrvconn@ \DN@{\xP@splinetrbldotted}\else \DN@{ \dir2{--}}\ifx\next@\xycrvconn@ \DN@{\xP@splinedbldashed}\else \DN@{ \dir3{--}}\ifx\next@\xycrvconn@ \DN@{\xP@splinetrbldashed}\else \DN@{ \dir{~}}\ifx\next@\xycrvconn@ \DN@{\xP@splinesquiggled}\else \DN@{ \dir2{~}}\ifx\next@\xycrvconn@ \DN@{\xP@splinedblsquiggled}\else \DN@{ \dir3{~}}\ifx\next@\xycrvconn@ \DN@{\xP@splinetrblsquiggled}\else \ifdim\splinetol@>\z@ \else \splinedefaulttol@ \fi +\DN@{\splineset@@}\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \else \DN@{\splineset@@}\fi \ifInvisible@\DN@{}\fi \next@ } \xP@hook{splinedoubled@} @@ -594,7 +704,7 @@ \ifdim\dimen5<\dimen7 \xP@preparespline \ifdim\@tempdimb>\z@ -\ifdim\@tempdimb<\xP@lw bp +\ifdim\@tempdimb<2\dimexpr\xP@preclw\relax \let\next@\xP@splinemultsolid \else \let\next@#1\fi @@ -618,7 +728,6 @@ \else \loop \xP@restorepts -\xP@shaveprec\xP@a\xP@b \xP@offsetsegment \xP@testoffset \ifxP@offsetok @@ -633,6 +742,9 @@ \expandafter\xP@paintsolid@ \fi } +\@ifdefinable\ifxP@moveto\relax +\@ifdefinable\xP@movetotrue\relax +\@ifdefinable\xP@movetofalse\relax \newif\ifxP@moveto \newcommand*\xP@savepts{\xP@xa\X@p \xP@ya\Y@p @@ -657,55 +769,74 @@ \newcommand*\xP@Tmxy{*\xP@Tmx/\xP@Tmy} \newcommand*\xP@Tmyx{*\xP@Tmy/\xP@Tmx} \newcommand*\xP@Tmzero{*\z@} -\newcommand*\xP@offsetsegment{{\xP@fa\p@ +\newcommand*\xP@offsetsegment{{\xP@tangentvec\xP@a +\xP@xa\dimexpr\xP@precbezierpoly\X@p\L@c\R@c\X@c\xP@a/8+\d@Y*\xP@off/\@tempdimb\relax +\xP@ya\dimexpr\xP@precbezierpoly\Y@p\U@c\D@c\Y@c\xP@a/8-\d@X*\xP@off/\@tempdimb\relax +\xP@scaleT +\xP@Tax\d@X +\xP@Tay\d@Y +\xP@E\@tempdimb +\xP@tangentvec\xP@b +\xP@xd\dimexpr\xP@precbezierpoly\X@p\L@c\R@c\X@c\xP@b/8+\d@Y*\xP@off/\@tempdimb\relax +\xP@yd\dimexpr\xP@precbezierpoly\Y@p\U@c\D@c\Y@c\xP@b/8-\d@X*\xP@off/\@tempdimb\relax +\xP@scaleT +\xP@Tdx-\d@X +\xP@Tdy-\d@Y +\xP@F\@tempdimb +\xP@M\z@ +\xP@Max\xP@M\xP@Tdx +\xP@Max\xP@M\xP@Tdy +\xP@L\dimexpr\xP@Tax*\xP@Tdx/\xP@M+\xP@Tay*\xP@Tdy/\xP@M\relax +\xP@tm\dimexpr(\xP@a+\xP@b)/2\relax +\ifdim\xP@L>\dimexpr\xP@E*\xP@F/\xP@M*49/50\relax +\d@X-\dimexpr\xP@Tay+\xP@Tdy\relax +\d@Y\dimexpr\xP@Tax+\xP@Tdx\relax +\xP@veclen +\xP@A\dimexpr\X@c-\X@p\relax +\xP@B\dimexpr\Y@c-\Y@p\relax +\xP@M\z@ +\xP@Max\xP@M\xP@A +\xP@Max\xP@M\xP@B +\ifdim\xP@M=\z@ +\xP@A\dimexpr\R@c-\L@c\relax +\xP@B\dimexpr\D@c-\U@c\relax +\xP@Max\xP@M\xP@A +\xP@Max\xP@M\xP@B +\fi +\xP@M\dimexpr\d@X*\xP@A/\xP@M+\d@Y*\xP@B/\xP@M\relax +\ifdim\xP@M<\z@ +\multiply\d@X\m@ne +\multiply\d@Y\m@ne +\fi +\else +\xP@tangentvec\xP@tm +\fi +\xP@xm\dimexpr\xP@precbezierpoly\X@p\L@c\R@c\X@c\xP@tm ++8\d@Y*\xP@off/\@tempdimb\relax +\xP@ym\dimexpr\xP@precbezierpoly\Y@p\U@c\D@c\Y@c\xP@tm +-8\d@X*\xP@off/\@tempdimb\relax +\xP@Tmx\d@X +\xP@Tmy\d@Y +\xP@ifabsless\xP@Tmy\xP@Tmx +\let\xP@tmy\xP@Tmyx +\let\xP@tmx\empty +\else +\ifdim\xP@Tmy=\z@ +\let\xP@tmx\xP@Tmzero +\let\xP@tmy\xP@Tmzero +\else +\let\xP@tmy\empty +\let\xP@tmx\xP@Tmxy +\fi +\fi +\xP@fa\p@ \xP@fd\p@ \xP@tm\p@ -\xP@normalvec{.5pt}\xP@off -\xP@xm\dimexpr(\X@p+\X@c+(\L@c+\R@c)*3)+8\d@X\relax -\xP@ym\dimexpr(\Y@p+\Y@c+(\U@c+\D@c)*3)+8\d@Y\relax -\xP@normalvec\z@\xP@off -\xP@xa\dimexpr\X@p+\d@X\relax -\xP@ya\dimexpr\Y@p+\d@Y\relax -\xP@normalvec\p@\xP@off -\xP@xd\dimexpr\X@c+\d@X\relax -\xP@yd\dimexpr\Y@c+\d@Y\relax -\xP@Tax\dimexpr\L@c-\X@p\relax -\xP@Tay\dimexpr\U@c-\Y@p\relax -\ifdim\xP@Tax=\z@ -\ifdim\xP@Tay=\z@ -\xP@Tax\dimexpr\R@c-\X@p\relax -\xP@Tay\dimexpr\D@c-\Y@p\relax -\ifdim\xP@Tax=\z@ -\ifdim\xP@Tay=\z@ -\xP@Tax\dimexpr\X@c-\X@p\relax -\xP@Tay\dimexpr\Y@c-\Y@p\relax -\fi -\fi -\fi -\fi -\multiply\xP@Tax\thr@@ -\multiply\xP@Tay\thr@@ -\xP@Tdx\dimexpr\R@c-\X@c\relax -\xP@Tdy\dimexpr\D@c-\Y@c\relax -\ifdim\xP@Tdx=\z@ -\ifdim\xP@Tdy=\z@ -\xP@Tdx\dimexpr\L@c-\X@c\relax -\xP@Tdy\dimexpr\U@c-\Y@c\relax -\ifdim\xP@Tdx=\z@ -\ifdim\xP@Tdy=\z@ -\xP@Tdx\dimexpr\X@p-\X@c\relax -\xP@Tdy\dimexpr\Y@p-\Y@c\relax -\fi -\fi -\fi -\fi -\multiply\xP@Tdx\thr@@ -\multiply\xP@Tdy\thr@@ \count@\z@ \loop +\xP@offsetpoints \@tempswafalse \ifnum10>\count@ -\xP@offsetpoints \xP@objfun\xP@oldobj \ifdim\xP@oldobj>\xP@maxobjfun\relax\@tempswatrue\fi \fi @@ -716,6 +847,15 @@ \L@c\the\xP@xb\U@c\the\xP@yb\R@c\the\xP@xc\D@c\the\xP@yc \X@c\the\xP@xd\Y@c\the\xP@yd\relax}}\@gtempa } +\newcommand*\xP@scaleT{\xP@B6.28\xP@off +\xP@abs\xP@B +\xP@C\dimexpr\d@X*\xP@B/\@tempdimb\relax +\xP@D\dimexpr\d@Y*\xP@B/\@tempdimb\relax +\xP@A\dimexpr\xP@b-\xP@a\relax +\d@X\dimexpr\xP@C+\d@X*\xP@A/\xP@bigdim\relax +\d@Y\dimexpr\xP@D+\d@Y*\xP@A/\xP@bigdim\relax +\@tempdimb\dimexpr\xP@B+\@tempdimb*\xP@A/\xP@bigdim\relax +} \newcommand*\xP@offsetloop{\xP@C\dimexpr\xP@C/2\relax \xP@G\dimexpr\xP@G/2\relax \xP@ta\dimexpr2\p@-\xP@tm\relax @@ -726,10 +866,8 @@ \xP@F\dimexpr\xP@Tdy*\xP@tb/\p@*\xP@tm/\p@\relax \xP@tb\dimexpr2\p@-3\xP@tm\relax \xP@tc\dimexpr\xP@tb+2\p@\relax -\xP@I\dimexpr(2\xP@Tay\xP@tmx-2\xP@Tax\xP@tmy) -*\xP@tb/\p@*\xP@ta/\p@\relax -\xP@J\dimexpr(2\xP@Tdy\xP@tmx-2\xP@Tdx\xP@tmy) -*\xP@tc/\p@*\xP@tm/\p@\relax +\xP@I\dimexpr(2\xP@Tay\xP@tmx-2\xP@Tax\xP@tmy)*\xP@tb/\p@*\xP@ta/\p@\relax +\xP@J\dimexpr(2\xP@Tdy\xP@tmx-2\xP@Tdx\xP@tmy)*\xP@tc/\p@*\xP@tm/\p@\relax \xP@K\dimexpr((\xP@yd-\xP@ya+(\xP@yb-\xP@yc)*3) *\xP@tm/\p@+(\xP@yc-2\xP@yb+\xP@ya)*2)*12\xP@tmx -((\xP@xd-\xP@xa+(\xP@xb-\xP@xc)*3) @@ -750,7 +888,7 @@ \advance\xP@fd-\xP@tb \advance\xP@tm-\xP@tc \ifdim\xP@tm<\z@\xP@tm\z@\fi -\ifdim\xP@tm>\tw@\p@\xP@tm\tw@\p@\fi +\ifdim\xP@tm>2\p@\xP@tm2\p@\fi \fi \advance\count@\@ne } @@ -769,7 +907,7 @@ \xP@M\xP@tm \advance\xP@tm-\xP@tc \ifdim\xP@tm<\z@\xP@tm\z@\fi -\ifdim\xP@tm>\tw@\p@\xP@tm\tw@\p@\fi +\ifdim\xP@tm>2\p@\xP@tm2\p@\fi {\xP@offsetpoints \xP@objfun\xP@M \expandafter}\ifdim\xP@M>\xP@oldobj @@ -779,24 +917,8 @@ \xP@validsolfalse \fi } -\newcommand*\xP@objfun[1]{\xP@D\xP@bezierpoly\xP@xa\xP@xb\xP@xc\xP@xd\xP@tm -\xP@D\dimexpr\xP@D-\xP@xm\relax -\xP@H\xP@bezierpoly\xP@ya\xP@yb\xP@yc\xP@yd\xP@tm -\xP@H\dimexpr\xP@H-\xP@ym\relax -\xP@Tmx\dimexpr\X@p-\X@c+\L@c-\R@c\relax -\xP@Tmy\dimexpr\Y@p-\Y@c+\U@c-\D@c\relax -\xP@ifabsless\xP@Tmy\xP@Tmx -\let\xP@tmy\xP@Tmyx -\let\xP@tmx\empty -\else -\ifdim\xP@Tmy=\z@ -\let\xP@tmx\xP@Tmzero -\let\xP@tmy\xP@Tmzero -\else -\let\xP@tmy\empty -\let\xP@tmx\xP@Tmxy -\fi -\fi +\newcommand*\xP@objfun[1]{\xP@D\dimexpr\xP@bezierpoly\xP@xa\xP@xb\xP@xc\xP@xd\xP@tm-\xP@xm\relax +\xP@H\dimexpr\xP@bezierpoly\xP@ya\xP@yb\xP@yc\xP@yd\xP@tm-\xP@ym\relax \xP@C\xP@beziertan\xP@xa\xP@xb\xP@xc\xP@xd\xP@tm \xP@G\xP@beziertan\xP@ya\xP@yb\xP@yc\xP@yd\xP@tm \xP@L\dimexpr\xP@G\xP@tmx-\xP@C\xP@tmy\relax @@ -804,10 +926,10 @@ \xP@Max#1\xP@D \xP@Max#1\xP@H \xP@Max#1\xP@L -\ifdim#1>4843165sp -#1\maxdimen +#1\ifdim#1>4843165sp +\maxdimen \else -#1\dimexpr\xP@D*\xP@D/\p@+\xP@H*\xP@H/\p@+\xP@L*\xP@L/\p@\relax +\dimexpr\xP@D*\xP@D/\p@+\xP@H*\xP@H/\p@+\xP@L*\xP@L/\p@\relax \fi } \newcommand*\xP@offsetpoints{\xP@xb\dimexpr\xP@xa+\xP@Tax*\xP@fa/196608\relax @@ -818,11 +940,20 @@ \newcommand*\xP@bezierpoly[5]{\dimexpr(((#4-#1+(#2-#3)*3)*#5/\p@+(#1-2#2+#3)*6)*#5/\p@+(#2-#1)*12)*#5/\p@ +#1*8\relax } +\newcommand*\xP@precbezierpoly[5]{\dimexpr(((#4-#1+(#2-#3)*3)*2*#5/\xP@bigdim+(#1-2#2+#3)*6)*2*#5/\xP@bigdim ++(#2-#1)*12)*2*#5/\xP@bigdim+#1*8\relax +} \newcommand*\xP@beziertan[5]{\dimexpr((#4-#1+(#2-#3)*3)*3*#5/32768+(#1-2#2+#3)*24)*#5/\p@+(#2-#1)*24\relax } +\newcommand*\xP@precbeziertan[5]{\dimexpr((#4-#1+(#2-#3)*3)*#5/\xP@bigdim+(#1-2#2+#3)*2)*#5/\xP@bigdim ++#2-#1\relax +} \@ifdefinable\xP@varone\relax \@ifdefinable\xP@vartwo\relax \@ifdefinable\xP@varthree\relax +\@ifdefinable\ifxP@validsol\relax +\@ifdefinable\xP@validsoltrue\relax +\@ifdefinable\xP@validsolfalse\relax \newif\ifxP@validsol \newcommand*\xP@solvelinearsystem{{\xP@scalerow\xP@A\xP@B\xP@C\xP@D \xP@scalerow\xP@E\xP@F\xP@G\xP@H @@ -872,12 +1003,15 @@ \fi \multiply\xP@E\m@ne \multiply\xP@I\m@ne +\ifdim\xP@A=\z@ +\else \advance\xP@F\dimexpr\xP@B*\xP@E/\xP@A\relax \advance\xP@G\dimexpr\xP@C*\xP@E/\xP@A\relax \advance\xP@H\dimexpr\xP@D*\xP@E/\xP@A\relax \advance\xP@J\dimexpr\xP@B*\xP@I/\xP@A\relax \advance\xP@K\dimexpr\xP@C*\xP@I/\xP@A\relax \advance\xP@L\dimexpr\xP@D*\xP@I/\xP@A\relax +\fi \count@\m@ne \xP@ifabsless\xP@F\xP@G\@tempcnta\z@\xP@M\xP@G \else\@tempcnta\m@ne\xP@M\xP@F\fi @@ -897,8 +1031,11 @@ \let\xP@vartwo\@tempa \xP@swapnum\xP@scaletwo\xP@scalethree \fi +\ifdim\xP@F=\z@ +\else \advance\xP@K\dimexpr-\xP@G*\xP@J/\xP@F\relax \advance\xP@L\dimexpr-\xP@H*\xP@J/\xP@F\relax +\fi \xP@ifabsless{\dimexpr\xP@L/60\relax}{\dimexpr\xP@K/\xP@scalethree\relax}\xP@validsoltrue \xP@varthree\dimexpr\xP@L*(\xP@scalethree*\p@)/\xP@K\relax \else @@ -1005,12 +1142,9 @@ \xP@H\dimexpr\xP@H*\maxdimen/\xP@sb\relax \xP@L\dimexpr\xP@L*\maxdimen/\xP@sb\relax \fi -\xP@Aba\dimexpr\xP@A*\xP@D/\xP@sa+\xP@E*\xP@H/\xP@sa -+\xP@I*\xP@L/\xP@sa\relax -\xP@Abb\dimexpr\xP@B*\xP@D/\xP@sa+\xP@F*\xP@H/\xP@sa -+\xP@J*\xP@L/\xP@sa\relax -\xP@Abc\dimexpr\xP@C*\xP@D/\xP@sa+\xP@G*\xP@H/\xP@sa -+\xP@K*\xP@L/\xP@sa\relax +\xP@Aba\dimexpr\xP@A*\xP@D/\xP@sa+\xP@E*\xP@H/\xP@sa+\xP@I*\xP@L/\xP@sa\relax +\xP@Abb\dimexpr\xP@B*\xP@D/\xP@sa+\xP@F*\xP@H/\xP@sa+\xP@J*\xP@L/\xP@sa\relax +\xP@Abc\dimexpr\xP@C*\xP@D/\xP@sa+\xP@G*\xP@H/\xP@sa+\xP@K*\xP@L/\xP@sa\relax \xP@AAba\dimexpr\xP@A*\xP@Aba/\xP@sa+\xP@B*\xP@Abb/\xP@sa +\xP@C*\xP@Abc/\xP@sa\relax \xP@AAbb\dimexpr\xP@E*\xP@Aba/\xP@sa+\xP@F*\xP@Abb/\xP@sa @@ -1050,21 +1184,22 @@ \fi }}\@gtempa } +\@ifdefinable\ifxP@offsetok\relax +\@ifdefinable\xP@offsetoktrue\relax +\@ifdefinable\xP@offsetokfalse\relax \newif\ifxP@offsetok -\newcommand*\xP@maxdev{.1\p@} -\newcommand*\xP@maxobjfun{.005\p@} -\newcommand*\xP@testoffset{{\gdef\@gtempa{\xP@offsetoktrue}\def\@gtempb{\ifdim\xP@ti<1.85pt}\xP@ti.1pt +\newcommand*\xP@maxdev{.1pt} +\newcommand*\xP@maxobjfun{.005pt} +\newcommand*\xP@testoffset{{\gdef\xP@afteroffsetok{\xP@offsetoktrue}\def\xP@offsetokif{\ifdim\xP@ti<1.85pt}\xP@ti.1pt \loop -\xP@tip -\dimexpr\xP@a*131072/\xP@bigdim+(\xP@b-\xP@a)*\xP@ti/\xP@bigdim\relax -\L@p-\xP@bezierpoly\xP@xa\xP@xb\xP@xc\xP@xd\xP@tip -\U@p-\xP@bezierpoly\xP@ya\xP@yb\xP@yc\xP@yd\xP@tip -\xP@valA\xP@bezierpoly\X@p\L@c\R@c\X@c\xP@ti -\advance\xP@valA\L@p -\xP@valB\xP@bezierpoly\Y@p\U@c\D@c\Y@c\xP@ti -\advance\xP@valB\U@p -\@tempdima\dimexpr\xP@tip/2\relax -\xP@velocity@@ +\xP@tip\dimexpr\xP@a+(\xP@b-\xP@a)*\xP@ti/131072\relax +\L@p-\xP@precbezierpoly\xP@xa\xP@xb\xP@xc\xP@xd\xP@tip +\U@p-\xP@precbezierpoly\xP@ya\xP@yb\xP@yc\xP@yd\xP@tip +\xP@valA\dimexpr\xP@bezierpoly\X@p\L@c\R@c\X@c\xP@ti+\L@p\relax +\xP@valB\dimexpr\xP@bezierpoly\Y@p\U@c\D@c\Y@c\xP@ti+\U@p\relax +\d@X3\xP@precbeziertan\xP@xa\xP@xb\xP@xc\xP@xd\xP@tip +\d@Y3\xP@precbeziertan\xP@ya\xP@yb\xP@yc\xP@yd\xP@tip +\xP@veclen \@tempdimc\dimexpr(\xP@b-\xP@a)*\@tempdimb/\xP@bigdim\relax \xP@abs\@tempdimc \ifdim.01pt<\@tempdimc @@ -1075,7 +1210,7 @@ \xP@abs\xP@devB \@tempdima\dimexpr\xP@devA+\xP@devB\relax \else -\ifdim.0005pt>\@tempdimc +\ifdim\@tempdimc=\z@ \@tempdima\z@ \else {\d@X\xP@valA @@ -1096,23 +1231,23 @@ \xP@transformcoor\X@c\Y@c \xP@findzero }\fi -\@gtempb +\xP@offsetokif \advance\xP@ti.1pt \repeat -\expandafter}\@gtempa +\expandafter}\xP@afteroffsetok } +\newcommand*\xP@afteroffsetok{} +\newcommand*\xP@offsetokif{} \newcommand*\xP@transformcoor[2]{\advance#1\L@p \advance#2\U@p \@tempdima\dimexpr#1*\d@X/\@tempdimb+#2*\d@Y/\@tempdimb\relax #2\dimexpr#2*\d@X/\@tempdimb-#1*\d@Y/\@tempdimb\relax #1\@tempdima } -\newcommand*\xP@findzero{\xP@setleftvalue\tw@ -\xP@setrightvalue\tw@ -\ifdim\xP@valB<\z@\xP@reversecoeff\fi +\newcommand*\xP@findzero{\xP@setleftvalue{.05}\xP@setrightvalue{.05}\ifdim\xP@valB<\z@\xP@reversecoeff\fi \ifdim\xP@valA>\z@ \@tempswatrue -\@for\@tempa:={\thr@@,4,5,7,10,20}\do{\if@tempswa +\@for\@tempa:={.1,.15,.2,.25,.35,.5,1.1}\do{\if@tempswa \xP@setleftvalue\@tempa \ifdim\xP@valA<\z@\@tempswafalse\fi \if@tempswa @@ -1125,8 +1260,9 @@ \fi }\if@tempswa \L@p\xP@ti -\xP@valA\dimexpr\xP@bezierpoly\X@p\L@c\R@c\X@c\L@p\relax -\ifdim\xP@valA>\z@ +\xP@valA\xP@bezierpoly\X@p\L@c\R@c\X@c\L@p +\ifdim\xP@valA<\z@ +\xP@setrightvalue{.05}\else \U@p\L@p \xP@valB\xP@valA \fi @@ -1151,12 +1287,12 @@ \xP@valB\dimexpr\xP@bezierpoly\Y@p\U@c\D@c\Y@c\L@p+8\xP@off\relax \xP@abs\xP@valA \xP@abs\xP@valB -\ifdim\dimexpr\xP@valA+\xP@valB\relax>\xP@maxdev +\ifdim\dimexpr\xP@valA+\xP@valB\relax>\xP@maxdev\relax \xP@failed \fi } -\newcommand*\xP@failed{\global\let\@gtempb\iffalse -\gdef\@gtempa{\xP@offsetokfalse}} +\newcommand*\xP@failed{\global\let\xP@offsetokif\iffalse +\gdef\xP@afteroffsetok{\xP@offsetokfalse}} \newcommand*\xP@reversecoeff{\multiply\X@p\m@ne \multiply\L@c\m@ne \multiply\R@c\m@ne @@ -1164,27 +1300,42 @@ \multiply\xP@valA\m@ne \multiply\xP@valB\m@ne } -\newcommand*\xP@setleftvalue[1]{\L@p\dimexpr\xP@ti-\p@/#1\relax -\ifdim\L@p<\z@\L@p\z@\fi -\xP@valA\dimexpr\xP@bezierpoly\X@p\L@c\R@c\X@c\L@p\relax +\newcommand*\xP@setleftvalue[1]{\L@p\dimexpr\xP@ti-#1\p@\relax +\ifdim\L@p<-.1pt\L@p-.1pt\fi +\xP@valA\xP@bezierpoly\X@p\L@c\R@c\X@c\L@p } -\newcommand*\xP@setrightvalue[1]{\U@p\dimexpr\xP@ti+\p@/#1\relax -\ifdim\U@p>2\p@\U@p2\p@\fi -\xP@valB\dimexpr\xP@bezierpoly\X@p\L@c\R@c\X@c\U@p\relax +\newcommand*\xP@setrightvalue[1]{\U@p\dimexpr\xP@ti+#1\p@\relax +\ifdim\U@p>2.1\p@\U@p2.1\p@\fi +\xP@valB\xP@bezierpoly\X@p\L@c\R@c\X@c\U@p } \newcommand*\xP@splinedbldashed{\xP@checkspline\xP@splinemultdashed\xP@doublestroke} \newcommand*\xP@splinetrbldashed{\xP@checkspline\xP@splinemultdashed\xP@trblstroke} -\newcommand*\xP@splinemultdashed{\@tempcnta\numexpr2*\numexpr(\@tempdimb+\xydashl@)/(2*\xydashl@)\relax-1\relax +\newcommand*\xP@splinemultdashed[1]{\xP@testcont\xP@dashmacro +\@tempcnta +\ifxP@splinecont +\numexpr2*((\@tempdimb-\xydashl@/3)/(2*\xydashl@))\relax +\else +\numexpr2*((\@tempdimb+\xydashl@)/(2*\xydashl@))-1\relax +\fi \ifnum\@tempcnta>\@ne -\expandafter\xP@splinemultdashed@ +\xP@splinemultdashed@#1\else +\ifnum\@tempcnta=\@ne +\xP@splinemultsolid#1 \else -\expandafter\xP@splinemultsolid +\xP@savec \fi +\fi +\global\let\xP@lastpattern\xP@dashmacro } \newcommand*\xP@splinemultdashed@[1]{{\xP@inibigdim \@tempdima\dimexpr\@tempdimb/\@tempcnta\relax \xP@temppar\z@ -\toks@{}\@tempcnta\z@ +\toks@{}\xP@savec +\ifodd\@tempcnta +\else +\xP@slide +\fi +\@tempcnta\z@ \loop \advance\@tempcnta\@ne \xP@append\toks@{\ifodd\@tempcnta\noexpand\xP@paintdash\fi @@ -1199,6 +1350,7 @@ \xP@oldpar \fi \@temptokena{}\xP@setsolidpat +\global\let\xP@lastpattern\xP@dashmacro \@for\@tempa:={#1}\do{\the\toks@}\xP@stroke{\the\@temptokena}}} \newcommand*\xP@paintdash[2]{\xP@paintsolid{\dimexpr#1*\xP@bigdim/\xP@lastpar\relax}{\dimexpr#2*\xP@bigdim/\xP@lastpar\relax}} \xP@hook{splinedbldotted@} @@ -1206,82 +1358,124 @@ \xP@checkspline\xP@splinemultdotted\xP@doublestroke} \newcommand*\xP@splinetrbldotted{\let\xP@normalmult\tw@ \xP@checkspline\xP@splinemultdotted\xP@trblstroke} -\newcommand*\xP@multidottedpat{\def\xP@pattern{2 J [0 \xP@dim{\xydashh@}]0 d }} +\newcommand*\xP@multidottedpat{\def\xP@pattern{0 J [\xP@lw\xP@dim{\xydashh@-\xP@preclw}]0 d}\global\let\xP@lastpattern\xP@dotmacro +} \@ifdefinable\xP@normalmult\relax \newcommand\xP@splinemultdotted[1]{{\xP@inibigdim -\@tempdima\dimexpr\@tempdimb/\numexpr\@tempdimb/131072+1\relax\relax \xP@temppar\z@ -\toks@{}\loop +\xP@testcont\xP@dotmacro +\ifxP@splinecont +\@tempdimc\dimexpr\@tempdimb/(\@tempdimb/131072+1)\relax +\@tempdima\dimexpr\@tempdimc-\xP@preclw/2\relax +\xP@slide +\@tempdima\@tempdimc +\else +\@tempdima\dimexpr\xP@preclw/2\relax +\xP@slide +\@tempdima\dimexpr\@tempdimb-\xP@preclw\relax +\ifdim\@tempdima<\z@\@tempdima\z@\fi +\@tempdima\dimexpr\@tempdima/(\@tempdima/131072+1)\relax +\fi +\xP@savec +\toks@{}\ifdim\xP@temppar<\xP@bigdim +\loop \xP@append\toks@{\noexpand\xP@paintdot{\the\xP@temppar}}\xP@oldpar\xP@temppar \xP@slide \ifdim\xP@temppar<\xP@bigdim \repeat -\xP@lastpar -\ifdim\dimexpr\xP@bigdim-\xP@oldpar\relax<\dimexpr\xP@temppar-\xP@bigdim\relax -\xP@oldpar +\xP@velocity\xP@bigdim\xP@tempvel +\ifdim +\ifdim\xP@preclw<\xP@tempvel +\dimexpr2\xP@bigdim-\xP@oldpar-\xP@preclw*\xP@bigdim/\xP@tempvel\relax +\else +-\maxdimen +\fi<\xP@temppar +\xP@temppar\xP@oldpar \else -\xP@temppar \xP@append\toks@{\noexpand\xP@paintdot{\the\xP@temppar}}\fi +\@tempdima\dimexpr\xP@preclw/2\relax +\xP@slide +\xP@lastpar\xP@temppar \@temptokena{}\the\toks@ \xP@multidottedpat -\xP@stroke{\the\@temptokena}}} +\xP@stroke{\the\@temptokena}\else +\global\let\xP@lastpattern\empty +\fi +}} \newcommand*\xP@slide{{\xP@slide@ \global\dimen@i\xP@temppar }\xP@temppar\dimen@i } -\newcommand*\xP@slide@{\xP@velocity{\xP@temppar*\p@/\xP@bigdim}\xP@tempvel -\xP@velocity{(\xP@temppar+\xP@bigdim/\numexpr\@tempdimb/131072+1\relax)*\p@/\xP@bigdim}\xP@tempvel@ -\ifdim\dimexpr\@tempdima*1310720/(\xP@tempvel+\xP@tempvel@)\relax>\p@ +\newcommand*\xP@slide@{\xP@velocity\xP@temppar\xP@tempvel +\@tempdimc\dimexpr\xP@bigdim*\@tempdima/\@tempdimb\relax +\count@\z@ +\@tempswatrue +\loop +\xP@velocity{\xP@temppar+\@tempdimc}\xP@tempvel@ +\ifdim\dimexpr\@tempdima*4/13\relax>\xP@tempvel@ +\@tempswafalse +\else +\xP@parinc\dimexpr\@tempdima*\xP@bigdim/\xP@tempvel@ +-(\xP@tempvel+\xP@tempvel@)/2*\@tempdimc/\xP@tempvel@\relax +\advance\@tempdimc\xP@parinc +\ifdim\@tempdimc>.12\xP@bigdim +\@tempswafalse +\else +\ifdim\xP@parinc=\z@ +\@tempswafalse +\else +\ifnum\count@=9\relax +\@tempswafalse +\fi +\fi +\fi +\fi +\if@tempswa +\advance\count@\@ne +\repeat +\ifdim\xP@temppar<5461pt +\ifdim\@tempdimc>.1\xP@bigdim +\@tempswatrue +\fi +\fi +\if@tempswa {\dimen5\xP@temppar \advance\xP@temppar.1\xP@bigdim +\ifdim\xP@temppar>5461pt\xP@temppar5461pt\fi \dimen7\xP@temppar \xP@shaveprec{\dimen5}{\dimen7}\xP@bezierlength -\advance\@tempdima-\@tempdimb -\expandafter}\expandafter\@tempdima\the\@tempdima\relax -\advance\xP@temppar.1\xP@bigdim +\global\dimen@i\dimexpr\@tempdima-\@tempdimb\relax +\global\dimen3\xP@temppar +}\@tempdima\dimen@i +\xP@temppar\dimen3\relax \expandafter\xP@slide@ \else -\advance\xP@temppar -\dimexpr2\xP@bigdim*\@tempdima/(\xP@tempvel+\xP@tempvel@)\relax +\advance\xP@temppar\@tempdimc \fi } -\newcommand*\xP@paintdot[1]{\xP@temppar\dimexpr#1*\xP@bigdim/\xP@lastpar\relax -\L@p\dimexpr\L@c-\X@p\relax -\D@p\dimexpr\U@c-\Y@p\relax -\d@X3\dimexpr((\X@c-\X@p+(\L@c-\R@c)*3)*\xP@temppar/\xP@bigdim -+(\R@c-\L@p-\L@c)*2)*\xP@temppar/\xP@bigdim+\L@p\relax -\d@Y3\dimexpr((\Y@c-\Y@p+(\U@c-\D@c)*3)*\xP@temppar/\xP@bigdim -+(\D@c-\D@p-\U@c)*2)*\xP@temppar/\xP@bigdim+\D@p\relax -\xP@veclen -\ifdim\@tempdimb=\z@ -\d@X3\dimexpr(\X@c-\X@p+(\L@c-\R@c)*3)*\xP@temppar/\xP@bigdim -+(\R@c-\L@p-\L@c)\relax -\d@Y3\dimexpr(\Y@c-\Y@p+(\U@c-\D@c)*3)*\xP@temppar/\xP@bigdim -+(\D@c-\D@p-\U@c)\relax -\xP@veclen -\ifdim\@tempdimb=\z@ -\d@X3\dimexpr\X@c-\X@p+(\L@c-\R@c)*3\relax -\d@Y3\dimexpr\Y@c-\Y@p+(\U@c-\D@c)*3\relax -\xP@veclen -\fi -\fi -\U@p\dimexpr\R@c-\L@p-\L@c\relax -\R@p\dimexpr\X@c-3\R@c+3\L@c-\X@p\relax -\X@min\dimexpr\D@c-\D@p-\U@c\relax -\Y@min\dimexpr\Y@c-3\D@c+3\U@c-\Y@p\relax -\xP@posX\dimexpr\X@p+(3\L@p+(3\U@p+\R@p*\xP@temppar/\xP@bigdim)*\xP@temppar/\xP@bigdim)*\xP@temppar/\xP@bigdim\relax -\xP@posY\dimexpr\Y@p+(3\D@p+(3\X@min+\Y@min*\xP@temppar/\xP@bigdim)*\xP@temppar/\xP@bigdim)*\xP@temppar/\xP@bigdim\relax -\L@p\dimexpr\xydashh@*\d@Y/\@tempdimb/2\relax -\U@p\dimexpr-\xydashh@*\d@X/\@tempdimb/2\relax +\newcommand*\xP@paintdot[1]{\@tempdima\dimexpr#1*\xP@bigdim/\xP@lastpar\relax +\xP@tangent +\xP@posX\dimexpr\xP@precbezierpoly\X@p\L@c\R@c\X@c\@tempdima/8\relax +\xP@posY\dimexpr\xP@precbezierpoly\Y@p\U@c\D@c\Y@c\@tempdima/8\relax +\@tempdima\dimexpr(\xydashh@+\xP@preclw/\xP@normalmult)/2\relax +\L@p\dimexpr\d@Y*\@tempdima/\@tempdimb\relax +\U@p\dimexpr-\d@X*\@tempdima/\@tempdimb\relax \xP@append\@temptokena{\xP@coor{\xP@posX+\L@p*\xP@normalmult}{\xP@posY+\U@p*\xP@normalmult}m \xP@coor{\xP@posX-\L@p*(\xP@normalmult+\@ne)}{\xP@posY-\U@p*(\xP@normalmult+\@ne)}l }} \newcommand*\xP@splinesquiggled{\xP@checkspline\xP@splinesquiggled@\z@} \newcommand*\xP@splinedblsquiggled{\xP@checkspline\xP@splinesquiggled@\xP@doublestroke} \newcommand*\xP@splinetrblsquiggled{\xP@checkspline\xP@splinesquiggled@\xP@trblstroke} \newcommand*\xP@splinesquiggled@[1]{{\xP@inibigdim +\xP@testcont\xP@oddsquigglemacro +\ifxP@splinecont +\def\xP@squigsign{-}\else +\let\xP@squigsign\empty +\fi +\xP@savec \@tempcnta=\numexpr\@tempdimb/\xybsqll@\relax \ifnum\@tempcnta<\tw@\@tempcnta\tw@\fi \multiply\@tempcnta\tw@ \@tempdima\dimexpr\@tempdimb/\@tempcnta\relax +\xP@squiglen\@tempdima \xP@temppar\z@ \toks@{}\@tempcnta\z@ \loop @@ -1293,72 +1487,88 @@ \xP@lastpar \ifodd\@tempcnta \xP@oldpar +\advance\@tempcnta\m@ne \else \xP@temppar \xP@append\toks@{\noexpand\xP@paintsquiggle{\the\xP@temppar}}\fi \@temptokena{}\xP@setsolidpat +\global\expandafter\let\expandafter\xP@lastpattern +\ifodd\numexpr\@tempcnta/2\if\xP@squigsign-+1\fi\relax +\xP@oddsquigglemacro +\else +\xP@evensquigglemacro +\fi \@for\@tempa:={#1}\do{\let\xP@dosquiggle\xP@dosquiggle@ \count@\z@ \the\toks@ -}\xP@stroke{\the\@temptokena} -}} -\newcommand*\xP@paintsquiggle[1]{\xP@temppar\dimexpr#1*\xP@bigdim/\xP@lastpar\relax -\L@p\dimexpr\L@c-\X@p\relax -\D@p\dimexpr\U@c-\Y@p\relax -\d@X3\dimexpr((\X@c-\X@p+(\L@c-\R@c)*3)*\xP@temppar/\xP@bigdim -+(\R@c-\L@p-\L@c)*2)*\xP@temppar/\xP@bigdim+\L@p\relax -\d@Y3\dimexpr((\Y@c-\Y@p+(\U@c-\D@c)*3)*\xP@temppar/\xP@bigdim -+(\D@c-\D@p-\U@c)*2)*\xP@temppar/\xP@bigdim+\D@p\relax -\xP@veclen -\ifdim\@tempdimb=\z@ -\d@X3\dimexpr(\X@c-\X@p+(\L@c-\R@c)*3)*\xP@temppar/\xP@bigdim -+(\R@c-\L@p-\L@c)\relax -\d@Y3\dimexpr(\Y@c-\Y@p+(\U@c-\D@c)*3)*\xP@temppar/\xP@bigdim -+(\D@c-\D@p-\U@c)\relax -\xP@veclen -\ifdim\@tempdimb=\z@ -\d@X3\dimexpr\X@c-\X@p+(\L@c-\R@c)*3\relax -\d@Y3\dimexpr\Y@c-\Y@p+(\U@c-\D@c)*3\relax -\xP@veclen -\fi -\fi -\U@p\dimexpr\R@c-\L@p-\L@c\relax -\R@p\dimexpr\X@c-3\R@c+3\L@c-\X@p\relax -\X@min\dimexpr\D@c-\D@p-\U@c\relax -\Y@min\dimexpr\Y@c-3\D@c+3\U@c-\Y@p\relax -\xP@posX\dimexpr\X@p+(3\L@p+(3\U@p+\R@p*\xP@temppar/\xP@bigdim)*\xP@temppar/\xP@bigdim)*\xP@temppar/\xP@bigdim\relax -\xP@posY\dimexpr\Y@p+(3\D@p+(3\X@min+\Y@min*\xP@temppar/\xP@bigdim)*\xP@temppar/\xP@bigdim)*\xP@temppar/\xP@bigdim\relax -\advance\xP@posX\dimexpr-\d@Y*\numexpr\@tempa\relax/\@tempdimb\relax -\advance\xP@posY\dimexpr\d@X*\numexpr\@tempa\relax/\@tempdimb\relax -\L@p\dimexpr\d@X*\@tempdima/\@tempdimb\relax -\U@p\dimexpr\d@Y*\@tempdima/\@tempdimb\relax +}\xP@stroke{\the\@temptokena}}} +\newcommand*\xP@paintsquiggle[1]{\@tempdima\dimexpr#1*\xP@bigdim/\xP@lastpar\relax +\xP@tangent +\xP@posX\dimexpr\xP@precbezierpoly\X@p\L@c\R@c\X@c\@tempdima/8-\d@Y*(\@tempa)/\@tempdimb\relax +\xP@posY\dimexpr\xP@precbezierpoly\Y@p\U@c\D@c\Y@c\@tempdima/8+\d@X*(\@tempa)/\@tempdimb\relax +\L@p\dimexpr\d@X*\xP@squiglen/\@tempdimb\relax +\U@p\dimexpr\d@Y*\xP@squiglen/\@tempdimb\relax \R@p\dimexpr\L@p*543339720/1311738121\relax \D@p\dimexpr\U@p*543339720/1311738121\relax \X@min\dimexpr\L@p*362911648/967576667\relax \Y@min\dimexpr\U@p*362911648/967576667\relax -\X@max\dimexpr(\L@p+\U@p)*173517671/654249180\relax -\Y@max\dimexpr(\L@p-\U@p)*173517671/654249180\relax +\X@max\dimexpr(\L@p+\xP@squigsign\U@p)*173517671/654249180\relax +\Y@max\dimexpr(\L@p-\xP@squigsign\U@p)*173517671/654249180\relax \xP@dosquiggle \ifnum\count@=\thr@@\relax\count@\z@\else\advance\count@\@ne\fi } \@ifdefinable\xP@dosquiggle@\relax -\newcommand*\xP@dosquiggle@{\edef\next@{\xP@coor{\xP@posX}{\xP@posY}m \xP@coor{\xP@posX+\Y@max}{\xP@posY+\X@max}}\let\xP@dosquiggle\xP@dosquiggle@@ +\newcommand*\xP@dosquiggle@{\edef\next@{\xP@coor{\xP@posX}{\xP@posY}m +\xP@coor{\xP@posX+\Y@max}{\xP@posY+\xP@squigsign\X@max}}\let\xP@dosquiggle\xP@dosquiggle@@ } \newcommand*\xP@dosquiggle@@{\xP@append\@temptokena{\next@\expandafter\xP@coor \ifcase\count@ -{\xP@posX-\Y@max}{\xP@posY-\X@max}\xP@coor\xP@posX\xP@posY +{\xP@posX-\Y@max}{\xP@posY-\xP@squigsign\X@max}\xP@coor\xP@posX\xP@posY \or -{\xP@posX-\D@p-\X@min}{\xP@posY+\R@p-\Y@min}\xP@coor{\xP@posX-\D@p}{\xP@posY+\R@p}\or -{\xP@posX-\X@max}{\xP@posY+\Y@max}\xP@coor\xP@posX\xP@posY +{\xP@posX-\xP@squigsign\D@p-\X@min}{\xP@posY+\xP@squigsign\R@p-\Y@min}\xP@coor{\xP@posX-\xP@squigsign\D@p}{\xP@posY+\xP@squigsign\R@p}\or +{\xP@posX-\X@max}{\xP@posY+\xP@squigsign\Y@max}\xP@coor\xP@posX\xP@posY \or -{\xP@posX+\D@p-\X@min}{\xP@posY-\R@p-\Y@min}\xP@coor{\xP@posX+\D@p}{\xP@posY-\R@p}\fi c }\edef\next@{\expandafter\xP@coor +{\xP@posX+\xP@squigsign\D@p-\X@min}{\xP@posY-\xP@squigsign\R@p-\Y@min}\xP@coor{\xP@posX+\xP@squigsign\D@p}{\xP@posY-\xP@squigsign\R@p}\fi c }\edef\next@{\expandafter\xP@coor \ifcase\count@ -{\xP@posX+\Y@max}{\xP@posY+\X@max}\or -{\xP@posX-\D@p+\X@min}{\xP@posY+\R@p+\Y@min}\or -{\xP@posX+\X@max}{\xP@posY-\Y@max}\or -{\xP@posX+\D@p+\X@min}{\xP@posY-\R@p+\Y@min}\fi +{\xP@posX+\Y@max}{\xP@posY+\xP@squigsign\X@max}\or +{\xP@posX-\xP@squigsign\D@p+\X@min}{\xP@posY+\xP@squigsign\R@p+\Y@min}\or +{\xP@posX+\X@max}{\xP@posY-\xP@squigsign\Y@max}\or +{\xP@posX+\xP@squigsign\D@p+\X@min}{\xP@posY-\xP@squigsign\R@p+\Y@min}\fi }} +\newcommand*\xP@lastX{} +\newcommand*\xP@lastY{} +\newcommand*\xP@lastpattern{} +\newcommand*\xP@solidmacro{solid} +\newcommand*\xP@dotmacro{dot} +\newcommand*\xP@dashmacro{dash} +\newcommand*\xP@evensquigglemacro{evensquiggle} +\newcommand*\xP@oddsquigglemacro{oddsquiggle} +\CheckCommand*\xy{\ifmmode\expandafter\xymath@\else\expandafter\xynomath@\fi} +\renewcommand*\xy{\global\let\xP@lastpattern\empty +\ifmmode\expandafter\xymath@\else\expandafter\xynomath@\fi} +\newcommand*\xP@savec{\xdef\xP@lastX{\the\X@c}\xdef\xP@lastY{\the\Y@c}} +\@ifdefinable\ifxP@splinecont\relax +\@ifdefinable\xP@splineconttrue\relax +\@ifdefinable\xP@splinecontfalse\relax +\newif\ifxP@splinecont +\newcommand*\xP@testcont[1]{\xP@splinecontfalse +\ifxP@cont +\ifx\xP@lastpattern#1\ifdim\xP@lastX=\X@p +\ifdim\xP@lastY=\Y@p +\xP@splineconttrue +\fi +\fi +\fi +\fi +} \xP@endgobble +\@ifdefinable\ifxP@cont\relax +\@ifdefinable\xP@conttrue\relax +\@ifdefinable\xP@contfalse\relax +\newif\ifxP@cont +\newcommand*\xypdfcontpatternon{\xP@conttrue} +\newcommand*\xypdfcontpatternoff{\xP@contfalse} +\xP@conttrue \endinput %% %% End of file `xypdf.sty'. |