| 1 |
% \iffalse meta-comment |
| 2 |
% File: picture.dtx |
| 3 |
% Version: 2026-03-07 v2.0 |
| 4 |
% Info: Dimens for picture macros |
| 5 |
% |
| 6 |
% Copyright (C) |
| 7 |
% 2006-2009 Heiko Oberdiek |
| 8 |
% 2016-2026 Oberdiek Package Support Group |
| 9 |
% https://github.com/ho-tex/picture/issues |
| 10 |
% |
| 11 |
% This work may be distributed and/or modified under the |
| 12 |
% conditions of the LaTeX Project Public License, either |
| 13 |
% version 1.3c of this license or (at your option) any later |
| 14 |
% version. This version of this license is in |
| 15 |
% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 16 |
% and the latest version of this license is in |
| 17 |
% https://www.latex-project.org/lppl.txt |
| 18 |
% and version 1.3 or later is part of all distributions of |
| 19 |
% LaTeX version 2005/12/01 or later. |
| 20 |
% |
| 21 |
% This work has the LPPL maintenance status "maintained". |
| 22 |
% |
| 23 |
% The Current Maintainers of this work are |
| 24 |
% Heiko Oberdiek and the Oberdiek Package Support Group |
| 25 |
% https://github.com/ho-tex/picture/issues |
| 26 |
% |
| 27 |
% This file is part of the "bookmark bundle" (The Work in LPPL) |
| 28 |
% and all files in that bundle must be distributed together. |
| 29 |
% |
| 30 |
% This work consists of the main source file picture.dtx and picture.ins |
| 31 |
% and the derived files picture.sty, picture-2024-01-11.sty, picture.pdf |
| 32 |
% and picture-example.tex. |
| 33 |
% |
| 34 |
% Distribution: |
| 35 |
% CTAN:macros/latex/contrib/picture/picture.dtx |
| 36 |
% CTAN:macros/latex/contrib/picture/picture.pdf |
| 37 |
% |
| 38 |
% Unpacking: |
| 39 |
% tex picture.ins |
| 40 |
% |
| 41 |
% Documentation: |
| 42 |
% The class ltxdoc loads the configuration file ltxdoc.cfg |
| 43 |
% if available. Here you can specify further options, e.g. |
| 44 |
% use A4 as paper format: |
| 45 |
% \PassOptionsToClass{a4paper}{article} |
| 46 |
% |
| 47 |
% Programm calls to get the documentation (example): |
| 48 |
% pdflatex picture.dtx |
| 49 |
% makeindex -s gind.ist picture.idx |
| 50 |
% pdflatex picture.dtx |
| 51 |
% makeindex -s gind.ist picture.idx |
| 52 |
% pdflatex picture.dtx |
| 53 |
% |
| 54 |
% Installation: |
| 55 |
% TDS:tex/latex/picture/picture.sty |
| 56 |
% TDS:tex/latex/picture/picture-2024-01-11.sty |
| 57 |
% TDS:doc/latex/picture/picture.pdf |
| 58 |
% TDS:doc/latex/picture/picture-example.tex |
| 59 |
% TDS:source/latex/picture/picture.dtx |
| 60 |
% \fi |
| 61 |
% |
| 62 |
% \iffalse |
| 63 |
%<*driver> |
| 64 |
\NeedsTeXFormat{LaTeX2e}[2020/10/01] |
| 65 |
\documentclass{ltxdoc} |
| 66 |
\usepackage{holtxdoc}[2011/11/22] |
| 67 |
\begin{document} |
| 68 |
\DocInput{picture.dtx}% |
| 69 |
\end{document} |
| 70 |
%</driver> |
| 71 |
% \fi |
| 72 |
% |
| 73 |
% \title{The \xpackage{picture} package} |
| 74 |
% \date{2026-03-07 v2.0} |
| 75 |
% \author{Heiko Oberdiek\thanks |
| 76 |
% {Please report any issues at \url{https://github.com/ho-tex/picture/issues}}} |
| 77 |
% |
| 78 |
% \maketitle |
| 79 |
% |
| 80 |
% \begin{abstract} |
| 81 |
% There are macro and environment arguments that expect numbers |
| 82 |
% that will internally be multiplicated with \cs{unitlength}. |
| 83 |
% This package extends the syntax of these arguments that |
| 84 |
% dimens with calculation support can be added for these arguments. |
| 85 |
% \end{abstract} |
| 86 |
% |
| 87 |
% \tableofcontents |
| 88 |
% \section{Change in version 2.0} |
| 89 |
% |
| 90 |
% Most of the functionality of this package is no longer needed, as |
| 91 |
% the \LaTeX~definitions provides support for dimensions in the arguments |
| 92 |
% of |picture| and macros such as \cs{put}, \cs{line}, \cs{vector} out of |
| 93 |
% the box. The exception is the support for the syntax of the \xpackage{calc} |
| 94 |
% package. Input like |\put(0,\widthof{text})| will \emph{not} work with |
| 95 |
% the kernel commands. |
| 96 |
% |
| 97 |
% Starting with version 2 this package is disabled by default and does nothing. |
| 98 |
% If support for the \xpackage{calc} is wanted, the loading of the previous |
| 99 |
% version of the \xpackage{picture} can be forced with any of the following |
| 100 |
% variants: |
| 101 |
% |
| 102 |
% \begin{verbatim} |
| 103 |
% \usepackage{picture}[=v1] |
| 104 |
% \usepackage[calc]{picture}[=v1] |
| 105 |
% \usepackage[calc]{picture} |
| 106 |
% \end{verbatim} |
| 107 |
% |
| 108 |
% The last option can also be used if the \xpackage{picture} has |
| 109 |
% already been loaded without or without some other option. |
| 110 |
% There will be no option clash error and the package will revert to the old |
| 111 |
% behaviour. |
| 112 |
% |
| 113 |
% \section{User interface of version 1.7} |
| 114 |
% |
| 115 |
% \subsection{Introduction} |
| 116 |
% |
| 117 |
% The environment |picture| and macros such as \cs{put}, \cs{line}, |
| 118 |
% \cs{vector} and other macros have arguments that expect numbers |
| 119 |
% that are used as factor for \cs{unitlength}. |
| 120 |
% This package redefines such macros and adds code that detects |
| 121 |
% whether such an argument is given as number or as length. |
| 122 |
% In the latter case, the length is used directly without multiplying |
| 123 |
% with \cs{unitlength}. |
| 124 |
% |
| 125 |
% \subsection{Options} |
| 126 |
% |
| 127 |
% Depending on the available features, also length expressions |
| 128 |
% can be given. Option \xoption{calc} loads package \xpackage{calc}. |
| 129 |
% Then expressions of these package may be used. |
| 130 |
% Otherwise \xoption{etex} wraps the length argument inside |
| 131 |
% \cs{dimexpr}\dots\cs{relax}, if \eTeX\ is available. Otherwise |
| 132 |
% option \xoption{plain} uses plain assignments without calculation |
| 133 |
% support. |
| 134 |
% |
| 135 |
% The default is \xoption{calc} if package \xpackage{calc} |
| 136 |
% is loaded before package \xoption{picture}. If you specify |
| 137 |
% option \xoption{calc} the loading of \xpackage{calc} is ensured. |
| 138 |
% Otherwise package \xpackage{picture} looks whether \cs{dimexpr} |
| 139 |
% is available and uses then option \xoption{etex} as default. |
| 140 |
% If \eTeX\ also could not be found, then \xoption{plain} is used. |
| 141 |
% |
| 142 |
% \subsection{Example} |
| 143 |
% |
| 144 |
% \begin{macrocode} |
| 145 |
%<*example> |
| 146 |
\documentclass{article} |
| 147 |
|
| 148 |
\usepackage[calc]{picture} |
| 149 |
|
| 150 |
\begin{document} |
| 151 |
|
| 152 |
\setlength{\unitlength}{1pt} |
| 153 |
|
| 154 |
\begin{picture}(\widthof{Hello World}, 10mm) |
| 155 |
\put(0, 0){\makebox(0,0)[lb]{Hello World}}% |
| 156 |
\put(0, \heightof{Hello World} + \fboxsep){% |
| 157 |
\line(1, 0){\widthof{Hello World}}% |
| 158 |
}% |
| 159 |
\put(\widthof{Hello World}, 10mm){% |
| 160 |
\line(0, -1){10mm}% |
| 161 |
}% |
| 162 |
\end{picture} |
| 163 |
|
| 164 |
\end{document} |
| 165 |
%</example> |
| 166 |
% \end{macrocode} |
| 167 |
% |
| 168 |
% \subsection{Supported packages} |
| 169 |
% |
| 170 |
% Packages \xpackage{pspicture} and \xpackage{pict2e} are supported, |
| 171 |
% but they must be loaded before package \xpackage{picture}. |
| 172 |
% |
| 173 |
% New macros can be supported by \cs{picture@redefine}. |
| 174 |
% The first argument is the macro which contains the arguments |
| 175 |
% in its parameter text that you want to support by package \xpackage{picture}. |
| 176 |
% The second argument contains the parameter text. Change \# to \& for |
| 177 |
% the arguments in question. |
| 178 |
% Examples (already used by package \xpackage{picture}): |
| 179 |
% \begin{quote} |
| 180 |
% |\picture@redefine\put{(&1,&2)}|\\ |
| 181 |
% |\picture@redefine\line{(#1,#2)&3}| |
| 182 |
% \end{quote} |
| 183 |
% |
| 184 |
% \StopEventually{ |
| 185 |
% } |
| 186 |
% |
| 187 |
% \section{Implementation} |
| 188 |
% \subsection{Identification} |
| 189 |
% \begin{macrocode} |
| 190 |
%<*package> |
| 191 |
\NeedsTeXFormat{LaTeX2e} |
| 192 |
\ProvidesPackage{picture}% |
| 193 |
[2026-03-07 v2 Dimens for picture macros (HO)]% |
| 194 |
% \end{macrocode} |
| 195 |
% |
| 196 |
% \subsection{Release handling} |
| 197 |
% \begin{macrocode} |
| 198 |
\providecommand\DeclareRelease[3]{} |
| 199 |
\providecommand\DeclareCurrentRelease[2]{} |
| 200 |
\DeclareRelease{v1}{0000-00-00}{picture-2024-01-11.sty} |
| 201 |
\DeclareCurrentRelease{}{2024-01-11} |
| 202 |
% \end{macrocode} |
| 203 |
% |
| 204 |
% \subsection{Option} |
| 205 |
% \begin{macrocode} |
| 206 |
\def\Pc@calcname{calc} |
| 207 |
\def\Pc@load@frozen@version |
| 208 |
{ |
| 209 |
\RequirePackage{calc}% |
| 210 |
\RequirePackage[calc]{picture-2024-01-11}% |
| 211 |
} |
| 212 |
\DeclareKeys |
| 213 |
{ |
| 214 |
calc .code:n = \Pc@load@frozen@version, |
| 215 |
calc .usage:n= preamble, |
| 216 |
plain.code:n={}, |
| 217 |
etex .code:n={} |
| 218 |
} |
| 219 |
|
| 220 |
\ProcessKeyOptions |
| 221 |
\AtBeginDocument{ |
| 222 |
\ifx\Pc@method\Pc@calcname |
| 223 |
\else |
| 224 |
{ |
| 225 |
\PackageWarning{picture} |
| 226 |
{The picture package has been disabled as most\MessageBreak |
| 227 |
of its functionality is now provided by LaTeX directly.\MessageBreak |
| 228 |
To force the loading of the previous version use\MessageBreak |
| 229 |
`\string\usepackage\string{picture\string}[=v1]`\MessageBreak |
| 230 |
or |
| 231 |
`\string\usepackage[calc]\string{picture\string}` |
| 232 |
} |
| 233 |
{} |
| 234 |
} |
| 235 |
\fi} |
| 236 |
% \end{macrocode} |
| 237 |
%</package> |
| 238 |
% |
| 239 |
% \subsection{Identification of version 1} |
| 240 |
% \begin{macrocode} |
| 241 |
%<*packagev1> |
| 242 |
\NeedsTeXFormat{LaTeX2e} |
| 243 |
\ProvidesPackage{picture-2024-01-11}% |
| 244 |
[2024/01/11 version1.7 Dimens for picture macros (HO)]% |
| 245 |
% \end{macrocode} |
| 246 |
% |
| 247 |
% \subsection{Options} |
| 248 |
% |
| 249 |
% \begin{macrocode} |
| 250 |
\def\Pc@calcname{calc} |
| 251 |
\def\Pc@etexname{etex} |
| 252 |
\def\Pc@plainname{plain} |
| 253 |
% \end{macrocode} |
| 254 |
% \begin{macro}{\Pc@method} |
| 255 |
% Macro \cs{Pc@method} stores the method to use for calculations. |
| 256 |
% Check which features are available and set the default for \cs{Pc@method}. |
| 257 |
% \begin{macrocode} |
| 258 |
\@ifpackageloaded{calc}{% |
| 259 |
\let\Pc@method\Pc@calcname |
| 260 |
}{% |
| 261 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 262 |
\expandafter\ifx\csname dimexpr\endcsname\relax |
| 263 |
\let\Pc@method\Pc@plainname |
| 264 |
\else |
| 265 |
\let\Pc@method\Pc@etexname |
| 266 |
\fi |
| 267 |
} |
| 268 |
% \end{macrocode} |
| 269 |
% \end{macro} |
| 270 |
% \begin{macrocode} |
| 271 |
\DeclareOption{plain}{% |
| 272 |
\let\Pc@method\Pc@plainname |
| 273 |
} |
| 274 |
\DeclareOption{etex}{% |
| 275 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 276 |
\expandafter\ifx\csname dimexpr\endcsname\relax |
| 277 |
\PackageError{picture}{% |
| 278 |
e-TeX is not available% |
| 279 |
}\@ehc |
| 280 |
\else |
| 281 |
\let\Pc@method\Pc@etexname |
| 282 |
\fi |
| 283 |
} |
| 284 |
\DeclareOption{calc}{% |
| 285 |
\let\Pc@method\Pc@calcname |
| 286 |
} |
| 287 |
\ProcessOptions* |
| 288 |
\begingroup |
| 289 |
\let\on@line\@empty |
| 290 |
\PackageInfo{picture}{Calculation method: \Pc@method}% |
| 291 |
\endgroup |
| 292 |
% \end{macrocode} |
| 293 |
% |
| 294 |
% \subsection{Calculation method} |
| 295 |
% |
| 296 |
% \begin{macrocode} |
| 297 |
\ifx\Pc@method\Pc@calcname |
| 298 |
\RequirePackage{calc}% |
| 299 |
\fi |
| 300 |
% \end{macrocode} |
| 301 |
% |
| 302 |
% \subsubsection{Method \xoption{calc}} |
| 303 |
% |
| 304 |
% \begin{macrocode} |
| 305 |
\ifx\Pc@method\Pc@calcname |
| 306 |
\def\Pc@tokslength#1{% |
| 307 |
\begingroup |
| 308 |
\let\calc@error\Pc@calc@error |
| 309 |
\setlength\dimen@{#1\unitlength}\Pc@next\Pc@nil{#1}% |
| 310 |
}% |
| 311 |
\let\PcOrg@calc@error\calc@error |
| 312 |
\@ifpackagelater{calc}{2007/08/22}{% v4.3 |
| 313 |
\def\Pc@calc@error#1{% |
| 314 |
\expandafter\ifx\expandafter\unitlength\noexpand#1\relax |
| 315 |
\def\calc@next##1!{% |
| 316 |
\endgroup |
| 317 |
\aftergroup\afterassignment |
| 318 |
\aftergroup\Pc@next |
| 319 |
}% |
| 320 |
\expandafter\@firstoftwo |
| 321 |
\else |
| 322 |
\expandafter\@secondoftwo |
| 323 |
\fi |
| 324 |
{% |
| 325 |
\calc@next{#1}% |
| 326 |
}{% |
| 327 |
\PcOrg@calc@error{#1}% |
| 328 |
}% |
| 329 |
}% |
| 330 |
}{% |
| 331 |
\def\Pc@calc@error#1{% |
| 332 |
\expandafter\ifx\expandafter\unitlength\noexpand#1\relax |
| 333 |
\def\calc@next##1!{% |
| 334 |
\endgroup |
| 335 |
\aftergroup\afterassignment |
| 336 |
\aftergroup\Pc@next |
| 337 |
}% |
| 338 |
\expandafter\@gobble |
| 339 |
\else |
| 340 |
\expandafter\@firstofone |
| 341 |
\fi |
| 342 |
{% |
| 343 |
\PcOrg@calc@error{#1}% |
| 344 |
}% |
| 345 |
}% |
| 346 |
}% |
| 347 |
\fi |
| 348 |
% \end{macrocode} |
| 349 |
% |
| 350 |
% \subsubsection{Method \xoption{etex}} |
| 351 |
% |
| 352 |
% \begin{macrocode} |
| 353 |
\ifx\Pc@method\Pc@etexname |
| 354 |
\def\Pc@tokslength#1{% |
| 355 |
\begingroup |
| 356 |
\afterassignment\Pc@next |
| 357 |
\dimen@=\dimexpr#1\unitlength\Pc@nil{#1}% |
| 358 |
}% |
| 359 |
\fi |
| 360 |
% \end{macrocode} |
| 361 |
% |
| 362 |
% \subsubsection{Method \xoption{plain}} |
| 363 |
% |
| 364 |
% \begin{macrocode} |
| 365 |
\ifx\Pc@method\Pc@plainname |
| 366 |
\def\Pc@tokslength#1{% |
| 367 |
\begingroup |
| 368 |
\afterassignment\Pc@next |
| 369 |
\dimen@=#1\unitlength\Pc@nil{#1}% |
| 370 |
}% |
| 371 |
\fi |
| 372 |
% \end{macrocode} |
| 373 |
% |
| 374 |
% \subsubsection{Help macros} |
| 375 |
% |
| 376 |
% \begin{macrocode} |
| 377 |
\def\Pc@next#1\Pc@nil#2{% |
| 378 |
\ifx\\#1\\% |
| 379 |
\endgroup |
| 380 |
\Pc@addtoks{{#2}}% |
| 381 |
\else |
| 382 |
\expandafter\endgroup |
| 383 |
\expandafter\Pc@addtoks\expandafter{% |
| 384 |
\expandafter{\the\dimen@}% |
| 385 |
}% |
| 386 |
\fi |
| 387 |
} |
| 388 |
% \end{macrocode} |
| 389 |
% \begin{macro}{\Pc@nil} |
| 390 |
% \cs{Pc@nil} must not have the meaning of \cs{relax} because of |
| 391 |
% \cs{dimexpr}. |
| 392 |
% \begin{macrocode} |
| 393 |
\let\Pc@nil\message |
| 394 |
% \end{macrocode} |
| 395 |
% \end{macro} |
| 396 |
% \begin{macro}{\Pc@addtoks} |
| 397 |
% \begin{macrocode} |
| 398 |
\def\Pc@addtoks#1{% |
| 399 |
\toks@=\expandafter{\the\toks@#1}% |
| 400 |
} |
| 401 |
% \end{macrocode} |
| 402 |
% \end{macro} |
| 403 |
% \begin{macro}{\Pc@init} |
| 404 |
% \begin{macrocode} |
| 405 |
\def\Pc@init#1{% |
| 406 |
\begingroup |
| 407 |
\toks@={#1}% |
| 408 |
} |
| 409 |
% \end{macrocode} |
| 410 |
% \end{macro} |
| 411 |
% \begin{macro}{\Pc@finish} |
| 412 |
% \begin{macrocode} |
| 413 |
\def\Pc@finish#1{% |
| 414 |
\expandafter\endgroup |
| 415 |
\expandafter#1\the\toks@ |
| 416 |
} |
| 417 |
% \end{macrocode} |
| 418 |
% \end{macro} |
| 419 |
% |
| 420 |
% \subsection{Redefinitions} |
| 421 |
% |
| 422 |
% \begin{macro}{\picture@redefine} |
| 423 |
% \begin{tabular}[t]{@{}l@{ }l@{}} |
| 424 |
% |#1|:& command name\\ |
| 425 |
% |#2|:& parameter text, length parameter with \& instead of \# |
| 426 |
% \end{tabular} |
| 427 |
% \begin{macrocode} |
| 428 |
\def\picture@redefine#1#2{% |
| 429 |
\begingroup |
| 430 |
\edef\reserved@a{% |
| 431 |
\noexpand\noexpand |
| 432 |
\expandafter\noexpand |
| 433 |
\csname PcOrg@\expandafter\@gobble\string#1\endcsname |
| 434 |
}% |
| 435 |
\toks0{#1}% |
| 436 |
\Pc@first#2&0% |
| 437 |
} |
| 438 |
% \end{macrocode} |
| 439 |
% \end{macro} |
| 440 |
% \begin{macro}{\Pc@first} |
| 441 |
% \begin{macrocode} |
| 442 |
\def\Pc@first#1&{% |
| 443 |
\toks1={#1}% |
| 444 |
\toks2={\Pc@init{#1}}% |
| 445 |
\Pc@scanlength |
| 446 |
} |
| 447 |
% \end{macrocode} |
| 448 |
% \end{macro} |
| 449 |
% \begin{macro}{\Pc@scanlength} |
| 450 |
% |#1|: number of length parameter or zero |
| 451 |
% \begin{macrocode} |
| 452 |
\def\Pc@scanlength#1{% |
| 453 |
\ifcase#1 % |
| 454 |
\expandafter\Pc@last |
| 455 |
\else |
| 456 |
\toks1=\expandafter{\the\toks1 ###1}% |
| 457 |
\toks2=\expandafter{\the\toks2 \Pc@tokslength{###1}}% |
| 458 |
\expandafter\Pc@scannext |
| 459 |
\fi |
| 460 |
} |
| 461 |
% \end{macrocode} |
| 462 |
% \end{macro} |
| 463 |
% \begin{macro}{\Pc@scannext} |
| 464 |
% \begin{macrocode} |
| 465 |
\def\Pc@scannext#1&{% |
| 466 |
\ifx\\#1\\% |
| 467 |
\else |
| 468 |
\toks1=\expandafter{\the\toks1 #1}% |
| 469 |
\toks2=\expandafter{\the\toks2 \Pc@addtoks{#1}}% |
| 470 |
\fi |
| 471 |
\Pc@scanlength |
| 472 |
} |
| 473 |
% \end{macrocode} |
| 474 |
% \end{macro} |
| 475 |
% \begin{macro}{\Pc@last} |
| 476 |
% \begin{macrocode} |
| 477 |
\def\Pc@last{% |
| 478 |
\edef\x{% |
| 479 |
\endgroup |
| 480 |
\let\reserved@a\the\toks0 % |
| 481 |
\def\the\toks0 \the\toks1 {% |
| 482 |
\the\toks2 % |
| 483 |
\noexpand\Pc@finish\reserved@a |
| 484 |
}% |
| 485 |
}% |
| 486 |
\x |
| 487 |
} |
| 488 |
% \end{macrocode} |
| 489 |
% \end{macro} |
| 490 |
% |
| 491 |
% \subsubsection{\LaTeX\ base macros} |
| 492 |
% |
| 493 |
% \begin{macrocode} |
| 494 |
\picture@redefine\@picture{(&1,&2)(&3,&4)} |
| 495 |
\picture@redefine\put{(&1,&2)} |
| 496 |
\picture@redefine\multiput{(&1,&2)} |
| 497 |
\picture@redefine\@multiput{(&1,&2)} |
| 498 |
\picture@redefine\line{(#1,#2)&3} |
| 499 |
\picture@redefine\vector{(#1,#2)&3} |
| 500 |
\picture@redefine\dashbox{&1(&2,&3)} |
| 501 |
\picture@redefine\@circle{&1} |
| 502 |
\picture@redefine\@dot{&1} |
| 503 |
\picture@redefine\@bezier{#1(&2,&3)(&4,&5)(&6,&7)} |
| 504 |
\picture@redefine\@imakepicbox{(&1,&2)} |
| 505 |
% \end{macrocode} |
| 506 |
% |
| 507 |
% \subsubsection{Package \xpackage{pspicture}} |
| 508 |
% |
| 509 |
% Package \xpackage{pspicture} changes the signature of \cs{@oval} |
| 510 |
% by adding an optional argument. |
| 511 |
% \begin{macrocode} |
| 512 |
\@ifpackageloaded{pspicture}{% |
| 513 |
\picture@redefine\@oval{[&1](&2,&3)}% |
| 514 |
\picture@redefine\Line{(&1,&2)}% |
| 515 |
\picture@redefine\Curve{(&1,&2)}% |
| 516 |
\picture@redefine\Vector{(&1,&2)}% |
| 517 |
}{% |
| 518 |
\picture@redefine\@oval{(&1,&2)}% |
| 519 |
} |
| 520 |
% \end{macrocode} |
| 521 |
% |
| 522 |
% \subsubsection{Package \xpackage{pict2e}} |
| 523 |
% Additions suggested in https://github.com/ho-tex/picture/issues/1 |
| 524 |
% \begin{macrocode} |
| 525 |
\@ifpackageloaded{pict2e}{% |
| 526 |
\AtBeginDocument{% |
| 527 |
\picture@redefine\@cbezier{[#1](&2,&3)(&4,&5)(&6,&7)(&8,&9)}% |
| 528 |
} |
| 529 |
\picture@redefine\pIIe@arc@@{(#1,#2)&3} |
| 530 |
\picture@redefine\polyline{(&1,&2)} |
| 531 |
\picture@redefine\@polyline{(&1,&2)} |
| 532 |
\picture@redefine\@polygon{(&1,&2)} |
| 533 |
\picture@redefine\@@polygon{(&1,&2)} |
| 534 |
\picture@redefine\moveto{(&1,&2)} |
| 535 |
\picture@redefine\lineto{(&1,&2)} |
| 536 |
\picture@redefine\curveto{(&1,&2)(&3,&4)(&5,&6)} |
| 537 |
}{} |
| 538 |
% \end{macrocode} |
| 539 |
% \subsection{Check package loading order} |
| 540 |
% |
| 541 |
% \begin{macro}{\PC@checkpackage} |
| 542 |
% \begin{macrocode} |
| 543 |
\def\Pc@checkpackage#1{% |
| 544 |
\@ifpackageloaded{#1}{% |
| 545 |
}{% |
| 546 |
\AtBeginDocument{% |
| 547 |
\@ifpackageloaded{#1}{% |
| 548 |
\PackageWarningNoLine{picture}{% |
| 549 |
Package `#1' is loaded after `picture'.\MessageBreak |
| 550 |
Load package `picture' afterwards to get full support% |
| 551 |
\MessageBreak |
| 552 |
of its additional syntax with length specifications% |
| 553 |
}% |
| 554 |
}{}% |
| 555 |
}% |
| 556 |
}% |
| 557 |
} |
| 558 |
% \end{macrocode} |
| 559 |
% \end{macro} |
| 560 |
% \begin{macrocode} |
| 561 |
\Pc@checkpackage{pict2e} |
| 562 |
\Pc@checkpackage{pspicture} |
| 563 |
% \end{macrocode} |
| 564 |
% |
| 565 |
% \begin{macrocode} |
| 566 |
%</packagev1> |
| 567 |
% \end{macrocode} |
| 568 |
% |
| 569 |
% \section{Installation} |
| 570 |
% |
| 571 |
% \subsection{Download} |
| 572 |
% |
| 573 |
% \paragraph{Package.} This package is available on |
| 574 |
% CTAN\footnote{\CTANpkg{picture}}: |
| 575 |
% \begin{description} |
| 576 |
% \item[\CTAN{macros/latex/contrib/picture/picture.dtx}] The source file. |
| 577 |
% \item[\CTAN{macros/latex/contrib/picture/picture.pdf}] Documentation. |
| 578 |
% \end{description} |
| 579 |
% |
| 580 |
% \subsection{Package installation} |
| 581 |
% |
| 582 |
% \paragraph{Unpacking.} Run tex or latex on the \xfile{.ins} |
| 583 |
% \begin{quote} |
| 584 |
% \verb|tex picture.dtx| |
| 585 |
% \end{quote} |
| 586 |
% |
| 587 |
% \paragraph{TDS.} Now the different files must be moved into |
| 588 |
% the different directories in your installation TDS tree |
| 589 |
% (also known as \xfile{texmf} tree): |
| 590 |
% \begin{quote} |
| 591 |
% \def\t{^^A |
| 592 |
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} |
| 593 |
% picture.sty & tex/latex/picture/picture.sty\\ |
| 594 |
% picture-2024-01-11.sty & tex/latex/picture/picture-2024-01-11.sty\\ |
| 595 |
% picture.pdf & doc/latex/picture/picture.pdf\\ |
| 596 |
% picture-example.tex & doc/latex/picture/picture-example.tex\\ |
| 597 |
% picture.dtx & source/latex/picture/picture.dtx\\ |
| 598 |
% \end{tabular}^^A |
| 599 |
% }^^A |
| 600 |
% \sbox0{\t}^^A |
| 601 |
% \ifdim\wd0>\linewidth |
| 602 |
% \begingroup |
| 603 |
% \advance\linewidth by\leftmargin |
| 604 |
% \advance\linewidth by\rightmargin |
| 605 |
% \edef\x{\endgroup |
| 606 |
% \def\noexpand\lw{\the\linewidth}^^A |
| 607 |
% }\x |
| 608 |
% \def\lwbox{^^A |
| 609 |
% \leavevmode |
| 610 |
% \hbox to \linewidth{^^A |
| 611 |
% \kern-\leftmargin\relax |
| 612 |
% \hss |
| 613 |
% \usebox0 |
| 614 |
% \hss |
| 615 |
% \kern-\rightmargin\relax |
| 616 |
% }^^A |
| 617 |
% }^^A |
| 618 |
% \ifdim\wd0>\lw |
| 619 |
% \sbox0{\small\t}^^A |
| 620 |
% \ifdim\wd0>\linewidth |
| 621 |
% \ifdim\wd0>\lw |
| 622 |
% \sbox0{\footnotesize\t}^^A |
| 623 |
% \ifdim\wd0>\linewidth |
| 624 |
% \ifdim\wd0>\lw |
| 625 |
% \sbox0{\scriptsize\t}^^A |
| 626 |
% \ifdim\wd0>\linewidth |
| 627 |
% \ifdim\wd0>\lw |
| 628 |
% \sbox0{\tiny\t}^^A |
| 629 |
% \ifdim\wd0>\linewidth |
| 630 |
% \lwbox |
| 631 |
% \else |
| 632 |
% \usebox0 |
| 633 |
% \fi |
| 634 |
% \else |
| 635 |
% \lwbox |
| 636 |
% \fi |
| 637 |
% \else |
| 638 |
% \usebox0 |
| 639 |
% \fi |
| 640 |
% \else |
| 641 |
% \lwbox |
| 642 |
% \fi |
| 643 |
% \else |
| 644 |
% \usebox0 |
| 645 |
% \fi |
| 646 |
% \else |
| 647 |
% \lwbox |
| 648 |
% \fi |
| 649 |
% \else |
| 650 |
% \usebox0 |
| 651 |
% \fi |
| 652 |
% \else |
| 653 |
% \lwbox |
| 654 |
% \fi |
| 655 |
% \else |
| 656 |
% \usebox0 |
| 657 |
% \fi |
| 658 |
% \end{quote} |
| 659 |
% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's |
| 660 |
% TDS installing feature, then some files can already be in the right |
| 661 |
% place, see the documentation of \docstrip. |
| 662 |
% |
| 663 |
% \subsection{Refresh file name databases} |
| 664 |
% |
| 665 |
% If your \TeX~distribution |
| 666 |
% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh |
| 667 |
% these. For example, \TeX\,Live\ users run \verb|texhash| or |
| 668 |
% \verb|mktexlsr|. |
| 669 |
% |
| 670 |
% \paragraph{Generating the documentation.} |
| 671 |
% You can use the \xfile{.dtx}. The process can be configured by the |
| 672 |
% configuration file \xfile{ltxdoc.cfg}. For instance, put this |
| 673 |
% line into this file, if you want to have A4 as paper format: |
| 674 |
% \begin{quote} |
| 675 |
% \verb|\PassOptionsToClass{a4paper}{article}| |
| 676 |
% \end{quote} |
| 677 |
% An example follows how to generate the |
| 678 |
% documentation with pdf\LaTeX: |
| 679 |
% \begin{quote} |
| 680 |
%\begin{verbatim} |
| 681 |
%pdflatex picture.dtx |
| 682 |
%makeindex -s gind.ist picture.idx |
| 683 |
%pdflatex picture.dtx |
| 684 |
%makeindex -s gind.ist picture.idx |
| 685 |
%pdflatex picture.dtx |
| 686 |
%\end{verbatim} |
| 687 |
% \end{quote} |
| 688 |
% |
| 689 |
% \begin{History} |
| 690 |
% \begin{Version}{2006/08/26 v1.0} |
| 691 |
% \item |
| 692 |
% First released version. (First start of the project was June/July 2002.) |
| 693 |
% \end{Version} |
| 694 |
% \begin{Version}{2007/04/11 v1.1} |
| 695 |
% \item |
| 696 |
% Line ends sanitized. |
| 697 |
% \end{Version} |
| 698 |
% \begin{Version}{2008/11/26 v1.2} |
| 699 |
% \item |
| 700 |
% Package \xpackage{pict2e} added to documentation section ``Supported |
| 701 |
% packages''. |
| 702 |
% \item |
| 703 |
% Package order of supported packages is checked. |
| 704 |
% \end{Version} |
| 705 |
% \begin{Version}{2009/10/11 v1.3} |
| 706 |
% \item |
| 707 |
% Fix because of new version v4.3 of package \xpackage{calc}. |
| 708 |
% \end{Version} |
| 709 |
% \begin{Version}{2016/05/16 v1.4} |
| 710 |
% \item |
| 711 |
% Documentation updates. |
| 712 |
% \end{Version} |
| 713 |
% \begin{Version}{2019/12/09 v1.5} |
| 714 |
% \item |
| 715 |
% Documentation updates. |
| 716 |
% \end{Version} |
| 717 |
% \begin{Version}{2020-04-22 v1.6} |
| 718 |
% \item Added definitions for pict2e (https://github.com/ho-tex/picture/issues/1) |
| 719 |
% \end{Version} |
| 720 |
% \begin{Version}{2024-01-11 v1.7} |
| 721 |
% \item Remove a now unneeded \verb|\@gobble|, requires LaTex 2020-10-01 (https://github.com/ho-tex/picture/issues/2) |
| 722 |
% \end{Version} |
| 723 |
% \begin{Version}{2026-03-07 v2.0} |
| 724 |
% \item Package is disabled unless the calc option is required. |
| 725 |
% \end{Version} |
| 726 |
% \end{History} |
| 727 |
% |
| 728 |
% \PrintIndex |
| 729 |
% |
| 730 |
% \Finale |
| 731 |
\endinput |