summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pict2e
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-06-14 22:18:35 +0000
committerKarl Berry <karl@freefriends.org>2020-06-14 22:18:35 +0000
commit70471008188a9958254fb3a466cbc1248d33f929 (patch)
treebc30f4a832bf8cd5ebcd48e218f6941d78747e92 /Master/texmf-dist/source/latex/pict2e
parent3cc75a75fe8966b95123fd66dbd8db584ad74151 (diff)
pict2e (15jun20)
git-svn-id: svn://tug.org/texlive/trunk@55550 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/pict2e')
-rw-r--r--Master/texmf-dist/source/latex/pict2e/pict2e.dtx192
1 files changed, 93 insertions, 99 deletions
diff --git a/Master/texmf-dist/source/latex/pict2e/pict2e.dtx b/Master/texmf-dist/source/latex/pict2e/pict2e.dtx
index 9c4baa4f3f8..9c2b986cc24 100644
--- a/Master/texmf-dist/source/latex/pict2e/pict2e.dtx
+++ b/Master/texmf-dist/source/latex/pict2e/pict2e.dtx
@@ -2,7 +2,7 @@
%
%
%
-% Copyright (C) 2003-2016
+% Copyright (C) 2003-2020
% Rolf Niepraschk, Rolf.Niepraschk@gmx.de
% Hubert Gaesslein, hubertjg@gmx.de
% Josef Tkadlec, j.tkadlec@email.cz
@@ -23,12 +23,12 @@
%
%<*package>
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{pict2e}[2019/08/20 v0.3c Improved picture commands (HjG,RN,JT)]
+\ProvidesPackage{pict2e}[2020/06/13 v0.3d Improved picture commands (HjG,RN,JT)]
%</package>
%
%<*driver>
\listfiles
-\errorcontextlines5
+\setcounter{errorcontextlines}{5}
\documentclass{ltxdoc}
\usepackage{pict2e} % [pstarrows]
%%\usepackage[debug]{pict2e}
@@ -37,13 +37,16 @@
\usepackage{color}
\usepackage{graphicx}
\usepackage{array}
-%%\usepackage{pstcol}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
\usepackage{longtable}
\IfFileExists{geometry.sty}{%
\usepackage[left=\marginparwidth,textwidth=1.15\textwidth,%
top=20mm,bottom=30mm]{geometry}}{}
\IfFileExists{url.sty}{\usepackage{url}}
{\newcommand*\url[1]{\texttt{#1}}}
+\usepackage{hypdoc}
+
%\OnlyDescription
\AlsoImplementation
\EnableCrossrefs
@@ -60,9 +63,9 @@
% \fi
%
% \GetFileInfo{pict2e.sty}
-% \def\docdate{2016/01/09}
+% \def\docdate{2020/06/13}
%
-% \CheckSum{2158}
+% \CheckSum{2157}
%
% ^^A ========
%
@@ -184,6 +187,7 @@
% \changes{v0.2y}{2011/04/05}{Support for dvipdfmx. (JT)}
% \changes{v0.2z}{2014/01/12}{Conflict wit epic, eepic solved. (JT)}
% \changes{v0.3a}{2016/01/09}{Local line types, documentation fixes. (JT)}
+% \changes{v0.3d}{2020/06/13}{\cmd{\@sline} renamed \cmd{\pIIe@sline} (RN)}
% \fi
%
% \changes{v0.1a}{2003/07/18}{First version. (RN)}
@@ -1594,39 +1598,44 @@
}
% \end{macrocode}
% \end{macro}
-% Arrow shape options.
-% The values for \LaTeX-style arrows are ``hand optimized'';
-% they should be regarded as experimental,
-% i.e., they may change in future versions of this package.
-% The values for \PSTricks-style arrows are the default ones used by
-% that bundle.
-% If the \textsf{pstricks} package is actually loaded, then
-% \textsf{pict2e} will obey the current values of the corresponding
-% internal \PSTricks\ parameters;
-% this feature should be regarded as experimental,
-% i.e., it may change in future versions of this package.
+% \begin{macro}{\pIIe@FAL}
+% \begin{macro}{\pIIe@FAW}
+% \begin{macro}{\pIIe@CAW}
+% \begin{macro}{\pIIe@FAI}
+% Some macros to parametrize the shape of the vector outline.
+% The following values are “hand optimized” with the aim of emulating
+% \LaTeX-style arrows. They also seem suitable for our \PSTricks-style arrows.
+% See Figures~\ref{fig:vector:ltx} and~\ref{fig:vector:pst}.
+% \changes{v0.1x}{2003/11/27}{Introduce ``inset''. (RN,HjG)}
% \begin{macrocode}
-\DeclareOption{ltxarrows}{\AtEndOfPackage{%
+\newcommand*\pIIe@FAL{1.52}%
+\newcommand*\pIIe@FAW{3.2}%
+\newcommand*\pIIe@CAW{1.5pt}%
+\newcommand*\pIIe@FAI{0.25}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\ltxarrows}
+% \begin{macro}{\pstarrows}
+% The following user-level macros can be used to change the arrow style
+% (\LaTeX-style is the default).
+% \changes{v0.3d}{2020/06/13}{New user-level macros \cmd{\ltxarrows}
+% and \cmd{\pstarrows}. (RN)}
+% \begin{macrocode}
+\newcommand*\ltxarrows{%
\let\pIIe@vector=\pIIe@vector@ltx
- \def\pIIe@FAL{1.52}%
- \def\pIIe@FAW{3.2}%
- \def\pIIe@CAW{1.5pt}%
- \def\pIIe@FAI{0.25}%
- }}
-\DeclareOption{pstarrows}{\AtEndOfPackage{%
+}
+\newcommand*\pstarrows{%
\let\pIIe@vector=\pIIe@vector@pst
- \iffalse
- \def\pIIe@FAL{1.4}%
- \def\pIIe@FAW{2}%
- \def\pIIe@CAW{1.5pt}%
- \def\pIIe@FAI{0.4}%
- \else % These are the ltxarrows values, which looks better. (RN)
- \def\pIIe@FAL{1.52}%
- \def\pIIe@FAW{3.2}%
- \def\pIIe@CAW{1.5pt}%
- \def\pIIe@FAI{0.25}%
- \fi
- }}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macrocode}
+\DeclareOption{ltxarrows}{\AtEndOfPackage{\ltxarrows}}
+\DeclareOption{pstarrows}{\AtEndOfPackage{\pstarrows}}
% \end{macrocode}
%
% \begin{macro}{\pIIe@debug@comment}
@@ -2392,41 +2401,61 @@
% \changes{v0.2t}{2008/05/11}{All lines by \cmd{\@sline} (JT)}
% \begin{macrocode}
\def\line(#1,#2)#3{%
+ \begingroup
\pIIe@checkslopeargsline{#1}{#2}%
\@tempdima=#1pt\relax \@tempdimb=#2pt\relax
\@linelen #3\unitlength
- \ifdim\@linelen<\z@ \@badlinearg \else \@sline \fi}
+ \ifdim\@linelen<\z@ \@badlinearg \else
+ \pIIe@sline
+ \pIIe@moveto\z@\z@
+ \pIIe@lineto\@xdim\@ydim
+ \pIIe@strokeGraph
+% \end{macrocode}
+% Simulated bounding box
+% \begin{macrocode}
+ \box\@tempboxa
+ \fi
+ \endgroup}
% \end{macrocode}
% \end{macro}
-%
-% \begin{macro}{\@sline}
-% (The implementation here is different from \cmd{\vector}!)
+% \begin{macro}{\pIIe@sline}
+% Common code for \cmd{\line} and \cmd{\vector}.
+% \changes{v0.3d}{2020/06/13}{Simulated bounding boxes for \cmd{\line}
+% and \cmd{\vector} suggested by Donald Arseneau (RN)}
+% \begin{macrocode}
+ \newcommand*\pIIe@sline{%
+% \end{macrocode}
+% Calculation of the endpoints \cmd{\@xdim}, \cmd{\@ydim}
+% (used for \cmd{\line} only).
% \begin{macrocode}
- \def\@sline{%
- \begingroup
\ifdim\@tempdima=\z@
\ifdim\@tempdimb<\z@\@linelen-\@linelen\fi
\@ydim=\@linelen
\@xdim=\z@
\else
+ \ifdim\@tempdima<\z@\@linelen-\@linelen\fi
\ifdim\@tempdimb=\z@
- \ifdim\@tempdima<\z@\@linelen-\@linelen\fi
\@xdim=\@linelen
\@ydim=\z@
\else
- \ifnum\@tempdima<\z@\@linelen-\@linelen\fi
\pIIe@divide\@tempdimb\@tempdima\dimen@
\@ydim=\strip@pt\dimen@\@linelen
\@xdim=\@linelen
\fi
\fi
- \pIIe@moveto\z@\z@
- \pIIe@lineto\@xdim\@ydim
- \pIIe@strokeGraph
- \endgroup}
+% \end{macrocode}
+% Prepare a box that can be used as a bounding box for \cmd{\line} and
+% \cmd{\vector} to achieve the same behavior as standard \LaTeX\ outside
+% of a picture environment.
+% \begin{macrocode}
+ \@ovxx=\ifnum\@xdim=\z@ \z@\else\@linelen\fi
+ \@ovyy=\ifnum\@ydim<\z@ \z@\else\@ydim\fi
+ \@ovdy=\ifnum\@ydim<\z@ -\@ydim\else\z@\fi
+ \setbox\@tempboxa\hbox{%
+ \vrule\@height \@ovyy \@depth \@ovdy \@width \z@
+ \vrule\@height \z@ \@depth \z@ \@width \@ovxx}}
% \end{macrocode}
% \end{macro}
-%
% \subsubsection{Vector}
% \label{sec:implementation:vector}
%
@@ -2450,10 +2479,11 @@
\@tempdima=#1pt\relax \@tempdimb=#2pt\relax
\@linelen#3\unitlength
\ifdim\@linelen<\z@ \@badlinearg \else
+ \pIIe@sline
+ \@linelen#3\unitlength
\pIIe@pyth{\@tempdima}{\@tempdimb}\dimen@
- \ifdim\@tempdima=\z@
- \else\ifdim\@tempdimb=\z@
- \else
+ \ifdim\@tempdima=\z@ \else
+ \ifdim\@tempdimb=\z@ \else
% \end{macrocode}
% This calculation is only necessary, if the vector is actually
% sloped.
@@ -2477,6 +2507,10 @@
% \begin{macrocode}
\pIIe@vector
\pIIe@fillGraph
+% \end{macrocode}
+% Simulated bounding box
+% \begin{macrocode}
+ \box\@tempboxa
\fi
\endgroup}
% \end{macrocode}
@@ -2492,51 +2526,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\pIIe@FAL}
-% \begin{macro}{\pIIe@FAW}
-% \begin{macro}{\pIIe@CAW}
-% \begin{macro}{\pIIe@FAI}
-% \changes{v0.1x}{2003/11/27}{Introduce ``inset''. (RN,HjG)}
-% \begin{macro}{\pIIe@@firstnum}
-% \changes{v0.1x}{2003/11/27}{New ancillary macro (RN,HjG)}
-% \begin{macro}{\pIIe@@secondnum}
-% \changes{v0.1x}{2003/11/27}{New ancillary macro (RN,HjG)}
-% Some macros to parametrize the shape of the vector outline.
-% ^^A Should be user-level macros or changeable via key-value interface.
-% ^^A (Defered to future version.)
-% See Figures~\ref{fig:vector:ltx} and~\ref{fig:vector:pst}.
-%\iffalse
-% Note that when the \textsf{pstricks} package has been loaded, its
-% arrow-drawing parameters will be dynamically evaluated;
-% of course,
-% this is only useful with the \textsf{pstarrows} package
-% option.
-% probably\slash most likely not useful with the default
-% \textsf{ltxarrows} package option.
-% \fi
-% \begin{macrocode}
- \newcommand*\pIIe@FAL{}\newcommand*\pIIe@FAW{}\newcommand*\pIIe@CAW{}
- \newcommand*\pIIe@FAI{}
- \newcommand*\pIIe@@firstnum{}\newcommand*\pIIe@@secondnum{}
- \iffalse% the pstricks values gives too small arrows. (RN)
- \AtBeginDocument{%
- \@ifpackageloaded{pstricks}{%
- \def\pIIe@FAL{\psk@arrowlength}%
- \def\pIIe@FAW{\expandafter\pIIe@@secondnum\psk@arrowsize}%
- \def\pIIe@CAW{\expandafter\pIIe@@firstnum\psk@arrowsize}%
- \def\pIIe@FAI{\psk@arrowinset}%
- \def\pIIe@@firstnum#1 #2 {#1\p@}%
- \def\pIIe@@secondnum#1 #2 {#2}%
- }{}%
- }
- \fi
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \paragraph{\LaTeX\ version}
%
@@ -3069,6 +3058,7 @@
%
% \begin{macro}{\oval}
% \begin{macro}{\pIIe@maxovalrad}
+% \begin{macro}{\pIIe@oval}
% The variant of \cmd{\oval} defined here takes an additional optional
% argument, which specifies the maximum radius of the rounded corners
% (default = 20\,pt, as given above).
@@ -3078,19 +3068,23 @@
% \changes{v0.2n}{2004/04/22}{Moved radius test from \cmd{\pIIe@def@UL}
% (RN/HjG)}
% \changes{v0.2n}{2004/04/22}{Allow zero diameter (RN/HjG)}
+% \changes{v0.3d}{2020/06/13}{Allow spaces after the first optional Argument
+% suggested by FMi (RN)}
% \begin{macrocode}
\newcommand*\pIIe@maxovalrad{}
+ \newcommand*\pIIe@oval{}
+ \def\pIIe@oval#1(#2,#3){\@ifnextchar[{\@oval(#2,#3)}{\@oval(#2,#3)[]}}
\renewcommand*\oval[1][\maxovalrad]{%
\begingroup \pIIe@defaultUL\pIIe@maxovalrad{#1}%
\ifdim\pIIe@maxovalrad<\z@ \pIIe@badcircarg \fi
% \end{macrocode}
% Can't close the group here, since arguments must be parsed.
-% (This is done by calling the saved original.)
% \begin{macrocode}
- \pIIe@oldoval}
+ \pIIe@oval}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@oval}
% (This is called in turn by the saved original.)