diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-29 00:31:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-29 00:31:31 +0000 |
commit | 6bc1f5497cfb2f56d65c80a4c36ea3bad6dc046c (patch) | |
tree | f7751da75030fb1e06653eeb44e579fcee09c65f /Master/texmf-dist/doc/generic/pgf | |
parent | ed0c7c756e441b2d2ba3633da233fc24361ac0d3 (diff) |
pgf 2.10 (28oct10)
git-svn-id: svn://tug.org/texlive/trunk@20236 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf')
125 files changed, 24330 insertions, 5385 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/AUTHORS b/Master/texmf-dist/doc/generic/pgf/AUTHORS index 6ff615fb975..8bd3d5bde95 100644 --- a/Master/texmf-dist/doc/generic/pgf/AUTHORS +++ b/Master/texmf-dist/doc/generic/pgf/AUTHORS @@ -1,2 +1,3 @@ Till Tantau <tantau@users.sourceforge.net> -Mark Wibrow
\ No newline at end of file +Mark Wibrow +Christian Feuersaenger <ludewich@users.sourceforge.net> diff --git a/Master/texmf-dist/doc/generic/pgf/ChangeLog b/Master/texmf-dist/doc/generic/pgf/ChangeLog index 59e78c56e82..6b0704d18ca 100644 --- a/Master/texmf-dist/doc/generic/pgf/ChangeLog +++ b/Master/texmf-dist/doc/generic/pgf/ChangeLog @@ -1,3 +1,1469 @@ +2010-10-25 Christian Feuersaenger <ludewich@users.sourceforge.net> + + Released version 2.10 + +2010-10-22 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - closed a lot of bugs on sourceforge, especially documentation bugs + - fixed bug 2429749: gnuplot invocation in tabularx did not work. + +2010-10-21 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed bug: there was an incompatibility between pgf and beamer due to a + missing \interlineskip in the shipout handling for latex. + +2010-10-15 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - renamed 'halfcircle' marker to 'halfcircle*' and added 'halfcircle'. + - provided special case 'mark color=none' for the half-filled markers. + +2010-10-13 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed incorrect fill/stroke coloring of new marker contributions (see + ChangeLog 2010-09-27) + - added more predefined dashed and dotted line patterns for black/white plots + to fulfill a related feature request of Tomek + - fixed bug: the 'name path global' feature did not work in every case... + the actual implementation might need to be revised eventually. + +2010-10-12 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Imported spell checking results of Stefan Pinnow (thanks!) + - Dealed with typo in 'sci generic' number formatting style: it now + accepts 'mantissa' *and* 'mantisse' + +2010-10-11 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - External lib: Fixed bug. The 'failed ref warnings for' was not properly \protect'ed. + +2010-09-27 Till Tantau <tantua@users.sourceforge.net> + + - Started on graph lib. Not yet finished and not documented. + + +2010-09-21 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added plot markers of Magnus Tewes and Tomek: halfcircle, halfsquare*, + halfsquare left*, halfsquare right*, heart + +2010-09-08 Till Tantau <tantua@users.sourceforge.net> + + - Added \pgfpositionnodelater and \pgfpositionnodenow + commands. + + +2010-08-31 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - externalization+\ref: fixed a bug + +2010-08-30 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: documented how to generate .png graphics and added support + switches. + +2010-08-26 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added 'baseline=default', 'trim left=default' and 'trim right=default' choices to reset these keys. + +2010-08-25 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added support to provide paragraphs in "pin" arguments + +2010-08-24 Till Tantau <tantau@users.sourceforge.net> + + - Worked on data visualization and its documentation. + + +2010-08-23 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - basic level externalization: added \hoffset=0pt and \voffset=0pt to improve + compatibility with special document classes + - added docs for \deferredanchor feature contributed by Christophe Jorssen <cjorssen@users.sourceforge.net> + - ConTeXt support: fixed loading problem of calendar lib + + +2010-08-18 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - pgfsys-tex4ht.def: fixed problem with \par in a non-long macro argument, + thereby eliminating a compilation problem + - pgfsys-tex4ht.def: renamed offending macro invocation \Par to \par + + +2010-08-16 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - basic level image externalization: added '/pgf/images/trim external={<left>}{<bottom>}{<right>}{<top>}' + to allow modifications to the hardcoded '1truein' shifts. + - added '/.style n args' key. + - \usetikzlibrary / \usepgflibrary: added support for white-space trimming + and empty arguments in the lists. Now, lines do not need to be terminated + by '%' and ',,' is valid. + +2010-08-13 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: documented how to solve compatibility problems with + \tikzifexternalizing + +2010-08-11 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \deferredanchor feature contributed by Christophe Jorssen <cjorssen@users.sourceforge.net> + +2010-08-03 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added optimized and numerically stable arc path command + \pgfpatharctoprecomputed which interpolates start- and end points + +2010-07-10 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: fixed incompatibility with 2010/06/08 v2.0b eso-pic package + +2010-07-06 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: added sanity checking for failed \ref,\pageref,\cite commands in external images. + +2010-07-01 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - math parser: improved error messages by providing the complete math expression. + +2010-06-30 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added 'trim left' and 'trim right' features to simplify bounding box + modifications and allow support for restricted bounding boxes and image + externalization. + +2010-06-16 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - pgfutil-latex.def: changed \usepackage to \RequirePackage (thanks to Christophe Jorssen) + - external lib: added \tikzappendtofigurename{} shortcut for '\tikzset{external/figure name/.add={}{suffix}}' + +2010-06-14 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: added warning at end of document if not all graphics have + been found. + +2010-06-10 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - updated file 'tikzexternal.sty' for \label and \ref support inside of + externalized graphics + - documented how \label and \ref support in external graphics works. + - activated \label support for mode=convert with system call and + documented limitations. + +2010-06-09 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \tikzifinpicture{<true code>}{<false code>} macro + +2010-05-31 Till Tantau <tantau@users.sourceforge.net> + + - Worked on data visualization. + +2010-05-30 Till Tantau <tantau@users.sourceforge.net> + + - Added .list key handler. + +2010-05-26 Till Tantau <tantau@users.sourceforge.net> + + - Worked on data visualization. + +2010-05-06 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - improved sanity checking in number printer: now, the zero flag is + checked even if its exponent > 0 + +2010-04-22 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - floatparsenumber: number format errors after exponents now contain the offending + character instead of '\relax' + +2010-04-12 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - number printer: added 'frac denom' and 'frac whole' for fine tuning of + fractional number printing. + +2010-04-10 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - number printer: made \protect portable across TeX variants (doesn't + produce bugs with context anymore) + - fpu: optimized \pgfmathfloatgetflagstomacro + +2010-04-09 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \pgfresetboundingbox + - added \pgfgetlastxy coordinate macro + - added '/pgf/images/include external/<image name>' code key. + +2010-04-08 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fpu: added convenience method \pgfmathfloattoint + +2010-03-31 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - number printer: added 'frac' style to automatically create fractionals. + +2010-03-25 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - splitted basic level file pgfcoreimage.code.tex: there is now a + pgfcoreexternal.code.tex file. + +2010-03-24 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - \pgfmathprintnumber is no longer a "fragile" command (it is \protect'ed + automatically in LaTeX). + +2010-03-23 Till Tantau <tantau@users.sourceforge.net> + + - Fixed baseline alignment with "text width" option in LaTeX. + +2010-03-23 Mark Wibrow <vibrovski@users.sourceforge.net> + + - New divide function + - Rewrote code foreach extensions. Now no longer an impenetrable mess. + pgffor.code.tex is much larger, but contains some (as yet) undocumented + features which may get optimised out. + +2010-03-19 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Image externalization: added '/pgf/images/aux in dpth' feature. + It allows to store \label and other .aux file related stuff in the image's + .dpth file which is processed when when the main document includes the + image. + The new switch is on for the semi-automatic modes of the external lib, otherwise it is + off. + +2010-03-17 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - pgfkeys: added '.code n args' handler. The difference to '.code + args={#1#2#3}' is that keys defined with 'code n args' gobble spaces + between the arguments. + Note: 'code 2 args' remains as-is (it has the special feature that the + second argument is optional). + - fixed bug in '/.add code' key handler: it didn't work properly for + complicated keys + - pgfkeys manual section: updated xrefs and docs + +2010-03-15 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: \tikzexternalize no longer needs (but still accepts) the + main job's name. Changes are now documented and the replacement |.sty| + file has been updated. + - intersection lib: added 'name path global' feature. + +2010-03-11 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: partially fixed incompatibility with glossary package and + documented work-around + +2010-03-05 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - FPU: added \pgfmathfloatifapproxequalrel + - number printing: added style to configure |sci precision| + - number printing: added style to configure |std=<lower e>:<upper e>| + +2010-03-03 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: the <real job's name> argument from \tikzexternalize is + now optional. It can be deduced automatically if it is missing. + +2010-02-18 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - number printing: added 'sci generic' style to customize the appearance + of scientific format and a 'verbatim' style which doesn't use TeX macros + for the formatted numbers. + +2010-02-17 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: now, a |\jobname.auxlock| file will be generated in order + to detect whether the \jobname.aux file is in its final state. This allows + to export any images containing |\ref{}| manually; the automatic procedure + will not use the .aux file. + +2010-02-16 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added \ifpgfexternalreadmainaux switch. Will be used to avoid buffering + problems during externalization mode 'convert with system call'. + +2010-02-16 Till Tantau <tantau@users.sourceforge.net> + + - Fixed bug "papersize not supported by pgfsys-xetex.def - ID: 2934982" + + +2010-02-09 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Improved automatic cross referencing: auto key path prefixing failed for + spaces in key paths. + +2010-02-08 Till Tantau <tantau@users.sourceforge.net> + + - Added "on background layer" key to backgrounds lib. + +2010-02-02 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \pgfmathifisint + - supported \nofiles in auto xref generation + +2010-02-01 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - externalization: both, basic layer and external lib now support \ref{}s + inside of externalized pictures. Furthermore, they won't generate any aux + files on their own (which wouldn't be thread safe and is not useful + anyway) + +2010-01-29 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: fixed bug with figure list/makefile handling and file + deps: calling file dependency handlings outside of a picture could result + in compilation failures + +2010-01-27 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: mode=list and make now supports the force remake keys. + - external lib: the -shell-escape switch for nested system calls is + activated only if it was active for the main document. This should allow a + reasonable security measure for mode=list and make (which will also work + without system calls from within TeX). + +2010-01-18 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: added support for file dependencies. + For mode=list and make, any file dependencies configured with + \tikzpicturedependsonfile{<name>} will be checked by the generated + makefile. + + +2010-01-16 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - profiler library now uses an output file which contains the current date + and time. Furthermore, it counts every invocation and allows to show every + command invocation (optionally with arguments expanded). + +2010-01-14 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - profiler library can now profile macros with arbitrary argument pattern + and is more rebust with respect to save stack usage + +2010-01-11 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - worked on profiler library and added docs for it. + +2010-01-10 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added first draft of the pgf 'profiler' library + +2010-01-07 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fix for rounded corners affecting custom fills in rectangle + split shape. + +2009-12-29 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - updated the 'make dist' documentation target such that it compresses + every pdf object. The resulting manual is half as large than without + compression, but it requires pdf 1.5 (at least acrobat 6.0). + +2009-12-22 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: some output messages did not respect the 'verbose + IO=false' flag; fixed that + - fixed buggy treatment of some automatic cross references in manual + +2009-12-15 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: improved the tikzexternal.sty package which can be used + without pgf installed. + +2009-12-04 Till Tantau <tantau@users.sourceforge.net> + + - added spy library. + +2009-12-02 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - imported a patch of Andy Schlaikjer which extends the 'plot gnuplot' + feature to read the ``unbounded point'' information provided by gnuplot. + +2009-11-29 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \r@pgf@reada temporary \openin register for compatibility with + other packages + +2009-11-19 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed an auto xref bug which wrote '\pgfkeys{}' although the manual + contained |\pgfkeys|. + +2009-11-18 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: the 'optimize command away' things where not activated + accidentally. I fixed it. + - added support for new paragraphs in pgfkeys values + - fixed bug in |const plot| handler (and all its variants): the first + coordinate was transformed twice + +2009-11-15 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - auto xrefs now support point coordinate systems. + - auto xrefs now provide an interface to deal with tricky active + characters (for |-) + - external lib: improved compatibility with |fadings| libary. + - replaced 'set terminal table; set output "<file>"' by 'set table "<file>"' + to maintain compatibility with the new gnuplot version. + +2009-11-14 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - pgfmanual.pdf: provided a 'make dist' target in version_for_pdftex/en + which activates automatic hyper references from codeexamples to key + declarations. + This utilizes larger memory limits, configured in + doc/generic/pgf/text-en/texmf.cnf + +2009-11-12 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added the 'small mindmap' style. + +2009-11-06 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - FPU: improved sanity checks and exception handling for the decompose + routines (pgfmathfloatgetexponent etc) and the number parser. + Added exception 'wrong lowlevel format'. + +2009-10-20 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - renamed 'text mark/style' to 'text mark style' and 'text mark/as node' + to 'text mark as node' (there are backw. compatibility hooks). + This should avoid confusion with '.unknown' handlers. + +2009-10-19 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - improved error recovery of external lib. + +2009-10-16 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - temporarily disabled the auto cross references -- it seems they compile + only with increased memory. + +2009-10-15 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Installed preliminary version of automatic cross referencing tool. + Now, every codeexample is parsed for options and control sequences which + have been defined somewhere else in the document; pdf cross references are + built automatically as well. + - configured links to be blue throughout the document. + - external lib: added \tikzexternaldisable such that partial externalization is possible + although the document contains unsupported constructs (where environments + can't be identified without macro expansion). + The pgfmanual compiles with image externalization now. + +2009-10-13 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \pgfutilsolvetwotwoleq to solve 2x2 linear equation systems using + column pivotisation and gauss elim. Should result in improved quality + compared with \pgftransforminvert as internal equation solver + +2009-10-09 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Defined \pgfdeclaregenericanchor to allow anchors which get the shape + name as argument. Only useful internally. + +2009-09-15 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Fixed buggy treatment of white spaces in \jobname and 'plot function' + using \pgfutilpreparefilename. + +2009-09-04 Till Tantau <tantau@users.sourceforge.net> + + - Fixed bug item #2834141 [wrong reversed double arrows] + - Fixed bug item #2834233 [shapes libraries] + - Fixed bug item #2822265 [tangent coordinates not working in CVS] + - Changed \rm to \tf in Context. + +2009-07-31 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: added 'mode=list and make'. Now, image externalisation + time can be reduced with 'make -j 2 -f mainfile.makefile'. + +2009-07-08 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external lib: fixed treatment of long arguments in \tikz ... ; shortcut + command. + +2009-06-30 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed white space bug in \pgfkeysdeactivatefamily + - added \pgfmathfloatvalueof + +2009-06-22 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added a '*' feature to '\pgfmathdeclarefunction' which overwrites + existing functions. + +2009-06-11 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added '/tikz/no marks' key. + - fixed typo in external lib documentation: the key is called 'figure name', + not 'file name' + +2009-06-10 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \pgfgettransformentries and \pgfsettransformentries. + - updated the external library such that it deals with active characters + in the same way as without external library. + - fixed bug in fpu cosh, sinh and tanh + +2009-06-09 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - provided two new aliases for key filters, added \pgfkeyssetfamily. + +2009-05-29 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - allowed numbers like '.9' in fpu. + +2009-02-29 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fix for signal shape. + + +2009-05-22 Jin-Hwan Cho <jinhwancho@users.sourceforge.net> + + - Applied the patches for dvipdfmx driver, + pgf-doc-diff.version2cvs (2009-04-18) and + pgf-generic-diff.version2cvs (2009-04-19). + +2009-05-18 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Restored processing of unknown keys in the predefined key filters 'and', + 'not', 'or' and 'false': it was not improvement... + +2009-05-17 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed the sequence of arguments of + \pgfqkeysactivatefamiliesandfilteroptions and + \pgfqkeysactivatesinglefamilyandfilteroptions + in the reference manual. + +2009-05-16 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - key filtering: the composed key filter handlers 'not', 'and', 'false' and 'or' now + ignore unknown options and call the .unknown handlers. + - pgfkeys: removed the experimental \pgfkeyssetdefaultpathforhandled method. + It doesn't fit into the clean interface for pgfkeys - and the problem of + default paths for handled keys can be solved better with the '/handler + config' method. + +2009-04-24 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - provided API function \pgfmathfloatifflags to simplify special cases in + FPU. + +2009-04-23 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added (primitive) veclen implementation for FPU. + - added cosh, sinh, tanh to FPU + +2009-04-21 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed bug in external lib: empty lines in tikzpicture environments were not accepted + for some operating modes. + +2009-04-18 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \pgfqpointscale + +2009-04-08 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added an optional argument count to 'optimize command away' in external + library. + +2009-04-03 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added the |figure name| key to the externalization library + - improved docs for externalization library + +2009-03-30 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - improved sanity checking of floating point comparison: does now also + yield results for infty/nan + - added fix for precedence bug for unary minus (fix has been suggested by + Mark Wibrow, by mail conversation) + +2009-03-22 Till Tantau <tantau@users.sourceforge.net> + + - Replaced \z@ by 0pt for context. + +2009-03-21 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - external library: fixed the 'optimize' feature: pictures which won't be + exported could not be optimized away (although they should) + +2009-03-20 Till Tantau <tantau@users.sourceforge.net> + + - Replaced \toks@ and \voidb@x by \pgfutil@toks@ and + \pgfutil@voidb@x. + +2009-03-14 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - improved docs for .search also. + - fixed initial value for 'domain' such that it really uses the default + samples=25. + + +2009-03-09 Till Tantau <tantau@users.sourceforge.net> + + - Added patch for context color support in luatex. + +2009-02-26 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - improved the optimization facilities of the external library: + |optimize=false| will now properly restore any optimized material + when used in \tikzset + +2009-02-23 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added |/handler config=all,only existing,full or existing| + configuration. + - added |.search also| key handler as a simple implementation of key + search paths. + - fixed default value for /tikz/samples at- there are no really 25 + samples, not 26. I forgot to fix this last time when I fixed 'samples' + +2009-02-20 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added |\pgfkeyssetdefaultpathforhandled| feature as improvement for + multiple key paths to pgfkeys. Reference documentation and an + application example is in the manual. + +2009-02-13 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added 'mark=text' which draws arbitrary TeX content as plot marks to + plot mark library. + +2009-02-06 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Added key 'define function' to define simple local functions. + +2009-02-04 Till Tantau <tantau@users.sourceforge.net> + + - Worked on dv stuff. + +2009-02-01 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Index argument to array is automatically truncated to an + integer. + - Text decoration can now be aligned along or fitted to a path. + - Added key '/pgf/decoration/reverse path' to decorate a path + backwards. + +2009-01-24 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - the FPU deactivation command is now assembled once and for all during + its first usage. + +2009-01-23 Till Tantau <tantau@users.sourceforge.net> + + - Changed the "ellipse", "circle" and "arc" commands, so that + they take options. This gives a much clearer and more + flexible syntax. Naturally, the old syntax continues to work + as expected. + - Documented svg stuff and added tikz interface. Most useful + for quickly converting svg pictures to tikz pictures... + +2009-01-23 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed fpu 'round' method - it rounded mantissas instead of the complete + number before. + +2009-01-22 Till Tantau <tantau@users.sourceforge.net> + + - Fixed some math stuff + - Renamed \pgfpathcurvebetweentime* to + \pgfpathcurvebetweentimecontinue. + - Added svg.path lib. It allows one to directly use + the svg syntax for paths (like "M10 10 L 20 20"). Not yet + documented. + +2009-01-06 Till Tantau <tantau@users.sourceforge.net> + + - Added tutorial for mind/lecture maps. + +2009-01-06 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - implemented fpu factorial + - if the fixed point library is activated, the fpu will be deactivated + automatically. + - added draft for FPU documentation + +2009-01-03 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed bug in fpu sqrt. + - added logical commands to fpu. + - fixed bug in fpu related to multi-argument-commands + - provided feature to disable fpu manually. + +2008-12-31 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added support for pgf 2.00 and the fpu (works only with additional + and technical work - the fpu file is not all which is needed) + - added pow and greaterthan to FPU + - fixed some FPU issues + - fixed processing of '/tikz/domain' key - it produced N+1 samples instead + of N. + +2008-12-30 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added further functions to fpu; improved sanity checking; fixed smaller + bugs related to fpu + +2008-12-29 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - improved internal floating point code: it is possible to change the + low-level representation with minimal number of code lines. + - modified low-level floating point representation. All high level code + should be completely unaffected; the changes are backwards compatible. + - Wrote first draft of a floating point unit library (fpu) similar in + spirit to the fixed point library of Mark Wibrow. + - Moved all floating point math operations (functions) into the fpu + library. It is now necessary to include the library in order to use + floating point math operations. The number formatting methods are still + available as before. + +2008-12-28 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added trigonometric functions to floating point unit. + +2008-12-17 Till Tantau <tantau@users.sourceforge.net> + + - Added \colorlet to ConTeXt stuff. + +2008-12-14 Till Tantau <tantau@users.sourceforge.net> + + - Worked some more on data visualization stuff. Still in + pre-alpha. + +2008-12-11 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \pgfmathfloatexp. + +2008-12-07 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - floating point macros now always use the basic pgf math methods for + mantisse computations, even if the fixed point library is active. + +2008-12-06 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - 'mark=none' is now equivalent with 'mark=' (disables plot marks). + The previous behavior was to issue \pgfuseplotmark{none} which is + equivalent to \relax (and wastes time). + +2008-12-03 Till Tantau <tantau@users.sourceforge.net> + + - Changed exp function code in + pgfmathfunctions.basic.code.tex. It is now *much* more + precise for negative values and also more precise for + positive values. + +2008-11-28 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - optimized \pgfmathfloattofixed for speed (although it introduces + redundand zeros) + - Added '/pgf/image/include external' command key as public interface + to modify the '\includegraphics' command in image externalization routines. + +2008-11-24 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed bug with |overlay| option and matrizes: now, cell pictures won't + collapse any more if the matrix has |overlay| enabled. However, the + matrix' bounding box won't contribute to the image as desired. + +2008-11-23 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added support for active '!' characters (for example in blue!30!black + and french babel setting) + - modified processing of 'domain' option: the argument is '\edef'ed such + that any potentially active ':' characters will be expanded to non-active + ones (avoiding errors in the following processing). + +2008-11-13 Till Tantau <tantau@users.sourceforge.net> + + - Fixed \pgfnodealias bug that caused chains to fail in matrices. + +2008-10-30 Till Tantau <tantau@users.sourceforge.net> + + - Added shading library, mainly containing the new color wheel + shading donated by Ken Starks. + +2008-10-27 Mark Wibrow <vibrovski@users.sourceforge.net> + + - More fixes for insertion of spaces. + +2008-10-27 Till Tantau <tantau@users.sourceforge.net> + + - Added square arrow send by + gvtjongahung@users.sourceforge.net. + - Changed pgfutil-context.def so that driver detection should + work once more. + +2008-10-27 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fixed insertion of space when parsing exponents. + +2008-10-23 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added int truncation to floating point unit. + +2008-10-22 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added abs, abserror and relerror to floating point unit. + +2008-10-21 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added sqrt for floating point unit, built on top of pgfmathsqrt. + +2008-10-09 Till Tantau <tantau@users.sourceforge.net> + + - Fixed the wrong lengths of support vectors for circles. Used to + be 0.555 (found by trial and error), while the correct value + is 4/3*(sqrt(2)-1) = 0.5522847, which gives much better + circles. + Thanks to Ken Starks for point this out. + +2008-10-07 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fixed rounded rectangle right arc bug. + +2008-10-06 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Fixed missing treatment of 'assume math mode' in \pgfmathprintnumber' + +2008-10-05 Till Tantau <tantau@users.sourceforge.net> + + - Fixed missing switching off of auto anchors in positioning + library. + +2008-10-01 Till Tantau <tantau@tcs.uni-luebeck.de> + + - Fixed matrix/pdfsync incompatibility. + +2008-09-30 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fixed some parsing bugs with arrays. + - Fix for parsing of arrays in TikZ coordinates. + +2008-09-25 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added number formatting option 'min exponent for 1000 sep'. + +2008-09-21 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fixed bug in math parser which inserted spaces into text + or picture. + +2008-09-17 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added number formatting style 'sci superscript' + Example: formats the number 42 as 4.2^1 instead of 4.2 \cdot 10^1 + +2008-09-15 Till Tantau <tantau@users.sourceforge.net> + + - Fixed bug "TikZ, the shadow library and ConTeXt MKIV + (LuaTeX)". + +2008-09-14 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fixed bug #2105132 for rounded rectangle. + - Fixed bug #2044129 for chamfered rectangle. + +2008-09-12 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Added \pgfpathcurvebetweentime. + +2008-09-10 Till Tantau <tantau@users.sourceforge.net> + + - Fixed problem with nodes on a line inside a picture that is + inside a node of another picture. Pictures will now always + start with "pos=.5" set. + +2008-09-07 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Slight hack of decorations so that the input path can consist of a + single move to. This enables stuff like + \path [decoration={some decoration}, decorate] (4,5); + +2008-09-03 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed small bug related to '@dec sep mark' and not-a-number in number + formatting routines. + +2008-09-03 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Solutions for path intersections can now be sorted along either path. + - \pgfintersectionsolutions is now a macro, not a count register. + +2008-08-31 Mark Wibrow <vibrovski@users.sourceforge.net> + + - fix for ``Missing character...' warnings in logfile when using + foreach. + - removed `trim integers' option from foreach as int function + can now be used. + +2008-08-31 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Rewrote math parser. Anyone who relies on, or has hacked internal + parser or function macros, or has defined their own functions for + the parser will need to reconsult the code and/or documentation. + - Files for functions definitions split (possibly permanantly) into + different files. + - Scaling of results at the end of the parse is no longer the default + action. This doesn't break PGF or TikZ, but it may break user code + that depended on this scaling. To turn it back on use + \let\pgfmathpostparse=\pgfmathscaleresult. + - Modifying existing functions or creating new functions must now be + done using \pgfmathdeclarefunction and \pgfmathredeclarefunction. + - Single argument functions do not need parentheses, provided the + funtion is followed by a space, so sin 60 is the same as sin(60). + But! Functions have the highest precedence, so sin 60*\x is the + same as sin(60)*\x. + - Added {} operators for array specification and [] operators for + array access - see docs for details. + - added postfix ! factorial operator. + - added c++/java style conditional e.g., \x > 10 ? 13 : 20. + - added >=, <=, !=, prefix !, &&, || operators. + - added atan2, log10, log2, e, int and frac functions. + - adapted cosh, sinh and tanh from Martin Heller. + - added lua-style random function for generating random integers. + - added Mod function (note capital letter). Uses floored division + and is never negative. + - min, max, veclen and pow can now be nested in any argument + position. + - min and max can now take a variable number of arguments. + - For compatability \pgfmathmax and \pgfmathmin still take two + arguments (although these can contain comma separated expressions). + However \pgfmathmin@ and \pgfmathmax@ now only take + one argument in the form \pgfmathmin@{{1}{2}{3}{4}{5}} (for 5 + arguments). + - added hex, Hex, bin, and oct functions. These functions will not + work properly if the post-parse scaling is turned back on. + - 0 prefix for integers now specifies an octal number which is + automatically converted to base 10. + - 0x or 0X prefix for integers now specifies a hexadecimal number, + which is automatically converted to base 10. + - 0b or 0B prefix for integers now specifies a binary number, + which is automatically converted to base 10. + - "" characters turn off parsing (!) for part of an expression. + - added width, height, and depth functions for text e.g., + width("Some text"), but as an expression is \edef'ed before + parsing other commands will have to be `protected' e.g., + width("\noexpand\Huge Some text"). + - bugfix for tan and cot. + +2008-08-27 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added '/tikz/external/export={true,false}' key for externalization + library. + +2008-08-05 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added documentation for basic layer externalization and baseline option. + +2008-07-28 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added 'showpos' key to number printing (and alias 'print sign'). + +2008-07-22 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - fixed typo in pgfmathfloat.code.tex + - added 'optimize command away=\macro' key to externalization library. It + allows to discard unnecessary and possibly expensive user macros during + export (unnecessary = not in selected picture). + +2008-07-18 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Fixed bug in system layer path collecting. Very long paths + are now processed more efficiently (the bug disabled an optimization). + +2008-07-14 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added "marker" positions into the output of number formatting routines + to find period positions (even if no period is typeset) and exponent + positions. Allows alignment within auxiliary routines. + +2008-07-14 Till Tantau <tantau@users.sourceforge.net> + + - Fixed dash phase bug. + - Fixed missing library include in automata lib. + - Added "align" option. "text ragged" and friends are now + deprecated. Text width need no longer not, but can, be + specified. The following now has the expected effect: \node + [draw,align=center] {Hello\\world.}; + +2008-07-10 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \pgfqpointxy and \pgfqpointxyz to complement the "quick" point + commands in basic layer. + +2008-07-09 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added 'every mark' style. + - 'mark options' simply overwrites 'every mark' (consistent with its old + definition) + +2008-07-07 Till Tantau <tantau@users.sourceforge.net> + + - Finished circuit library and documentation (well, some + shapes still missing, but that's something users should + contribute). + +2008-07-01 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - the external library now handles active double quotes ", + single quotes ', and active semicolons ';' in its system call + correctly. Furthermore, \\ will expand to a normal + backslash. The initial system call now uses double quotes + for indows compatibility, it also contains the shell-escape + feature for gnuplot invocations. + +2008-06-30 Till Tantau <tantau@users.sourceforge.net> + + - Did some documentation of circuit lib. + - Removed the separated documentation of the intersection + library and made this documentation part of the main + documentation. + - The intersection cs is now deprecated, the documentation + is now only based on the intersection lib. + - Added a "by" option so that "name intersections={of=A and + B,by={c,d,e}}" will create an alias c for intersection-1, d + for intersection-2 and e for intersection-3. + - Renamed "path name" to "name path" in the intersection + lib. This is more consistent with "name intersections". + +2008-06-29 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Minor changes on float stuff, wrote pgfmathfloatmultiply and + pgfmathfloatdivide on top of pgfmathmultiply and pgfmathdivide + +2008-06-29 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Added `Fixed Point Arithmetic' library, which provides + a parsing interface to the fp package. Dealing with plotting + files still a bit crude. + - This library means the manual now requires the fp pacakge + to compile. + - Fixed floor function for negative numbers. + - Fixed \pgfmathsetseed. + - Font and group fix for external documentation. + +2008-06-27 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Complete change of TikZ intersections (PGF unchanged). + - Slight hack of the TikZ scopes library to permit local + path naming. Should work... + +2008-06-26 Till Tantau <tantau@users.sourceforge.net> + + - Continued with circuit library. + - Introduced subdirectories inside the pgf library + directory and moved libs into them. + You may need to update your checkout. + +2008-06-26 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - The external library now typesets as horizontal material by issueing + \leavevmode. This fixes an inconsistency with the normal tikzpictures. + +2008-06-25 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Added intersection library + documentation for + intersecting ``named'' paths. + +2008-06-25 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Fixed bug in external library. Now, strings like '#1' occuring + somewhere in an image is collected correctly. + +2008-06-24 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Removed new intersection stuff. Need to restart from scratch... + +2008-06-23 Till Tantau <tantau@users.sourceforge.net> + + - Started working on circuit library documentation. + +2008-06-23 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Added PGF code and docs for intersections of two curves and + intersections of a line and a curve. + - Fixed bug in foreach code when registers are used with dots + statement. + +2008-06-22 Till Tantau <tantau@users.sourceforge.net> + + - Created first version of circuit libraries for electrical + engineering (circuits.ee.*). + - Added libraries so that ee circuits and logical circuits can + be accessed using the same interface. (circuits.logic.*) + - The tikz lib shapes.gates.logic.* will no + longer be needed, the circuits.logic.* will replace them. (The + pgf libs shapes.gates.* are still used as before, however.) + - Minor patch in shapes.gates.logic.US so that the .0 and .180 + anchors of a not gate or a buffer gate are the same as the + input or output anchors. + - All this is not documented, yet. + - Worked some more on dv stuff, but nothing to "show", yet. + +2008-06-21 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fixed parsing bug in foreach code. + - Added "rotate fit" key to fit library, so (e.g.) a rotated + rectangle can be fitted around nodes/coordinates. + +2008-06-21 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added documentation for tikz 'external' library. + - created pgfexternalwithdepth.tex file to use the 'baseline' information. + - improved some issues of the external library. + - Added '/pgf/images/draft' option + - Modified implementation of draft images to show the image file name + instead of the internal image name + +2008-06-19 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added tikz library 'external' which allows automatic or semiautomatic + export of each tikzpicture to pdf. Documentation is not yet ready. + - Added self-contained latex package tikzexternal.sty to read those images + without tikz/pgf installed. + - Added support for the 'baseline' option in \beginpgfgraphicnamed ... \endpgfgraphicnamed + by storing the box depth into a separate file. + +2008-06-19 Till Tantau <tantau@users.sourceforge.net> + + - Added first ideas for a circuit library. + - Bugfixes in scoping behaviour. + - Changed scoping rules for to path operation: Options are now + local. This may break existing code, but is much more + consistent with everything else and removes other problems. + - Patched mindmap lib to account for these changed rules. + - Added insert path option. + - Deprecated "after node path". Use "append after command" and + "prefix after command" instead. + - Moved datavisualization libraries to separate subdirectory. + +2008-06-18 Till Tantau <tantau@users.sourceforge.net> + + - Changed label and pin options once again, to allow more + flexibility. In particular, the angle can now be + omitted. Also, for rotated main nodes the anchors are now + chosen in more sensible ways. + +2008-06-16 Till Tantau <tantau@users.sourceforge.net> + + - Added tiny little turtle graphics library for fun. + - Changed scoping rules for \foreach statement on a path: the + last coordinate is now persistent not only after the foreach + statement, but also between different iterations. + - Changed positioning of "label" when you attach a label to a + transformed shape. The position is now absolute with respect + to the page, unless the "transform shape" option is used. + +2008-06-11 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fixed the bug fix for character checking in foreach. + - Updates and fixes for new foreach code. + +2008-06-13 Till Tantau <tantau@users.sourceforge.net> + + - Fixed bug in new \foreach stuff that causes an error on + things like \foreach \i in {1,...,\foo}. If a list element + is a macro, no is-it-a-character check is done. + +2008-06-11 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Checked in proposed \foreach extensions. Possibly the + extensions would be better contained in a pgflibrary... + - list items can now be evaluated. + - dots replacement is context sensitive. + - sequences indicated by dots can be character sequences. + - a list item can be ``remembered'' in the next iteration. + - access to the number of the current item in the list is + provided. + +2008-06-09 Till Tantau <tantau@users.sourceforge.net> + + - Worked a bit on data visualization stuff. + +2008-06-07 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added '/pgf/number format/1000 sep' and 'dec sep' shortcut + styles which simply call 'set thousands separator' and 'set + decimal separator'. Those option are somewhat long... + +2008-06-06 Till Tantau <tantau@users.sourceforge.net> + + - Fixed the "local bounding box" option so that it honors the + "relevant for picture size"-if. + +2008-06-04 Till Tantau <tantau@users.sourceforge.net> + + - Fixed buggy "mid left" and "mid right" options. + - Added "between positions" option to the "mark" option. This + makes it possible to create paths with "repeated arrows along + the path". This did not work before. + +2008-06-03 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added '/pgf/number format/assume math mode' to disable math checks. + This allows to assemble tabulars, apply \pgfmathprintnumber to each cell + and use the dcolumn package to align at decimal separators (no + documentation for that feature yet) + +2008-06-02 Till Tantau <tantau@users.sourceforge.net> + + - Fixed pgfpages in conjunction with everyshi. + +2008-05-31 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Semantics of |/pgf/number format/fixed zerofill| changed: it now simply + sets a boolean which affects all numbers in fixed format; it does not + SET fixed format. The same holds for sci zerofill. + +2008-05-30 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Provided \pgfmathprintnumberto macro in addition to + \pgfmathprintnumber. + +2008-05-22 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Revised Lindenmayer system stuff. Documentation should + now be up to date. + +2008-05-22 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added 'xbar interval' and 'ybar interval' plot handlers. + - Moved plot handler options to /pgf key tree. + - added 'bar shift' option. + - bar width option is now evaluated when needed. + - Added documentation for plot handler library changes and for tikz-plot + interfaces. + - Modified pgf manual macros: codeexamples section now employs pgfkeys, + xkeyval no longer required. Introduced style 'every codeexample' to + maintain compatibility and allow customization for users. + +2008-05-21 Till Tantau <tantau@users.sourceforge.net> + + - Added missing documentation of moveto-decoration. + +2008-05-20 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Changed the processing of \pgflsystemstep. Now a TeX + dimension, it permits a symbol to shorten the step. + +2008-05-19 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Added Lindemayer system drawing library. + - Renamed the ranomization keys for the step and angle. + - Updated the L-system docs. + +2008-05-19 Till Tantau <tantau@users.sourceforge.net> + + - Added documentation of oo-subsystem. + - Started documentation of data visualization-subsystem. + - Fixed hyperlink problem in dvipdfm(x)/xetex. + - Fixed typos in Lindemayer system doc. + +2008-05-17 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added \pgfmathfloatadd, \pgfmathfloatsubtract and + \pgfmathfloatmultiplyfixed based on pgf's normal math parser + - Added tests for float arithmetics + - Added \pgfmathfloattoextentedprecision for 8-digit mantisse precision + - Added documentation for these methods + - Added basic layer input stream methods to set zero levels for [xy]comb/[xy]bar; + allows to start bars at different offsets than x=0 / y=0. + - Added documentation for zero level streams. + +2008-05-15 Till Tantau <tantau@users.sourceforge.net> + + - Added "path picture" option, mostly for the implementation + of the corrected mindmap connecting bars. + - Fixed buggy code of mindmap connect bars: Shading angles + where sometimes wrong and shading was sometimes at the wrong + position. + +2008-05-14 Till Tantau <tantau@users.sourceforge.net> + + - Completely rewrote management of pdf resources. This affects + pdftex, dvipdfm, dvipdfmx and xetex backends and all front + ends. They should now all work together in harmony, as far + as this is supported by them. + - Completely rewrote driver detection in plain and context + mode. + - dvipdfmx and xetex now use \special{pdf:literal direct}, + which can *considerably* reduce file sizes (up to a factor + of 2). + +2008-05-14 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fixed compatability issue with old calc code. + +2008-05-13 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - documented '.lasttry' key handler + - introduced documentation for key filtering routines (as \input section + in pgfmanual-en-pgfkeys.tex). Main section of pgfkeys not really updated + yet; I only removed the 'family limitation' item in the introduction. + +2008-05-11 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Multiple fixes for signal shape. + +2008-05-03 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - added \pgfplotbarwidth and docs + - used \pgfmathparse to assign \pgfsetplotbarwidth + - added 'const plot mark right' to plot handler library to complete the + different variants of left/right connected/jump handlers. + +2008-05-01 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fixed parser for expressions that begin and end with braces. + +2008-04-27 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added \pgfmathapproxequalto operation and documentation below + \pgfmathequalto + - Added some user-interface methods to floating point arithmetics + - Added options + /pgf/number format/set decimal separator + /pgf/number format/set thousands separator + /pgf/number format/skip 0. + - Added documentation for floating point arithmetics + - Added documentation for number printing + +2008-04-26 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added PGF plot handlers to plot handler library: + - \pgfplothandlerxbar + - \pgfplothandlerybar + with parameter \pgfsetplotbarwidth{} and + - \pgfplothandlerconstantlineto + - \pgfplothandlerjumpmarkleft + - \pgfplothandlerjumpmarkright + - Added Tikz-Plot handlers + - /tikz/xbar + - /tikz/ybar + with option '/tikz/bar width' and + - /tikz/const plot + - /tikz/jump mark left + - /tikz/jump mark right + - Added documentation for new plot handlers to Tikz- and plot handler + section in manual + +2008-04-23 Till Tantau <tantau@users.sourceforge.net> + + - Documented changed double line handling. + - Made some arrow tips work with double lines. + +2008-04-22 Till Tantau <tantau@users.sourceforge.net> + + - Added (not yet documented) "inner lines", which move the + double line mechanism from tikz to the basic layer. This + allows the definition of special arrow tips for double lines. + - Added (not yet documented) new arrow tip "implies" using + this mechanism. + +2008-04-21 Mark Wibrow <vibrovski@users.sourceforge.net> + + - New version of rectangle split shape. Now supports horizontal + as well as vertical spliting. Also supports up to 20 parts. + +2008-04-17 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added pgfkeysfiltered.code.tex which provides key filtering + and provides key-selection utilities like xkeyvals families + - changed pgfkeys.code.tex to '\input' pgfkeysfiltered.code.tex + +2008-04-14 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added \tikzaddtikzonlycommandshortcutlet and + \tikzaddtikzonlycommandshortcutdef to install shortcut commands at the + beginning of tikzpicture. + - pgfkeys.code.tex: fixed incompatibility .try with .is choice + +2008-04-10 Till Tantau <tantau@users.sourceforge.net> + + - Fixed patterns in dvips mode (were broken). + +2008-04-03 Till Tantau <tantau@users.sourceforge.net> + + - Switched to everyshi in latex mode to hack into + \shipout. Wrote direct code to hack into \shipout in plain + mode. Hacking into \shipout in Context is still unclear. + - Added space arrow. + +2008-4-02 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Reimplemented parsing of operands. + +2008-04-01 Till Tantau <tantau@users.sourceforge.net> + + - Added cirlce solidus shape by Manuel Lacruz. + +2008-03-19 Mark Wibrow <vibrovski@users.sourceforge.net> + + - `curve control points' decoration no longer exists. It is + replaced by the `show path construction' decoration. + - added code + docs for defining changable patterns. + - Parser altered to access \pgfmathfloatparsenumber when + \ifpgfmathfloat is true (old interface to \pgfmathfloat deleted). + +2008-03-18 Christian Feuersaenger <ludewich@users.sourceforge.net> + + - Added generic/pgf/math/pgfmathfloat.code.tex + - Modified pgfmath.code.tex to include pgfmathfloat.code.tex + - Added generic/pgf/testsuite/mathtest/pgfmathtestsuite.tex [dvipdfm/pdflatex] + which provides testing for pgfmathfloat.code.tex + +2008-03-17 Till Tantau <tantau@users.sourceforge.net> + + - Fixed minimum width handling in rounded rectangle shape. + +2008-03-12 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Added key for rectangle split to ignore empty parts. + - Extended \pgfshadecolortorgb to define macros for the + individual color components. + +2008-03-08 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Added `curve control points' decoration for drawing + curve controls. NB: names/keys may change. + +2008-03-07 Mark Wibrow <vibrovski@users.sourceforge.net> + + - Fix for (some) `hidden' bugs: ``Missing character: + There is no <char> in font nullfont!''. This is usually + only seen in log file. Fixed for star, circular sector + and math macros. + +2008-03-03 Till Tantau <tantau@users.sourceforge.net> + + - Fixed documentation "placment" replaced by "positioning" + - Fixed ConTeXt page resource problem. (ConTeXt support is + still not as smooth as support of other formats) + - Checked in some data visualization stuff, without any + documentation. Everything still likely to change + completely. + - Moved module management to pgfutil. + - Added support for simple oo-programming, not documented. + +2008-02-26 Till Tantau <tantau@users.sourceforge.net> + + - Fixed bug in pgfkeysaddvalue. + - Fixed bug of stack leak in function shadings in postscript. + - Fixed missing image inclusion documentation. + - Fixed atan bug in documentation example. + - Fixed missing dependency of chains--positioning library + - Fixed missing dependency of mindmap--decorations library + +2008-02-20 Till Tantau <tantau@users.sourceforge.net> + + Released version 2.00 + 2008-02-14 Till Tantau <tantau@users.sourceforge.net> - Fixed "initial"/"accepting" distance bug. diff --git a/Master/texmf-dist/doc/generic/pgf/FILES b/Master/texmf-dist/doc/generic/pgf/FILES index a9549e8488f..941e8a18ab7 100644 --- a/Master/texmf-dist/doc/generic/pgf/FILES +++ b/Master/texmf-dist/doc/generic/pgf/FILES @@ -1,329 +1,434 @@ -pgf-2.00/context/pgf/basiclayer/t-pgf.tex -pgf-2.00/context/pgf/basiclayer/t-pgfbim.tex -pgf-2.00/context/pgf/basiclayer/t-pgfbla.tex -pgf-2.00/context/pgf/basiclayer/t-pgfbma.tex -pgf-2.00/context/pgf/basiclayer/t-pgfbpl.tex -pgf-2.00/context/pgf/basiclayer/t-pgfbpt.tex -pgf-2.00/context/pgf/basiclayer/t-pgfbsh.tex -pgf-2.00/context/pgf/basiclayer/t-pgfbsn.tex -pgf-2.00/context/pgf/basiclayer/t-pgfcor.tex -pgf-2.00/context/pgf/frontendlayer/t-tikz.tex -pgf-2.00/context/pgf/math/t-pgfmat.tex -pgf-2.00/context/pgf/systemlayer/t-pgfsys.tex -pgf-2.00/context/pgf/utilities/t-pgfcal.tex -pgf-2.00/context/pgf/utilities/t-pgffor.tex -pgf-2.00/context/pgf/utilities/t-pgfkey.tex -pgf-2.00/context/pgf/utilities/t-pgfmod.tex -pgf-2.00/context/pgf/utilities/t-pgfrcs.tex -pgf-2.00/doc/generic/pgf/AUTHORS -pgf-2.00/doc/generic/pgf/ChangeLog -pgf-2.00/doc/generic/pgf/FILES -pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo-mask.bb -pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo-mask.jpg -pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.25.bb -pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.25.eps -pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.25.jpg -pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.bb -pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.eps -pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.jpg -pgf-2.00/doc/generic/pgf/images/pgfmanual-mindmap-1.pdf -pgf-2.00/doc/generic/pgf/images/pgfmanual-mindmap-2.pdf -pgf-2.00/doc/generic/pgf/INSTALL -pgf-2.00/doc/generic/pgf/licenses/gnu-free-documentation-license-1.2.txt -pgf-2.00/doc/generic/pgf/licenses/gnu-public-license-2.txt -pgf-2.00/doc/generic/pgf/licenses/latex-project-public-license-1.3c.txt -pgf-2.00/doc/generic/pgf/licenses/LICENSE -pgf-2.00/doc/generic/pgf/licenses/manifest-code.txt -pgf-2.00/doc/generic/pgf/licenses/manifest-documentation.txt -pgf-2.00/doc/generic/pgf/macros/pgfmanual-en-macros.tex -pgf-2.00/doc/generic/pgf/pgfmanual.pdf -pgf-2.00/doc/generic/pgf/README -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-layers.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-installation.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-fadings.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-shadows.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-through.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-license.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-main.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pages.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-paths.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex -pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-asymptotic-example.gnuplot -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-asymptotic-example.table -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-exp.gnuplot -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-exp.table -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-parametric-example.gnuplot -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-parametric-example.table -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-sin.gnuplot -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-sin.table -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-x.gnuplot -pgf-2.00/doc/generic/pgf/text-en/plots/pgf-x.table -pgf-2.00/doc/generic/pgf/text-en/plots/pgfmanual-sine.gnuplot -pgf-2.00/doc/generic/pgf/text-en/plots/pgfmanual-sine.table -pgf-2.00/doc/generic/pgf/text-en/plots/pgfplotgnuplot-example.gnuplot -pgf-2.00/doc/generic/pgf/text-en/plots/pgfplotgnuplot-example.table -pgf-2.00/doc/generic/pgf/TODO -pgf-2.00/doc/generic/pgf/version-for-dvipdfm/en/Makefile -pgf-2.00/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex -pgf-2.00/doc/generic/pgf/version-for-dvipdfm/pgfmanual-dvipdfm.cfg -pgf-2.00/doc/generic/pgf/version-for-dvips/en/Makefile -pgf-2.00/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex -pgf-2.00/doc/generic/pgf/version-for-dvips/pgfmanual-dvips.cfg -pgf-2.00/doc/generic/pgf/version-for-pdftex/en/Makefile -pgf-2.00/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex -pgf-2.00/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg -pgf-2.00/doc/generic/pgf/version-for-tex4ht/en/Makefile -pgf-2.00/doc/generic/pgf/version-for-tex4ht/en/pgfmanual.tex -pgf-2.00/doc/generic/pgf/version-for-tex4ht/pgfmanual-tex4ht.cfg -pgf-2.00/doc/generic/pgf/version-for-vtex/en/Makefile -pgf-2.00/doc/generic/pgf/version-for-vtex/en/pgfmanual.tex -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.gnuplot -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.table -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.gnuplot -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.table -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.gnuplot -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.table -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.gnuplot -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.table -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.gnuplot -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.table -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.gnuplot -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.table -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.gnuplot -pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.table -pgf-2.00/doc/generic/pgf/version-for-vtex/pgfmanual-vtex.cfg -pgf-2.00/generic/pgf/basiclayer/pgfcore.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcorearrows.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcoreimage.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcorelayers.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcoreobjects.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcorepathusage.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcorepatterns.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcorepoints.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcorequick.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcorescopes.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcoreshade.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcoretransformations.code.tex -pgf-2.00/generic/pgf/basiclayer/pgfcoretransparency.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex -pgf-2.00/generic/pgf/frontendlayer/tikz/tikz.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryarrows.code.tex -pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.footprints.code.tex -pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.fractals.code.tex -pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.markings.code.tex -pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.pathmorphing.code.tex -pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex -pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.shapes.code.tex -pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.text.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryfadings.code.tex -pgf-2.00/generic/pgf/libraries/pgflibrarypatterns.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryplothandlers.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryplotmarks.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryshapes.arrows.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryshapes.callouts.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryshapes.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryshapes.gates.logic.IEC.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryshapes.gates.logic.US.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryshapes.geometric.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryshapes.misc.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryshapes.multipart.code.tex -pgf-2.00/generic/pgf/libraries/pgflibraryshapes.symbols.code.tex -pgf-2.00/generic/pgf/libraries/pgflibrarysnakes.code.tex -pgf-2.00/generic/pgf/math/pgfmath.code.tex -pgf-2.00/generic/pgf/math/pgfmathbase.code.tex -pgf-2.00/generic/pgf/math/pgfmathcalc.code.tex -pgf-2.00/generic/pgf/math/pgfmathoperations.code.tex -pgf-2.00/generic/pgf/math/pgfmathparser.code.tex -pgf-2.00/generic/pgf/math/pgfmathrnd.code.tex -pgf-2.00/generic/pgf/math/pgfmathtrig.code.tex -pgf-2.00/generic/pgf/math/pgfmathutil.code.tex -pgf-2.00/generic/pgf/modules/pgfmoduledecorations.code.tex -pgf-2.00/generic/pgf/modules/pgfmodulematrix.code.tex -pgf-2.00/generic/pgf/modules/pgfmoduleplot.code.tex -pgf-2.00/generic/pgf/modules/pgfmoduleshapes.code.tex -pgf-2.00/generic/pgf/modules/pgfmodulesnakes.code.tex -pgf-2.00/generic/pgf/systemlayer/pgf.cfg -pgf-2.00/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-common-pdf.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-common-postscript.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-common-svg.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-dvi.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-dvipdfm.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-dvipdfmx.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-dvips.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-pdftex.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-tex4ht.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-textures.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-vtex.def -pgf-2.00/generic/pgf/systemlayer/pgfsys-xetex.def -pgf-2.00/generic/pgf/systemlayer/pgfsys.code.tex -pgf-2.00/generic/pgf/systemlayer/pgfsysprotocol.code.tex -pgf-2.00/generic/pgf/systemlayer/pgfsyssoftpath.code.tex -pgf-2.00/generic/pgf/utilities/pgfcalendar.code.tex -pgf-2.00/generic/pgf/utilities/pgfexternal.tex -pgf-2.00/generic/pgf/utilities/pgffor.code.tex -pgf-2.00/generic/pgf/utilities/pgfkeys.code.tex -pgf-2.00/generic/pgf/utilities/pgfrcs.code.tex -pgf-2.00/generic/pgf/utilities/pgfutil-common.tex -pgf-2.00/generic/pgf/utilities/pgfutil-context.def -pgf-2.00/generic/pgf/utilities/pgfutil-latex.def -pgf-2.00/generic/pgf/utilities/pgfutil-plain.def -pgf-2.00/latex/pgf/basiclayer/pgf.sty -pgf-2.00/latex/pgf/basiclayer/pgfbaseimage.sty -pgf-2.00/latex/pgf/basiclayer/pgfbaselayers.sty -pgf-2.00/latex/pgf/basiclayer/pgfbasematrix.sty -pgf-2.00/latex/pgf/basiclayer/pgfbasepatterns.sty -pgf-2.00/latex/pgf/basiclayer/pgfbaseplot.sty -pgf-2.00/latex/pgf/basiclayer/pgfbaseshapes.sty -pgf-2.00/latex/pgf/basiclayer/pgfbasesnakes.sty -pgf-2.00/latex/pgf/basiclayer/pgfcore.sty -pgf-2.00/latex/pgf/compatibility/pgfarrows.sty -pgf-2.00/latex/pgf/compatibility/pgfautomata.sty -pgf-2.00/latex/pgf/compatibility/pgfcomp-version-0-65.sty -pgf-2.00/latex/pgf/compatibility/pgfcomp-version-1-18.sty -pgf-2.00/latex/pgf/compatibility/pgfheaps.sty -pgf-2.00/latex/pgf/compatibility/pgflibraryarrows.sty -pgf-2.00/latex/pgf/compatibility/pgflibraryautomata.sty -pgf-2.00/latex/pgf/compatibility/pgflibraryplothandlers.sty -pgf-2.00/latex/pgf/compatibility/pgflibraryplotmarks.sty -pgf-2.00/latex/pgf/compatibility/pgflibraryshapes.sty -pgf-2.00/latex/pgf/compatibility/pgflibrarysnakes.sty -pgf-2.00/latex/pgf/compatibility/pgflibrarytikzbackgrounds.sty -pgf-2.00/latex/pgf/compatibility/pgflibrarytikztrees.sty -pgf-2.00/latex/pgf/compatibility/pgfnodes.sty -pgf-2.00/latex/pgf/compatibility/pgfshade.sty -pgf-2.00/latex/pgf/frontendlayer/pgfpict2e.sty -pgf-2.00/latex/pgf/frontendlayer/tikz.sty -pgf-2.00/latex/pgf/math/pgfmath.sty -pgf-2.00/latex/pgf/systemlayer/pgfsys.sty -pgf-2.00/latex/pgf/utilities/pgfcalendar.sty -pgf-2.00/latex/pgf/utilities/pgffor.sty -pgf-2.00/latex/pgf/utilities/pgfkeys.sty -pgf-2.00/latex/pgf/utilities/pgfpages.sty -pgf-2.00/latex/pgf/utilities/pgfrcs.sty -pgf-2.00/latex/pgf/utilities/xxcolor.sty -pgf-2.00/plain/pgf/basiclayer/pgf.tex -pgf-2.00/plain/pgf/basiclayer/pgfbaseimage.tex -pgf-2.00/plain/pgf/basiclayer/pgfbaselayers.tex -pgf-2.00/plain/pgf/basiclayer/pgfbasematrix.tex -pgf-2.00/plain/pgf/basiclayer/pgfbasepatterns.tex -pgf-2.00/plain/pgf/basiclayer/pgfbaseplot.tex -pgf-2.00/plain/pgf/basiclayer/pgfbaseshapes.tex -pgf-2.00/plain/pgf/basiclayer/pgfbasesnakes.tex -pgf-2.00/plain/pgf/basiclayer/pgfcore.tex -pgf-2.00/plain/pgf/frontendlayer/tikz.tex -pgf-2.00/plain/pgf/math/pgfmath.tex -pgf-2.00/plain/pgf/systemlayer/pgfsys.tex -pgf-2.00/plain/pgf/utilities/pgfcalendar.tex -pgf-2.00/plain/pgf/utilities/pgffor.tex -pgf-2.00/plain/pgf/utilities/pgfkeys.tex -pgf-2.00/plain/pgf/utilities/pgfrcs.tex -pgf-2.00/README +pgf/doc/generic/pgf/images/brave-gnu-world-logo-mask.jpg +pgf/doc/generic/pgf/images/brave-gnu-world-logo-mask.bb +pgf/doc/generic/pgf/images/brave-gnu-world-logo.25.bb +pgf/doc/generic/pgf/images/brave-gnu-world-logo.25.eps +pgf/doc/generic/pgf/images/brave-gnu-world-logo.25.jpg +pgf/doc/generic/pgf/images/brave-gnu-world-logo.bb +pgf/doc/generic/pgf/images/brave-gnu-world-logo.eps +pgf/doc/generic/pgf/images/brave-gnu-world-logo.jpg +pgf/doc/generic/pgf/images/pgfmanual-mindmap-1.pdf +pgf/doc/generic/pgf/images/pgfmanual-mindmap-2.pdf +pgf/doc/generic/pgf/licenses/LICENSE +pgf/doc/generic/pgf/licenses/gnu-free-documentation-license-1.2.txt +pgf/doc/generic/pgf/licenses/gnu-public-license-2.txt +pgf/doc/generic/pgf/licenses/latex-project-public-license-1.3c.txt +pgf/doc/generic/pgf/licenses/manifest-code.txt +pgf/doc/generic/pgf/licenses/manifest-documentation.txt +pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex +pgf/doc/generic/pgf/text-en/plots/pgfmanual-sine.table +pgf/doc/generic/pgf/text-en/plots/pgf-x.table +pgf/doc/generic/pgf/text-en/plots/pgf-asymptotic-example.gnuplot +pgf/doc/generic/pgf/text-en/plots/pgf-asymptotic-example.table +pgf/doc/generic/pgf/text-en/plots/pgf-exp.gnuplot +pgf/doc/generic/pgf/text-en/plots/pgf-exp.table +pgf/doc/generic/pgf/text-en/plots/pgf-parametric-example.gnuplot +pgf/doc/generic/pgf/text-en/plots/pgf-parametric-example.table +pgf/doc/generic/pgf/text-en/plots/pgf-sin.gnuplot +pgf/doc/generic/pgf/text-en/plots/pgf-sin.table +pgf/doc/generic/pgf/text-en/plots/pgf-x.gnuplot +pgf/doc/generic/pgf/text-en/plots/pgfplotgnuplot-example.gnuplot +pgf/doc/generic/pgf/text-en/plots/pgfmanual-sine.gnuplot +pgf/doc/generic/pgf/text-en/plots/pgfplotgnuplot-example.table +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-layers.tex +pgf/doc/generic/pgf/text-en/texmf.cnf +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-installation.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fadings.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-shadows.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-through.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-license.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-main.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-oo.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-pages.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-paths.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex.orig +pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex +pgf/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex +pgf/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex +pgf/doc/generic/pgf/version-for-dvipdfm/en/Makefile +pgf/doc/generic/pgf/version-for-dvipdfm/pgfmanual-dvipdfm.cfg +pgf/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex +pgf/doc/generic/pgf/version-for-dvipdfmx/en/Makefile +pgf/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg +pgf/doc/generic/pgf/version-for-dvips/en/Makefile +pgf/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex +pgf/doc/generic/pgf/version-for-dvips/pgfmanual-dvips.cfg +pgf/doc/generic/pgf/version-for-pdftex/en/Makefile +pgf/doc/generic/pgf/version-for-pdftex/en/pgfmanual.figlist +pgf/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex +pgf/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg +pgf/doc/generic/pgf/version-for-tex4ht/en/pgfmanual.tex +pgf/doc/generic/pgf/version-for-tex4ht/en/Makefile +pgf/doc/generic/pgf/version-for-tex4ht/pgfmanual-tex4ht.cfg +pgf/doc/generic/pgf/version-for-vtex/en/pgfmanual.tex +pgf/doc/generic/pgf/version-for-vtex/en/Makefile +pgf/doc/generic/pgf/version-for-vtex/pgfmanual-vtex.cfg +pgf/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex +pgf/doc/generic/pgf/version-for-xetex/en/Makefile +pgf/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg +pgf/doc/generic/pgf/ChangeLog +pgf/doc/generic/pgf/AUTHORS +pgf/doc/generic/pgf/pgfmanual.pdf +pgf/doc/generic/pgf/FILES +pgf/doc/generic/pgf/INSTALL +pgf/doc/generic/pgf/README +pgf/doc/generic/pgf/TODO +pgf/tex/context/third/pgf/basiclayer/t-pgf.tex +pgf/tex/context/third/pgf/basiclayer/t-pgfbim.tex +pgf/tex/context/third/pgf/basiclayer/t-pgfbla.tex +pgf/tex/context/third/pgf/basiclayer/t-pgfbma.tex +pgf/tex/context/third/pgf/basiclayer/t-pgfbpl.tex +pgf/tex/context/third/pgf/basiclayer/t-pgfbpt.tex +pgf/tex/context/third/pgf/basiclayer/t-pgfbsh.tex +pgf/tex/context/third/pgf/basiclayer/t-pgfbsn.tex +pgf/tex/context/third/pgf/basiclayer/t-pgfcor.tex +pgf/tex/context/third/pgf/frontendlayer/t-tikz.tex +pgf/tex/context/third/pgf/math/t-pgfmat.tex +pgf/tex/context/third/pgf/systemlayer/t-pgfsys.tex +pgf/tex/context/third/pgf/utilities/t-pgfcal.tex +pgf/tex/context/third/pgf/utilities/t-pgffor.tex +pgf/tex/context/third/pgf/utilities/t-pgfkey.tex +pgf/tex/context/third/pgf/utilities/t-pgfmod.tex +pgf/tex/context/third/pgf/utilities/t-pgfrcs.tex +pgf/tex/latex/pgf/basiclayer/pgfbaseimage.sty +pgf/tex/latex/pgf/basiclayer/pgf.sty +pgf/tex/latex/pgf/basiclayer/pgfbaselayers.sty +pgf/tex/latex/pgf/basiclayer/pgfbasematrix.sty +pgf/tex/latex/pgf/basiclayer/pgfbasepatterns.sty +pgf/tex/latex/pgf/basiclayer/pgfbaseplot.sty +pgf/tex/latex/pgf/basiclayer/pgfbaseshapes.sty +pgf/tex/latex/pgf/basiclayer/pgfbasesnakes.sty +pgf/tex/latex/pgf/basiclayer/pgfcore.sty +pgf/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty +pgf/tex/latex/pgf/compatibility/pgfarrows.sty +pgf/tex/latex/pgf/compatibility/pgfautomata.sty +pgf/tex/latex/pgf/compatibility/pgflibraryplothandlers.sty +pgf/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty +pgf/tex/latex/pgf/compatibility/pgfheaps.sty +pgf/tex/latex/pgf/compatibility/pgflibraryarrows.sty +pgf/tex/latex/pgf/compatibility/pgflibraryautomata.sty +pgf/tex/latex/pgf/compatibility/pgflibrarytikzbackgrounds.sty +pgf/tex/latex/pgf/compatibility/pgflibraryplotmarks.sty +pgf/tex/latex/pgf/compatibility/pgflibraryshapes.sty +pgf/tex/latex/pgf/compatibility/pgflibrarysnakes.sty +pgf/tex/latex/pgf/compatibility/pgflibrarytikztrees.sty +pgf/tex/latex/pgf/compatibility/pgfnodes.sty +pgf/tex/latex/pgf/compatibility/pgfshade.sty +pgf/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex +pgf/tex/latex/pgf/doc/pgfmanual.code.tex +pgf/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex +pgf/tex/latex/pgf/doc/pgfmanual.sty +pgf/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex +pgf/tex/latex/pgf/frontendlayer/pgfpict2e.sty +pgf/tex/latex/pgf/frontendlayer/tikz.sty +pgf/tex/latex/pgf/math/pgfmath.sty +pgf/tex/latex/pgf/systemlayer/pgfsys.sty +pgf/tex/latex/pgf/utilities/pgfcalendar.sty +pgf/tex/latex/pgf/utilities/pgffor.sty +pgf/tex/latex/pgf/utilities/pgfkeys.sty +pgf/tex/latex/pgf/utilities/pgfpages.sty +pgf/tex/latex/pgf/utilities/pgfrcs.sty +pgf/tex/latex/pgf/utilities/tikzexternal.sty +pgf/tex/latex/pgf/utilities/xxcolor.sty +pgf/tex/plain/pgf/basiclayer/pgfbaseimage.tex +pgf/tex/plain/pgf/basiclayer/pgf.tex +pgf/tex/plain/pgf/basiclayer/pgfbaselayers.tex +pgf/tex/plain/pgf/basiclayer/pgfbasematrix.tex +pgf/tex/plain/pgf/basiclayer/pgfbasepatterns.tex +pgf/tex/plain/pgf/basiclayer/pgfbaseplot.tex +pgf/tex/plain/pgf/basiclayer/pgfbaseshapes.tex +pgf/tex/plain/pgf/basiclayer/pgfbasesnakes.tex +pgf/tex/plain/pgf/basiclayer/pgfcore.tex +pgf/tex/plain/pgf/frontendlayer/tikz.tex +pgf/tex/plain/pgf/math/pgfmath.tex +pgf/tex/plain/pgf/systemlayer/pgfsys.tex +pgf/tex/plain/pgf/utilities/pgfcalendar.tex +pgf/tex/plain/pgf/utilities/pgffor.tex +pgf/tex/plain/pgf/utilities/pgfkeys.tex +pgf/tex/plain/pgf/utilities/pgfrcs.tex +pgf/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcore.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcorequick.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex +pgf/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex +pgf/tex/generic/pgf/frontendlayer/svg/svgpgf.cfg +pgf/tex/generic/pgf/frontendlayer/svg/svgpgf.xmt +pgf/tex/generic/pgf/frontendlayer/svg/svgtest.cfg +pgf/tex/generic/pgf/frontendlayer/svg/svgtest.tex +pgf/tex/generic/pgf/frontendlayer/svg/svgtest.xml +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.barcharts.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.3d.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.polar.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.sparklines.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.basic.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzexternalshared.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfixedpointarithmetic.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfpu.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarylindenmayersystems.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadings.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryspy.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysvg.path.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryturtle.code.tex +pgf/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex +pgf/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.formats.functions.code.tex +pgf/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.barcharts.code.tex +pgf/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.polar.code.tex +pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex +pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex +pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.markings.code.tex +pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex +pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex +pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex +pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex +pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex +pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex +pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex +pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex +pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex +pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex +pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex +pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex +pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex +pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.multipart.code.tex +pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex +pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex +pgf/tex/generic/pgf/libraries/pgflibraryintersections.code.tex +pgf/tex/generic/pgf/libraries/pgflibraryarrows.code.tex +pgf/tex/generic/pgf/libraries/pgflibraryfadings.code.tex +pgf/tex/generic/pgf/libraries/pgflibraryfpu.code.tex +pgf/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex +pgf/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex +pgf/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex +pgf/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex +pgf/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex +pgf/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex +pgf/tex/generic/pgf/libraries/pgflibraryshadings.code.tex +pgf/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex +pgf/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex +pgf/tex/generic/pgf/math/pgfmathcalc.code.tex +pgf/tex/generic/pgf/math/pgfmath.code.tex +pgf/tex/generic/pgf/math/pgfmathfunctions.base.code.tex +pgf/tex/generic/pgf/math/pgfmathfloat.code.tex +pgf/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex +pgf/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex +pgf/tex/generic/pgf/math/pgfmathfunctions.code.tex +pgf/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex +pgf/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex +pgf/tex/generic/pgf/math/pgfmathfunctions.random.code.tex +pgf/tex/generic/pgf/math/pgfmathfunctions.round.code.tex +pgf/tex/generic/pgf/math/pgfmathparser.code.tex +pgf/tex/generic/pgf/math/pgfmathutil.code.tex +pgf/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex +pgf/tex/generic/pgf/modules/pgfmoduledecorations.code.tex +pgf/tex/generic/pgf/modules/pgfmodulematrix.code.tex +pgf/tex/generic/pgf/modules/pgfmoduleoo.code.tex +pgf/tex/generic/pgf/modules/pgfmoduleparser.code.tex +pgf/tex/generic/pgf/modules/pgfmoduleplot.code.tex +pgf/tex/generic/pgf/modules/pgfmoduleshapes.code.tex +pgf/tex/generic/pgf/modules/pgfmodulesnakes.code.tex +pgf/tex/generic/pgf/modules/pgfmodulesorting.code.tex +pgf/tex/generic/pgf/rendering/pgfrendertransform.code.tex +pgf/tex/generic/pgf/rendering/pgfrenderpoints.code.tex +pgf/tex/generic/pgf/systemlayer/pgfsys-dvi.def +pgf/tex/generic/pgf/systemlayer/pgf.cfg +pgf/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def +pgf/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def +pgf/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def +pgf/tex/generic/pgf/systemlayer/pgfsys-common-svg.def +pgf/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def +pgf/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def +pgf/tex/generic/pgf/systemlayer/pgfsys-dvips.def +pgf/tex/generic/pgf/systemlayer/pgfsys-pdftex.def +pgf/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def +pgf/tex/generic/pgf/systemlayer/pgfsys-textures.def +pgf/tex/generic/pgf/systemlayer/pgfsys-vtex.def +pgf/tex/generic/pgf/systemlayer/pgfsys-xetex.def +pgf/tex/generic/pgf/systemlayer/pgfsys.code.tex +pgf/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex +pgf/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex +pgf/tex/generic/pgf/utilities/pgfexternalwithdepth.tex +pgf/tex/generic/pgf/utilities/pgfcalendar.code.tex +pgf/tex/generic/pgf/utilities/pgfexternal.tex +pgf/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex +pgf/tex/generic/pgf/utilities/pgffor.code.tex +pgf/tex/generic/pgf/utilities/pgfkeys.code.tex +pgf/tex/generic/pgf/utilities/pgfutil-common.tex +pgf/tex/generic/pgf/utilities/pgfrcs.code.tex +pgf/tex/generic/pgf/utilities/pgfutil-context.def +pgf/tex/generic/pgf/utilities/pgfutil-latex.def +pgf/tex/generic/pgf/utilities/pgfutil-plain.def +pgf/README +pgf/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.pdf +pgf/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.sty +pgf/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.tex +pgf/source/latex/pgf/incoming/KarlheinzOchs/interconnection.pdf +pgf/source/latex/pgf/incoming/KarlheinzOchs/basics.pdf +pgf/source/latex/pgf/incoming/KarlheinzOchs/basics.tex +pgf/source/latex/pgf/incoming/KarlheinzOchs/fir.pdf +pgf/source/latex/pgf/incoming/KarlheinzOchs/fir.tex +pgf/source/latex/pgf/incoming/KarlheinzOchs/signalflowdiagram.sty +pgf/source/latex/pgf/incoming/KarlheinzOchs/interconnection.tex +pgf/source/latex/pgf/incoming/KarlheinzOchs/macros.sty +pgf/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowoperators.code.tex +pgf/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowarrows.code.tex +pgf/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowblocks.code.tex +pgf/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowdiagram.code.tex +pgf/source/latex/pgf/incoming/KarlheinzOchs/placement.pdf +pgf/source/latex/pgf/incoming/KarlheinzOchs/placement.tex +pgf/source/latex/pgf/testsuite/external/Makefile +pgf/source/latex/pgf/testsuite/external/tikzexternaltest.code.tex +pgf/source/latex/pgf/testsuite/external/tikzexternaltest.sharedpreamble.tex +pgf/source/latex/pgf/testsuite/external/tikzexternaltest.tex +pgf/source/latex/pgf/testsuite/external/tikzexternaltestmakefile.tex +pgf/source/latex/pgf/testsuite/mathtest/pgfmathtestsuite.tex diff --git a/Master/texmf-dist/doc/generic/pgf/INSTALL b/Master/texmf-dist/doc/generic/pgf/INSTALL index bf3469a37bc..f3cb456dc4c 100644 --- a/Master/texmf-dist/doc/generic/pgf/INSTALL +++ b/Master/texmf-dist/doc/generic/pgf/INSTALL @@ -7,5 +7,5 @@ For the impatient: Long version: In the manual, which you find in the file -doc/generic/pgf/version-for-pdftex/en/pgfmanual.pdf, you will find a +doc/generic/pgf/pgfmanual.pdf, you will find a detailed explanation on how to install pgf. diff --git a/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.25.eps b/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.25.eps index 9c02410d1d2..7fc67685fa9 100644 --- a/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.25.eps +++ b/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.25.eps @@ -1,4 +1,469 @@ -%!PS-Adobe-3.0 EPSF-3.0
%%Title: brave-gnu-world-logo.25.eps
%%CreationDate: 09.10.2006 22:09 Uhr
%%BoundingBox: 0 0 342 387
%%HiResBoundingBox: 0 0 342 387
%%SuppressDotGainCompensation
%%EndComments
%%BeginProlog
%%EndProlog
%%BeginSetup
%%EndSetup
%ImageData: 342 387 8 3 0 1 3 "beginimage"
%BeginPhotoshop: 13952
% 3842494D0425000000000010000000000000000000000000000000003842494D
% 03EA000000001DA63C3F786D6C2076657273696F6E3D22312E302220656E636F
% 64696E673D225554462D38223F3E0A3C21444F435459504520706C6973742050
% 55424C494320222D2F2F4170706C6520436F6D70757465722F2F44544420504C
% 49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E63
% 6F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C
% 706C6973742076657273696F6E3D22312E30223E0A3C646963743E0A093C6B65
% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D48
% 6F72697A6F6E74616C5265733C2F6B65793E0A093C646963743E0A09093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F72
% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
% 696E676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E61
% 70706C652E7072696E742E7469636B65742E6974656D41727261793C2F6B6579
% 3E0A09093C61727261793E0A0909093C646963743E0A090909093C6B65793E63
% 6F6D2E6170706C652E7072696E742E50616765466F726D61742E504D486F7269
% 7A6F6E74616C5265733C2F6B65793E0A090909093C7265616C3E37323C2F7265
% 616C3E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F6D
% 2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E0A
% 090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D31302D
% 30395432303A30333A33365A3C2F646174653E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B
% 65793E0A090909093C696E74656765723E303C2F696E74656765723E0A090909
% 3C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B65
% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D4F
% 7269656E746174696F6E3C2F6B65793E0A093C646963743E0A09093C6B65793E
% 636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F
% 6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E
% 676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E617070
% 6C652E7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A
% 09093C61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E50616765466F726D61742E504D4F7269656E74
% 6174696F6E3C2F6B65793E0A090909093C696E74656765723E313C2F696E7465
% 6765723E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
% 636B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F
% 6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E
% 0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D3130
% 2D30395432303A30333A33365A3C2F646174653E0A090909093C6B65793E636F
% 6D2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F
% 6B65793E0A090909093C696E74656765723E303C2F696E74656765723E0A0909
% 093C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B
% 65793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D
% 5363616C696E673C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F6B6579
% 3E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E676D61
% 6E616765723C2F737472696E673E0A09093C6B65793E636F6D2E6170706C652E
% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A09093C
% 61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D2E6170
% 706C652E7072696E742E50616765466F726D61742E504D5363616C696E673C2F
% 6B65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B6579
% 3E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F
% 6B65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E74
% 696E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B6579
% 3E0A090909093C646174653E323030362D31302D30395432303A30333A33365A
% 3C2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E74
% 656765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F
% 61727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E
% 7072696E742E50616765466F726D61742E504D566572746963616C5265733C2F
% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E50616765466F726D61742E504D566572746963616C5265733C2F6B65793E0A
% 090909093C7265616C3E37323C2F7265616C3E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B65793E
% 0A090909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D
% 616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E617070
% 6C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E0A0909
% 09093C646174653E323030362D31302D30395432303A30333A33365A3C2F6461
% 74653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465676572
% 3E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61727261
% 793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E7072696E
% 742E50616765466F726D61742E504D566572746963616C5363616C696E673C2F
% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E50616765466F726D61742E504D566572746963616C5363616C696E673C2F6B
% 65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B65793E
% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
% 65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E7469
% 6E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E
% 6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E
% 0A090909093C646174653E323030362D31302D30395432303A30333A33365A3C
% 2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E
% 7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465
% 6765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61
% 727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E70
% 72696E742E7375625469636B65742E70617065725F696E666F5F7469636B6574
% 3C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E
% 7072696E742E50616765466F726D61742E504D41646A75737465645061676552
% 6563743C2F6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E61
% 70706C652E7072696E742E7469636B65742E63726561746F723C2F6B65793E0A
% 0909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D616E
% 616765723C2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E
% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A090909
% 3C61727261793E0A090909093C646963743E0A09090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E50616765466F726D61742E504D41646A757374
% 656450616765526563743C2F6B65793E0A09090909093C61727261793E0A0909
% 090909093C7265616C3E302E303C2F7265616C3E0A0909090909093C7265616C
% 3E302E303C2F7265616C3E0A0909090909093C7265616C3E3738333C2F726561
% 6C3E0A0909090909093C7265616C3E3535393C2F7265616C3E0A09090909093C
% 2F61727261793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E
% 742E7469636B65742E636C69656E743C2F6B65793E0A09090909093C73747269
% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
% 72696E673E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
% 7469636B65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E
% 323030362D31302D30395432303A30333A33365A3C2F646174653E0A09090909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E737461
% 7465466C61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E
% 74656765723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09
% 093C2F646963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E
% 50616765466F726D61742E504D41646A75737465645061706572526563743C2F
% 6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E6170706C652E
% 7072696E742E7469636B65742E63726561746F723C2F6B65793E0A0909093C73
% 7472696E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C
% 2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E7469636B65742E6974656D41727261793C2F6B65793E0A0909093C61727261
% 793E0A090909093C646963743E0A09090909093C6B65793E636F6D2E6170706C
% 652E7072696E742E50616765466F726D61742E504D41646A7573746564506170
% 6572526563743C2F6B65793E0A09090909093C61727261793E0A090909090909
% 3C7265616C3E2D31383C2F7265616C3E0A0909090909093C7265616C3E2D3138
% 3C2F7265616C3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A09
% 09090909093C7265616C3E3537373C2F7265616C3E0A09090909093C2F617272
% 61793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
% 636B65742E636C69656E743C2F6B65793E0A09090909093C737472696E673E63
% 6F6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E67
% 3E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B
% 65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E32303036
% 2D31302D30395432303A30333A33365A3C2F646174653E0A09090909093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E7374617465466C
% 61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E74656765
% 723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09093C2F64
% 6963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E50617065
% 72496E666F2E504D50617065724E616D653C2F6B65793E0A09093C646963743E
% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E617070
% 6C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A
% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E69
% 74656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C64
% 6963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E50
% 61706572496E666F2E504D50617065724E616D653C2F6B65793E0A0909090909
% 3C737472696E673E69736F2D61343C2F737472696E673E0A09090909093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C
% 2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C652E707269
% 6E742E706D2E506F73745363726970743C2F737472696E673E0A09090909093C
% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
% 74653C2F6B65793E0A09090909093C646174653E323030332D30372D30315431
% 373A34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
% 0A09090909093C696E74656765723E313C2F696E74656765723E0A090909093C
% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
% 556E61646A757374656450616765526563743C2F6B65793E0A09093C64696374
% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170
% 706C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E
% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 6974656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C
% 646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
% 5061706572496E666F2E504D556E61646A757374656450616765526563743C2F
% 6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E302E
% 303C2F7265616C3E0A0909090909093C7265616C3E302E303C2F7265616C3E0A
% 0909090909093C7265616C3E3738333C2F7265616C3E0A0909090909093C7265
% 616C3E3535393C2F7265616C3E0A09090909093C2F61727261793E0A09090909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69
% 656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C65
% 2E7072696E74696E676D616E616765723C2F737472696E673E0A09090909093C
% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
% 74653C2F6B65793E0A09090909093C646174653E323030362D31302D30395432
% 303A30333A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
% 0A09090909093C696E74656765723E303C2F696E74656765723E0A090909093C
% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
% 556E61646A75737465645061706572526563743C2F6B65793E0A09093C646963
% 743E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65
% 742E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E61
% 70706C652E7072696E742E706D2E506F73745363726970743C2F737472696E67
% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E6974656D41727261793C2F6B65793E0A0909093C61727261793E0A09090909
% 3C646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E5061706572496E666F2E504D556E61646A7573746564506170657252656374
% 3C2F6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E
% 2D31383C2F7265616C3E0A0909090909093C7265616C3E2D31383C2F7265616C
% 3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A0909090909093C
% 7265616C3E3537373C2F7265616C3E0A09090909093C2F61727261793E0A0909
% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E63
% 6C69656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E617070
% 6C652E7072696E74696E676D616E616765723C2F737472696E673E0A09090909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F64
% 446174653C2F6B65793E0A09090909093C646174653E323030362D31302D3039
% 5432303A30333A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E
% 6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65
% 793E0A09090909093C696E74656765723E303C2F696E74656765723E0A090909
% 093C2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09
% 093C6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E
% 7070642E504D50617065724E616D653C2F6B65793E0A09093C646963743E0A09
% 09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6372
% 6561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170706C65
% 2E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A0909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E697465
% 6D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C646963
% 743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E506170
% 6572496E666F2E7070642E504D50617065724E616D653C2F6B65793E0A090909
% 09093C737472696E673E41343C2F737472696E673E0A09090909093C6B65793E
% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
% 65793E0A09090909093C737472696E673E636F6D2E6170706C652E7072696E74
% 2E706D2E506F73745363726970743C2F737472696E673E0A09090909093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F6444617465
% 3C2F6B65793E0A09090909093C646174653E323030332D30372D30315431373A
% 34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170706C
% 652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E0A09
% 090909093C696E74656765723E313C2F696E74656765723E0A090909093C2F64
% 6963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E41504956657273
% 696F6E3C2F6B65793E0A09093C737472696E673E30302E32303C2F737472696E
% 673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E707269766174654C6F636B3C2F6B65793E0A09093C66616C73652F3E0A0909
% 3C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74797065
% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
% 2E5061706572496E666F5469636B65743C2F737472696E673E0A093C2F646963
% 743E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 41504956657273696F6E3C2F6B65793E0A093C737472696E673E30302E32303C
% 2F737472696E673E0A093C6B65793E636F6D2E6170706C652E7072696E742E74
% 69636B65742E707269766174654C6F636B3C2F6B65793E0A093C66616C73652F
% 3E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74
% 7970653C2F6B65793E0A093C737472696E673E636F6D2E6170706C652E707269
% 6E742E50616765466F726D61745469636B65743C2F737472696E673E0A3C2F64
% 6963743E0A3C2F706C6973743E0A3842494D03E9000000000078000300000048
% 004800000000030F022FFFEEFFEE033802410367057B03E00002000000480048
% 0000000002D802280001000000640000000100030303000000017FFF00010001
% 0000000000000000000000006808001901900000000000200000000000000000
% 0000000000000000000000000000000000003842494D03ED0000000000100048
% 00000001000200480000000100023842494D042600000000000E000000000000
% 000000003F8000003842494D040D0000000000040000001E3842494D04190000
% 000000040000001E3842494D03F3000000000009000000000000000001003842
% 494D040A00000000000100003842494D271000000000000A0001000000000000
% 00023842494D03F5000000000048002F66660001006C66660006000000000001
% 002F6666000100A1999A0006000000000001003200000001005A000000060000
% 00000001003500000001002D000000060000000000013842494D03F800000000
% 00700000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000
% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFF
% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800003842494D04080000000000100000
% 00010000024000000240000000003842494D041E000000000004000000003842
% 494D041A00000000036300000006000000000000000000000183000001560000
% 001700620072006100760065002D0067006E0075002D0077006F0072006C0064
% 002D006C006F0067006F002E0032003500000001000000000000000000000000
% 0000000000000001000000000000000000000156000001830000000000000000
% 0000000000000000010000000000000000000000000000000000000010000000
% 010000000000006E756C6C0000000200000006626F756E64734F626A63000000
% 01000000000000526374310000000400000000546F70206C6F6E670000000000
% 0000004C6566746C6F6E67000000000000000042746F6D6C6F6E670000018300
% 000000526768746C6F6E670000015600000006736C69636573566C4C73000000
% 014F626A6300000001000000000005736C6963650000001200000007736C6963
% 6549446C6F6E67000000000000000767726F757049446C6F6E67000000000000
% 00066F726967696E656E756D0000000C45536C6963654F726967696E0000000D
% 6175746F47656E6572617465640000000054797065656E756D0000000A45536C
% 6963655479706500000000496D672000000006626F756E64734F626A63000000
% 01000000000000526374310000000400000000546F70206C6F6E670000000000
% 0000004C6566746C6F6E67000000000000000042746F6D6C6F6E670000018300
% 000000526768746C6F6E67000001560000000375726C54455854000000010000
% 000000006E756C6C54455854000000010000000000004D736765544558540000
% 0001000000000006616C74546167544558540000000100000000000E63656C6C
% 54657874497348544D4C626F6F6C010000000863656C6C546578745445585400
% 000001000000000009686F727A416C69676E656E756D0000000F45536C696365
% 486F727A416C69676E0000000764656661756C740000000976657274416C6967
% 6E656E756D0000000F45536C69636556657274416C69676E0000000764656661
% 756C740000000B6267436F6C6F7254797065656E756D0000001145536C696365
% 4247436F6C6F7254797065000000004E6F6E6500000009746F704F7574736574
% 6C6F6E67000000000000000A6C6566744F75747365746C6F6E67000000000000
% 000C626F74746F6D4F75747365746C6F6E67000000000000000B72696768744F
% 75747365746C6F6E6700000000003842494D041100000000000101003842494D
% 0414000000000004000000013842494D040C0000000011340000000100000071
% 00000080000001540000AA000000111800180001FFD8FFE000104A4649460001
% 0201004800480000FFED000C41646F62655F434D0002FFEE000E41646F626500
% 648000000001FFDB0084000C08080809080C09090C110B0A0B11150F0C0C0F15
% 18131315131318110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
% 0C0C0C0C0C0C0C0C0C0C0C010D0B0B0D0E0D100E0E10140E0E0E14140E0E0E0E
% 14110C0C0C0C0C11110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
% 0C0C0C0C0C0C0C0C0C0C0C0CFFC00011080080007103012200021101031101FF
% DD00040008FFC4013F0000010501010101010100000000000000030001020405
% 060708090A0B0100010501010101010100000000000000010002030405060708
% 090A0B1000010401030204020507060805030C33010002110304211231054151
% 611322718132061491A1B14223241552C16233347282D14307259253F0E1F163
% 733516A2B283264493546445C2A3743617D255E265F2B384C3D375E3F3462794
% A485B495C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F637475767778797
% A7B7C7D7E7F71100020201020404030405060707060535010002110321311204
% 4151617122130532819114A1B14223C152D1F0332462E1728292435315637334
% F1250616A2B283072635C2D2449354A317644555367465E2F2B384C3D375E3F3
% 4694A485B495C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F62737475767
% 778797A7B7C7FFDA000C03010002110311003F00F5549249252952EA5D6303A6
% B01C9B3F48E04D74B06EB1D1FBACFDCFCDF56CD94FEFD8A9F5AEB8EC4B1B8182
% CF5BA85A040896B377D17387B7D4B1DB7D94FF00D72EF4AA50E93F57C54F766F
% 513F69CDB4EE739E43849FECB5AE733E87B7F435FD0A2AAAA494969FAC06FD6A
% C0CA73791ED64F9E82C72B9566DF63B6FD8EE66B05CF35868F3FE777BBFB0C56
% 80F979240009294275911E09D2492535322DEA35585D5555E4526206E2C7B74F
% 76ED2C6DBEEFDDF4FF00E2FF00C22A77F51EAFF46BC7C7A9C7F3ADB6C81F9DF4
% 7D0ABF35BFBEB5D2494E5E066E7DAE8BDF8CFD09D94EEDC60EDFCF73BF3BF796
% 931E1ED04692260F2151EA1D1E9CB3EAD4EFB3E50D45AD120FFC755F46DFFCF9
% FCB553A7F53BC669E9FD440A731809601F42D1AFE998FF00F09BA3D9FF00A53D
% 8929DB49327494A49249253FFFD0F55599D77ABFECDA18DA5A2CCCC825B8EC3A
% 8111BEE7810E732ADECF637F9DB5F553FA3F53D5669AE4F12D6F53EB36752B3D
% F57A831F10088D8D163FD4DDB7E8B696DD97F43E9E4D74FF00A2494E8740E91E
% 8B1F999536655F2E7BDC649DC439DBB46B7DDB7F37FF003C7A55ADBF34CC6ED6
% 86F8052494A49258791F59EB7DBF67E9349EA16FFA469DB5027DA3F4B0EF57FA
% D5B7D1FF0086494EE24B370733A8D8FDB96CA5A4CC8ADD3B6086EDE5DB9FB9DF
% C853EA3D6FA7F4EDADBDE4DCF12CA2B05D6113B6767E637F9566C494DF4967E2
% F59AB206EFB3DF5375F73DA3B6A67D373DCAF32C658DDCC70703DC24A64B3BAD
% F4A6F52C4DAC8665D277E2DA646D7FEEB8B7FC15BFCDDBFF006E7F395D6B4524
% 94E3F42EA8FCEA032F9664D07D3B6B321DB99ED79B3E97FEAE5B0B987B8627D6
% 6CCF4CED65B48B1FB7B13E9B777F9C3D477F5D74CD208D381A7DDA24A5D24924
% 94FF00FFD1F547025A434C3A343E6B95FAAAE68C4A75DA7DF519D00B1E2835EF
% 67B7E936A733DDF9F52EAD60E574BC9C0CBBB3701A6EC6CA9765E20FA41C4973
% EDA3F7F7B8EED9F4FD4FE6FE9FE8D29DB37541BBDCE01BC1713027E2A166661D
% 4D2FB6FAEB6375739CF6803E24959B5E4D790C635AE9DA76D8DB25C5A63F384B
% 1CFB2BDAA4DE89D2FD3F57228640F77BF489ECFF00A2D494E65D9197F59AF763
% 636EA3A55662C79106D3CFBDA47B5BFB98EFFF00D0BFFB8AB6B1FA562E352296
% B4069FCD048DC63DDB8B8EF7EEFCFF007FFE05FA34B1EE6399E874F6B1B4D6ED
% 81EC1EC6E81EE867B3F7FF007D068E9F6FDAB7643DD786C1208105C3875BEEF7
% 7FC055FA5F47F9CFE752009DBF15A6755E2DD6D0DADB0D6C37521ADD00D1C36B
% 581BB550B6BC1392F71654ECD11BC020DAD6E9B7D92EB7DCDFDDF52C7AD0B1AD
% 9DE40DEE01AEE4CB44BB6FE6AAB8A5D91634E562D7518B1ECF7377B06E6ED63D
% A3DDEA58D77AB76DFD1D7FCDFBD2063746FE8A24F4AFF0BD281D958ED690F2EA
% F7E9B4CC03EDFD1EDFF02E74B37D5F4FDFFA556A9C864876E0D6C7B23BE9FB8D
% FA5FF93FF068EDA61CE6C35CC70F708E67F7964BB1FD5C9B7EC47EC81AFF004D
% A1DB832C786C96FA2F1ED6FF0053FEDBB13B849BAD695C7FBDE9E8EC5993454D
% 9BAC6543C5CE0047C5D0B3737EB3F4BC7696D160CCC8FCCA68F749FE5DAD9AEB
% FF00ABFDCAEC556DC9739FF63EA558AED322B9FE69F103D967B7F44DF67A9EE6
% 7FD6958C7C66B59EC6358ED443181A07F298FF00D35D637DDFA3F4DBFF006D26
% AE73B031B2ADCD7E56701F6ACA2CB1F5813B6B043AA6ECFCDF5ACA29AAADDF4F
% 1E9CABAEFF0008BA7ADBB5B1E249FBC9720518B5B786901C4971792E738E8DDC
% F73FDDEEDBB7FE2995D7FCD2B49294924924A7FFD2F55492492520BB131AD70B
% 2CAC1B1BC5834788F0B1BB5EAB64E48345C08FB5381DAFC6ADA1E040DCEA4EEF
% DE6BBDCFB91731D9EF70A30C32ADD05F91619869277368A5BEEB2EF6FF0085F4
% AAFD27F86F7D4876E217EFB3A85E3ECC047A0D3B6B826375EF9DF91EDF66C7FE
% 87FE0AD40D9D00DFAA083DE97C66E558FAEDC9BAB68FA5563E39961046DF7DAF
% DAFC86B5AEF66DAA867F215AB9C5AD0448931204F6EEA149AC173995892434B9
% A002E81B771FCD4AE739DB1F503635AE2486380D60B750EDAD7FF9E8C850D100
% 820EBDDCCBD96BAC739D7FA75D624B18DFFA565B61FF00A0C594EEB1496EFA1B
% 6B9F4BA77BB6B5AE274DB66DDCEDBFC9DAB6ADE9F8F98D7D598CB5C09DE2A712
% CD3F976D2FD963777F2D3E1BF16B2DAF02B365434229D82961F377B773FF007F
% 6FA8A200750C03181F30D7C3F97A9CEFB45D9353AABDE0525A1F153C8D9DB67E
% 8EB2E66DFA75D9BFF46B55D9CEAF2EBA2DA5EFA5EC97646D90D33B5A5E59F98F
% 9FFAC7FC56FF0042A757EA34E2B4D2D6B6DC8B012E635DED6B4FB77E44FD062A
% 755DD66DC57D8D76350C8F4BD67B9CD718FCEADCF6BAB73754E8896E02E88978
% 70F8BB39189899B43314B89A5B04110E0E05AEDA196582CF7B7F9CDECFD325D2
% 31DD46132AB2CF55ED2438F8104FE8F977F37F450BA6613DB41BAFBBD7C8BD8C
% 6DEE6BB4696496D34D94FA7FA3A9F659EFDBEA588F45D915BC372FD30EB6368A
% C1FA41BFA5DEE27DDF454B44824EFD596EA8550D9B8924926AE524924929FFD3
% F554C74D53A8BDA1ED2D3C1E47924A44CB1FF69B1AF2D02016346A4B40D6C7FB
% 7DBB9FEC6FFC5A0BB3706CCC6E31BEB75C06E65421CE691FE11DF4B67F21567E
% 0DD915BDF97A5971F731A4B9AD00FE8AA6CFEEB7F9DFF4967A8957F64E9EE656
% DDAD2E92F7C06807F96EFDE530803B1B95550FE2D696522C513ADBA2DC7A8012
% DDC7C5DA93F1944F6B60683B008745ECB9BB9A6478F8A8B1EF0FF4DD5B84925D
% 669B493FD53BFF00CE6A866640D166870571446FD833B68A6D20D8D0E2D9027C
% 0FD26FF55CA9D580FC2A5CDC67B4971DCEB2FDC63C5DB1AE6D7F47F36BF415C6
% 58C2D1E9CB9BC0238FF3BF393DAF656C2EB012D04030D2EE4EDFA2D0EFFCC134
% 709D579DABBBCE3F0F2B3DD7065FEB536C7AD94DFD1B1DE9977A7563D156F73E
% A6EFFD25B65D67A9FF0017B158FB0E261DB4D977A7EA39BB2AF6973811FE8F76
% E72D2A3AB74FBC5A59688A1CE6DA4F0DDBF9CE7FF36D67F2B77FE09BD1DD451B
% 8DA58DDF1F4C8D614D0C911A01A3164C529697FF0072D2C3ADF4836DAF739D61
% 009768E33A37467B559C8B1B5D4D6BD9BD847B817098FA3A6FFA7F4BF7D1DA1A
% 00DBC762B23AC6506D4D0F6C5AED6AD636C3873FBDBFD9FA2FF0B67E8D899932
% 13B685118184753C44BAB8F732FA596B0CB5C3BE864687FE9222CCFABC727F67
% 4640877A961699E5AE77A9C7E66C73FD2DBFF06B4D0F3661B6AA49249253FFD4
% F5550B63D27CC81B4EA2678EDB21FF00E6A9A6735AE696B84B5C2083C1052521
% 756DB7D37133B007026473DF669EE5917B76BDF6BEB796D7616D4C716D758FE5
% 0FCEB372D2B32DEC6D0D6D42CB6DD1E1AE68637696B6EF7D858E77A5BBF32BFC
% C51FD9D5BB25F9169F56C71258481B5A3B358DFDEDBF9EA6C79044907A7460CB
% 8CCA363525AACCBCD758DAEB6358D03DDB89E4FEEED5A34D8F6B0BAF78D3BC6D
% 1F892A4DA76C00040F1D4A1370DDB8BAD7FAAE719F701007EEB1A94A5097411F
% CD8F1C32C28EFE1D190BECB2C0DA9AD2CFCE7870D3FAAD83B9584014EC3B8B8B
% 8766E908A663DC62398D1472AD299E065AF10D5AD7D599BB6D26B7D446A2E930
% 7F77D9FCE31DFCBFA1FF000BBFF461AB1B230B1B2AE786E55AE3BEBC7AC7A758
% DAD8AE9AD8E758DDCE7FB9F77E7FFDB6AF36D63EB0FACEF69E0B759F8154F32E
% C8C70F758F636A26597381DACFE45CDDDF4BFD1DDFF5BFD17E8FD5611C3A81AA
% FB02CD5F7F1497DD15C5A62752C64C9FE40DB0EFF5FA0B16D75965B664871391
% EB86D0D0FDD5D15967A5F687532DFD2BB75DE9FF00C27E8FFD221E5E5B9DF67B
% CD576CB5F1481A3AD77954E76F6334FF00468DD3F14D4CB2ECD0319D63CD950B
% 1BC47E84DB65BA535DB6BEFDB8D5DBF99FE0FF009DF4C63F9AE4C71E33648E9A
% 7F55D2E867761B9ED9F49D63853BB9D8C8A013FD6755B968A0E1D031F16AA75F
% 6B759E64FB9DFF0049193E5B9F3648EC1492492097FFD5F5549249252175465C
% 19A171DED9D4077E77B7F95FF56B2197E4B6E353AD3894D0F1E8D75ED797B662
% E65CCDB635B56EFE6FD3F4ED62DB7B43DA5A6402224120EBE0E6C39AB2BA80B3
% 1EA631F63D9481FA7CA76E76CAC37F4AF73EBDBFA6DAC6ECBACFD1D7FCF7E93F
% 997B67777F4639020831BBFC1B14F53ADD98EC176E7DD24B0B58E03601BF758E
% 70D9FF0007BD8EFF0047FBEACE564371A875EFFA0C8DE7B35A486BAC77EED75B
% 7F4967F2163538169F4FA8623ADB5EC8153B29C5E367D0F5D94511BDDE9BECF4
% BDCCFE73E82D5C7C877A7B0EEB6C61DAE716ECDC47EEB53C4254B84C0AE22906
% 454FAEBBEBB05955801ACD7EF0F0ED5AE6B99BB7336AA7D40D97B4B585D536A9
% 2E7176D0EFE4EC66EB1EADDEF2C754E86EA483B84BBE8B9D0CD5BFBAA961F56F
% B56406331DCEC7B1FB29BC35DB5C035EFB2F2EDA6AF437B19456EF57D4B2CFF0
% 7E9FA6FB146601DB50A944CAC0F36A60D79877B8D8E73C18697CB8347FC1876D
% 5A7EADE1BE98607088758490493FBAC60F77F9EC44BD8E6B41A9BE32D02499FE
% DD6D6AA96E6D58A7D323ED196D689AEB074DDF47D5B0EF652D77F2FF00EB75A9
% 8C8486C3CBAB008CE32278BFB12E174F38F90FCAB6C375D635B5EE7B40735838
% ADAE6FE6EEF7BFFE11553D359665D7451FA3E9F4B8BDD8EC02BAA49F58C56D1F
% A675B92EDF63FF0099F4FF0043E9FE96E49D5E5E639A2D787020C5357B6B0276
% D85EF796D96ECFE6FE87FD67F48B4B1B1ABC6ABD3AC47771F13F3DCA23103CFB
% 766789BD3A2649249357292492494FFFD6F554924925290EEA59706EED0B0EE6
% 38685AE1F9CD3FF47F96CFD1BFF4688924A73FA937A836B73B1ACFA65A37113E
% 9025AC7BEBAEB0DF53FD2FE9ACFF00C013E167E2DEC0DA6C6BAD76E06C6B086B
% 9ECF6DBDBE96EFF07BD5F42BB1E9BD8596B0381F9107F79AF6FB98EFE53521D7
% B1457F22E4E7E46654FF00758DA5BCBDF638C081BBD9B5BB76FB7E9D8F546BEA
% B936D95DD48BEE6BA41706BEBADC08D3D371FF00C8FBD6FB7A7630209DEF8FA3
% EA3DCF23FAAFB0B9FDFF0079577742C7B06CBEFC8BABEF5BAD2D0E3FBD61A7D2
% 7D9FBBB1EFF4BFE0D33835DD8C62FE56E659D4F305753ADB61ECD59435E1BBDC
% DFA2EC87B9DEB3F1B77D3F47F4977FC5AD46306535DE9D64B490E36BC1ADAF71
% 078AA1B6BABAFD9FF1BFE9559C5C0C2C36918D4B6A9E481A9FEB3CFB9CAC27C6
% E3B15E23A51D50D18B5504B9A25EE0017F7DADFA15B7F72AAF77E8EB6A324924
% B94924924A524924929FFFD93842494D04210000000000790000000101000000
% 1800410064006F00620065002000500068006F0074006F00730068006F007000
% 200045006C0065006D0065006E007400730000001C00410064006F0062006500
% 2000500068006F0074006F00730068006F007000200045006C0065006D006500
% 6E0074007300200032002E003000000001003842494D042200000000012E4D4D
% 002A000000080007011200030000000100010000011A00050000000100000062
% 011B0005000000010000006A012800030000000100020000013100020000001D
% 0000007201320002000000140000008F8769000400000001000000A4000000D0
% 0000004800000001000000480000000141646F62652050686F746F73686F7020
% 456C656D656E747320322E3000323030363A31303A30392032323A30393A3238
% 00000003A001000300000001FFFF0000A00200040000000100000156A0030004
% 00000001000001830000000000000006010300030000000100060000011A0005
% 000000010000011E011B00050000000100000126012800030000000100020000
% 02010004000000010000012E0202000400000001000000000000000000000048
% 0000000100000048000000013842494D03FD0000000000070000000000000000
%EndPhotoshop
%begin_xml_code
/pdfmark where {pop true} {false} ifelse
/currentdistillerparams where {pop currentdistillerparams
/CoreDistVersion get 5000 ge } {false} ifelse
and not {userdict /pdfmark /cleartomark load put} if
[/NamespacePush pdfmark
[/_objdef {photoshop_metadata_stream} /type /stream /OBJ pdfmark
/MetadataString 5038 string def % exact length of metadata
/TempString 100 string def
/ConsumeMetadata {
currentfile TempString readline pop pop
currentfile MetadataString readstring pop pop
} bind def
ConsumeMetadata
%begin_xml_packet: 5038
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?> +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: brave-gnu-world-logo.25.eps +%%CreationDate: 09.10.2006 22:09 Uhr +%%BoundingBox: 0 0 342 387 +%%HiResBoundingBox: 0 0 342 387 +%%SuppressDotGainCompensation +%%EndComments +%%BeginProlog +%%EndProlog +%%BeginSetup +%%EndSetup +%ImageData: 342 387 8 3 0 1 3 "beginimage" +%BeginPhotoshop: 13952 +% 3842494D0425000000000010000000000000000000000000000000003842494D +% 03EA000000001DA63C3F786D6C2076657273696F6E3D22312E302220656E636F +% 64696E673D225554462D38223F3E0A3C21444F435459504520706C6973742050 +% 55424C494320222D2F2F4170706C6520436F6D70757465722F2F44544420504C +% 49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E63 +% 6F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C +% 706C6973742076657273696F6E3D22312E30223E0A3C646963743E0A093C6B65 +% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D48 +% 6F72697A6F6E74616C5265733C2F6B65793E0A093C646963743E0A09093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F72 +% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74 +% 696E676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E61 +% 70706C652E7072696E742E7469636B65742E6974656D41727261793C2F6B6579 +% 3E0A09093C61727261793E0A0909093C646963743E0A090909093C6B65793E63 +% 6F6D2E6170706C652E7072696E742E50616765466F726D61742E504D486F7269 +% 7A6F6E74616C5265733C2F6B65793E0A090909093C7265616C3E37323C2F7265 +% 616C3E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963 +% 6B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F6D +% 2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E0A +% 090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E +% 6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D31302D +% 30395432303A30333A33365A3C2F646174653E0A090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B +% 65793E0A090909093C696E74656765723E303C2F696E74656765723E0A090909 +% 3C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B65 +% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D4F +% 7269656E746174696F6E3C2F6B65793E0A093C646963743E0A09093C6B65793E +% 636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F +% 6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E +% 676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E617070 +% 6C652E7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A +% 09093C61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E50616765466F726D61742E504D4F7269656E74 +% 6174696F6E3C2F6B65793E0A090909093C696E74656765723E313C2F696E7465 +% 6765723E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469 +% 636B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F +% 6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E +% 0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 +% 2E6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D3130 +% 2D30395432303A30333A33365A3C2F646174653E0A090909093C6B65793E636F +% 6D2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F +% 6B65793E0A090909093C696E74656765723E303C2F696E74656765723E0A0909 +% 093C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B +% 65793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D +% 5363616C696E673C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D +% 2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F6B6579 +% 3E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E676D61 +% 6E616765723C2F737472696E673E0A09093C6B65793E636F6D2E6170706C652E +% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A09093C +% 61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D2E6170 +% 706C652E7072696E742E50616765466F726D61742E504D5363616C696E673C2F +% 6B65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B6579 +% 3E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F +% 6B65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E74 +% 696E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B6579 +% 3E0A090909093C646174653E323030362D31302D30395432303A30333A33365A +% 3C2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E74 +% 656765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F +% 61727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E +% 7072696E742E50616765466F726D61742E504D566572746963616C5265733C2F +% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072 +% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269 +% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 +% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963 +% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909 +% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E50616765466F726D61742E504D566572746963616C5265733C2F6B65793E0A +% 090909093C7265616C3E37323C2F7265616C3E0A090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B65793E +% 0A090909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D +% 616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E617070 +% 6C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E0A0909 +% 09093C646174653E323030362D31302D30395432303A30333A33365A3C2F6461 +% 74653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963 +% 6B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465676572 +% 3E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61727261 +% 793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E7072696E +% 742E50616765466F726D61742E504D566572746963616C5363616C696E673C2F +% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072 +% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269 +% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 +% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963 +% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909 +% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E50616765466F726D61742E504D566572746963616C5363616C696E673C2F6B +% 65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B65793E +% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B +% 65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E7469 +% 6E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E +% 6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E +% 0A090909093C646174653E323030362D31302D30395432303A30333A33365A3C +% 2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E +% 7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465 +% 6765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61 +% 727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E70 +% 72696E742E7375625469636B65742E70617065725F696E666F5F7469636B6574 +% 3C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E +% 7072696E742E50616765466F726D61742E504D41646A75737465645061676552 +% 6563743C2F6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E61 +% 70706C652E7072696E742E7469636B65742E63726561746F723C2F6B65793E0A +% 0909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D616E +% 616765723C2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E +% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A090909 +% 3C61727261793E0A090909093C646963743E0A09090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E50616765466F726D61742E504D41646A757374 +% 656450616765526563743C2F6B65793E0A09090909093C61727261793E0A0909 +% 090909093C7265616C3E302E303C2F7265616C3E0A0909090909093C7265616C +% 3E302E303C2F7265616C3E0A0909090909093C7265616C3E3738333C2F726561 +% 6C3E0A0909090909093C7265616C3E3535393C2F7265616C3E0A09090909093C +% 2F61727261793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E +% 742E7469636B65742E636C69656E743C2F6B65793E0A09090909093C73747269 +% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 +% 72696E673E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E +% 7469636B65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E +% 323030362D31302D30395432303A30333A33365A3C2F646174653E0A09090909 +% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E737461 +% 7465466C61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E +% 74656765723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09 +% 093C2F646963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E +% 50616765466F726D61742E504D41646A75737465645061706572526563743C2F +% 6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E6170706C652E +% 7072696E742E7469636B65742E63726561746F723C2F6B65793E0A0909093C73 +% 7472696E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C +% 2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E7469636B65742E6974656D41727261793C2F6B65793E0A0909093C61727261 +% 793E0A090909093C646963743E0A09090909093C6B65793E636F6D2E6170706C +% 652E7072696E742E50616765466F726D61742E504D41646A7573746564506170 +% 6572526563743C2F6B65793E0A09090909093C61727261793E0A090909090909 +% 3C7265616C3E2D31383C2F7265616C3E0A0909090909093C7265616C3E2D3138 +% 3C2F7265616C3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A09 +% 09090909093C7265616C3E3537373C2F7265616C3E0A09090909093C2F617272 +% 61793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469 +% 636B65742E636C69656E743C2F6B65793E0A09090909093C737472696E673E63 +% 6F6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E67 +% 3E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B +% 65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E32303036 +% 2D31302D30395432303A30333A33365A3C2F646174653E0A09090909093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E7374617465466C +% 61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E74656765 +% 723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09093C2F64 +% 6963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E50617065 +% 72496E666F2E504D50617065724E616D653C2F6B65793E0A09093C646963743E +% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E +% 63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E617070 +% 6C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A +% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E69 +% 74656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C64 +% 6963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E50 +% 61706572496E666F2E504D50617065724E616D653C2F6B65793E0A0909090909 +% 3C737472696E673E69736F2D61343C2F737472696E673E0A09090909093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C +% 2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C652E707269 +% 6E742E706D2E506F73745363726970743C2F737472696E673E0A09090909093C +% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461 +% 74653C2F6B65793E0A09090909093C646174653E323030332D30372D30315431 +% 373A34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170 +% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E +% 0A09090909093C696E74656765723E313C2F696E74656765723E0A090909093C +% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C +% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D +% 556E61646A757374656450616765526563743C2F6B65793E0A09093C64696374 +% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 +% 2E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170 +% 706C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E +% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E +% 6974656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C +% 646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E +% 5061706572496E666F2E504D556E61646A757374656450616765526563743C2F +% 6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E302E +% 303C2F7265616C3E0A0909090909093C7265616C3E302E303C2F7265616C3E0A +% 0909090909093C7265616C3E3738333C2F7265616C3E0A0909090909093C7265 +% 616C3E3535393C2F7265616C3E0A09090909093C2F61727261793E0A09090909 +% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69 +% 656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C65 +% 2E7072696E74696E676D616E616765723C2F737472696E673E0A09090909093C +% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461 +% 74653C2F6B65793E0A09090909093C646174653E323030362D31302D30395432 +% 303A30333A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170 +% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E +% 0A09090909093C696E74656765723E303C2F696E74656765723E0A090909093C +% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C +% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D +% 556E61646A75737465645061706572526563743C2F6B65793E0A09093C646963 +% 743E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65 +% 742E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E61 +% 70706C652E7072696E742E706D2E506F73745363726970743C2F737472696E67 +% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 +% 2E6974656D41727261793C2F6B65793E0A0909093C61727261793E0A09090909 +% 3C646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E5061706572496E666F2E504D556E61646A7573746564506170657252656374 +% 3C2F6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E +% 2D31383C2F7265616C3E0A0909090909093C7265616C3E2D31383C2F7265616C +% 3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A0909090909093C +% 7265616C3E3537373C2F7265616C3E0A09090909093C2F61727261793E0A0909 +% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E63 +% 6C69656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E617070 +% 6C652E7072696E74696E676D616E616765723C2F737472696E673E0A09090909 +% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F64 +% 446174653C2F6B65793E0A09090909093C646174653E323030362D31302D3039 +% 5432303A30333A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E +% 6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65 +% 793E0A09090909093C696E74656765723E303C2F696E74656765723E0A090909 +% 093C2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09 +% 093C6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E +% 7070642E504D50617065724E616D653C2F6B65793E0A09093C646963743E0A09 +% 09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6372 +% 6561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170706C65 +% 2E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A0909 +% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E697465 +% 6D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C646963 +% 743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E506170 +% 6572496E666F2E7070642E504D50617065724E616D653C2F6B65793E0A090909 +% 09093C737472696E673E41343C2F737472696E673E0A09090909093C6B65793E +% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B +% 65793E0A09090909093C737472696E673E636F6D2E6170706C652E7072696E74 +% 2E706D2E506F73745363726970743C2F737472696E673E0A09090909093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F6444617465 +% 3C2F6B65793E0A09090909093C646174653E323030332D30372D30315431373A +% 34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170706C +% 652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E0A09 +% 090909093C696E74656765723E313C2F696E74656765723E0A090909093C2F64 +% 6963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E41504956657273 +% 696F6E3C2F6B65793E0A09093C737472696E673E30302E32303C2F737472696E +% 673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 +% 2E707269766174654C6F636B3C2F6B65793E0A09093C66616C73652F3E0A0909 +% 3C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74797065 +% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74 +% 2E5061706572496E666F5469636B65743C2F737472696E673E0A093C2F646963 +% 743E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E +% 41504956657273696F6E3C2F6B65793E0A093C737472696E673E30302E32303C +% 2F737472696E673E0A093C6B65793E636F6D2E6170706C652E7072696E742E74 +% 69636B65742E707269766174654C6F636B3C2F6B65793E0A093C66616C73652F +% 3E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74 +% 7970653C2F6B65793E0A093C737472696E673E636F6D2E6170706C652E707269 +% 6E742E50616765466F726D61745469636B65743C2F737472696E673E0A3C2F64 +% 6963743E0A3C2F706C6973743E0A3842494D03E9000000000078000300000048 +% 004800000000030F022FFFEEFFEE033802410367057B03E00002000000480048 +% 0000000002D802280001000000640000000100030303000000017FFF00010001 +% 0000000000000000000000006808001901900000000000200000000000000000 +% 0000000000000000000000000000000000003842494D03ED0000000000100048 +% 00000001000200480000000100023842494D042600000000000E000000000000 +% 000000003F8000003842494D040D0000000000040000001E3842494D04190000 +% 000000040000001E3842494D03F3000000000009000000000000000001003842 +% 494D040A00000000000100003842494D271000000000000A0001000000000000 +% 00023842494D03F5000000000048002F66660001006C66660006000000000001 +% 002F6666000100A1999A0006000000000001003200000001005A000000060000 +% 00000001003500000001002D000000060000000000013842494D03F800000000 +% 00700000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000 +% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFF +% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFFFFFFFFFF +% FFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800003842494D04080000000000100000 +% 00010000024000000240000000003842494D041E000000000004000000003842 +% 494D041A00000000036300000006000000000000000000000183000001560000 +% 001700620072006100760065002D0067006E0075002D0077006F0072006C0064 +% 002D006C006F0067006F002E0032003500000001000000000000000000000000 +% 0000000000000001000000000000000000000156000001830000000000000000 +% 0000000000000000010000000000000000000000000000000000000010000000 +% 010000000000006E756C6C0000000200000006626F756E64734F626A63000000 +% 01000000000000526374310000000400000000546F70206C6F6E670000000000 +% 0000004C6566746C6F6E67000000000000000042746F6D6C6F6E670000018300 +% 000000526768746C6F6E670000015600000006736C69636573566C4C73000000 +% 014F626A6300000001000000000005736C6963650000001200000007736C6963 +% 6549446C6F6E67000000000000000767726F757049446C6F6E67000000000000 +% 00066F726967696E656E756D0000000C45536C6963654F726967696E0000000D +% 6175746F47656E6572617465640000000054797065656E756D0000000A45536C +% 6963655479706500000000496D672000000006626F756E64734F626A63000000 +% 01000000000000526374310000000400000000546F70206C6F6E670000000000 +% 0000004C6566746C6F6E67000000000000000042746F6D6C6F6E670000018300 +% 000000526768746C6F6E67000001560000000375726C54455854000000010000 +% 000000006E756C6C54455854000000010000000000004D736765544558540000 +% 0001000000000006616C74546167544558540000000100000000000E63656C6C +% 54657874497348544D4C626F6F6C010000000863656C6C546578745445585400 +% 000001000000000009686F727A416C69676E656E756D0000000F45536C696365 +% 486F727A416C69676E0000000764656661756C740000000976657274416C6967 +% 6E656E756D0000000F45536C69636556657274416C69676E0000000764656661 +% 756C740000000B6267436F6C6F7254797065656E756D0000001145536C696365 +% 4247436F6C6F7254797065000000004E6F6E6500000009746F704F7574736574 +% 6C6F6E67000000000000000A6C6566744F75747365746C6F6E67000000000000 +% 000C626F74746F6D4F75747365746C6F6E67000000000000000B72696768744F +% 75747365746C6F6E6700000000003842494D041100000000000101003842494D +% 0414000000000004000000013842494D040C0000000011340000000100000071 +% 00000080000001540000AA000000111800180001FFD8FFE000104A4649460001 +% 0201004800480000FFED000C41646F62655F434D0002FFEE000E41646F626500 +% 648000000001FFDB0084000C08080809080C09090C110B0A0B11150F0C0C0F15 +% 18131315131318110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +% 0C0C0C0C0C0C0C0C0C0C0C010D0B0B0D0E0D100E0E10140E0E0E14140E0E0E0E +% 14110C0C0C0C0C11110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +% 0C0C0C0C0C0C0C0C0C0C0C0CFFC00011080080007103012200021101031101FF +% DD00040008FFC4013F0000010501010101010100000000000000030001020405 +% 060708090A0B0100010501010101010100000000000000010002030405060708 +% 090A0B1000010401030204020507060805030C33010002110304211231054151 +% 611322718132061491A1B14223241552C16233347282D14307259253F0E1F163 +% 733516A2B283264493546445C2A3743617D255E265F2B384C3D375E3F3462794 +% A485B495C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F637475767778797 +% A7B7C7D7E7F71100020201020404030405060707060535010002110321311204 +% 4151617122130532819114A1B14223C152D1F0332462E1728292435315637334 +% F1250616A2B283072635C2D2449354A317644555367465E2F2B384C3D375E3F3 +% 4694A485B495C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F62737475767 +% 778797A7B7C7FFDA000C03010002110311003F00F5549249252952EA5D6303A6 +% B01C9B3F48E04D74B06EB1D1FBACFDCFCDF56CD94FEFD8A9F5AEB8EC4B1B8182 +% CF5BA85A040896B377D17387B7D4B1DB7D94FF00D72EF4AA50E93F57C54F766F +% 513F69CDB4EE739E43849FECB5AE733E87B7F435FD0A2AAAA494969FAC06FD6A +% C0CA73791ED64F9E82C72B9566DF63B6FD8EE66B05CF35868F3FE777BBFB0C56 +% 80F979240009294275911E09D2492535322DEA35585D5555E4526206E2C7B74F +% 76ED2C6DBEEFDDF4FF00E2FF00C22A77F51EAFF46BC7C7A9C7F3ADB6C81F9DF4 +% 7D0ABF35BFBEB5D2494E5E066E7DAE8BDF8CFD09D94EEDC60EDFCF73BF3BF796 +% 931E1ED04692260F2151EA1D1E9CB3EAD4EFB3E50D45AD120FFC755F46DFFCF9 +% FCB553A7F53BC669E9FD440A731809601F42D1AFE998FF00F09BA3D9FF00A53D +% 8929DB49327494A49249253FFFD0F55599D77ABFECDA18DA5A2CCCC825B8EC3A +% 8111BEE7810E732ADECF637F9DB5F553FA3F53D5669AE4F12D6F53EB36752B3D +% F57A831F10088D8D163FD4DDB7E8B696DD97F43E9E4D74FF00A2494E8740E91E +% 8B1F999536655F2E7BDC649DC439DBB46B7DDB7F37FF003C7A55ADBF34CC6ED6 +% 86F8052494A49258791F59EB7DBF67E9349EA16FFA469DB5027DA3F4B0EF57FA +% D5B7D1FF0086494EE24B370733A8D8FDB96CA5A4CC8ADD3B6086EDE5DB9FB9DF +% C853EA3D6FA7F4EDADBDE4DCF12CA2B05D6113B6767E637F9566C494DF4967E2 +% F59AB206EFB3DF5375F73DA3B6A67D373DCAF32C658DDCC70703DC24A64B3BAD +% F4A6F52C4DAC8665D277E2DA646D7FEEB8B7FC15BFCDDBFF006E7F395D6B4524 +% 94E3F42EA8FCEA032F9664D07D3B6B321DB99ED79B3E97FEAE5B0B987B8627D6 +% 6CCF4CED65B48B1FB7B13E9B777F9C3D477F5D74CD208D381A7DDA24A5D24924 +% 94FF00FFD1F547025A434C3A343E6B95FAAAE68C4A75DA7DF519D00B1E2835EF +% 67B7E936A733DDF9F52EAD60E574BC9C0CBBB3701A6EC6CA9765E20FA41C4973 +% EDA3F7F7B8EED9F4FD4FE6FE9FE8D29DB37541BBDCE01BC1713027E2A166661D +% 4D2FB6FAEB6375739CF6803E24959B5E4D790C635AE9DA76D8DB25C5A63F384B +% 1CFB2BDAA4DE89D2FD3F57228640F77BF489ECFF00A2D494E65D9197F59AF763 +% 636EA3A55662C79106D3CFBDA47B5BFB98EFFF00D0BFFB8AB6B1FA562E352296 +% B4069FCD048DC63DDB8B8EF7EEFCFF007FFE05FA34B1EE6399E874F6B1B4D6ED +% 81EC1EC6E81EE867B3F7FF007D068E9F6FDAB7643DD786C1208105C3875BEEF7 +% 7FC055FA5F47F9CFE752009DBF15A6755E2DD6D0DADB0D6C37521ADD00D1C36B +% 581BB550B6BC1392F71654ECD11BC020DAD6E9B7D92EB7DCDFDDF52C7AD0B1AD +% 9DE40DEE01AEE4CB44BB6FE6AAB8A5D91634E562D7518B1ECF7377B06E6ED63D +% A3DDEA58D77AB76DFD1D7FCDFBD2063746FE8A24F4AFF0BD281D958ED690F2EA +% F7E9B4CC03EDFD1EDFF02E74B37D5F4FDFFA556A9C864876E0D6C7B23BE9FB8D +% FA5FF93FF068EDA61CE6C35CC70F708E67F7964BB1FD5C9B7EC47EC81AFF004D +% A1DB832C786C96FA2F1ED6FF0053FEDBB13B849BAD695C7FBDE9E8EC5993454D +% 9BAC6543C5CE0047C5D0B3737EB3F4BC7696D160CCC8FCCA68F749FE5DAD9AEB +% FF00ABFDCAEC556DC9739FF63EA558AED322B9FE69F103D967B7F44DF67A9EE6 +% 7FD6958C7C66B59EC6358ED443181A07F298FF00D35D637DDFA3F4DBFF006D26 +% AE73B031B2ADCD7E56701F6ACA2CB1F5813B6B043AA6ECFCDF5ACA29AAADDF4F +% 1E9CABAEFF0008BA7ADBB5B1E249FBC9720518B5B786901C4971792E738E8DDC +% F73FDDEEDBB7FE2995D7FCD2B49294924924A7FFD2F55492492520BB131AD70B +% 2CAC1B1BC5834788F0B1BB5EAB64E48345C08FB5381DAFC6ADA1E040DCEA4EEF +% DE6BBDCFB91731D9EF70A30C32ADD05F91619869277368A5BEEB2EF6FF0085F4 +% AAFD27F86F7D4876E217EFB3A85E3ECC047A0D3B6B826375EF9DF91EDF66C7FE +% 87FE0AD40D9D00DFAA083DE97C66E558FAEDC9BAB68FA5563E39961046DF7DAF +% DAFC86B5AEF66DAA867F215AB9C5AD0448931204F6EEA149AC173995892434B9 +% A002E81B771FCD4AE739DB1F503635AE2486380D60B750EDAD7FF9E8C850D100 +% 820EBDDCCBD96BAC739D7FA75D624B18DFFA565B61FF00A0C594EEB1496EFA1B +% 6B9F4BA77BB6B5AE274DB66DDCEDBFC9DAB6ADE9F8F98D7D598CB5C09DE2A712 +% CD3F976D2FD963777F2D3E1BF16B2DAF02B365434229D82961F377B773FF007F +% 6FA8A200750C03181F30D7C3F97A9CEFB45D9353AABDE0525A1F153C8D9DB67E +% 8EB2E66DFA75D9BFF46B55D9CEAF2EBA2DA5EFA5EC97646D90D33B5A5E59F98F +% 9FFAC7FC56FF0042A757EA34E2B4D2D6B6DC8B012E635DED6B4FB77E44FD062A +% 755DD66DC57D8D76350C8F4BD67B9CD718FCEADCF6BAB73754E8896E02E88978 +% 70F8BB39189899B43314B89A5B04110E0E05AEDA196582CF7B7F9CDECFD325D2 +% 31DD46132AB2CF55ED2438F8104FE8F977F37F450BA6613DB41BAFBBD7C8BD8C +% 6DEE6BB4696496D34D94FA7FA3A9F659EFDBEA588F45D915BC372FD30EB6368A +% C1FA41BFA5DEE27DDF454B44824EFD596EA8550D9B8924926AE524924929FFD3 +% F554C74D53A8BDA1ED2D3C1E47924A44CB1FF69B1AF2D02016346A4B40D6C7FB +% 7DBB9FEC6FFC5A0BB3706CCC6E31BEB75C06E65421CE691FE11DF4B67F21567E +% 0DD915BDF97A5971F731A4B9AD00FE8AA6CFEEB7F9DFF4967A8957F64E9EE656 +% DDAD2E92F7C06807F96EFDE530803B1B95550FE2D696522C513ADBA2DC7A8012 +% DDC7C5DA93F1944F6B60683B008745ECB9BB9A6478F8A8B1EF0FF4DD5B84925D +% 669B493FD53BFF00CE6A866640D166870571446FD833B68A6D20D8D0E2D9027C +% 0FD26FF55CA9D580FC2A5CDC67B4971DCEB2FDC63C5DB1AE6D7F47F36BF415C6 +% 58C2D1E9CB9BC0238FF3BF393DAF656C2EB012D04030D2EE4EDFA2D0EFFCC134 +% 709D579DABBBCE3F0F2B3DD7065FEB536C7AD94DFD1B1DE9977A7563D156F73E +% A6EFFD25B65D67A9FF0017B158FB0E261DB4D977A7EA39BB2AF6973811FE8F76 +% E72D2A3AB74FBC5A59688A1CE6DA4F0DDBF9CE7FF36D67F2B77FE09BD1DD451B +% 8DA58DDF1F4C8D614D0C911A01A3164C529697FF0072D2C3ADF4836DAF739D61 +% 009768E33A37467B559C8B1B5D4D6BD9BD847B817098FA3A6FFA7F4BF7D1DA1A +% 00DBC762B23AC6506D4D0F6C5AED6AD636C3873FBDBFD9FA2FF0B67E8D899932 +% 13B685118184753C44BAB8F732FA596B0CB5C3BE864687FE9222CCFABC727F67 +% 4640877A961699E5AE77A9C7E66C73FD2DBFF06B4D0F3661B6AA49249253FFD4 +% F5550B63D27CC81B4EA2678EDB21FF00E6A9A6735AE696B84B5C2083C1052521 +% 756DB7D37133B007026473DF669EE5917B76BDF6BEB796D7616D4C716D758FE5 +% 0FCEB372D2B32DEC6D0D6D42CB6DD1E1AE68637696B6EF7D858E77A5BBF32BFC +% C51FD9D5BB25F9169F56C71258481B5A3B358DFDEDBF9EA6C79044907A7460CB +% 8CCA363525AACCBCD758DAEB6358D03DDB89E4FEEED5A34D8F6B0BAF78D3BC6D +% 1F892A4DA76C00040F1D4A1370DDB8BAD7FAAE719F701007EEB1A94A5097411F +% CD8F1C32C28EFE1D190BECB2C0DA9AD2CFCE7870D3FAAD83B9584014EC3B8B8B +% 8766E908A663DC62398D1472AD299E065AF10D5AD7D599BB6D26B7D446A2E930 +% 7F77D9FCE31DFCBFA1FF000BBFF461AB1B230B1B2AE786E55AE3BEBC7AC7A758 +% DAD8AE9AD8E758DDCE7FB9F77E7FFDB6AF36D63EB0FACEF69E0B759F8154F32E +% C8C70F758F636A26597381DACFE45CDDDF4BFD1DDFF5BFD17E8FD5611C3A81AA +% FB02CD5F7F1497DD15C5A62752C64C9FE40DB0EFF5FA0B16D75965B664871391 +% EB86D0D0FDD5D15967A5F687532DFD2BB75DE9FF00C27E8FFD221E5E5B9DF67B +% CD576CB5F1481A3AD77954E76F6334FF00468DD3F14D4CB2ECD0319D63CD950B +% 1BC47E84DB65BA535DB6BEFDB8D5DBF99FE0FF009DF4C63F9AE4C71E33648E9A +% 7F55D2E867761B9ED9F49D63853BB9D8C8A013FD6755B968A0E1D031F16AA75F +% 6B759E64FB9DFF0049193E5B9F3648EC1492492097FFD5F5549249252175465C +% 19A171DED9D4077E77B7F95FF56B2197E4B6E353AD3894D0F1E8D75ED797B662 +% E65CCDB635B56EFE6FD3F4ED62DB7B43DA5A6402224120EBE0E6C39AB2BA80B3 +% 1EA631F63D9481FA7CA76E76CAC37F4AF73EBDBFA6DAC6ECBACFD1D7FCF7E93F +% 997B67777F4639020831BBFC1B14F53ADD98EC176E7DD24B0B58E03601BF758E +% 70D9FF0007BD8EFF0047FBEACE564371A875EFFA0C8DE7B35A486BAC77EED75B +% 7F4967F2163538169F4FA8623ADB5EC8153B29C5E367D0F5D94511BDDE9BECF4 +% BDCCFE73E82D5C7C877A7B0EEB6C61DAE716ECDC47EEB53C4254B84C0AE22906 +% 454FAEBBEBB05955801ACD7EF0F0ED5AE6B99BB7336AA7D40D97B4B585D536A9 +% 2E7176D0EFE4EC66EB1EADDEF2C754E86EA483B84BBE8B9D0CD5BFBAA961F56F +% B56406331DCEC7B1FB29BC35DB5C035EFB2F2EDA6AF437B19456EF57D4B2CFF0 +% 7E9FA6FB146601DB50A944CAC0F36A60D79877B8D8E73C18697CB8347FC1876D +% 5A7EADE1BE98607088758490493FBAC60F77F9EC44BD8E6B41A9BE32D02499FE +% DD6D6AA96E6D58A7D323ED196D689AEB074DDF47D5B0EF652D77F2FF00EB75A9 +% 8C8486C3CBAB008CE32278BFB12E174F38F90FCAB6C375D635B5EE7B40735838 +% ADAE6FE6EEF7BFFE11553D359665D7451FA3E9F4B8BDD8EC02BAA49F58C56D1F +% A675B92EDF63FF0099F4FF0043E9FE96E49D5E5E639A2D787020C5357B6B0276 +% D85EF796D96ECFE6FE87FD67F48B4B1B1ABC6ABD3AC47771F13F3DCA23103CFB +% 766789BD3A2649249357292492494FFFD6F554924925290EEA59706EED0B0EE6 +% 38685AE1F9CD3FF47F96CFD1BFF4688924A73FA937A836B73B1ACFA65A37113E +% 9025AC7BEBAEB0DF53FD2FE9ACFF00C013E167E2DEC0DA6C6BAD76E06C6B086B +% 9ECF6DBDBE96EFF07BD5F42BB1E9BD8596B0381F9107F79AF6FB98EFE53521D7 +% B1457F22E4E7E46654FF00758DA5BCBDF638C081BBD9B5BB76FB7E9D8F546BEA +% B936D95DD48BEE6BA41706BEBADC08D3D371FF00C8FBD6FB7A7630209DEF8FA3 +% EA3DCF23FAAFB0B9FDFF0079577742C7B06CBEFC8BABEF5BAD2D0E3FBD61A7D2 +% 7D9FBBB1EFF4BFE0D33835DD8C62FE56E659D4F305753ADB61ECD59435E1BBDC +% DFA2EC87B9DEB3F1B77D3F47F4977FC5AD46306535DE9D64B490E36BC1ADAF71 +% 078AA1B6BABAFD9FF1BFE9559C5C0C2C36918D4B6A9E481A9FEB3CFB9CAC27C6 +% E3B15E23A51D50D18B5504B9A25EE0017F7DADFA15B7F72AAF77E8EB6A324924 +% B94924924A524924929FFFD93842494D04210000000000790000000101000000 +% 1800410064006F00620065002000500068006F0074006F00730068006F007000 +% 200045006C0065006D0065006E007400730000001C00410064006F0062006500 +% 2000500068006F0074006F00730068006F007000200045006C0065006D006500 +% 6E0074007300200032002E003000000001003842494D042200000000012E4D4D +% 002A000000080007011200030000000100010000011A00050000000100000062 +% 011B0005000000010000006A012800030000000100020000013100020000001D +% 0000007201320002000000140000008F8769000400000001000000A4000000D0 +% 0000004800000001000000480000000141646F62652050686F746F73686F7020 +% 456C656D656E747320322E3000323030363A31303A30392032323A30393A3238 +% 00000003A001000300000001FFFF0000A00200040000000100000156A0030004 +% 00000001000001830000000000000006010300030000000100060000011A0005 +% 000000010000011E011B00050000000100000126012800030000000100020000 +% 02010004000000010000012E0202000400000001000000000000000000000048 +% 0000000100000048000000013842494D03FD0000000000070000000000000000 +%EndPhotoshop +%begin_xml_code +/pdfmark where {pop true} {false} ifelse +/currentdistillerparams where {pop currentdistillerparams +/CoreDistVersion get 5000 ge } {false} ifelse +and not {userdict /pdfmark /cleartomark load put} if +[/NamespacePush pdfmark +[/_objdef {photoshop_metadata_stream} /type /stream /OBJ pdfmark +/MetadataString 5038 string def % exact length of metadata +/TempString 100 string def +/ConsumeMetadata { +currentfile TempString readline pop pop +currentfile MetadataString readstring pop pop +} bind def +ConsumeMetadata +%begin_xml_packet: 5038 +<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?> <?adobe-xap-filters esc="CR"?> <x:xapmeta xmlns:x='adobe:ns:meta/' x:xaptk='XMP toolkit 2.8.2-33, framework 1.5'> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'> @@ -61,7 +526,77 @@ -<?xpacket end='w'?>
%end_xml_packet
[{photoshop_metadata_stream} 2 dict begin /Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark
[{photoshop_metadata_stream} MetadataString /PUT pdfmark
[/_objdef {nextImage} /NI pdfmark
%end_xml_code
gsave % EPS gsave
/hascolor
/deviceinfo where
{pop deviceinfo /Colors known
{deviceinfo /Colors get exec 1 gt}
{false} ifelse}
{/statusdict where
{pop statusdict /processcolors known
{statusdict /processcolors get exec 1 gt}
{false} ifelse}
{false} ifelse}
ifelse
def
40 dict begin
/_image systemdict /image get def
/_setgray systemdict /setgray get def
/_currentgray systemdict /currentgray get def
/_settransfer systemdict /settransfer get def
/_currenttransfer systemdict /currenttransfer get def
/blank 0 _currenttransfer exec
1 _currenttransfer exec eq def
/negative blank
{0 _currenttransfer exec 0.5 lt}
{0 _currenttransfer exec 1 _currenttransfer exec gt}
ifelse def
/inverted? negative def
/level2 systemdict /languagelevel known
{languagelevel 2 ge} {false} ifelse def
/level3 systemdict /languagelevel known
{languagelevel 3 ge} {false} ifelse def
level2 {/band 0 def} {/band 5 def} ifelse
gsave % Image Header gsave
/rows 387 def
/cols 342 def
342 387 scale
level2 {
/DeviceRGB
setcolorspace currentdict /PhotoshopDuotoneColorSpace undef currentdict /PhotoshopDuotoneAltColorSpace undef } if
/beginimage level2
{/image load def}
{{pop .9 setgray 0 0 moveto 0 1 lineto
1 1 lineto 1 0 lineto fill 0 setgray
0 1 translate 1 cols div 1 rows div scale
/ratio {cols 400 div mul} def
/Helvetica findfont 15 ratio scalefont setfont
5 ratio -20 ratio moveto
(Mit JPEG komprimierte Bilder ben\232tigen PostScript Level 2) show
/x 128 string def
{currentfile x readline {} {pop exit} ifelse
(~>) search {pop pop pop exit} {pop} ifelse
} loop } def}
ifelse
12 dict begin
/ImageType 1 def
/Width cols def
/Height rows def
/ImageMatrix [cols 0 0 rows neg 0 rows] def
/BitsPerComponent 8 def
/Decode [0 1 0 1 0 1] def
/DataSource currentfile /ASCII85Decode filter
/DCTDecode filter def
currentdict end
%%BeginBinary: 12801
beginimage
s4IA0!"_al8O`[\!W`9l!([(is6]js6"FnCAH67k!!!!"s4[O,!"obO%M0*b&.fQt +<?xpacket end='w'?> +%end_xml_packet +[{photoshop_metadata_stream} 2 dict begin /Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark +[{photoshop_metadata_stream} MetadataString /PUT pdfmark +[/_objdef {nextImage} /NI pdfmark +%end_xml_code +gsave % EPS gsave +/hascolor +/deviceinfo where +{pop deviceinfo /Colors known +{deviceinfo /Colors get exec 1 gt} +{false} ifelse} +{/statusdict where +{pop statusdict /processcolors known +{statusdict /processcolors get exec 1 gt} +{false} ifelse} +{false} ifelse} +ifelse +def +40 dict begin +/_image systemdict /image get def +/_setgray systemdict /setgray get def +/_currentgray systemdict /currentgray get def +/_settransfer systemdict /settransfer get def +/_currenttransfer systemdict /currenttransfer get def +/blank 0 _currenttransfer exec +1 _currenttransfer exec eq def +/negative blank +{0 _currenttransfer exec 0.5 lt} +{0 _currenttransfer exec 1 _currenttransfer exec gt} +ifelse def +/inverted? negative def +/level2 systemdict /languagelevel known +{languagelevel 2 ge} {false} ifelse def +/level3 systemdict /languagelevel known +{languagelevel 3 ge} {false} ifelse def +level2 {/band 0 def} {/band 5 def} ifelse +gsave % Image Header gsave +/rows 387 def +/cols 342 def +342 387 scale +level2 { +/DeviceRGB +setcolorspace currentdict /PhotoshopDuotoneColorSpace undef currentdict /PhotoshopDuotoneAltColorSpace undef } if +/beginimage level2 +{/image load def} +{{pop .9 setgray 0 0 moveto 0 1 lineto +1 1 lineto 1 0 lineto fill 0 setgray +0 1 translate 1 cols div 1 rows div scale +/ratio {cols 400 div mul} def +/Helvetica findfont 15 ratio scalefont setfont +5 ratio -20 ratio moveto +(Mit JPEG komprimierte Bilder ben\232tigen PostScript Level 2) show +/x 128 string def +{currentfile x readline {} {pop exit} ifelse +(~>) search {pop pop pop exit} {pop} ifelse +} loop } def} +ifelse +12 dict begin +/ImageType 1 def +/Width cols def +/Height rows def +/ImageMatrix [cols 0 0 rows neg 0 rows] def +/BitsPerComponent 8 def +/Decode [0 1 0 1 0 1] def +/DataSource currentfile /ASCII85Decode filter +/DCTDecode filter def +currentdict end +%%BeginBinary: 12801 +beginimage +s4IA0!"_al8O`[\!W`9l!([(is6]js6"FnCAH67k!!!!"s4[O,!"obO%M0*b&.fQt '+km!,8q:3)C$FB(Ddl(+qY4l$k*OQ&I]'V$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ $iq%U',DH$)]';0'FkT_'GM#e%Ls0b$k*OQ$kX'[$k*OQ$kWmV$k*OQ$k*OQ$k*OQ $k*OQ$k*OQ$k*OQ$k30O!"fJ;K)o!T!?qLF&HMtG!WUsU"995;_uW(&!!*6(!<E3% @@ -254,4 +789,9 @@ P"?rK,a(_k8L0HsP"?p`Uln:q.3t'J8kC:k;NaTsPekl!n"d`jmi)3+S>%b'+%/FF (5C.cK]sbFP`eT`V'M3q.7keJ8lA5+P*D,$,c)cL8L[4VP"JVD,a+CT8L156fBs8X *0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrkVqb0V *0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrkVqb0V -*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@Cs4I~>
%%EndBinary
grestore end % Image Trailer grestore
grestore % EPS grestore
[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT pdfmark
[/NamespacePop pdfmark
\ No newline at end of file +*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@Cs4I~> +%%EndBinary +grestore end % Image Trailer grestore +grestore % EPS grestore +[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT pdfmark +[/NamespacePop pdfmark diff --git a/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.eps b/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.eps index 1c5f93cff22..680ee260892 100644 --- a/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.eps +++ b/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.eps @@ -1,4 +1,541 @@ -%!PS-Adobe-3.0 EPSF-3.0
%%Title: brave-gnu-world-logo.eps
%%CreationDate: 09.10.2006 22:10 Uhr
%%BoundingBox: 0 0 342 387
%%HiResBoundingBox: 0 0 342 387
%%SuppressDotGainCompensation
%%EndComments
%%BeginProlog
%%EndProlog
%%BeginSetup
%%EndSetup
%ImageData: 342 387 8 3 0 1 3 "beginimage"
%BeginPhotoshop: 16252
% 3842494D0425000000000010000000000000000000000000000000003842494D
% 03EA000000001DA63C3F786D6C2076657273696F6E3D22312E302220656E636F
% 64696E673D225554462D38223F3E0A3C21444F435459504520706C6973742050
% 55424C494320222D2F2F4170706C6520436F6D70757465722F2F44544420504C
% 49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E63
% 6F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C
% 706C6973742076657273696F6E3D22312E30223E0A3C646963743E0A093C6B65
% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D48
% 6F72697A6F6E74616C5265733C2F6B65793E0A093C646963743E0A09093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F72
% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
% 696E676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E61
% 70706C652E7072696E742E7469636B65742E6974656D41727261793C2F6B6579
% 3E0A09093C61727261793E0A0909093C646963743E0A090909093C6B65793E63
% 6F6D2E6170706C652E7072696E742E50616765466F726D61742E504D486F7269
% 7A6F6E74616C5265733C2F6B65793E0A090909093C7265616C3E37323C2F7265
% 616C3E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F6D
% 2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E0A
% 090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D31302D
% 30395432303A31303A30355A3C2F646174653E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B
% 65793E0A090909093C696E74656765723E303C2F696E74656765723E0A090909
% 3C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B65
% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D4F
% 7269656E746174696F6E3C2F6B65793E0A093C646963743E0A09093C6B65793E
% 636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F
% 6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E
% 676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E617070
% 6C652E7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A
% 09093C61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E50616765466F726D61742E504D4F7269656E74
% 6174696F6E3C2F6B65793E0A090909093C696E74656765723E313C2F696E7465
% 6765723E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
% 636B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F
% 6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E
% 0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D3130
% 2D30395432303A31303A30355A3C2F646174653E0A090909093C6B65793E636F
% 6D2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F
% 6B65793E0A090909093C696E74656765723E303C2F696E74656765723E0A0909
% 093C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B
% 65793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D
% 5363616C696E673C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F6B6579
% 3E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E676D61
% 6E616765723C2F737472696E673E0A09093C6B65793E636F6D2E6170706C652E
% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A09093C
% 61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D2E6170
% 706C652E7072696E742E50616765466F726D61742E504D5363616C696E673C2F
% 6B65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B6579
% 3E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F
% 6B65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E74
% 696E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B6579
% 3E0A090909093C646174653E323030362D31302D30395432303A31303A30355A
% 3C2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E74
% 656765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F
% 61727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E
% 7072696E742E50616765466F726D61742E504D566572746963616C5265733C2F
% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E50616765466F726D61742E504D566572746963616C5265733C2F6B65793E0A
% 090909093C7265616C3E37323C2F7265616C3E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B65793E
% 0A090909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D
% 616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E617070
% 6C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E0A0909
% 09093C646174653E323030362D31302D30395432303A31303A30355A3C2F6461
% 74653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465676572
% 3E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61727261
% 793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E7072696E
% 742E50616765466F726D61742E504D566572746963616C5363616C696E673C2F
% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E50616765466F726D61742E504D566572746963616C5363616C696E673C2F6B
% 65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B65793E
% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
% 65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E7469
% 6E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E
% 6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E
% 0A090909093C646174653E323030362D31302D30395432303A31303A30355A3C
% 2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E
% 7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465
% 6765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61
% 727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E70
% 72696E742E7375625469636B65742E70617065725F696E666F5F7469636B6574
% 3C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E
% 7072696E742E50616765466F726D61742E504D41646A75737465645061676552
% 6563743C2F6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E61
% 70706C652E7072696E742E7469636B65742E63726561746F723C2F6B65793E0A
% 0909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D616E
% 616765723C2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E
% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A090909
% 3C61727261793E0A090909093C646963743E0A09090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E50616765466F726D61742E504D41646A757374
% 656450616765526563743C2F6B65793E0A09090909093C61727261793E0A0909
% 090909093C7265616C3E302E303C2F7265616C3E0A0909090909093C7265616C
% 3E302E303C2F7265616C3E0A0909090909093C7265616C3E3738333C2F726561
% 6C3E0A0909090909093C7265616C3E3535393C2F7265616C3E0A09090909093C
% 2F61727261793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E
% 742E7469636B65742E636C69656E743C2F6B65793E0A09090909093C73747269
% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
% 72696E673E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
% 7469636B65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E
% 323030362D31302D30395432303A31303A30355A3C2F646174653E0A09090909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E737461
% 7465466C61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E
% 74656765723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09
% 093C2F646963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E
% 50616765466F726D61742E504D41646A75737465645061706572526563743C2F
% 6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E6170706C652E
% 7072696E742E7469636B65742E63726561746F723C2F6B65793E0A0909093C73
% 7472696E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C
% 2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E7469636B65742E6974656D41727261793C2F6B65793E0A0909093C61727261
% 793E0A090909093C646963743E0A09090909093C6B65793E636F6D2E6170706C
% 652E7072696E742E50616765466F726D61742E504D41646A7573746564506170
% 6572526563743C2F6B65793E0A09090909093C61727261793E0A090909090909
% 3C7265616C3E2D31383C2F7265616C3E0A0909090909093C7265616C3E2D3138
% 3C2F7265616C3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A09
% 09090909093C7265616C3E3537373C2F7265616C3E0A09090909093C2F617272
% 61793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
% 636B65742E636C69656E743C2F6B65793E0A09090909093C737472696E673E63
% 6F6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E67
% 3E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B
% 65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E32303036
% 2D31302D30395432303A31303A30355A3C2F646174653E0A09090909093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E7374617465466C
% 61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E74656765
% 723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09093C2F64
% 6963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E50617065
% 72496E666F2E504D50617065724E616D653C2F6B65793E0A09093C646963743E
% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E617070
% 6C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A
% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E69
% 74656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C64
% 6963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E50
% 61706572496E666F2E504D50617065724E616D653C2F6B65793E0A0909090909
% 3C737472696E673E69736F2D61343C2F737472696E673E0A09090909093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C
% 2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C652E707269
% 6E742E706D2E506F73745363726970743C2F737472696E673E0A09090909093C
% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
% 74653C2F6B65793E0A09090909093C646174653E323030332D30372D30315431
% 373A34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
% 0A09090909093C696E74656765723E313C2F696E74656765723E0A090909093C
% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
% 556E61646A757374656450616765526563743C2F6B65793E0A09093C64696374
% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170
% 706C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E
% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 6974656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C
% 646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
% 5061706572496E666F2E504D556E61646A757374656450616765526563743C2F
% 6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E302E
% 303C2F7265616C3E0A0909090909093C7265616C3E302E303C2F7265616C3E0A
% 0909090909093C7265616C3E3738333C2F7265616C3E0A0909090909093C7265
% 616C3E3535393C2F7265616C3E0A09090909093C2F61727261793E0A09090909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69
% 656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C65
% 2E7072696E74696E676D616E616765723C2F737472696E673E0A09090909093C
% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
% 74653C2F6B65793E0A09090909093C646174653E323030362D31302D30395432
% 303A31303A30355A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
% 0A09090909093C696E74656765723E303C2F696E74656765723E0A090909093C
% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
% 556E61646A75737465645061706572526563743C2F6B65793E0A09093C646963
% 743E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65
% 742E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E61
% 70706C652E7072696E742E706D2E506F73745363726970743C2F737472696E67
% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E6974656D41727261793C2F6B65793E0A0909093C61727261793E0A09090909
% 3C646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E5061706572496E666F2E504D556E61646A7573746564506170657252656374
% 3C2F6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E
% 2D31383C2F7265616C3E0A0909090909093C7265616C3E2D31383C2F7265616C
% 3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A0909090909093C
% 7265616C3E3537373C2F7265616C3E0A09090909093C2F61727261793E0A0909
% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E63
% 6C69656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E617070
% 6C652E7072696E74696E676D616E616765723C2F737472696E673E0A09090909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F64
% 446174653C2F6B65793E0A09090909093C646174653E323030362D31302D3039
% 5432303A31303A30355A3C2F646174653E0A09090909093C6B65793E636F6D2E
% 6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65
% 793E0A09090909093C696E74656765723E303C2F696E74656765723E0A090909
% 093C2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09
% 093C6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E
% 7070642E504D50617065724E616D653C2F6B65793E0A09093C646963743E0A09
% 09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6372
% 6561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170706C65
% 2E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A0909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E697465
% 6D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C646963
% 743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E506170
% 6572496E666F2E7070642E504D50617065724E616D653C2F6B65793E0A090909
% 09093C737472696E673E41343C2F737472696E673E0A09090909093C6B65793E
% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
% 65793E0A09090909093C737472696E673E636F6D2E6170706C652E7072696E74
% 2E706D2E506F73745363726970743C2F737472696E673E0A09090909093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F6444617465
% 3C2F6B65793E0A09090909093C646174653E323030332D30372D30315431373A
% 34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170706C
% 652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E0A09
% 090909093C696E74656765723E313C2F696E74656765723E0A090909093C2F64
% 6963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E41504956657273
% 696F6E3C2F6B65793E0A09093C737472696E673E30302E32303C2F737472696E
% 673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E707269766174654C6F636B3C2F6B65793E0A09093C66616C73652F3E0A0909
% 3C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74797065
% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
% 2E5061706572496E666F5469636B65743C2F737472696E673E0A093C2F646963
% 743E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 41504956657273696F6E3C2F6B65793E0A093C737472696E673E30302E32303C
% 2F737472696E673E0A093C6B65793E636F6D2E6170706C652E7072696E742E74
% 69636B65742E707269766174654C6F636B3C2F6B65793E0A093C66616C73652F
% 3E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74
% 7970653C2F6B65793E0A093C737472696E673E636F6D2E6170706C652E707269
% 6E742E50616765466F726D61745469636B65743C2F737472696E673E0A3C2F64
% 6963743E0A3C2F706C6973743E0A3842494D03E9000000000078000300000048
% 004800000000030F022FFFEEFFEE033802410367057B03E00002000000480048
% 0000000002D802280001000000640000000100030303000000017FFF00010001
% 0000000000000000000000006808001901900000000000200000000000000000
% 0000000000000000000000000000000000003842494D03ED0000000000100048
% 00000001000200480000000100023842494D042600000000000E000000000000
% 000000003F8000003842494D040D0000000000040000001E3842494D04190000
% 000000040000001E3842494D03F3000000000009000000000000000001003842
% 494D040A00000000000100003842494D271000000000000A0001000000000000
% 00023842494D03F5000000000048002F66660001006C66660006000000000001
% 002F6666000100A1999A0006000000000001003200000001005A000000060000
% 00000001003500000001002D000000060000000000013842494D03F800000000
% 00700000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000
% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFF
% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800003842494D04080000000000100000
% 00010000024000000240000000003842494D041E000000000004000000003842
% 494D041A00000000035D00000006000000000000000000000183000001560000
% 001400620072006100760065002D0067006E0075002D0077006F0072006C0064
% 002D006C006F0067006F00000001000000000000000000000000000000000000
% 0001000000000000000000000156000001830000000000000000000000000000
% 0000010000000000000000000000000000000000000010000000010000000000
% 006E756C6C0000000200000006626F756E64734F626A63000000010000000000
% 00526374310000000400000000546F70206C6F6E6700000000000000004C6566
% 746C6F6E67000000000000000042746F6D6C6F6E670000018300000000526768
% 746C6F6E670000015600000006736C69636573566C4C73000000014F626A6300
% 000001000000000005736C6963650000001200000007736C69636549446C6F6E
% 67000000000000000767726F757049446C6F6E6700000000000000066F726967
% 696E656E756D0000000C45536C6963654F726967696E0000000D6175746F4765
% 6E6572617465640000000054797065656E756D0000000A45536C696365547970
% 6500000000496D672000000006626F756E64734F626A63000000010000000000
% 00526374310000000400000000546F70206C6F6E6700000000000000004C6566
% 746C6F6E67000000000000000042746F6D6C6F6E670000018300000000526768
% 746C6F6E67000001560000000375726C54455854000000010000000000006E75
% 6C6C54455854000000010000000000004D736765544558540000000100000000
% 0006616C74546167544558540000000100000000000E63656C6C546578744973
% 48544D4C626F6F6C010000000863656C6C546578745445585400000001000000
% 000009686F727A416C69676E656E756D0000000F45536C696365486F727A416C
% 69676E0000000764656661756C740000000976657274416C69676E656E756D00
% 00000F45536C69636556657274416C69676E0000000764656661756C74000000
% 0B6267436F6C6F7254797065656E756D0000001145536C6963654247436F6C6F
% 7254797065000000004E6F6E6500000009746F704F75747365746C6F6E670000
% 00000000000A6C6566744F75747365746C6F6E67000000000000000C626F7474
% 6F6D4F75747365746C6F6E67000000000000000B72696768744F75747365746C
% 6F6E6700000000003842494D041100000000000101003842494D041400000000
% 0004000000013842494D040C000000001A350000000100000071000000800000
% 01540000AA0000001A1900180001FFD8FFE000104A4649460001020100480048
% 0000FFED000C41646F62655F434D0002FFEE000E41646F626500648000000001
% FFDB0084000C08080809080C09090C110B0A0B11150F0C0C0F15181313151313
% 18110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
% 0C0C0C0C0C010D0B0B0D0E0D100E0E10140E0E0E14140E0E0E0E14110C0C0C0C
% 0C11110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
% 0C0C0C0C0C0CFFC00011080080007103012200021101031101FFDD00040008FF
% C4013F0000010501010101010100000000000000030001020405060708090A0B
% 0100010501010101010100000000000000010002030405060708090A0B100001
% 0401030204020507060805030C33010002110304211231054151611322718132
% 061491A1B14223241552C16233347282D14307259253F0E1F163733516A2B283
% 264493546445C2A3743617D255E265F2B384C3D375E3F3462794A485B495C4D4
% E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F637475767778797A7B7C7D7E7F7
% 1100020201020404030405060707060535010002110321311204415161712213
% 0532819114A1B14223C152D1F0332462E1728292435315637334F1250616A2B2
% 83072635C2D2449354A317644555367465E2F2B384C3D375E3F34694A485B495
% C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F62737475767778797A7B7C7
% FFDA000C03010002110311003F00F5549249252962FD63FADFD0BEADD3BFA95F
% FA67006BC4AA1D7BC1DC039B4EE6EDAFF46FFD35BE9D3FF09BD61FD7EFAFE3A1
% 8FD91D22323AEDE000000E18E1C3DB658DFA2FC87B7DD451FF00A1191FA2F4AA
% C9E1FA4FD5DCEEA998EEA7D58BFA8751CC74D3597026D70038716BABAF1F1D8D
% DB65FF00CC52CF469AB67A94D8929EA2CFF1C4CB2D8E9FD132322AEEEB2C6D6E
% E63F9BAD993F9BFF0008B5A9FF0018D45AD31D1F3C585E6BA9B1400F7EA1B5D7
% BF258EB2C76DFA14D76A9F4FFA834B58D7E7E4D8D773F66C6706D4D91F47D6B2
% BFB4DCE6EEFE77F56FFC2F5ADDE9BD07A474B71B30B19B5DCE043AF717597104
% 8739AFCABDD6E4399B9BBB67AA9292F4DBFA86452EB73B1460B8B88AA8F505AF
% 0C1F45F7BEAFD0B2C7FF00A1A5F7FA7FF721FF00E0ADA4924A79BEBBD47EB974
% 9B1F7E06053D6B05DAB59597539356AEDCCB1937332D9B7D3F4ACC7632DFF494
% 7F855CB752FF0019FF005971C7A7FB2A8E9F748939A320340D665B65185FF07F
% E13FF3E2F4D49253E59D37FC66FD64B323D4C9AF03269827ECF8FEA31CE8F67E
% 8B21CFC8D9EFFF004B4FFDB5FCF57E83D13AFF004EEB743ADC37383EBDBEB63D
% A36DB5EE1B99BD9AEE63FF00C1DF53ACC7BBFC0DB62C4FAD5FE2EFA4F5B6D995
% 84D6F4EEABF49B91588AEC7025F199437D96FA9BDDFA7FE91FF1BE9FA2BCFABB
% FAD740EBC303A89FB1754C40E38990C135DA1FFE1F7B87EB38D76CF753FF005B
% FD0E4D1FA24A7DB9258DF56FEB0B3ACE31173063E75207AF44CB48FCDC9C677F
% 84C5B7F33FD1FF00336FE916CA4A524924929FFFD0F555CC7D7DFAE15FD58E96
% 3D269B3A96687D7835812039BB77DF618DBB28F52BFD1FF86B3F47F43D5B6AE9
% D782F56EA87EB37D6BCAEAAE71B315961A30441814D42CB3D50DB7DCDD98F5DB
% 97657B7FA45DFE0D2527FAADD06CCA7D9D433C3F2AFB9C2581FF00A5BEEB9DBD
% 98E2CB377BED7B7D5CABBFC151FA7C8B3D15EBDD07A1D7D2F1F7DA18FCFB9A06
% 4DCC076C0FA18F8FBE5D5E263FD0A6BFFAF59FA7B6D58DF527A355481956FBED
% A2B635B31FA3B2D636FBDBB3DCE6DCDAACAFF49F4FF58BAA5D724A52499CE6B1
% A5CE21AD689738E8001DCAE03AFF00F8DAC1C6C87E07D5FC63D57246E67AF3B6
% 86BFE830B3682FCA67A9FB9E8D567F81C9494FA024BCBFA6FF008CDFAD0EC963
% 73B0F06DAF5DF4D0E7D76684336B2CB2DC9ABD5F51DF42C6319FF0D5AE9FA87F
% 8CAFAAB81D3E9CCB6EB1F66434BABC163272416BBD1B59754E2C663BAAB37FF3
% F6D7EAFA567D9FD6494F5292E1F0FF00C6C746C8B62DC0CDA292EDA2ED8D7800
% 7D27DB5D563AE6EC6EDDDE9577AEB7A6756E9BD5F1465F4DC8665504ED2F61E1
% D01DE9D8C3EFAACDAE6FE8EC6FA8929B6B9FFAEDF5529FACFD1DD8A36579F4FE
% 930725E0FB1FA6E61733DEDAB21ADF4EDFFADDFE958FA2B5D024929F11FAB3D7
% 3A85393582F38BD4F049AB6580B75691F68C7CE66D7BFECB7ECD96B367AACCA6
% 7E8EAFB4D78FE9FB2F4ECFA3A8E15799402D65920B1D1B98F6935DD4D9B4B9BE
% A536B1F559B5CBC5FEB8B2AE9FFE303AA8A229AEC6B2D796E9B5D6B28B6DB7FE
% DE7BAE7AEFBEA266165F6E00115DB59B76811B2DC77370AFF5777B9D6DF5FD99
% DFF07E8BFF00B694F66924924A7FFFD1F50CA6DCFC5B9943B6DCEADC2B7710E2
% 0EC77F9CBE7BFAB4E0031BB8377BECA4171F687DA296D46C0DF76C7EC77FDB5F
% CB5F44AF2FFAEFF50F37133EFEBBD0697E5D19AE2EEA3D3DB2FB03DC4BDD918C
% DFA56B2C7B9DBAAFE728B1FF00A1FD0FF454A75FEABFD6CE958551C5CFB7ECF5
% 585A5B976FB6BF576B6ABB1EFB3E856FFD17A8CB5DB29FF03FA3B29FD274EFFA
% CBF5718DDCFEAB86D6F89C8A80FF00AB5E29565B32D95ED7EE021B66FF007169
% 8D1CF6EEAFD4B58DFF00AEBFFAEAE51F567A78A1D939748A98D87B59639AC3EF
% FE65B90E26AAE86BBE97BFFF0003FCF4A6F7D6CFAD79DF5D731DD27A3EFABA15
% 0EFD259043B21CD3B9AFB07E653B87EAD8EFFF008EBFF58FB3E3D15B1BEAF328
% A994359B8D861B5D675B0804BFE916D96FE6FAAC67E67E8BFC27A0AE74EB72F2
% 5870FEAFE28BE9A5C2B665D601C7A3633D4B6DB03D94D3EADAEB376FBEFF00A1
% BFF43916FF00379FD33A66664752756E75BD42C69DAEAEB0C7EE206DDD6DB697
% 6DDBFF0069BF4791F63FE91FA0BD3A1094FE51F5DB4592CB18EA5B67A664E3D2
% 2CFB3D8CA7710D2D6398C0EDAF6B296B3D3AD9EAEBFB9EA7F3BF43F3F3727168
% 19363AD65673C1FD333783732086ED756E2EB9F6FF00C5FDA2F7B3FE1175DD4D
% B57D9CBF368C367516FA78ADC2A326FBC8C6AEC7E4E463F517D77D1535FEA3BF
% 43BFF9CBFF0056FD27ABE9ACCE9F89899F636ACAE9F878990197598CCFB5B28B
% 2B25D35E2E6E1DF75F915DBB3D4C87BEBC6FF47EAD767E92C481C7C5C249F31C
% 3308E324D47865A5D7CAE05D7D74EFAAF0FA5EE716163DA46D734B37D3B086FA
% 16FD0F568FE77DFF00A657BA5F54C8C1CCAF370EFF00B2DAD86B5ED1B9AF6C7F
% 35918ECFE9547FC67E9B7FF45FB3FD35B35F41EAB876BF763B6DC4B6B873F633
% 63B74FF3B4B5D7D9F67D5ED6E5595FBFFE2972AFC5AF2736EFD9CE6E157EA0AA
% 9DC1EDAED786FB9BE859BBD2FA5F9BFF006CFEE38E23FA244BF050C9FBC0C5F5
% 7E8DF5F3A4655219D5AEA7A5E6B44B9B6D81B4BC69FA5C5C9B7D3ADFBB77F30E
% FD62AFF8BFD3595BAD7F8D3FAA9D36A78C6C8FDA59634AE8C604B4B88259BB28
% B7D06D7BBD8FF4DD75ACFF004162F2BBED78B0E1753A832CD4327F9A7C7B5BB2
% C1FE05AE6FBF6BFF00EDB46C6C460692D0CADDA83B581B13F9D5B9A2FC8B9BFB
% 9E933E87F39E8A8D911B9DD47AC754BFAAF5100E6E7BD8E3535BA064B7ECF486
% 39DFE15F551450CDFF00D169CBB6FF00E6BD45E93F526870CC65A5C48B3ED16B
% 09DB2F639D57BDAD23D477B9DEA596FEFDB5D5FF0072172BD2FA68BEE630576F
% A4F0EDC04BF22E062A7574D67DEF7E47D0BBF49ECC3FE7B2A9C15E97F573A3BB
% A6E33ACBDA1995901BEA3038BF635BBBD2A5D6E9EB58CF52CF52EDBFF07FCC55
% 424A7612492494FF00FFD2F5549249253CF7D68FABFF0055F268B3AA755C3DD7
% D23DB918FB9992E7BB6D345553F1DD5D9917BECF4E9C5AADF53F49FA35C2E4F5
% 3661D76B2DA3EDF994EFAB23A78AFED5563B590F7613C3856CCACBF6FA99BD4E
% EFF26E33FF0047D330723D3FD1749F5D7A9F52CCCFAFA27437554E6B008CAB1E
% 5B6B5D68B2BB5BD3298FD264D78CCB7D5CD67F43AAEBAA65B55CFB3D3E7F230C
% B2ACACAEB9946F65120D3539C7098F7FE8EBFB7E5BEFAF2BABE53D9E97EADEAF
% F83FD62CF4922247488DF792C9DE801AEB6931EFCEFDA15D7D53229C8C363C33
% 0BA4E23EB661E457B3754FF4EDF4FD7C2AABB7F9CA3A6B2AC8B7F49FCD7A2B5B
% AE67E453D0FECD5B9CEA3D573336EC4A982B67B4BAAC5CAFB3D8FF00D5AFB1FF
% 00A4BD9E933F57F432FF004795F67B70BA2E4E3E3DB9165384324BFF00441C1A
% DC72F1F9D6DAEA5F4E2D357FC17ABB2BAFF4752DAEA3D4DDD4307131FA18A2DA
% 301CE7E6E2E23DB5B18F1FD15DBEE7D3859B4D0EDEFBB17ED6CFD73ECB91FA5A
% EAB2A5265C5C38AA20D91F6B1717171441D28D7EFF00F8CF0993539C5FBEF15B
% 291B9D5D55B8811F9D75B90E63BFEB752C8BBAAE3ED69A45B63AA3BCBDE1AD0E
% 27F36CDBBB756BAAB3A062D9EA37A9D79B65D66EB68A2C6B6963DAD875B73BA8
% 5566563E5D0DF519FCCBF7D2A3D32CC365CCAFA7537E63041B29C67B1986C7FD
% 16B9F75ADDEFFF0084B37AA5A0BB04D74F958408C7420923A7F37170065DD7D4
% 6AB5CD14002D632A77B6BD7F9B0D656FDAD64FE8B73FF43FE0D74EDEAACBBAB5
% 54F54A2D38F750D37676D0368693B72AC7E3B1CC7D6EDDEFB3D0A2CC6FE777AC
% BEBF9D8B84D76331953F2EDDC6E6E35E6DA9A09FFB55B9BB773377E62CFC4B3A
% BDD857DB5DB8B8C368A4DD6BCD6F7899FD0BED3E9B94B8BDCF9A029920244588
% 81127691F9BC5ECBAAF4BE92FE934F45AB25D9349B5D6E0DD5D6CBDB734B0B3E
% CD4E5FAB7E3FDA5AD637D47B3D3C9A3D2F655E865FA8AC7D4AFA96DCCE995DB6
% 7516BEB63BD3C8AEBAE6EAEC60FD2E1DAEB9F6D0C7635DF47F57BBD7A7D2B3F9
% 9F4960F4AE946EC62D17FDAAEC96B6BCA2D756CABD6AC3DF8D55198CB2BF4DBE
% EF7DDB3F4967AAB4FEAA75FCBE97D7AAB7A99ADADEA8598D7FA43F3E3D3664DF
% EED8EF4727F41F68FDCBAFF53D5FD0FA73F0C88E23BF567040A1B7F2EEFA574D
% E8FD3FA6348C5ACFA8F1166458E365CFFF008DC8B4BED7FF005377A75FF83575
% 249317A92492494FFFD3F5540CDCBA7070EFCDBE7D1C6ADF759024EDADA6C7ED
% 1FD56A3AC6FADED73FEAEE5D4D0E70BFD3A5ED67D2732DB6AA2D637FAF558F6A
% 205903BA09A04F67CF7033735DD49EFCCBC56FB817E4B2A8B5F73277E5BED716
% 8AFECD7DFF00AB50C6DB5E27A18FFA0F52BF52EB639FD5FA4F53EA95BDF7D74B
% F56E363068BACAC47BF3B2AF6B7ECD4E43F6ECA7171BF9AAD6565E065E7B6CCB
% EA00B6ECB3AD4C97319B0B6BA316B69FA0DA59ECD8D51ADDD3FA45B4D74B9A5C
% 4137BDCD0D0D703F45EF8F7395D8E2BE136234D2965AE214657FB1EB3A2FD5AC
% 1CE65561C3765C1871B1CD74FF00C3653ACFFA152E94748E9B896558B9D9D4D3
% EAB837170DA2AA019D19556C76EB2E589F54BEB1DB957B28B2C2719C4CFBAAAD
% BFD7DC18CB9FB7F777AA37D79D5B5ECCEE9B7FA5937D97752CDC50C7E2DAF7B9
% E5CE65949BADFB1B58D63297E5329F43FED5FE9941CD66CB8F4034FD8BB1C61C
% 3C422724AF500FC81EA3EB5D5F57A707F6BE0D9D42DAF78C4631AE2D13E9FAA2
% FDAEAB1BD37EDABD97FF00DB6B88C5E875E063D9FB2F3701F1FCF65F546BEA35
% C0F7BAA6FAD761DBFF0007B28A3FEBCB7BA3F59C3C8C3C5E9E3A7D995D1AA7B6
% 8A6F6D6E6B68630399F68BB3BDBD3F32B63BDB63E9BBD7FF0083CAB568F55C1E
% 974D03A87567557E257B431CCADD90F74FD06D7454C737FB7B2C55E1EDE404CE
% C3626090008F144F4F95F27C9AB273DD90CA328DD8EF2DFB4E5340AABB4D5BFD
% 1F4F1696EF7B6BF51DFA4BBFF0244FB062605943F20B03EC6EDADA185EE04705
% ACB0EE5DD1FACBF563A858DB3A6DD461BAB7FA577DB5CEAB68076B2C6D78D5D9
% 89E959FE96DC9ABFE13629E67D54C4A1B9199BEA3601B9D977B0D74B43BFD1DB
% 7FB6EFE47A2AD619E28815F9316486422AA8741178FC2A1D8C0E5E53DE5F6383
% 7F492DB1D3F4767A7BB62D7CEFD99574AC2A32697DADBF7FDA5CDB87A8CAD8E1
% 8FE8E39B9B5D76DF6FDA5CFB3D4B6AA6AABFE16C5BBD12AE9991655563E3E466
% 565C19F6A35B4540BBDAEB3DCFF57D26CFEE2E33EB4F561922B6FA5B1A379C0A
% BE8FA55FABFE135B7ED19190CAAAFB4BFD6B3D6B595D389FA2AFF4ADE672C741
% 0DEC52DC6271167524D01FCBFAAFAEFD55EA87ABFD5DC0CF738D96DB486DEF23
% 693757FA0C9F60FF00BB15DAB55711FE2872326DFAAF757907F98CCB5958F06B
% 9B4E4B9BFF006EE45ABB75036D4924924A7FFFD4F5558DF5BDF6D7F56F3ADA49
% 6BEA636D2F01C4B5B5BD965B6B3D27D36FA9556C7D95FA76D6FDEB6557EA1875
% 67E064E0DD22ACBA5F45846876D8D756E8FECB920A7C9EEA6ACA38EE3906D662
% D4CB5F75EDF4FDD73836D77A34BBDAFF006EC7596FBFD8B9FBDAD63ADBECA9E6
% BAEE7578F5B8B29AC1ECED9EEB2DDCBB1A73AA181D3F1AFE97567754CE0FC67D
% 15B8627A2CC670AF2AA7DF93BB7E6E265BF7FA0CF57F55F52FBBF43E9AC7B7A1
% 0A3AADE3A9EF7673CB9D8E5CC1B5CD0760FB3501D67B9D5ED77D3FE5AB98720E
% 2E1EDDDA99B1CB8788F5EDFCA2D06750EAD7DADA2BDAC635BEE0E240D7F77D3D
% BB96DF4EB5F80D6E665DB2FA3FA3B48343371FF876BFD472BB8FD1FA87A6D751
% 8CD6318D906DF7DA5C78F6FB58CFEA6E552EFAB5998E0E6752C865CEB6093686
% B4B5AEF6B5B4D13F9AAC4CE396FA9FDE916B43DC8EDE91FBB10A1D6BAE751C81
% 5636539A376E7D8DCB018C6F01B4D3634AE9B05BD4322E6E4BBA8E7166303EF6
% 369B19FCADDEDF771FB8B98FB25188064DD6597D6E3B69A890DAE7FE118D1B95
% DBE9C9C8A98DC9CDAB171DBEEB035E71E96B40ED57D3B1CA0963801A533C72CC
% CB5B010F59C56E3D95E2F4ECEA9D80E712CC5EA356512D2E3B8D2D6D1558FEA1
% 539CE73EBB2EFD255FCDDD7DDFA351E9FD2F1307A6754CDEA783FB50E316E4D3
% 82C16E26234B22A3E85777E8D8E731CFB3F494FAD91FCDD14BEC57F13AEF4AC2
% C607A6D2FCDA1CE0D2E61735D69F065D99B1EDABFA8A97D64CEEB228FB65B7D6
% DC5DE0D75BDBB6BC279DD6578D663D363AAC8B7F47EAE1755B3FED47A95FEA17
% 7A75AA73C631DCA313E619C480B908EA770373E6D6EA9D5B2998EEC379AFA763
% 3C7E93030B7B5CFD1D355F6B36E5DBB98FD8FF0052EC7FFC28B98C8B85A1F940
% 9194EC8D9556D7EFA68A7D36D755BE87B76BFF0048FF0041BBBF45E97A5E9A06
% 4D97D871AEF42F73322C2DC7810EBDE0ECDB5D7B9EE6B77FE6318AE61747B71B
% 09FD43A8BEBC375B3914D17822D35CBB1DD9505BE937D5BACF4B11B77E93F476
% 5D4D1E9FE99478ACCAE66FCD18C4F52753AD7689FEAC5F48FF0014B5399F56F2
% 2D8229BF32C763B9D12EAD95D18BBFFCFC7B176CB17EA6F4B7F49FAAFD3B06D0
% E6DCDA459736CFA4DB2E2ECABEB3FF001575CFAD6D2909B24B30D8292492412F
% FFD5F5549249253E7FF59FA2BA8EB36D54322BEA85B97845D5B1F43336B0E666
% 36E6E8EAA9C8A1FF006AB1FF00E9BED19DFF0068D71BD3BAFF0059E997BF1ABC
% DBFA6D588F7369C41B6EDAE2FDB94CBB0DFBE86FA567A9B6B6FD9FD25ECDD57A
% 5E3F54C3762DC5D59FA555F512CB6A7C1636EA2D6FBEBB36BDECFE5D6FB2AB3F
% 45658BC83AF62752C0CDFB0756B6F168975D9CFDF683496B68B3305EDFD25DED
% AF1EADF657FAAFF84FD37F3CD98BA901AEC4FF00D12C538906E3609D3FDF76F1
% FEB7579F9197D3B2E8CAEA179B3ED347D8E9DAD732B6EEDB9955C5DE87BB657E
% BD3EA63FBEAB6DF47F49BF732EDE91D3F16EEA8CC68CE636B376156F66EA6B2E
% 6B2FC9B6CC6AAFB594E356FF005AFB3659FF004D79C63F4FCDF4DBD5F019916B
% 6A314D992E360158DD53AEAE9A19FA6F4B73FDDBBD3FF825D1F40FACAFE9186F
% C3A319F9E64D6E360FB33741EE6B31EB190CBB9FF0FE9A9E10C9C3E202B8A028
% 4883D24D8CFC8C7AADAF26CCA63A9B9C7D0C5E9CDF5CD8D9735B7DD9DBF73B7E
% DFCC585D7F21DD41CE755EAE3328FE75D75D1BDDE544D97B96F7526331B0307A
% 93BA3E253EAD8EA48B6B326297E4D57D7F637E135DBFECF7FDA7FC1FF33F6654
% 3A7750AF39AD03A636BA32ED34E26563D37D4031822FCADB6372B0B231FD7FD5
% BFE50FB431FF00E0D18E500F0CAEC782D30B97A2B6E2FA3CD60559AF2E79B5CF
% B1876B0D9EF0D1FF00042C236FF9AB77173B330996578D8B45965B5BA9393635
% CE7FE91A6BB5B8D5D1B37BFD377F38F7A2751A5D4877D9F19F4575CD6FA4B4B9
% FBBFD23DCCB2AA68639DFE95DEA2A1665518321FB32B318C00D4C6B9DB77F6B2
% DDEFAA9FEDFF00EC3298CA128D57F6B1819233BBEBA7F55B7D331B2BA7E47DA9
% D96F7E4DB532B69F49AEB98D67E869A6BB1AF7ECF53F3B66CF5BFC3AB9D23A4D
% 3D73EB0E1F4BC661FD8D82FF00B5E550C0CFB392DF73BD59AF6E6BB3733F47F4
% 28C5A71BEDB8DD3EAB31FF004EB0DB89D4FAC64D54301C8B321C594E2E382CAB
% DA36DAEB2C77E652D3B2D7B99FABB3F9CAFF004F532CF5DFAAFF0056707EAEF4
% FF00B3E3B41C8BA1F9778E6CB23B6EF7368ABE863D5F98CFF497D975D6D69803
% 402BC1B10DBC3F96CECA492498BD4924924A7FFFD6F5549249252952EA9D2713
% AAE31A32439AE1269BEB3B6DA9C46DF571EDFF0006FF00FC0EDAFF00437B2DA6
% CB2B5752494F997D6BE8DF5C7A66396E2DCEBBA73A03ECC16BAAF4F46FDA6FBF
% A762EC7DBEB3C7ADEA3B272E967A6FFD16262DDE9ACCE85D7BA735CCF4AAC7AE
% F757635D9F5D0E70F5D83FA6578D3E93EF636CAAEBB1BF9A7BFF0098F4D7B02C
% AEABF55BEAF75871B3A8605375CE2D27200F4EEF6FD0FD6A8F4F23DB1FE95189
% A24EBAF62B4C7EBFDEF57FD27C67AA5DD5E8C99CBB5F55F631AE75D90F739EE6
% 387A83D3B7F3E9B367F38FB3DFB3F9AFF06A855D63A97DA19958F66497B8906C
% A8BE96991B36D6FA9DEDFF0037DEBD6F23FC58740BEFF546466D4D6886542E16
% 359F4B5ADF975E4DEDDAE7EEFE79059FE2A3A00205D9BD4322A9F7D365CC0C7C
% F6B7D1A29B5DC7FA451FB601D18FDAA363F3D5F361F597AC0AAAFB5E6D8EAEB6
% 6D6E27AA58CB23F372F65953EDC777F85DBFA7C9FF00C11747D1BEABE5F5CD8F
% C4C72709E5B65B9F91BA8C7B090DDDF67C46B6ACDC8AAA63FF0045FA4A2AC8FC
% FCCA7FC27A074AFA97F557A4383F03A6D2CB1AFF005196D80DD635C349AAFC93
% 75B57FD6DEB6D3E371BA3BB208F7F579B95D03EAEE0F43C7D94FE9B25E22ECA7
% B5A1EE03E8D4C6D6D65746355FE031286B28ABFE37D5B2CD5492497292492494
% A49249253FFFD9003842494D0421000000000079000000010100000018004100
% 64006F00620065002000500068006F0074006F00730068006F00700020004500
% 6C0065006D0065006E007400730000001C00410064006F006200650020005000
% 68006F0074006F00730068006F007000200045006C0065006D0065006E007400
% 7300200032002E003000000001003842494D042200000000012E4D4D002A0000
% 00080007011200030000000100010000011A00050000000100000062011B0005
% 000000010000006A012800030000000100020000013100020000001D00000072
% 01320002000000140000008F8769000400000001000000A4000000D000000048
% 00000001000000480000000141646F62652050686F746F73686F7020456C656D
% 656E747320322E3000323030363A31303A30392032323A31303A313900000003
% A001000300000001FFFF0000A00200040000000100000156A003000400000001
% 000001830000000000000006010300030000000100060000011A000500000001
% 0000011E011B0005000000010000012601280003000000010002000002010004
% 000000010000012E020200040000000100000000000000000000004800000001
% 00000048000000013842494D03FD0000000000070000000000000000
%EndPhotoshop
%begin_xml_code
/pdfmark where {pop true} {false} ifelse
/currentdistillerparams where {pop currentdistillerparams
/CoreDistVersion get 5000 ge } {false} ifelse
and not {userdict /pdfmark /cleartomark load put} if
[/NamespacePush pdfmark
[/_objdef {photoshop_metadata_stream} /type /stream /OBJ pdfmark
/MetadataString 5038 string def % exact length of metadata
/TempString 100 string def
/ConsumeMetadata {
currentfile TempString readline pop pop
currentfile MetadataString readstring pop pop
} bind def
ConsumeMetadata
%begin_xml_packet: 5038
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?> +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: brave-gnu-world-logo.eps +%%CreationDate: 09.10.2006 22:10 Uhr +%%BoundingBox: 0 0 342 387 +%%HiResBoundingBox: 0 0 342 387 +%%SuppressDotGainCompensation +%%EndComments +%%BeginProlog +%%EndProlog +%%BeginSetup +%%EndSetup +%ImageData: 342 387 8 3 0 1 3 "beginimage" +%BeginPhotoshop: 16252 +% 3842494D0425000000000010000000000000000000000000000000003842494D +% 03EA000000001DA63C3F786D6C2076657273696F6E3D22312E302220656E636F +% 64696E673D225554462D38223F3E0A3C21444F435459504520706C6973742050 +% 55424C494320222D2F2F4170706C6520436F6D70757465722F2F44544420504C +% 49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E63 +% 6F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C +% 706C6973742076657273696F6E3D22312E30223E0A3C646963743E0A093C6B65 +% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D48 +% 6F72697A6F6E74616C5265733C2F6B65793E0A093C646963743E0A09093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F72 +% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74 +% 696E676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E61 +% 70706C652E7072696E742E7469636B65742E6974656D41727261793C2F6B6579 +% 3E0A09093C61727261793E0A0909093C646963743E0A090909093C6B65793E63 +% 6F6D2E6170706C652E7072696E742E50616765466F726D61742E504D486F7269 +% 7A6F6E74616C5265733C2F6B65793E0A090909093C7265616C3E37323C2F7265 +% 616C3E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963 +% 6B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F6D +% 2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E0A +% 090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E +% 6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D31302D +% 30395432303A31303A30355A3C2F646174653E0A090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B +% 65793E0A090909093C696E74656765723E303C2F696E74656765723E0A090909 +% 3C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B65 +% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D4F +% 7269656E746174696F6E3C2F6B65793E0A093C646963743E0A09093C6B65793E +% 636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F +% 6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E +% 676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E617070 +% 6C652E7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A +% 09093C61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E50616765466F726D61742E504D4F7269656E74 +% 6174696F6E3C2F6B65793E0A090909093C696E74656765723E313C2F696E7465 +% 6765723E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469 +% 636B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F +% 6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E +% 0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 +% 2E6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D3130 +% 2D30395432303A31303A30355A3C2F646174653E0A090909093C6B65793E636F +% 6D2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F +% 6B65793E0A090909093C696E74656765723E303C2F696E74656765723E0A0909 +% 093C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B +% 65793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D +% 5363616C696E673C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D +% 2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F6B6579 +% 3E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E676D61 +% 6E616765723C2F737472696E673E0A09093C6B65793E636F6D2E6170706C652E +% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A09093C +% 61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D2E6170 +% 706C652E7072696E742E50616765466F726D61742E504D5363616C696E673C2F +% 6B65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B6579 +% 3E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F +% 6B65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E74 +% 696E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B6579 +% 3E0A090909093C646174653E323030362D31302D30395432303A31303A30355A +% 3C2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E74 +% 656765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F +% 61727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E +% 7072696E742E50616765466F726D61742E504D566572746963616C5265733C2F +% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072 +% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269 +% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 +% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963 +% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909 +% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E50616765466F726D61742E504D566572746963616C5265733C2F6B65793E0A +% 090909093C7265616C3E37323C2F7265616C3E0A090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B65793E +% 0A090909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D +% 616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E617070 +% 6C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E0A0909 +% 09093C646174653E323030362D31302D30395432303A31303A30355A3C2F6461 +% 74653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963 +% 6B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465676572 +% 3E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61727261 +% 793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E7072696E +% 742E50616765466F726D61742E504D566572746963616C5363616C696E673C2F +% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072 +% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269 +% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 +% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963 +% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909 +% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E50616765466F726D61742E504D566572746963616C5363616C696E673C2F6B +% 65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B65793E +% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B +% 65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E7469 +% 6E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E +% 6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E +% 0A090909093C646174653E323030362D31302D30395432303A31303A30355A3C +% 2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E +% 7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465 +% 6765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61 +% 727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E70 +% 72696E742E7375625469636B65742E70617065725F696E666F5F7469636B6574 +% 3C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E +% 7072696E742E50616765466F726D61742E504D41646A75737465645061676552 +% 6563743C2F6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E61 +% 70706C652E7072696E742E7469636B65742E63726561746F723C2F6B65793E0A +% 0909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D616E +% 616765723C2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E +% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A090909 +% 3C61727261793E0A090909093C646963743E0A09090909093C6B65793E636F6D +% 2E6170706C652E7072696E742E50616765466F726D61742E504D41646A757374 +% 656450616765526563743C2F6B65793E0A09090909093C61727261793E0A0909 +% 090909093C7265616C3E302E303C2F7265616C3E0A0909090909093C7265616C +% 3E302E303C2F7265616C3E0A0909090909093C7265616C3E3738333C2F726561 +% 6C3E0A0909090909093C7265616C3E3535393C2F7265616C3E0A09090909093C +% 2F61727261793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E +% 742E7469636B65742E636C69656E743C2F6B65793E0A09090909093C73747269 +% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 +% 72696E673E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E +% 7469636B65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E +% 323030362D31302D30395432303A31303A30355A3C2F646174653E0A09090909 +% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E737461 +% 7465466C61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E +% 74656765723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09 +% 093C2F646963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E +% 50616765466F726D61742E504D41646A75737465645061706572526563743C2F +% 6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E6170706C652E +% 7072696E742E7469636B65742E63726561746F723C2F6B65793E0A0909093C73 +% 7472696E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C +% 2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E7469636B65742E6974656D41727261793C2F6B65793E0A0909093C61727261 +% 793E0A090909093C646963743E0A09090909093C6B65793E636F6D2E6170706C +% 652E7072696E742E50616765466F726D61742E504D41646A7573746564506170 +% 6572526563743C2F6B65793E0A09090909093C61727261793E0A090909090909 +% 3C7265616C3E2D31383C2F7265616C3E0A0909090909093C7265616C3E2D3138 +% 3C2F7265616C3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A09 +% 09090909093C7265616C3E3537373C2F7265616C3E0A09090909093C2F617272 +% 61793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469 +% 636B65742E636C69656E743C2F6B65793E0A09090909093C737472696E673E63 +% 6F6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E67 +% 3E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B +% 65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E32303036 +% 2D31302D30395432303A31303A30355A3C2F646174653E0A09090909093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E7374617465466C +% 61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E74656765 +% 723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09093C2F64 +% 6963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E50617065 +% 72496E666F2E504D50617065724E616D653C2F6B65793E0A09093C646963743E +% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E +% 63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E617070 +% 6C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A +% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E69 +% 74656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C64 +% 6963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E50 +% 61706572496E666F2E504D50617065724E616D653C2F6B65793E0A0909090909 +% 3C737472696E673E69736F2D61343C2F737472696E673E0A09090909093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C +% 2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C652E707269 +% 6E742E706D2E506F73745363726970743C2F737472696E673E0A09090909093C +% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461 +% 74653C2F6B65793E0A09090909093C646174653E323030332D30372D30315431 +% 373A34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170 +% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E +% 0A09090909093C696E74656765723E313C2F696E74656765723E0A090909093C +% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C +% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D +% 556E61646A757374656450616765526563743C2F6B65793E0A09093C64696374 +% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 +% 2E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170 +% 706C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E +% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E +% 6974656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C +% 646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E +% 5061706572496E666F2E504D556E61646A757374656450616765526563743C2F +% 6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E302E +% 303C2F7265616C3E0A0909090909093C7265616C3E302E303C2F7265616C3E0A +% 0909090909093C7265616C3E3738333C2F7265616C3E0A0909090909093C7265 +% 616C3E3535393C2F7265616C3E0A09090909093C2F61727261793E0A09090909 +% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69 +% 656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C65 +% 2E7072696E74696E676D616E616765723C2F737472696E673E0A09090909093C +% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461 +% 74653C2F6B65793E0A09090909093C646174653E323030362D31302D30395432 +% 303A31303A30355A3C2F646174653E0A09090909093C6B65793E636F6D2E6170 +% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E +% 0A09090909093C696E74656765723E303C2F696E74656765723E0A090909093C +% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C +% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D +% 556E61646A75737465645061706572526563743C2F6B65793E0A09093C646963 +% 743E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65 +% 742E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E61 +% 70706C652E7072696E742E706D2E506F73745363726970743C2F737472696E67 +% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 +% 2E6974656D41727261793C2F6B65793E0A0909093C61727261793E0A09090909 +% 3C646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E74 +% 2E5061706572496E666F2E504D556E61646A7573746564506170657252656374 +% 3C2F6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E +% 2D31383C2F7265616C3E0A0909090909093C7265616C3E2D31383C2F7265616C +% 3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A0909090909093C +% 7265616C3E3537373C2F7265616C3E0A09090909093C2F61727261793E0A0909 +% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E63 +% 6C69656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E617070 +% 6C652E7072696E74696E676D616E616765723C2F737472696E673E0A09090909 +% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F64 +% 446174653C2F6B65793E0A09090909093C646174653E323030362D31302D3039 +% 5432303A31303A30355A3C2F646174653E0A09090909093C6B65793E636F6D2E +% 6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65 +% 793E0A09090909093C696E74656765723E303C2F696E74656765723E0A090909 +% 093C2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09 +% 093C6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E +% 7070642E504D50617065724E616D653C2F6B65793E0A09093C646963743E0A09 +% 09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6372 +% 6561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170706C65 +% 2E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A0909 +% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E697465 +% 6D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C646963 +% 743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E506170 +% 6572496E666F2E7070642E504D50617065724E616D653C2F6B65793E0A090909 +% 09093C737472696E673E41343C2F737472696E673E0A09090909093C6B65793E +% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B +% 65793E0A09090909093C737472696E673E636F6D2E6170706C652E7072696E74 +% 2E706D2E506F73745363726970743C2F737472696E673E0A09090909093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F6444617465 +% 3C2F6B65793E0A09090909093C646174653E323030332D30372D30315431373A +% 34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170706C +% 652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E0A09 +% 090909093C696E74656765723E313C2F696E74656765723E0A090909093C2F64 +% 6963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C6B65 +% 793E636F6D2E6170706C652E7072696E742E7469636B65742E41504956657273 +% 696F6E3C2F6B65793E0A09093C737472696E673E30302E32303C2F737472696E +% 673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 +% 2E707269766174654C6F636B3C2F6B65793E0A09093C66616C73652F3E0A0909 +% 3C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74797065 +% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74 +% 2E5061706572496E666F5469636B65743C2F737472696E673E0A093C2F646963 +% 743E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E +% 41504956657273696F6E3C2F6B65793E0A093C737472696E673E30302E32303C +% 2F737472696E673E0A093C6B65793E636F6D2E6170706C652E7072696E742E74 +% 69636B65742E707269766174654C6F636B3C2F6B65793E0A093C66616C73652F +% 3E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74 +% 7970653C2F6B65793E0A093C737472696E673E636F6D2E6170706C652E707269 +% 6E742E50616765466F726D61745469636B65743C2F737472696E673E0A3C2F64 +% 6963743E0A3C2F706C6973743E0A3842494D03E9000000000078000300000048 +% 004800000000030F022FFFEEFFEE033802410367057B03E00002000000480048 +% 0000000002D802280001000000640000000100030303000000017FFF00010001 +% 0000000000000000000000006808001901900000000000200000000000000000 +% 0000000000000000000000000000000000003842494D03ED0000000000100048 +% 00000001000200480000000100023842494D042600000000000E000000000000 +% 000000003F8000003842494D040D0000000000040000001E3842494D04190000 +% 000000040000001E3842494D03F3000000000009000000000000000001003842 +% 494D040A00000000000100003842494D271000000000000A0001000000000000 +% 00023842494D03F5000000000048002F66660001006C66660006000000000001 +% 002F6666000100A1999A0006000000000001003200000001005A000000060000 +% 00000001003500000001002D000000060000000000013842494D03F800000000 +% 00700000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000 +% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFF +% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFFFFFFFFFF +% FFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800003842494D04080000000000100000 +% 00010000024000000240000000003842494D041E000000000004000000003842 +% 494D041A00000000035D00000006000000000000000000000183000001560000 +% 001400620072006100760065002D0067006E0075002D0077006F0072006C0064 +% 002D006C006F0067006F00000001000000000000000000000000000000000000 +% 0001000000000000000000000156000001830000000000000000000000000000 +% 0000010000000000000000000000000000000000000010000000010000000000 +% 006E756C6C0000000200000006626F756E64734F626A63000000010000000000 +% 00526374310000000400000000546F70206C6F6E6700000000000000004C6566 +% 746C6F6E67000000000000000042746F6D6C6F6E670000018300000000526768 +% 746C6F6E670000015600000006736C69636573566C4C73000000014F626A6300 +% 000001000000000005736C6963650000001200000007736C69636549446C6F6E +% 67000000000000000767726F757049446C6F6E6700000000000000066F726967 +% 696E656E756D0000000C45536C6963654F726967696E0000000D6175746F4765 +% 6E6572617465640000000054797065656E756D0000000A45536C696365547970 +% 6500000000496D672000000006626F756E64734F626A63000000010000000000 +% 00526374310000000400000000546F70206C6F6E6700000000000000004C6566 +% 746C6F6E67000000000000000042746F6D6C6F6E670000018300000000526768 +% 746C6F6E67000001560000000375726C54455854000000010000000000006E75 +% 6C6C54455854000000010000000000004D736765544558540000000100000000 +% 0006616C74546167544558540000000100000000000E63656C6C546578744973 +% 48544D4C626F6F6C010000000863656C6C546578745445585400000001000000 +% 000009686F727A416C69676E656E756D0000000F45536C696365486F727A416C +% 69676E0000000764656661756C740000000976657274416C69676E656E756D00 +% 00000F45536C69636556657274416C69676E0000000764656661756C74000000 +% 0B6267436F6C6F7254797065656E756D0000001145536C6963654247436F6C6F +% 7254797065000000004E6F6E6500000009746F704F75747365746C6F6E670000 +% 00000000000A6C6566744F75747365746C6F6E67000000000000000C626F7474 +% 6F6D4F75747365746C6F6E67000000000000000B72696768744F75747365746C +% 6F6E6700000000003842494D041100000000000101003842494D041400000000 +% 0004000000013842494D040C000000001A350000000100000071000000800000 +% 01540000AA0000001A1900180001FFD8FFE000104A4649460001020100480048 +% 0000FFED000C41646F62655F434D0002FFEE000E41646F626500648000000001 +% FFDB0084000C08080809080C09090C110B0A0B11150F0C0C0F15181313151313 +% 18110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +% 0C0C0C0C0C010D0B0B0D0E0D100E0E10140E0E0E14140E0E0E0E14110C0C0C0C +% 0C11110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +% 0C0C0C0C0C0CFFC00011080080007103012200021101031101FFDD00040008FF +% C4013F0000010501010101010100000000000000030001020405060708090A0B +% 0100010501010101010100000000000000010002030405060708090A0B100001 +% 0401030204020507060805030C33010002110304211231054151611322718132 +% 061491A1B14223241552C16233347282D14307259253F0E1F163733516A2B283 +% 264493546445C2A3743617D255E265F2B384C3D375E3F3462794A485B495C4D4 +% E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F637475767778797A7B7C7D7E7F7 +% 1100020201020404030405060707060535010002110321311204415161712213 +% 0532819114A1B14223C152D1F0332462E1728292435315637334F1250616A2B2 +% 83072635C2D2449354A317644555367465E2F2B384C3D375E3F34694A485B495 +% C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F62737475767778797A7B7C7 +% FFDA000C03010002110311003F00F5549249252962FD63FADFD0BEADD3BFA95F +% FA67006BC4AA1D7BC1DC039B4EE6EDAFF46FFD35BE9D3FF09BD61FD7EFAFE3A1 +% 8FD91D22323AEDE000000E18E1C3DB658DFA2FC87B7DD451FF00A1191FA2F4AA +% C9E1FA4FD5DCEEA998EEA7D58BFA8751CC74D3597026D70038716BABAF1F1D8D +% DB65FF00CC52CF469AB67A94D8929EA2CFF1C4CB2D8E9FD132322AEEEB2C6D6E +% E63F9BAD993F9BFF0008B5A9FF0018D45AD31D1F3C585E6BA9B1400F7EA1B5D7 +% BF258EB2C76DFA14D76A9F4FFA834B58D7E7E4D8D773F66C6706D4D91F47D6B2 +% BFB4DCE6EEFE77F56FFC2F5ADDE9BD07A474B71B30B19B5DCE043AF717597104 +% 8739AFCABDD6E4399B9BBB67AA9292F4DBFA86452EB73B1460B8B88AA8F505AF +% 0C1F45F7BEAFD0B2C7FF00A1A5F7FA7FF721FF00E0ADA4924A79BEBBD47EB974 +% 9B1F7E06053D6B05DAB59597539356AEDCCB1937332D9B7D3F4ACC7632DFF494 +% 7F855CB752FF0019FF005971C7A7FB2A8E9F748939A320340D665B65185FF07F +% E13FF3E2F4D49253E59D37FC66FD64B323D4C9AF03269827ECF8FEA31CE8F67E +% 8B21CFC8D9EFFF004B4FFDB5FCF57E83D13AFF004EEB743ADC37383EBDBEB63D +% A36DB5EE1B99BD9AEE63FF00C1DF53ACC7BBFC0DB62C4FAD5FE2EFA4F5B6D995 +% 84D6F4EEABF49B91588AEC7025F199437D96FA9BDDFA7FE91FF1BE9FA2BCFABB +% FAD740EBC303A89FB1754C40E38990C135DA1FFE1F7B87EB38D76CF753FF005B +% FD0E4D1FA24A7DB9258DF56FEB0B3ACE31173063E75207AF44CB48FCDC9C677F +% 84C5B7F33FD1FF00336FE916CA4A524924929FFFD0F555CC7D7DFAE15FD58E96 +% 3D269B3A96687D7835812039BB77DF618DBB28F52BFD1FF86B3F47F43D5B6AE9 +% D782F56EA87EB37D6BCAEAAE71B315961A30441814D42CB3D50DB7DCDD98F5DB +% 97657B7FA45DFE0D2527FAADD06CCA7D9D433C3F2AFB9C2581FF00A5BEEB9DBD +% 98E2CB377BED7B7D5CABBFC151FA7C8B3D15EBDD07A1D7D2F1F7DA18FCFB9A06 +% 4DCC076C0FA18F8FBE5D5E263FD0A6BFFAF59FA7B6D58DF527A355481956FBED +% A2B635B31FA3B2D636FBDBB3DCE6DCDAACAFF49F4FF58BAA5D724A52499CE6B1 +% A5CE21AD689738E8001DCAE03AFF00F8DAC1C6C87E07D5FC63D57246E67AF3B6 +% 86BFE830B3682FCA67A9FB9E8D567F81C9494FA024BCBFA6FF008CDFAD0EC963 +% 73B0F06DAF5DF4D0E7D76684336B2CB2DC9ABD5F51DF42C6319FF0D5AE9FA87F +% 8CAFAAB81D3E9CCB6EB1F66434BABC163272416BBD1B59754E2C663BAAB37FF3 +% F6D7EAFA567D9FD6494F5292E1F0FF00C6C746C8B62DC0CDA292EDA2ED8D7800 +% 7D27DB5D563AE6EC6EDDDE9577AEB7A6756E9BD5F1465F4DC8665504ED2F61E1 +% D01DE9D8C3EFAACDAE6FE8EC6FA8929B6B9FFAEDF5529FACFD1DD8A36579F4FE +% 930725E0FB1FA6E61733DEDAB21ADF4EDFFADDFE958FA2B5D024929F11FAB3D7 +% 3A85393582F38BD4F049AB6580B75691F68C7CE66D7BFECB7ECD96B367AACCA6 +% 7E8EAFB4D78FE9FB2F4ECFA3A8E15799402D65920B1D1B98F6935DD4D9B4B9BE +% A536B1F559B5CBC5FEB8B2AE9FFE303AA8A229AEC6B2D796E9B5D6B28B6DB7FE +% DE7BAE7AEFBEA266165F6E00115DB59B76811B2DC77370AFF5777B9D6DF5FD99 +% DFF07E8BFF00B694F66924924A7FFFD1F50CA6DCFC5B9943B6DCEADC2B7710E2 +% 0EC77F9CBE7BFAB4E0031BB8377BECA4171F687DA296D46C0DF76C7EC77FDB5F +% CB5F44AF2FFAEFF50F37133EFEBBD0697E5D19AE2EEA3D3DB2FB03DC4BDD918C +% DFA56B2C7B9DBAAFE728B1FF00A1FD0FF454A75FEABFD6CE958551C5CFB7ECF5 +% 585A5B976FB6BF576B6ABB1EFB3E856FFD17A8CB5DB29FF03FA3B29FD274EFFA +% CBF5718DDCFEAB86D6F89C8A80FF00AB5E29565B32D95ED7EE021B66FF007169 +% 8D1CF6EEAFD4B58DFF00AEBFFAEAE51F567A78A1D939748A98D87B59639AC3EF +% FE65B90E26AAE86BBE97BFFF0003FCF4A6F7D6CFAD79DF5D731DD27A3EFABA15 +% 0EFD259043B21CD3B9AFB07E653B87EAD8EFFF008EBFF58FB3E3D15B1BEAF328 +% A994359B8D861B5D675B0804BFE916D96FE6FAAC67E67E8BFC27A0AE74EB72F2 +% 5870FEAFE28BE9A5C2B665D601C7A3633D4B6DB03D94D3EADAEB376FBEFF00A1 +% BFF43916FF00379FD33A66664752756E75BD42C69DAEAEB0C7EE206DDD6DB697 +% 6DDBFF0069BF4791F63FE91FA0BD3A1094FE51F5DB4592CB18EA5B67A664E3D2 +% 2CFB3D8CA7710D2D6398C0EDAF6B296B3D3AD9EAEBFB9EA7F3BF43F3F3727168 +% 19363AD65673C1FD333783732086ED756E2EB9F6FF00C5FDA2F7B3FE1175DD4D +% B57D9CBF368C367516FA78ADC2A326FBC8C6AEC7E4E463F517D77D1535FEA3BF +% 43BFF9CBFF0056FD27ABE9ACCE9F89899F636ACAE9F878990197598CCFB5B28B +% 2B25D35E2E6E1DF75F915DBB3D4C87BEBC6FF47EAD767E92C481C7C5C249F31C +% 3308E324D47865A5D7CAE05D7D74EFAAF0FA5EE716163DA46D734B37D3B086FA +% 16FD0F568FE77DFF00A657BA5F54C8C1CCAF370EFF00B2DAD86B5ED1B9AF6C7F +% 35918ECFE9547FC67E9B7FF45FB3FD35B35F41EAB876BF763B6DC4B6B873F633 +% 63B74FF3B4B5D7D9F67D5ED6E5595FBFFE2972AFC5AF2736EFD9CE6E157EA0AA +% 9DC1EDAED786FB9BE859BBD2FA5F9BFF006CFEE38E23FA244BF050C9FBC0C5F5 +% 7E8DF5F3A4655219D5AEA7A5E6B44B9B6D81B4BC69FA5C5C9B7D3ADFBB77F30E +% FD62AFF8BFD3595BAD7F8D3FAA9D36A78C6C8FDA59634AE8C604B4B88259BB28 +% B7D06D7BBD8FF4DD75ACFF004162F2BBED78B0E1753A832CD4327F9A7C7B5BB2 +% C1FE05AE6FBF6BFF00EDB46C6C460692D0CADDA83B581B13F9D5B9A2FC8B9BFB +% 9E933E87F39E8A8D911B9DD47AC754BFAAF5100E6E7BD8E3535BA064B7ECF486 +% 39DFE15F551450CDFF00D169CBB6FF00E6BD45E93F526870CC65A5C48B3ED16B +% 09DB2F639D57BDAD23D477B9DEA596FEFDB5D5FF0072172BD2FA68BEE630576F +% A4F0EDC04BF22E062A7574D67DEF7E47D0BBF49ECC3FE7B2A9C15E97F573A3BB +% A6E33ACBDA1995901BEA3038BF635BBBD2A5D6E9EB58CF52CF52EDBFF07FCC55 +% 424A7612492494FF00FFD2F5549249253CF7D68FABFF0055F268B3AA755C3DD7 +% D23DB918FB9992E7BB6D345553F1DD5D9917BECF4E9C5AADF53F49FA35C2E4F5 +% 3661D76B2DA3EDF994EFAB23A78AFED5563B590F7613C3856CCACBF6FA99BD4E +% EFF26E33FF0047D330723D3FD1749F5D7A9F52CCCFAFA27437554E6B008CAB1E +% 5B6B5D68B2BB5BD3298FD264D78CCB7D5CD67F43AAEBAA65B55CFB3D3E7F230C +% B2ACACAEB9946F65120D3539C7098F7FE8EBFB7E5BEFAF2BABE53D9E97EADEAF +% F83FD62CF4922247488DF792C9DE801AEB6931EFCEFDA15D7D53229C8C363C33 +% 0BA4E23EB661E457B3754FF4EDF4FD7C2AABB7F9CA3A6B2AC8B7F49FCD7A2B5B +% AE67E453D0FECD5B9CEA3D573336EC4A982B67B4BAAC5CAFB3D8FF00D5AFB1FF +% 00A4BD9E933F57F432FF004795F67B70BA2E4E3E3DB9165384324BFF00441C1A +% DC72F1F9D6DAEA5F4E2D357FC17ABB2BAFF4752DAEA3D4DDD4307131FA18A2DA +% 301CE7E6E2E23DB5B18F1FD15DBEE7D3859B4D0EDEFBB17ED6CFD73ECB91FA5A +% EAB2A5265C5C38AA20D91F6B1717171441D28D7EFF00F8CF0993539C5FBEF15B +% 291B9D5D55B8811F9D75B90E63BFEB752C8BBAAE3ED69A45B63AA3BCBDE1AD0E +% 27F36CDBBB756BAAB3A062D9EA37A9D79B65D66EB68A2C6B6963DAD875B73BA8 +% 5566563E5D0DF519FCCBF7D2A3D32CC365CCAFA7537E63041B29C67B1986C7FD +% 16B9F75ADDEFFF0084B37AA5A0BB04D74F958408C7420923A7F37170065DD7D4 +% 6AB5CD14002D632A77B6BD7F9B0D656FDAD64FE8B73FF43FE0D74EDEAACBBAB5 +% 54F54A2D38F750D37676D0368693B72AC7E3B1CC7D6EDDEFB3D0A2CC6FE777AC +% BEBF9D8B84D76331953F2EDDC6E6E35E6DA9A09FFB55B9BB773377E62CFC4B3A +% BDD857DB5DB8B8C368A4DD6BCD6F7899FD0BED3E9B94B8BDCF9A029920244588 +% 81127691F9BC5ECBAAF4BE92FE934F45AB25D9349B5D6E0DD5D6CBDB734B0B3E +% CD4E5FAB7E3FDA5AD637D47B3D3C9A3D2F655E865FA8AC7D4AFA96DCCE995DB6 +% 7516BEB63BD3C8AEBAE6EAEC60FD2E1DAEB9F6D0C7635DF47F57BBD7A7D2B3F9 +% 9F4960F4AE946EC62D17FDAAEC96B6BCA2D756CABD6AC3DF8D55198CB2BF4DBE +% EF7DDB3F4967AAB4FEAA75FCBE97D7AAB7A99ADADEA8598D7FA43F3E3D3664DF +% EED8EF4727F41F68FDCBAFF53D5FD0FA73F0C88E23BF567040A1B7F2EEFA574D +% E8FD3FA6348C5ACFA8F1166458E365CFFF008DC8B4BED7FF005377A75FF83575 +% 249317A92492494FFFD3F5540CDCBA7070EFCDBE7D1C6ADF759024EDADA6C7ED +% 1FD56A3AC6FADED73FEAEE5D4D0E70BFD3A5ED67D2732DB6AA2D637FAF558F6A +% 205903BA09A04F67CF7033735DD49EFCCBC56FB817E4B2A8B5F73277E5BED716 +% 8AFECD7DFF00AB50C6DB5E27A18FFA0F52BF52EB639FD5FA4F53EA95BDF7D74B +% F56E363068BACAC47BF3B2AF6B7ECD4E43F6ECA7171BF9AAD6565E065E7B6CCB +% EA00B6ECB3AD4C97319B0B6BA316B69FA0DA59ECD8D51ADDD3FA45B4D74B9A5C +% 4137BDCD0D0D703F45EF8F7395D8E2BE136234D2965AE214657FB1EB3A2FD5AC +% 1CE65561C3765C1871B1CD74FF00C3653ACFFA152E94748E9B896558B9D9D4D3 +% EAB837170DA2AA019D19556C76EB2E589F54BEB1DB957B28B2C2719C4CFBAAAD +% BFD7DC18CB9FB7F777AA37D79D5B5ECCEE9B7FA5937D97752CDC50C7E2DAF7B9 +% E5CE65949BADFB1B58D63297E5329F43FED5FE9941CD66CB8F4034FD8BB1C61C +% 3C422724AF500FC81EA3EB5D5F57A707F6BE0D9D42DAF78C4631AE2D13E9FAA2 +% FDAEAB1BD37EDABD97FF00DB6B88C5E875E063D9FB2F3701F1FCF65F546BEA35 +% C0F7BAA6FAD761DBFF0007B28A3FEBCB7BA3F59C3C8C3C5E9E3A7D995D1AA7B6 +% 8A6F6D6E6B68630399F68BB3BDBD3F32B63BDB63E9BBD7FF0083CAB568F55C1E +% 974D03A87567557E257B431CCADD90F74FD06D7454C737FB7B2C55E1EDE404CE +% C3626090008F144F4F95F27C9AB273DD90CA328DD8EF2DFB4E5340AABB4D5BFD +% 1F4F1696EF7B6BF51DFA4BBFF0244FB062605943F20B03EC6EDADA185EE04705 +% ACB0EE5DD1FACBF563A858DB3A6DD461BAB7FA577DB5CEAB68076B2C6D78D5D9 +% 89E959FE96DC9ABFE13629E67D54C4A1B9199BEA3601B9D977B0D74B43BFD1DB +% 7FB6EFE47A2AD619E28815F9316486422AA8741178FC2A1D8C0E5E53DE5F6383 +% 7F492DB1D3F4767A7BB62D7CEFD99574AC2A32697DADBF7FDA5CDB87A8CAD8E1 +% 8FE8E39B9B5D76DF6FDA5CFB3D4B6AA6AABFE16C5BBD12AE9991655563E3E466 +% 565C19F6A35B4540BBDAEB3DCFF57D26CFEE2E33EB4F561922B6FA5B1A379C0A +% BE8FA55FABFE135B7ED19190CAAAFB4BFD6B3D6B595D389FA2AFF4ADE672C741 +% 0DEC52DC6271167524D01FCBFAAFAEFD55EA87ABFD5DC0CF738D96DB486DEF23 +% 693757FA0C9F60FF00BB15DAB55711FE2872326DFAAF757907F98CCB5958F06B +% 9B4E4B9BFF006EE45ABB75036D4924924A7FFFD4F5558DF5BDF6D7F56F3ADA49 +% 6BEA636D2F01C4B5B5BD965B6B3D27D36FA9556C7D95FA76D6FDEB6557EA1875 +% 67E064E0DD22ACBA5F45846876D8D756E8FECB920A7C9EEA6ACA38EE3906D662 +% D4CB5F75EDF4FDD73836D77A34BBDAFF006EC7596FBFD8B9FBDAD63ADBECA9E6 +% BAEE7578F5B8B29AC1ECED9EEB2DDCBB1A73AA181D3F1AFE97567754CE0FC67D +% 15B8627A2CC670AF2AA7DF93BB7E6E265BF7FA0CF57F55F52FBBF43E9AC7B7A1 +% 0A3AADE3A9EF7673CB9D8E5CC1B5CD0760FB3501D67B9D5ED77D3FE5AB98720E +% 2E1EDDDA99B1CB8788F5EDFCA2D06750EAD7DADA2BDAC635BEE0E240D7F77D3D +% BB96DF4EB5F80D6E665DB2FA3FA3B48343371FF876BFD472BB8FD1FA87A6D751 +% 8CD6318D906DF7DA5C78F6FB58CFEA6E552EFAB5998E0E6752C865CEB6093686 +% B4B5AEF6B5B4D13F9AAC4CE396FA9FDE916B43DC8EDE91FBB10A1D6BAE751C81 +% 5636539A376E7D8DCB018C6F01B4D3634AE9B05BD4322E6E4BBA8E7166303EF6 +% 369B19FCADDEDF771FB8B98FB25188064DD6597D6E3B69A890DAE7FE118D1B95 +% DBE9C9C8A98DC9CDAB171DBEEB035E71E96B40ED57D3B1CA0963801A533C72CC +% CB5B010F59C56E3D95E2F4ECEA9D80E712CC5EA356512D2E3B8D2D6D1558FEA1 +% 539CE73EBB2EFD255FCDDD7DDFA351E9FD2F1307A6754CDEA783FB50E316E4D3 +% 82C16E26234B22A3E85777E8D8E731CFB3F494FAD91FCDD14BEC57F13AEF4AC2 +% C607A6D2FCDA1CE0D2E61735D69F065D99B1EDABFA8A97D64CEEB228FB65B7D6 +% DC5DE0D75BDBB6BC279DD6578D663D363AAC8B7F47EAE1755B3FED47A95FEA17 +% 7A75AA73C631DCA313E619C480B908EA770373E6D6EA9D5B2998EEC379AFA763 +% 3C7E93030B7B5CFD1D355F6B36E5DBB98FD8FF0052EC7FFC28B98C8B85A1F940 +% 9194EC8D9556D7EFA68A7D36D755BE87B76BFF0048FF0041BBBF45E97A5E9A06 +% 4D97D871AEF42F73322C2DC7810EBDE0ECDB5D7B9EE6B77FE6318AE61747B71B +% 09FD43A8BEBC375B3914D17822D35CBB1DD9505BE937D5BACF4B11B77E93F476 +% 5D4D1E9FE99478ACCAE66FCD18C4F52753AD7689FEAC5F48FF0014B5399F56F2 +% 2D8229BF32C763B9D12EAD95D18BBFFCFC7B176CB17EA6F4B7F49FAAFD3B06D0 +% E6DCDA459736CFA4DB2E2ECABEB3FF001575CFAD6D2909B24B30D8292492412F +% FFD5F5549249253E7FF59FA2BA8EB36D54322BEA85B97845D5B1F43336B0E666 +% 36E6E8EAA9C8A1FF006AB1FF00E9BED19DFF0068D71BD3BAFF0059E997BF1ABC +% DBFA6D588F7369C41B6EDAE2FDB94CBB0DFBE86FA567A9B6B6FD9FD25ECDD57A +% 5E3F54C3762DC5D59FA555F512CB6A7C1636EA2D6FBEBB36BDECFE5D6FB2AB3F +% 45658BC83AF62752C0CDFB0756B6F168975D9CFDF683496B68B3305EDFD25DED +% AF1EADF657FAAFF84FD37F3CD98BA901AEC4FF00D12C538906E3609D3FDF76F1 +% FEB7579F9197D3B2E8CAEA179B3ED347D8E9DAD732B6EEDB9955C5DE87BB657E +% BD3EA63FBEAB6DF47F49BF732EDE91D3F16EEA8CC68CE636B376156F66EA6B2E +% 6B2FC9B6CC6AAFB594E356FF005AFB3659FF004D79C63F4FCDF4DBD5F019916B +% 6A314D992E360158DD53AEAE9A19FA6F4B73FDDBBD3FF825D1F40FACAFE9186F +% C3A319F9E64D6E360FB33741EE6B31EB190CBB9FF0FE9A9E10C9C3E202B8A028 +% 4883D24D8CFC8C7AADAF26CCA63A9B9C7D0C5E9CDF5CD8D9735B7DD9DBF73B7E +% DFCC585D7F21DD41CE755EAE3328FE75D75D1BDDE544D97B96F7526331B0307A +% 93BA3E253EAD8EA48B6B326297E4D57D7F637E135DBFECF7FDA7FC1FF33F6654 +% 3A7750AF39AD03A636BA32ED34E26563D37D4031822FCADB6372B0B231FD7FD5 +% BFE50FB431FF00E0D18E500F0CAEC782D30B97A2B6E2FA3CD60559AF2E79B5CF +% B1876B0D9EF0D1FF00042C236FF9AB77173B330996578D8B45965B5BA9393635 +% CE7FE91A6BB5B8D5D1B37BFD377F38F7A2751A5D4877D9F19F4575CD6FA4B4B9 +% FBBFD23DCCB2AA68639DFE95DEA2A1665518321FB32B318C00D4C6B9DB77F6B2 +% DDEFAA9FEDFF00EC3298CA128D57F6B1819233BBEBA7F55B7D331B2BA7E47DA9 +% D96F7E4DB532B69F49AEB98D67E869A6BB1AF7ECF53F3B66CF5BFC3AB9D23A4D +% 3D73EB0E1F4BC661FD8D82FF00B5E550C0CFB392DF73BD59AF6E6BB3733F47F4 +% 28C5A71BEDB8DD3EAB31FF004EB0DB89D4FAC64D54301C8B321C594E2E382CAB +% DA36DAEB2C77E652D3B2D7B99FABB3F9CAFF004F532CF5DFAAFF0056707EAEF4 +% FF00B3E3B41C8BA1F9778E6CB23B6EF7368ABE863D5F98CFF497D975D6D69803 +% 402BC1B10DBC3F96CECA492498BD4924924A7FFFD6F5549249252952EA9D2713 +% AAE31A32439AE1269BEB3B6DA9C46DF571EDFF0006FF00FC0EDAFF00437B2DA6 +% CB2B5752494F997D6BE8DF5C7A66396E2DCEBBA73A03ECC16BAAF4F46FDA6FBF +% A762EC7DBEB3C7ADEA3B272E967A6FFD16262DDE9ACCE85D7BA735CCF4AAC7AE +% F757635D9F5D0E70F5D83FA6578D3E93EF636CAAEBB1BF9A7BFF0098F4D7B02C +% AEABF55BEAF75871B3A8605375CE2D27200F4EEF6FD0FD6A8F4F23DB1FE95189 +% A24EBAF62B4C7EBFDEF57FD27C67AA5DD5E8C99CBB5F55F631AE75D90F739EE6 +% 387A83D3B7F3E9B367F38FB3DFB3F9AFF06A855D63A97DA19958F66497B8906C +% A8BE96991B36D6FA9DEDFF0037DEBD6F23FC58740BEFF546466D4D6886542E16 +% 359F4B5ADF975E4DEDDAE7EEFE79059FE2A3A00205D9BD4322A9F7D365CC0C7C +% F6B7D1A29B5DC7FA451FB601D18FDAA363F3D5F361F597AC0AAAFB5E6D8EAEB6 +% 6D6E27AA58CB23F372F65953EDC777F85DBFA7C9FF00C11747D1BEABE5F5CD8F +% C4C72709E5B65B9F91BA8C7B090DDDF67C46B6ACDC8AAA63FF0045FA4A2AC8FC +% FCCA7FC27A074AFA97F557A4383F03A6D2CB1AFF005196D80DD635C349AAFC93 +% 75B57FD6DEB6D3E371BA3BB208F7F579B95D03EAEE0F43C7D94FE9B25E22ECA7 +% B5A1EE03E8D4C6D6D65746355FE031286B28ABFE37D5B2CD5492497292492494 +% A49249253FFFD9003842494D0421000000000079000000010100000018004100 +% 64006F00620065002000500068006F0074006F00730068006F00700020004500 +% 6C0065006D0065006E007400730000001C00410064006F006200650020005000 +% 68006F0074006F00730068006F007000200045006C0065006D0065006E007400 +% 7300200032002E003000000001003842494D042200000000012E4D4D002A0000 +% 00080007011200030000000100010000011A00050000000100000062011B0005 +% 000000010000006A012800030000000100020000013100020000001D00000072 +% 01320002000000140000008F8769000400000001000000A4000000D000000048 +% 00000001000000480000000141646F62652050686F746F73686F7020456C656D +% 656E747320322E3000323030363A31303A30392032323A31303A313900000003 +% A001000300000001FFFF0000A00200040000000100000156A003000400000001 +% 000001830000000000000006010300030000000100060000011A000500000001 +% 0000011E011B0005000000010000012601280003000000010002000002010004 +% 000000010000012E020200040000000100000000000000000000004800000001 +% 00000048000000013842494D03FD0000000000070000000000000000 +%EndPhotoshop +%begin_xml_code +/pdfmark where {pop true} {false} ifelse +/currentdistillerparams where {pop currentdistillerparams +/CoreDistVersion get 5000 ge } {false} ifelse +and not {userdict /pdfmark /cleartomark load put} if +[/NamespacePush pdfmark +[/_objdef {photoshop_metadata_stream} /type /stream /OBJ pdfmark +/MetadataString 5038 string def % exact length of metadata +/TempString 100 string def +/ConsumeMetadata { +currentfile TempString readline pop pop +currentfile MetadataString readstring pop pop +} bind def +ConsumeMetadata +%begin_xml_packet: 5038 +<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?> <?adobe-xap-filters esc="CR"?> <x:xapmeta xmlns:x='adobe:ns:meta/' x:xaptk='XMP toolkit 2.8.2-33, framework 1.5'> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'> @@ -61,7 +598,77 @@ -<?xpacket end='w'?>
%end_xml_packet
[{photoshop_metadata_stream} 2 dict begin /Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark
[{photoshop_metadata_stream} MetadataString /PUT pdfmark
[/_objdef {nextImage} /NI pdfmark
%end_xml_code
gsave % EPS gsave
/hascolor
/deviceinfo where
{pop deviceinfo /Colors known
{deviceinfo /Colors get exec 1 gt}
{false} ifelse}
{/statusdict where
{pop statusdict /processcolors known
{statusdict /processcolors get exec 1 gt}
{false} ifelse}
{false} ifelse}
ifelse
def
40 dict begin
/_image systemdict /image get def
/_setgray systemdict /setgray get def
/_currentgray systemdict /currentgray get def
/_settransfer systemdict /settransfer get def
/_currenttransfer systemdict /currenttransfer get def
/blank 0 _currenttransfer exec
1 _currenttransfer exec eq def
/negative blank
{0 _currenttransfer exec 0.5 lt}
{0 _currenttransfer exec 1 _currenttransfer exec gt}
ifelse def
/inverted? negative def
/level2 systemdict /languagelevel known
{languagelevel 2 ge} {false} ifelse def
/level3 systemdict /languagelevel known
{languagelevel 3 ge} {false} ifelse def
level2 {/band 0 def} {/band 5 def} ifelse
gsave % Image Header gsave
/rows 387 def
/cols 342 def
342 387 scale
level2 {
/DeviceRGB
setcolorspace currentdict /PhotoshopDuotoneColorSpace undef currentdict /PhotoshopDuotoneAltColorSpace undef } if
/beginimage level2
{/image load def}
{{pop .9 setgray 0 0 moveto 0 1 lineto
1 1 lineto 1 0 lineto fill 0 setgray
0 1 translate 1 cols div 1 rows div scale
/ratio {cols 400 div mul} def
/Helvetica findfont 15 ratio scalefont setfont
5 ratio -20 ratio moveto
(Mit JPEG komprimierte Bilder ben\232tigen PostScript Level 2) show
/x 128 string def
{currentfile x readline {} {pop exit} ifelse
(~>) search {pop pop pop exit} {pop} ifelse
} loop } def}
ifelse
12 dict begin
/ImageType 1 def
/Width cols def
/Height rows def
/ImageMatrix [cols 0 0 rows neg 0 rows] def
/BitsPerComponent 8 def
/Decode [0 1 0 1 0 1] def
/DataSource currentfile /ASCII85Decode filter
/DCTDecode filter def
currentdict end
%%BeginBinary: 21006
beginimage
s4IA0!"_al8O`[\!W`9l!([(is6]js6"FnCAH67k!!!!"s4[O,!"obO%M0*b&.fQt +<?xpacket end='w'?> +%end_xml_packet +[{photoshop_metadata_stream} 2 dict begin /Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark +[{photoshop_metadata_stream} MetadataString /PUT pdfmark +[/_objdef {nextImage} /NI pdfmark +%end_xml_code +gsave % EPS gsave +/hascolor +/deviceinfo where +{pop deviceinfo /Colors known +{deviceinfo /Colors get exec 1 gt} +{false} ifelse} +{/statusdict where +{pop statusdict /processcolors known +{statusdict /processcolors get exec 1 gt} +{false} ifelse} +{false} ifelse} +ifelse +def +40 dict begin +/_image systemdict /image get def +/_setgray systemdict /setgray get def +/_currentgray systemdict /currentgray get def +/_settransfer systemdict /settransfer get def +/_currenttransfer systemdict /currenttransfer get def +/blank 0 _currenttransfer exec +1 _currenttransfer exec eq def +/negative blank +{0 _currenttransfer exec 0.5 lt} +{0 _currenttransfer exec 1 _currenttransfer exec gt} +ifelse def +/inverted? negative def +/level2 systemdict /languagelevel known +{languagelevel 2 ge} {false} ifelse def +/level3 systemdict /languagelevel known +{languagelevel 3 ge} {false} ifelse def +level2 {/band 0 def} {/band 5 def} ifelse +gsave % Image Header gsave +/rows 387 def +/cols 342 def +342 387 scale +level2 { +/DeviceRGB +setcolorspace currentdict /PhotoshopDuotoneColorSpace undef currentdict /PhotoshopDuotoneAltColorSpace undef } if +/beginimage level2 +{/image load def} +{{pop .9 setgray 0 0 moveto 0 1 lineto +1 1 lineto 1 0 lineto fill 0 setgray +0 1 translate 1 cols div 1 rows div scale +/ratio {cols 400 div mul} def +/Helvetica findfont 15 ratio scalefont setfont +5 ratio -20 ratio moveto +(Mit JPEG komprimierte Bilder ben\232tigen PostScript Level 2) show +/x 128 string def +{currentfile x readline {} {pop exit} ifelse +(~>) search {pop pop pop exit} {pop} ifelse +} loop } def} +ifelse +12 dict begin +/ImageType 1 def +/Width cols def +/Height rows def +/ImageMatrix [cols 0 0 rows neg 0 rows] def +/BitsPerComponent 8 def +/Decode [0 1 0 1 0 1] def +/DataSource currentfile /ASCII85Decode filter +/DCTDecode filter def +currentdict end +%%BeginBinary: 21006 +beginimage +s4IA0!"_al8O`[\!W`9l!([(is6]js6"FnCAH67k!!!!"s4[O,!"obO%M0*b&.fQt '+km!,8q:3)C$FB(Ddl(+qY4l$k*OQ&I]'V$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ $iq%U',DH$)]';0'FkT_'GM#e%Ls0b$k*OQ$kX'[$k*OQ$kWmV$k*OQ$k*OQ$k*OQ $k*OQ$k*OQ$k*OQ$k30O!"fJ;K)o!T!?qLF&HMtG!WUsU"995;_uW(&!!*6(!<E3% @@ -378,4 +985,9 @@ P"KeukZoD(0?%Inm@+%To>d`-]BZ:eT4b-1P?\XtIBLQ#Ou?0'_*:r(p6IVgL7U\d e<718C=1KkIR!E`os"4GNSjHmdoMW',cN&P8P2Q"P#@H7,a>*f8L5f2P"A8;,a)&g 8L0OrP"?rK,a(_ps4?ZO?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrk Vqb0V*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrk -Vqb0V*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrkVuPE~>
%%EndBinary
grestore end % Image Trailer grestore
grestore % EPS grestore
[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT pdfmark
[/NamespacePop pdfmark
\ No newline at end of file +Vqb0V*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrkVuPE~> +%%EndBinary +grestore end % Image Trailer grestore +grestore % EPS grestore +[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT pdfmark +[/NamespacePop pdfmark diff --git a/Master/texmf-dist/doc/generic/pgf/macros/pgfmanual-en-macros.tex b/Master/texmf-dist/doc/generic/pgf/macros/pgfmanual-en-macros.tex index 9bfa33d0364..116cde6d9bf 100644 --- a/Master/texmf-dist/doc/generic/pgf/macros/pgfmanual-en-macros.tex +++ b/Master/texmf-dist/doc/generic/pgf/macros/pgfmanual-en-macros.tex @@ -7,10 +7,13 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -% $Header: /cvsroot/pgf/pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex,v 1.28 2008/02/20 11:00:42 tantau Exp $ +% $Header: /cvsroot/pgf/pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex,v 1.45 2009/11/15 13:13:24 ludewich Exp $ + \providecommand\href[2]{\texttt{#1}} +\providecommand\hypertarget[2]{\texttt{#1}} +\providecommand\hyperlink[2]{\texttt{#1}} \colorlet{examplefill}{yellow!80!black} @@ -28,6 +31,7 @@ \pgfmanualentryheadline{\texttt{\string\pgfpagesuselayout\char`\{\declare{#1}\char`\}}\oarg{options}} \index{#1@\protect\texttt{#1} layout}% \index{Page layouts!#1@\protect\texttt{#1}}% + \pgfmanualpdflabel{#1}{}% \pgfmanualbody } { @@ -44,55 +48,152 @@ \end{pgfmanualentry} } +\newenvironment{commandlist}[1]{% + \begin{pgfmanualentry} + \foreach \xx in {#1} {% + \expandafter\extractcommand\xx\@@ + }% + \pgfmanualbody +}{% + \end{pgfmanualentry} +}% + +% \begin{internallist}[register]{\pgf@xa} +% \end{internallist} +% +% \begin{internallist}[register]{\pgf@xa,\pgf@xb} +% \end{internallist} +\newenvironment{internallist}[2][register]{% + \begin{pgfmanualentry} + \foreach \xx in {#2} {% + \expandafter\extractinternalcommand\expandafter{\xx}{#1}% + }% + \pgfmanualbody +}{% + \end{pgfmanualentry} +}% +\def\extractinternalcommand#1#2{% + \pgfmanualentryheadline{Internal #2 \declare{\texttt{\string#1}}}% + \removeats{#1}% + \index{Internals!\strippedat @\protect\myprintocmmand{\strippedat}}% + \index{\strippedat @\protect\myprintocmmand{\strippedat}}% + \pgfmanualpdflabel{\textbackslash\strippedat}{}% +} + %% MW: START MATH MACROS -\def\mvar#1{{\rmfamily\textit{#1}}} +\def\mvar#1{{\ifmmode\textrm{\textit{#1}}\else\rmfamily\textit{#1}\fi}} \makeatletter \def\extractmathfunctionname#1{\extractmathfunctionname@#1(,)\tmpa\tmpb} \def\extractmathfunctionname@#1(#2)#3\tmpb{\def\mathname{#1}} -\def\extractmathoperatorname{\begingroup\def\mvar##1{}\def\ {}\extractmathoperatorname@} -\def\extractmathoperatorname@#1{\xdef\mathname{#1}\endgroup} - \makeatother -\def\vskipspecial#1{\vskip#1\vskip0em} - \newenvironment{math-function}[1]{ + \def\mathdefaultname{#1} + \extractmathfunctionname{#1} + \edef\mathurl{{math:\mathname}}\expandafter\hypertarget\expandafter{\mathurl}{}% \begin{pgfmanualentry} - \extractmathfunctionname{#1} \pgfmanualentryheadline{\texttt{#1}}% \index{\mathname @\protect\texttt{\mathname} math function}% - \index{Math functions!\mathname @\protect\texttt{\mathname}} + \index{Math functions!\mathname @\protect\texttt{\mathname}}% \pgfmanualbody } { - \end{pgfmanualentry}\vskipspecial{-3em} + \end{pgfmanualentry} } -\newenvironment{math-operator}[1]{ +\def\pgfmanualemptytext{} +\def\pgfmanualvbarvbar{\char`\|\char`\|} + +\newenvironment{math-operator}[4][]{% \begin{pgfmanualentry} - \extractmathoperatorname{#1} - \pgfmanualentryheadline{\texttt{#1}}% - \index{\mathname @\protect\texttt{\mathname} math operator}% - \index{Math operators!\mathname @\protect\texttt{\mathname}} - \pgfmanualbody -} -{% - \end{pgfmanualentry}\vskipspecial{-3em} + \csname math#3operator\endcsname{#2}{#4} + \def\mathtest{#4}% + \ifx\mathtest\pgfmanualemptytext% + \def\mathtype{(#3 operator)} + \else% + \def\mathtype{(#3 operator; uses the \texttt{#4} function)} + \fi% + \pgfmanualentryheadline{\mathexample\hfill\mathtype}% + \def\mathtest{#1}% + \ifx\mathtest\pgfmanualemptytext% + \index{#2@\protect\texttt{#2} #3 math operator}% + \index{Math operators!#2@\protect\texttt{#2}}% + \fi% + \pgfmanualbody } +{\end{pgfmanualentry}} -\newenvironment{math-constant}[1]{ +\newenvironment{math-operators}[5][]{% \begin{pgfmanualentry} - \pgfmanualentryheadline{\texttt{#1}}% - \index{#1@\protect\texttt{#1} math constant}% - \index{Math constants!#1@\protect\texttt{#1}} - \pgfmanualbody + \csname math#4operator\endcsname{#2}{#3} + \def\mathtest{#5}% + \ifx\mathtest\pgfmanualemptytext% + \def\mathtype{(#4 operators)} + \else% + \def\mathtype{(#4 operators; use the \texttt{#5} function)} + \fi% + \pgfmanualentryheadline{\mathexample\hfill\mathtype}% + \def\mathtest{#1}% + \ifx\mathtest\pgfmanualemptytext% + \index{#2#3@\protect\texttt{#2\protect\ #3} #4 math operators}% + \index{Math operators!#2#3@\protect\texttt{#2\protect\ #3}}% + \fi% + \pgfmanualbody } -{ - \end{pgfmanualentry}\vskipspecial{-3em} +{\end{pgfmanualentry}} + +\def\mathinfixoperator#1#2{% + \def\mathoperator{\texttt{#1}}% + \def\mathexample{\mvar{x}\space\texttt{#1}\space\mvar{y}}% +} + +\def\mathprefixoperator#1#2{% + \def\mathoperator{\texttt{#1}}% + \def\mathexample{\texttt{#1}\mvar{x}}% +} + +\def\mathpostfixoperator#1#2{% + \def\mathoperator{\texttt{#1}} + \def\mathexample{\mvar{x}\texttt{#1}}% +} + +\def\mathgroupoperator#1#2{% + \def\mathoperator{\texttt{#1\ #2}}% + \def\mathexample{\texttt{#1}\mvar{x}\texttt{#2}}% +} + +\expandafter\let\csname matharray accessoperator\endcsname=\mathgroupoperator +\expandafter\let\csname matharrayoperator\endcsname=\mathgroupoperator + +\def\mathconditionaloperator#1#2{% + \def\mathoperator{#1\space#2} + \def\mathexample{\mvar{x}\ \texttt{#1}\ \mvar{y}\ {\texttt{#2}}\ \mvar{z}} +} + +\newcommand\mathcommand[1][\mathdefaultname]{% + \expandafter\makemathcommand#1(\empty)\stop% + \expandafter\extractcommand\mathcommandname\@@% + \medskip } +\makeatletter + +\def\makemathcommand#1(#2)#3\stop{% + \expandafter\def\expandafter\mathcommandname\expandafter{\csname pgfmath#1\endcsname}% + \ifx#2\empty% + \else% + \@makemathcommand#2,\stop, + \fi} +\def\@makemathcommand#1,{% + \ifx#1\stop% + \else% + \expandafter\def\expandafter\mathcommandname\expandafter{\mathcommandname{\ttfamily\char`\{#1\char`\}}}% + \expandafter\@makemathcommand% + \fi} +\makeatother + \def\calcname{\textsc{calc}} %% MW: END MATH MACROS @@ -100,9 +201,12 @@ \def\extractcommand#1#2\@@{% \pgfmanualentryheadline{\declare{\texttt{\string#1}}#2}% \removeats{#1}% - \index{\strippedat @\protect\myprintocmmand{\strippedat}}} + \index{\strippedat @\protect\myprintocmmand{\strippedat}} + \pgfmanualpdflabel{\textbackslash\strippedat}{}% +} +% \begin{environment}{{name}\marg{arguments}} \renewenvironment{environment}[1]{ \begin{pgfmanualentry} \extractenvironement#1\@@ @@ -117,7 +221,9 @@ \pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}% \pgfmanualentryheadline{{\ttfamily\char`\\end\char`\{\declare{#1}\char`\}}}% \index{#1@\protect\texttt{#1} environment}% - \index{Environments!#1@\protect\texttt{#1}}} + \index{Environments!#1@\protect\texttt{#1}} + \pgfmanualpdflabel{#1}{}% +} \newenvironment{plainenvironment}[1]{ @@ -134,7 +240,8 @@ \pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}% \pgfmanualentryheadline{{\ttfamily\declare{\char`\\end#1}}}% \index{#1@\protect\texttt{#1} environment}% - \index{Environments!#1@\protect\texttt{#1}}} + \index{Environments!#1@\protect\texttt{#1}}% +} \newenvironment{contextenvironment}[1]{ @@ -159,6 +266,19 @@ \pgfmanualentryheadline{Shape {\ttfamily\declare{#1}}}% \index{#1@\protect\texttt{#1} shape}% \index{Shapes!#1@\protect\texttt{#1}} + \pgfmanualpdflabel{#1}{}% + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} + +\newenvironment{shading}[1]{ + \begin{pgfmanualentry} + \pgfmanualentryheadline{Shading {\ttfamily\declare{#1}}}% + \index{#1@\protect\texttt{#1} shading}% + \index{Shadings!#1@\protect\texttt{#1}} + \pgfmanualpdflabel{#1}{}% \pgfmanualbody } { @@ -166,6 +286,18 @@ } +\newenvironment{dataformat}[1]{ + \begin{pgfmanualentry} + \pgfmanualentryheadline{Format {\ttfamily\declare{#1}}}% + \index{#1@\protect\texttt{#1} format}% + \index{Formats!#1@\protect\texttt{#1}} + \pgfmanualpdflabel{#1}{}% + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} + \newenvironment{handler}[1]{ \begin{pgfmanualentry} \extracthandler#1\@nil% @@ -180,6 +312,7 @@ \pgfmanualentryheadline{Key handler \meta{key}{\ttfamily/\declare{#1}}#2}% \index{\gobble#1@\protect\texttt{#1} handler}% \index{Key handlers!#1@\protect\texttt{#1}} + \pgfmanualpdflabel{/handlers/#1}% } @@ -196,7 +329,29 @@ \end{pgfmanualentry} } - +\def\choicesep{$\vert$}% +\def\choicearg#1{\texttt{#1}} + +\newif\iffirstchoice + +% \mchoice{choice1,choice2,choice3} +\newcommand\mchoice[1]{% + \begingroup + \firstchoicetrue + \foreach \mchoice@ in {#1} {% + \iffirstchoice + \global\firstchoicefalse + \else + \choicesep + \fi + \choicearg{\mchoice@}% + }% + \endgroup +}% + +% \begin{key}{/path/x=value} +% \begin{key}{/path/x=value (initially XXX)} +% \begin{key}{/path/x=value (default XXX)} \newenvironment{key}[1]{ \begin{pgfmanualentry} \def\extrakeytext{} @@ -208,6 +363,49 @@ \end{pgfmanualentry} } +% \insertpathifneeded{a key}{/pgf} -> assign mykey={/pgf/a key} +% \insertpathifneeded{/tikz/a key}{/pgf} -> assign mykey={/tikz/a key} +% +% #1: the key +% #2: a default path (or empty) +\def\insertpathifneeded#1#2{% + \def\insertpathifneeded@@{#2}% + \ifx\insertpathifneeded@@\empty + \def\mykey{#1}% + \else + \insertpathifneeded@#2\@nil + \ifpgfutil@in@ + \def\mykey{#2/#1}% + \else + \def\mykey{#1}% + \fi + \fi +}% +\def\insertpathifneeded@#1#2\@nil{% + \def\insertpathifneeded@@{#1}% + \def\insertpathifneeded@@@{/}% + \ifx\insertpathifneeded@@\insertpathifneeded@@@ + \pgfutil@in@true + \else + \pgfutil@in@false + \fi +}% + +% \begin{keylist}[default path] +% {/path/option 1=value,/path/option 2=value2} +% \end{keylist} +\newenvironment{keylist}[2][]{% + \begin{pgfmanualentry} + \def\extrakeytext{}% + \foreach \xx in {#2} {% + \expandafter\insertpathifneeded\expandafter{\xx}{#1}% + \expandafter\extractkey\mykey\@nil% + }% + \pgfmanualbody +}{% + \end{pgfmanualentry} +}% + \def\extractkey#1\@nil{% \pgfutil@in@={#1}% \ifpgfutil@in@% @@ -263,7 +461,11 @@ \decompose#1/\nil% } -\def\keyalias#1{\vspace{-3pt}\item{\small alias {\ttfamily/#1/\myname}}\vspace{-2pt}\par} +% Introduces a key alias '/#1/<name of current key>' +% to be used inside of \begin{key} ... \end{key} +\def\keyalias#1{\vspace{-3pt}\item{\small alias {\ttfamily/#1/\myname}}\vspace{-2pt}\par + \pgfmanualpdflabel{/#1/\myname}{}% +} \newif\iffirsttime @@ -278,6 +480,13 @@ \def\myname{#1}% \else% \iffirsttime + \begingroup + % also make a pdf link anchor with full key path. + \def\hyperlabelwithoutslash##1/\nil{% + \pgfmanualpdflabel{##1}{}% + }% + \hyperlabelwithoutslash/#1/#2\nil + \endgroup \def\mypath{#1@\protect\texttt{/#1/}!}% \firsttimefalse \else @@ -288,12 +497,91 @@ \fi% } +\def\indexkey#1{% + \def\mypath{}% + \decompose#1/\nil% +} + +\newenvironment{predefinedmethod}[1]{ + \begin{pgfmanualentry} + \extractpredefinedmethod#1\@nil + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} +\def\extractpredefinedmethod#1(#2)\@nil{% + \pgfmanualentryheadline{Method \declare{\ttfamily #1}\texttt(#2\texttt) \hfill(predefined for all classes)} + \index{#1@\protect\texttt{#1} method}% + \index{Methods!#1@\protect\texttt{#1}} + \pgfmanualpdflabel{#1}{}% +} + + +\newenvironment{ooclass}[1]{ + \begin{pgfmanualentry} + \def\currentclass{#1} + \pgfmanualentryheadline{Class \declare{\texttt{#1}}} + \index{#1@\protect\texttt{#1} class}% + \index{Class #1@Class \protect\texttt{#1}}% + \index{Classes!#1@\protect\texttt{#1}} + \pgfmanualpdflabel{#1}{}% + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} + +\newenvironment{method}[1]{ + \begin{pgfmanualentry} + \extractmethod#1\@nil + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} +\def\extractmethod#1(#2)\@nil{% + \def\test{#1} + \ifx\test\currentclass + \pgfmanualentryheadline{Constructor \declare{\ttfamily #1}\texttt(#2\texttt)} + \else + \pgfmanualentryheadline{Method \declare{\ttfamily #1}\texttt(#2\texttt)} + \fi + \index{#1@\protect\texttt{#1} method}% + \index{Methods!#1@\protect\texttt{#1}} + \index{Class \currentclass!#1@\protect\texttt{#1}}% + \pgfmanualpdflabel{#1}{}% +} + +\newenvironment{attribute}[1]{ + \begin{pgfmanualentry} + \extractattribute#1\@nil + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} +\def\extractattribute#1=#2;\@nil{% + \def\test{#2}% + \ifx\test\@empty + \pgfmanualentryheadline{Private attribute \declare{\ttfamily #1} \hfill (initially empty)} + \else + \pgfmanualentryheadline{Private attribute \declare{\ttfamily #1} \hfill (initially {\ttfamily #2})} + \fi + \index{#1@\protect\texttt{#1} attribute}% + \index{Attributes!#1@\protect\texttt{#1}} + \index{Class \currentclass!#1@\protect\texttt{#1}}% + \pgfmanualpdflabel{#1}{}% +} + + \newenvironment{predefinednode}[1]{ \begin{pgfmanualentry} \pgfmanualentryheadline{Predefined node {\ttfamily\declare{#1}}}% \index{#1@\protect\texttt{#1} node}% \index{Predefined node!#1@\protect\texttt{#1}} + \pgfmanualpdflabel{#1}{}% \pgfmanualbody } { @@ -305,6 +593,7 @@ \pgfmanualentryheadline{Coordinate system {\ttfamily\declare{#1}}}% \index{#1@\protect\texttt{#1} coordinate system}% \index{Coordinate systems!#1@\protect\texttt{#1}} + \pgfmanualpdflabel{#1}{}% \pgfmanualbody } { @@ -345,6 +634,23 @@ \ifx\pgfmanualtest\@empty% \index{#2@\protect\texttt{#2} path operation}% \index{Path operations!#2@\protect\texttt{#2}}% + \pgfmanualpdflabel{#2}{}% + \fi% + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} +\newenvironment{datavisualizationoperation}[3][]{ + \begin{pgfmanualentry} + \pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\datavisualization}\ + \ \dots} + \declare{\texttt{#2}}#3\ \textcolor{gray}{\dots\texttt{;}}}% + \def\pgfmanualtest{#1}% + \ifx\pgfmanualtest\@empty% + \index{#2@\protect\texttt{#2} (data visualization)}% + \index{Data visualization!#2@\protect\texttt{#2}}% + \pgfmanualpdflabel{#2}{}% \fi% \pgfmanualbody } @@ -356,7 +662,9 @@ \def\extractcommand#1#2\@@{% \pgfmanualentryheadline{\declare{\texttt{\string#1}}#2}% \removeats{#1}% - \index{\strippedat @\protect\myprintocmmand{\strippedat}}} + \index{\strippedat @\protect\myprintocmmand{\strippedat}} + \pgfmanualpdflabel{\textbackslash\strippedat}{}% +} \def\doublebs{\texttt{\char`\\\char`\\}} @@ -383,6 +691,7 @@ \index{Modules!#1@\protect\texttt{#1}}% \pgfmanualentryheadline{{\ttfamily\char`\\usepgfmodule[\declare{#1}]\space\space \char`\%\space\space Con\TeX t\space and pure pgf}} \pgfmanualbody + \pgfmanualpdflabel{#1}{}% } { \end{pgfmanualentry} @@ -400,6 +709,7 @@ \pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t\space when using \tikzname}} \pgfmanualbody + \pgfmanualpdflabel{#1}{}% } { \end{pgfmanualentry} @@ -412,6 +722,7 @@ \index{Libraries!#1@\protect\texttt{#1}}% \pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}} \pgfmanualbody + \pgfmanualpdflabel{#1}{}% } { \end{pgfmanualentry} @@ -454,6 +765,7 @@ \def\beamer{\textsc{beamer}} \def\pdf{\textsc{pdf}} +\def\eps{\texttt{eps}} \def\pgfname{\textsc{pgf}} \def\tikzname{Ti\emph{k}Z} \def\pstricks{\textsc{pstricks}} @@ -560,6 +872,28 @@ \draw (0pt,.5ex) -- (1cm,.5ex); \end{tikzpicture} } +\newcommand\symarrowdouble[1]{ + \index{#1@\protect\texttt{#1} arrow tip}% + \index{Arrow tips!#1@\protect\texttt{#1}} + \texttt{#1}& yields thick + \begin{tikzpicture}[arrows={#1-#1},thick,baseline] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw (0pt,.5ex) -- (1cm,.5ex); + \end{tikzpicture} + and thin + \begin{tikzpicture}[arrows={#1-#1},thin,baseline] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw (0pt,.5ex) -- (1cm,.5ex); + \end{tikzpicture}, double + \begin{tikzpicture}[arrows={#1-#1},thick,baseline] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex); + \end{tikzpicture} and + \begin{tikzpicture}[arrows={#1-#1},thin,baseline] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex); + \end{tikzpicture} +} \newcommand\sarrow[2]{ \index{#1@\protect\texttt{#1} arrow tip}% @@ -577,6 +911,30 @@ \end{tikzpicture} } +\newcommand\sarrowdouble[2]{ + \index{#1@\protect\texttt{#1} arrow tip}% + \index{Arrow tips!#1@\protect\texttt{#1}} + \index{#2@\protect\texttt{#2} arrow tip}% + \index{Arrow tips!#2@\protect\texttt{#2}} + \texttt{#1-#2}& yields thick + \begin{tikzpicture}[arrows={#1-#2},thick,baseline] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw (0pt,.5ex) -- (1cm,.5ex); + \end{tikzpicture} and thin + \begin{tikzpicture}[arrows={#1-#2},thin,baseline] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw (0pt,.5ex) -- (1cm,.5ex); + \end{tikzpicture}, double + \begin{tikzpicture}[arrows={#1-#2},thick,baseline] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex); + \end{tikzpicture} and + \begin{tikzpicture}[arrows={#1-#2},thin,baseline] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex); + \end{tikzpicture} +} + \newcommand\carrow[1]{ \index{#1@\protect\texttt{#1} arrow tip}% \index{Arrow tips!#1@\protect\texttt{#1}} @@ -617,11 +975,16 @@ \catcode`\\=12 |gdef|find@example#1\end{codeexample}[|endofcodeexample[#1]] |endgroup +% define \returntospace. +% +% It should define NEWLINE as {}, spaces and tabs as \space. \begingroup \catcode`\^=7 \catcode`\^^M=13 +\catcode`\^^I=13 \catcode`\ =13% -\gdef\returntospace{\catcode`\ =13\def {\space}\catcode`\^^M=13\def^^M{}}% +\gdef\returntospace{\catcode`\ =13\def {\space}\catcode`\^^I=13\def^^I{\space}} +\gdef\showreturn{\show^^M} \endgroup \begingroup @@ -634,19 +997,86 @@ \gdef\@typeset@till@return#1^^M{{\def%{\char`\%}\textsl{\char`\%#1}}\par} \endgroup -\define@key{codeexample}{width}{\setlength\codeexamplewidth{#1}} -\define@key{codeexample}{graphic}{\colorlet{graphicbackground}{#1}} -\define@key{codeexample}{code}{\colorlet{codebackground}{#1}} -\define@key{codeexample}{execute code}{\csname code@execute#1\endcsname} -\define@key{codeexample}{code only}[]{\code@executefalse} -\define@key{codeexample}{pre}{\def\code@pre{#1}} -\define@key{codeexample}{post}{\def\code@post{#1}} -\define@key{codeexample}{vbox}[]{\def\code@pre{\vbox\bgroup\setlength{\hsize}{\linewidth-6pt}}\def\code@post{\egroup}} -\define@key{codeexample}{ignorespaces}[]{\let\@gobble@till@return=\@gobble@till@return@ignore} -\define@key{codeexample}{leave comments}[]{\def\code@catcode@hook{\catcode`\%=12}\let\commenthandler=\relax\let\typesetcomment=\relax} - -\def\code@pre{} -\def\code@post{} +% Define tab-implementation functions +% \codeexample@tabinit@replacementchars@ +% and +% \codeexample@tabinit@catcode@ +% +% They should ONLY be used in case that tab replacement is active. +% +% This here is merely a preparation step. +% +% Idea: +% \codeexample@tabinit@catcode@ will make TAB active +% and +% \codeexample@tabinit@replacementchars@ will insert as many spaces as +% /codeexample/tabsize contains. +{ +\catcode`\^^I=13 +% ATTENTION: do NOT use tabs in these definitions!! +\gdef\codeexample@tabinit@replacementchars@{% + \begingroup + \count0=\pgfkeysvalueof{/codeexample/tabsize}\relax + \toks0={}% + \loop + \ifnum\count0>0 + \advance\count0 by-1 + \toks0=\expandafter{\the\toks0\ }% + \repeat + \xdef\codeexample@tabinit@replacementchars@@{\the\toks0}% + \endgroup + \let^^I=\codeexample@tabinit@replacementchars@@ +}% +\gdef\codeexample@tabinit@catcode@{\catcode`\^^I=13}% +}% + +% Called after any options have been set. It assigns +% \codeexample@tabinit@catcode +% and +% \codeexample@tabinit@replacementchars +% which are used inside of +%\begin{codeexample} +% ... +%\end{codeexample} +% +% \codeexample@tabinit@catcode is either \relax or it makes tab +% active. +% +% \codeexample@tabinit@replacementchars is either \relax or it inserts +% a proper replacement sequence for tabs (as many spaces as +% configured) +\def\codeexample@tabinit{% + \ifnum\pgfkeysvalueof{/codeexample/tabsize}=0\relax + \let\codeexample@tabinit@replacementchars=\relax + \let\codeexample@tabinit@catcode=\relax + \else + \let\codeexample@tabinit@catcode=\codeexample@tabinit@catcode@ + \let\codeexample@tabinit@replacementchars=\codeexample@tabinit@replacementchars@ + \fi +} + +\pgfqkeys{/codeexample}{% + width/.code= {\setlength\codeexamplewidth{#1}}, + graphic/.code= {\colorlet{graphicbackground}{#1}}, + code/.code= {\colorlet{codebackground}{#1}}, + execute code/.is if=code@execute, + code only/.code= {\code@executefalse}, + pre/.store in=\code@pre, + post/.store in=\code@post, + % #1 is the *complete* environment contents as it shall be + % typeset. In particular, the catcodes are NOT the normal ones. + typeset listing/.code= {#1}, + render instead/.store in=\code@render, + vbox/.code= {\def\code@pre{\vbox\bgroup\setlength{\hsize}{\linewidth-6pt}}\def\code@post{\egroup}}, + ignorespaces/.code= {\let\@gobble@till@return=\@gobble@till@return@ignore}, + leave comments/.code= {\def\code@catcode@hook{\catcode`\%=12}\let\commenthandler=\relax\let\typesetcomment=\relax}, + tabsize/.initial=0,% FIXME : this here is merely used for indentation. It is just a TAB REPLACEMENT. + every codeexample/.style={width=4cm+7pt}, +} + +\let\code@pre\pgfutil@empty +\let\code@post\pgfutil@empty +\let\code@render\pgfutil@empty \def\code@catcode@hook{} \newdimen\codeexamplewidth @@ -655,8 +1085,8 @@ \def\codeexample[#1]{% \begingroup% \code@executetrue - \setlength\codeexamplewidth{4cm+7pt} - \setkeys{codeexample}{#1}% + \pgfqkeys{/codeexample}{every codeexample,#1}% + \codeexample@tabinit% assigns \codeexample@tabinit@[catcode,replacementchars] \parindent0pt \begingroup% \par% @@ -668,21 +1098,28 @@ \catcode`\%=13% \catcode`\^^M=13% \code@catcode@hook% + \codeexample@tabinit@catcode \relax% \find@example} \def\endofcodeexample#1{% \endgroup% \ifcode@execute% \setbox\codeexamplebox=\hbox{% + \ifx\code@render\pgfutil@empty% {% {% \returntospace% \commenthandler% \xdef\code@temp{#1}% removes returns and comments }% + \catcode`\^^M=9% \colorbox{graphicbackground}{\color{black}\ignorespaces% \code@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@post\ignorespaces}% }% + \else% + \colorbox{graphicbackground}{\color{black}\ignorespaces% + \code@render}% + \fi% }% \ifdim\wd\codeexamplebox>\codeexamplewidth% \def\code@start{\par}% @@ -725,6 +1162,7 @@ \frenchspacing\@vobeyspaces \normalfont\ttfamily\footnotesize \typesetcomment% + \codeexample@tabinit@replacementchars \@tempswafalse \def\par{% \if@tempswa @@ -735,7 +1173,8 @@ \fi}% \obeylines \everypar \expandafter{\the\everypar \unpenalty}% - #1} + \pgfkeysvalueof{/codeexample/typeset listing/.@cmd}{#1}\pgfeov + } \end{minipage}}% \code@end% \par% @@ -748,6 +1187,18 @@ \makeatother +\usepackage{pgfmanual} + +\makeatletter +% \pgfautoxrefs will be defined by 'make dist' +\pgfutil@ifundefined{pgfautoxrefs}{% + \def\pgfmanualpdflabel#1#2{#2}% NO-OP + \def\pgfmanualpdfref#1#2{#2}% + \pgfkeys{ + /pdflinks/codeexample links=false,% DISABLED. + }% +}{} +\makeatother %%% Local Variables: %%% mode: latex diff --git a/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf b/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf Binary files differindex 1e115982b01..68d7e593a38 100644 --- a/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf +++ b/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex index 95d941bd5db..77172602df0 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex @@ -254,9 +254,9 @@ command is described in Section~\ref{section-transparency}. \subsubsection{Graphic Parameter: Arrows} After a path has been drawn, \pgfname\ can add arrow tips at the -ends. Currently, it will only add arrows correctly at the end of paths -that consist of a single open part. For other paths, like closed paths -or path consisting of multiple parts, the result is not defined. +ends. It will only add arrows at the beginning of the first subpath +and at the end of the last subpath. For closed paths the result is not +defined, that is, it may change without notice in the future. \begin{command}{\pgfsetarrowsstart\marg{arrow kind}} Sets the arrow tip kind used at the start of a (possibly curved) @@ -337,6 +337,84 @@ or path consisting of multiple parts, the result is not defined. \end{command} +\subsubsection{Inner Lines} + +When a path is stroked, it is possible to request that it is stroked +twice, the second time with a different line width and a different +color. This is a useful effect for creating ``double'' lines, for +instance by setting the line width to 2pt and stroking a black line +and then setting the inner line width to 1pt and stroking a white +line on the same path as the original path. This results in what looks +like two lines, each of thickness 0.5pt, spaces 1pt apart. + +You may wonder why there is direct support for this ``double +stroking'' in the basic layer. After all, this effect is easy to +achieve ``by hand''. The main reason is that arrow tips must be +treated in a special manner when such ``double lines'' are +present. First, the order of actions is important: First, the (thick) +main line should be stroked, then the (thin) inner line, and only then +should the arrow tip be drawn. Second, the way an arrow tip looks +typically depends strongly on the width of the inner line, so the +arrow tip code, which is part of the basic layer, needs access to the +inner line thickness. + +Two commands are used to set the inner line width and color. + +\begin{command}{\pgfsetinnerlinewidth\marg{dimension}} + This command sets the width of the inner line. Whenever a path is + stroked (and only then), it will be stroked normally and, afterward, + it is stroked once more with the color set to the inner line color + and the line width set to \meta{dimension}. + + In case arrow tips are added to a path, the path is first stroked + normally, then the inner line is stroked, and then the arrow tip is + added. In case the main path is shortened because of the added arrow + tip, this shortened path is double stroked, not the original path + (which is exactly what you want). + + When the inner line width is set to 0pt, which is the default, no + inner line is stroked at all (not even a line of width 0pt). So, in + order to ``switch off'' double stroking, set \meta{dimension} + to~|0pt|. + + The setting of the inner line width is local to the current \TeX\ + group and \emph{not} to the current \pgfname\ scope. + + Note that inner lines will \emph{not} be drawn for paths that are + also used for clipping. However, this may change in the future, so + you should not depend on this. + +\begin{codeexample}[] +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfsetlinewidth{2pt} + \pgfsetinnerlinewidth{1pt} + \pgfusepath{stroke} +\end{pgfpicture} +\end{codeexample} +\end{command} + + +\begin{command}{\pgfsetinnerstrokecolor\marg{color}} + This command sets the \meta{color} that is to be used when the inner + line is stroked. The effect of this command is also local to the + current \TeX\ group. + +\begin{codeexample}[] +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfsetlinewidth{2pt} + \pgfsetinnerlinewidth{1pt} + \pgfsetinnerstrokecolor{red!50} + \pgfusepath{stroke} +\end{pgfpicture} +\end{codeexample} +\end{command} + \subsection{Filling a Path} \label{section-fill} @@ -419,7 +497,7 @@ When you add the |use as bounding box| option, the bounding box of the picture will be enlarged such that the path in encompassed, but any \emph{subsequent} paths of the current \TeX\ scope will not have any effect on the size of the bounding box. Typically, you use this -command at the very beginning of a |{pgfpicture}| environment. +command at the very beginning of a |{pgfpicture}| environment. Alternatively, you can use |\pgfresetboundingbox|, followed by |\pgfusepath{use as bounding box}| to overrule the picture's bounding box completely. \begin{codeexample}[] Left diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex index 4f5033ec86a..aac739b9d1f 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex @@ -22,7 +22,7 @@ of lines. The interface works as follows: \begin{enumerate} \item You (or someone else) assigns a name to a certain kind of arrow - tips. For example, the + tips. For example, the arrow tip |latex| is the arrow tip used by the standard \LaTeX\ picture environment; the arrow tip |to| looks like the tip of the arrow in \TeX's |\to| command; and so on. @@ -49,6 +49,7 @@ of lines. The interface works as follows: In the above description, there are a number of ``appropriately.'' The exact details are not quite trivial and described later on. + \subsubsection{Meta-Arrow Tips} In \pgfname, arrows are ``meta-arrows'' in the same way that fonts in @@ -69,7 +70,7 @@ version scaled by a factor of two. Obviously, the first look better. Now, compare ``\tikz{\node [scale=.5,inner sep=0pt,outer sep=0pt]{Berlin};}'' and ``{\tiny Berlin}''. This time, the normal text was scaled down, while the second text is a ``normal'' tiny -text. The second text is easier to read. +text. The second text is easier to read. \pgfname's meta-arrows work in a similar fashion: The shape of an arrow tip can vary according to the line width of the arrow tip is @@ -96,7 +97,7 @@ drawn by \pgfname\ at four different sizes: \medskip Here, by comparison, is the same arrow when it is simply ``resized'' -(as done by most programs): +(as done by some programs): \pgfarrowsdeclare{bad latex}{bad latex} { @@ -156,6 +157,11 @@ Here, by comparison, is the same arrow when it is simply ``resized'' As can be seen, simple scaling produces arrow tips that are way too large at larger sizes and way too small at smaller sizes. +In addition to the line width, other options may also influence the +appearance of an arrow tip. In particular, the width of the inner line +(the line used to create the effect of a double line) influences arrow +tips as well as other options that are specific to the arrow tip. + \subsection{Declaring an Arrow Tip Kind} @@ -259,8 +265,8 @@ used: \item The code will be executed only once, namely the first time the arrow tip needs to be drawn. The resulting low-level driver - commands are protocoled and stored away. In all subsequent - uses of the arrow tip, the protocoled code is directly inserted. + commands are protocolled and stored away. In all subsequent + uses of the arrow tip, the protocolled code is directly inserted. \item However, the code will be executed anew for each line width. Thus, an arrow of line width 2pt may result in a different protocol than @@ -287,7 +293,7 @@ used: larger. However, the size of the arrow typically \emph{should not} grow in direct proportion to the line width. On the other hand, the size of the arrow head typically \emph{should} grow ``a bit'' with - the line width. + the line width. For these reasons, \pgfname\ will not simply executed your arrow code within a scaled scope, where the scaling depends on the line @@ -297,7 +303,7 @@ used: In our example, we could use the following code for the new arrow tip kind |arc'| (note the prime): \begin{codeexample}[code only] -\newdimen\arrowsize +\newdimen\arrowsize \pgfarrowsdeclare{arcs'}{arcs'}{...} { \arrowsize=0.2pt @@ -311,7 +317,7 @@ used: \pgfusepathqstroke } \end{codeexample} -\newdimen\arrowsize +\newdimen\arrowsize \pgfarrowsdeclare{arcs'}{arcs'}{\pgfarrowsleftextend{0pt}\pgfarrowsrightextend{0pt}} { \arrowsize=0.2pt @@ -333,7 +339,7 @@ used: \useasboundingbox (-2,-1.75) rectangle (0,0.5); \end{tikzpicture} \end{codeexample} - + However, sometimes, it can also be useful to have arrows that do not resize at all when the line width changes. This can be achieved by giving absolute size coordinates in the code, as done for |arc|. On @@ -341,6 +347,7 @@ used: line width by specifying all coordinates as multiples of |\pgflinewidth|. + \medskip \textbf{The left and right extend.} Let us have another look at the exact left and right ``ends'' of our arrow tip. Let us draw the arrow tip |arc'| at a very large size: @@ -384,13 +391,13 @@ used: \coordinate (xline 1) at (0,1.5); \coordinate (xline 2) at (0,2.8); - - \draw[|->|] (xline 1 -| a) -- node[above=2pt] {right extend} (xline 1 -| b); + + \draw[|->|] (xline 1 -| a) -- node[above=2pt] {right extend} (xline 1 -| b); \draw[|<-|] (xline 2 -| c) -- node[above=2pt] {left extend} (xline 2 -| a); \draw (0,0) -- (1,-1) node[below right] {origin}; \end{tikzpicture} - + The \meta{extend code} is normal \TeX\ code that is executed whenever \pgfname\ wants to know how far the arrow tip will protrude @@ -398,7 +405,7 @@ used: commands: \declare{|\pgfarrowsrightextend|} and \declare{|\pgfarrowsleftextend|}. Both arguments take one argument that specifies the size. Here is the final code for the |arc''| arrow - tip: + tip: \begin{codeexample}[] \pgfarrowsdeclare{arcs''}{arcs''} { @@ -426,6 +433,104 @@ used: \draw[line width=2pt,white] (-2,0) -- (0,0); \end{tikzpicture} \end{codeexample} + + \medskip + \textbf{Taking inner lines into account.} + In addition to the line width, there is another parameter that (may) + influence the way an arrow looks: The inner line width, which is the + line width of the second line that is stroked on top of a normal + line in order to create the effect of a ``double'' line. When this + line width changes, the arrow tip code is also reexecuted (and + cached), so your code may depend on the current value of the inner + line width. + + The following example shows how this works. The |implies| arrow + defined below has to setup the line width not for the ``main'' line + width, but for the main line width minus the inner line width, + divided by~2. +\begin{codeexample}[code only] +\pgfarrowsdeclare{implies}{implies}{...} +{ + \pgfmathsetlength{\pgfutil@tempdimb}{.5\pgflinewidth-.5*\pgfinnerlinewidth}% + \pgfsetlinewidth{\pgfutil@tempdimb} + \pgfsetdash{}{0pt} + \pgfsetroundcap + \pgfsetroundjoin + \pgfmathsetlength{\pgfutil@tempdima}{.25\pgflinewidth+.25*\pgfinnerlinewidth}% + \pgfpathmoveto {\pgfpoint{-1.4\pgfutil@tempdima}{2.65\pgfutil@tempdima}} + \pgfpathcurveto{\pgfpoint{-0.75\pgfutil@tempdima}{1.25\pgfutil@tempdima}} + {\pgfpoint{1\pgfutil@tempdima}{0.05\pgfutil@tempdima}} + {\pgfpoint{2\pgfutil@tempdima}{0pt}} + \pgfpathcurveto{\pgfpoint{1\pgfutil@tempdima}{-0.05\pgfutil@tempdima}} + {\pgfpoint{-.75\pgfutil@tempdima}{-1.25\pgfutil@tempdima}} + {\pgfpoint{-1.4\pgfutil@tempdima}{-2.65\pgfutil@tempdima}} + \pgfusepathqstroke +} +\end{codeexample} + Here is the effect for different combinations of line width and + inner line width: +\begin{codeexample}[] +\begin{tikzpicture} + \foreach \linewidth in {2,2.4,...,4.4} + \foreach \innerlinewidth in {0.4,0.8,...,1.8} + { + \pgfsetlinewidth{\linewidth pt} + \pgfsetinnerlinewidth{\innerlinewidth pt} + \draw [-implies] (\innerlinewidth*50pt,\linewidth*40pt) -- ++(4mm,0); + } +\end{tikzpicture} +\end{codeexample} + + \medskip + \textbf{Arrow options.} + You may wish to have further option influence the appearance of an + arrow tip. For instance, for a ``pointed'' arrow you may wish to set + the opening angle of the tip. Then, whenever this option changes + that arrow tip code also needs to be reexecuted, even though the + line width has stayed the same. + + You can use the commands |\pgfsetarrowoptions| and + |\pgfgetarrowoptions| to set such options for an arrow tip. Whenever + an arrow tip needs to be rendered, it is checked whether the arrow + tip code has already been executed for the current (expanded) value of the + options. If so, the cached code is used; otherwise the code is + executed once more. Naturally, inside the code the current value of + the arrow options should be taken into account. + + Arrow options can and must be specified individually for each arrow + type. + + In the following example, we make the arc angle an option. +\begin{codeexample}[] +\pgfarrowsdeclare{var arc}{var arc} % options is an angle +{ + \arrowsize=0.2pt + \advance\arrowsize by .5\pgflinewidth + \pgfarrowsleftextend{-4\arrowsize-.5\pgflinewidth} + \pgfarrowsrightextend{.5\pgflinewidth} +} +{ + \arrowsize=0.2pt + \advance\arrowsize by .5\pgflinewidth + \pgfsetdash{}{0pt} % do not dash + \pgfsetroundjoin % fix join + \pgfsetroundcap % fix cap + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharc{-90}{-180+\pgfgetarrowoptions{var arc}}{4\arrowsize} + \pgfusepathqstroke + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharc{90}{180-\pgfgetarrowoptions{var arc}}{4\arrowsize} + \pgfusepathqstroke +} +\begin{tikzpicture} + \draw[help lines] (-2,-4) grid (1,4); + \foreach \option in {-60,-50,...,60} + { + \pgfsetarrowoptions{var arc}{\option} + \draw[ultra thick,-var arc] (-2,\option/15) -- (0,\option/15); + } +\end{tikzpicture} +\end{codeexample} \end{command} \pgfarrowsdeclare{arcs''}{arcs''} @@ -449,6 +554,17 @@ used: \pgfusepathqstroke } +\begin{command}{\pgfsetarrowoptions\marg{arrow tip}\marg{text}} + Sets the options for the \meta{arrow tip} to \meta{text}. The + default, before any call to this macro is made, is 0. +\end{command} + +\begin{command}{\pgfgetarrowoptions\marg{arrow tip}} + This will expand to the current value of the options for the + \meta{arrow tip}. +\end{command} + + \subsection{Declaring a Derived Arrow Tip Kind} @@ -480,7 +596,7 @@ set correctly. This command creates a new arrow kind that is the ``reverse'' of an existing arrow kind. The (automatically cerated) code of the new arrow kind will contain a flip of the canvas and the meanings of the - left and right extend will be reversed. + left and right extend will be reversed. \begin{codeexample}[] \pgfarrowsdeclarereversed{arcs reversed}{arcs reversed}{arcs''}{arcs''}% @@ -557,7 +673,7 @@ set correctly. \pgfusepath{stroke} \useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{command} @@ -577,7 +693,7 @@ set correctly. \pgfusepath{stroke} \useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{command} @@ -603,7 +719,7 @@ stroking is done. \pgfusepath{stroke} \useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{command} \begin{command}{\pgfsetarrowsend\marg{start arrow kind}} @@ -617,11 +733,11 @@ stroking is done. \pgfusepath{stroke} \useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{command} \emph{Warning:} If the compatibility mode is active (which is the -default), there also exist old commands called |\pgfsetstartarrow| and +default), there also exist old commands called |\pgfsetstartarrow| and |\pgfsetendarrow|, which are incompatible with the meta-arrow management. @@ -638,7 +754,7 @@ management. \pgfusepath{stroke} \useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{command} @@ -660,7 +776,7 @@ The following arrow tip kinds are always defined: \sarrow{latex reversed}{latex reversed} \\ \index{*vbar@\protect\texttt{\protect\myvbar} arrow tip}% \index{Arrow tips!*vbar@\protect\texttt{\protect\myvbar}} - \texttt{|-|}& yields thick + \texttt{|-|}& yields thick \begin{tikzpicture}[arrows={|-|},thick] \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); \draw (0,0) -- (1,0); @@ -674,7 +790,7 @@ The following arrow tip kinds are always defined: For further arrow tips, see page~\pageref{section-library-arrows}. -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex index 21ddb1f445c..ea145e8fb06 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex @@ -15,7 +15,7 @@ The commands for creating decorations are defined in this module, so you need to load this module to use decorations. This module is automatically loaded by the different decoration - libraries. + libraries. \end{pgfmodule} @@ -24,7 +24,7 @@ Decorations are a general way of creating graphics by ``moving along'' a path and, while doing so, either drawing something or constructing a new path. This could be as simple as extending a path with a -``zigzagged'' line\ldots +``zigzagged'' line\ldots \begin{codeexample}[] \tikz \draw decorate[decoration=zigzag] {(0,0) -- (3,0)}; @@ -69,9 +69,9 @@ Decoration automata (and the closely related meta-decoration automata) are a general concept for creating graphics ``along paths.'' For straight lines, this idea was first proposed by Till Tantau in an earlier version of \pgfname, the idea to extend this to arbitrary path -was proposed and implemented by Mark Wibrow. Further versitility is +was proposed and implemented by Mark Wibrow. Further versatility is provided by ``meta-decorations''. These are automata that decorate a -path with decorations. +path with decorations. In the present subsection the different ideas underlying decoration automata are presented. @@ -81,12 +81,12 @@ automata are presented. \subsubsection{The Different Paths} In order to prevent confusion with different types of path, such -as those that are extended, those that are decorated and those that +as those that are extended, those that are decorated and those that are created, the following conventions will be used: \begin{itemize} -\item - The \emph{preexisting} path refers to the current path in existence +\item + The \emph{preexisting} path refers to the current path in existence before a decoration environment. (Possibly this path has been created by another decoration used earlier, but we will still call this path the preexisting path also in this case.) @@ -95,14 +95,14 @@ are created, the following conventions will be used: decoration automaton moves along. The input path may consist of many line and curve input segments (for example, a circle or an ellipse consists of four curves). It is specified inside the decoration - environment. + environment. \item - The \emph{output} path refers to the path that the decoration + The \emph{output} path refers to the path that the decoration creates. Depending on the decoration, this path may or may not be empty (a decoration can also choose to use side-effects instead of producing an output path). The input path is always consumed by the decoration automaton, that is, it is no longer available in any way - after the decoration automaton has finished. + after the decoration automaton has finished. \end{itemize} The effect of a decoration environment is the following: The input @@ -123,10 +123,10 @@ automaton progresses, the current path is constantly being extend by the output path. This means that first time e |\pgfusepath| command is used on a decoration, the preexisting path is part of the path this command operates on; in subsequent calls only the part of the output -path constructed since the last |\pgfusepath| command will be used. +path constructed since the last |\pgfusepath| command will be used. You can use this mechanism to stroke or fill different part of the -output path in different colors, line widths, fills and shades; all +output path in different colors, line widths, fills and shades; all within the same decoration. Alternatively, a decoration can choose to produce no output path at all: the |text| decoration simply typesets text along a path. @@ -135,20 +135,20 @@ text along a path. \subsubsection{Segments and States} The most common use a decoration is to ``repeat something along a -path'' (for example, the |zigzag| decoration +path'' (for example, the |zigzag| decoration repeats \tikz\draw decorate[decoration=zigzag] {(0,0)--(\pgfdecorationsegmentlength,0)}; along a path). However, it not necessarily the case that only one thing be repeated: a decoration can consist of different parts, or \emph{segments}, repeated in a -particular order. +particular order. -When you declare a decoration, you provide a description +When you declare a decoration, you provide a description of how their different segments will be rendered. The description of each segment should be given in a way as if the ``x-axis'' of the segment is the tangent to the path at a particular point, and that point is the origin of the segment. Thus, for example, the segment of the |zigzag| decoration might be -defined using the following code: +defined using the following code: \begin{codeexample}[code only] \pgfpathlineto{\pgfpoint{5pt}{5pt}} \pgfpathlineto{\pgfpoint{15pt}{-5pt}} @@ -171,7 +171,7 @@ The width of a segment can (and must) be specified explicitly. \pgfname\ will use this width to find out the start point of the next segment and the correct rotation. The width the you provide need not be the ``real'' width of the segment, which allows -decoration segments to overlap or to be spaced far apart. +decoration segments to overlap or to be spaced far apart. The |zigzag| decoration only has one segment that is repeated again and again. However, we might also like to have \emph{different} segments @@ -180,12 +180,12 @@ example, we might have special segments at the start and at the end. Decorations use a mechanism known in theoretical in computer science as \emph{finite state automata} to describe which segment is used at a -particular point. The idea is the following: For the first segment we +particular point. The idea is the following: For the first segment we start in a special \emph{state} called the \emph{initial state}. In this state, and also in all other state later, \pgfname\ first computes how much space is left on the input path. That is, \pgfname\ keeps -track of the distance to the end of the input path. Attached to each state -there is a set of rules of the following form: ``If the remaining +track of the distance to the end of the input path. Attached to each state +there is a set of rules of the following form: ``If the remaining distance on the input path is less than $x$, switch to state~$q$.'' \pgfname\ checks for each of these rules whether it applies and, if so, immediately switches to state~$q$. @@ -224,10 +224,10 @@ this command describes the decoration automaton. will ``travel along the path,'' each time being moved along by a certain distance. This will also work if the path is not a straight line. That is, it is permissible that the path curves are veers at a - sharp angle. It is also permissible that while travelling along the + sharp angle. It is also permissible that while traveling along the input path the current input segment ends and a new input segment starts. In this case, the remaining distance on the first input segment is subtracted - from the \meta{dimension} and then we travelled along the second + from the \meta{dimension} and then we traveled along the second input segment for the remaining distance. This input segment may also end early, in which case we travel along the next input segment, and so on. Note that it cannot happen that we travel past the end of the @@ -246,12 +246,12 @@ this command describes the decoration automaton. \begin{command}{\state\marg{name}\oarg{options}\marg{code}} This command declares a new state inside the current decoration automaton. The state is named \meta{name}. - + When the decoration automaton is in state \meta{name}, the following things happen: \begin{enumerate} \item - The \meta{options} are parsed. This may lead, see below, to a + The \meta{options} are parsed. This may lead, see below, to a state switch. When this happens, the following steps are not executed. The \meta{options} are executed one after the other in the given order. If an option causes a state switch, the switch @@ -261,11 +261,11 @@ this command describes the decoration automaton. The \meta{code} is executed in a \TeX-group with the current transformation matrix setup in such a way that the origin is on the input path at the current point (the point at the distance - travelled up to now) and the coordinate system is rotated in + traveled up to now) and the coordinate system is rotated in such a way that the positive $x$-axis points in the direction of the tangent to the input path at the current point, while the positive $y$-axis points to the left of this tangent. - + As described earlier, the \meta{code} can have two different effects: If it just contains path construction commands, the decoration will produce an output path, which is extends the @@ -300,7 +300,7 @@ this command describes the decoration automaton. output path for the first invocation and the different parts of the rest of the output path for the following invocation. Here is an example: - + \begin{codeexample}[] \pgfdeclaredecoration{stars}{initial}{ \state{initial}[width=15pt] @@ -316,7 +316,7 @@ this command describes the decoration automaton. } } \tikz\path[decorate, decoration=stars, star point ratio=2, star points=5, - inner sep=0, minimum size=rnd*10pt+2pt] + inner sep=0, minimum size=rnd*10pt+2pt] (0,0) .. controls (0,2) and (3,2) .. (3,0) .. controls (3,-3) and (0,0) .. (0,-3) .. controls (0,-5) and (3,-5) .. (3,-3); @@ -362,13 +362,13 @@ this command describes the decoration automaton. state switches occur, the \meta{code} is executed and the repetition counter is decreased. Then, there is once more a chance of a state change caused by any of the \meta{options}. If - no repetition occurs, the \meta{code} is executed + no repetition occurs, the \meta{code} is executed once more and the counter is decreased once more. When the counter reaches zero, the \meta{code} is executed once more, but, then, a different state is entered, as specified by the |next state| option. - Note, that the maximum number of times the state will be executed + Note, that the maximum number of times the state will be executed is $\meta{repetitions}+1$. \end{key} \begin{key}{/pgf/decoration automaton/next state=\meta{new state}} @@ -388,7 +388,7 @@ this command describes the decoration automaton. \begin{key}{/pgf/decoration automaton/auto end on length=\meta{dimension}} This key is just included for convenience, it does nothing that cannot be achieved using the previous options. The effect is the - following: If the remaingin input path's length is at most + following: If the remaining input path's length is at most \meta{dimension}, the decorated path is ended with a straight line to the end of the input path and, possibly, it is closed, namely if the input path ended with a closepath @@ -419,7 +419,7 @@ this command describes the decoration automaton. transformational \TeX-group of the current segment, so that these results of these computations are available in the next state. For this, the following two options are useful: - + \begin{key}{/pgf/decoration automaton/persistent precomputation=\meta{precode}} If the \meta{code} of state is executed, the \meta{precode} is executed first and it executed outside the \TeX-group of the @@ -432,40 +432,40 @@ this command describes the decoration automaton. \meta{postcode} is executed after (and also outside) the \TeX-group of the main \meta{code}. \end{key} - + There are a number of macros and dimensions which may be useful inside a decoration automaton. The following macros are available: - + \begin{command}{\pgfdecoratedpathlength} The length of the input path. If the input path consists of several input segments, this number is the sum of the lengths of the - input segments. + input segments. \end{command} - + \begin{command}{\pgfdecoratedinputsegmentlength} The length of the current input segment of the input path. ``Current input segment'' refers to the input segment on which the current point - lies. + lies. \end{command} \begin{command}{\pgfpointdecoratedpathlast} The final point of the input path. \end{command} - + \begin{command}{\pgfpointdecoratedinputsegmentlast} The final point of the current input segment of the input path. \end{command} \begin{command}{\pgfdecoratedangle} The angle of the tangent to the decorated path at the \emph{origin} - of the current segment. The transformation matrix applied at - the beginning of a state includes a rotation equivalent to + of the current segment. The transformation matrix applied at + the beginning of a state includes a rotation equivalent to this angle. \end{command} - The following \TeX\ dimension registers are also available inside the + The following \TeX\ dimension registers are also available inside the automaton: - + \begin{command}{\pgfdecoratedremainingdistance} The remaining distance on the input path. \end{command} @@ -473,25 +473,25 @@ this command describes the decoration automaton. \begin{command}{\pgfdecoratedcompleteddistance} The completed distance on the input path. \end{command} - + \begin{command}{\pgfdecoratedinputsegmentremainingdistance} The remaining distance on the current input segment of the input path. \end{command} - + \begin{command}{\pgfdecoratedinputsegmentcompleteddistance} The completed distance on the current input segment of the input path. \end{command} Further keys and macros are defined and used by the decoration libraries, see Section~\ref{section-library-decorations}. - + The following example shows how these options can be used: \begin{codeexample}[] \pgfdeclaredecoration{complicated example decoration}{initial} { \state{initial}[width=5pt,next state=up] { \pgfpathlineto{\pgfpoint{5pt}{0pt}} } - + \state{up}[width=5pt,next state=down] { \ifdim\pgfdecoratedremainingdistance>\pgfdecoratedcompleteddistance @@ -504,7 +504,7 @@ this command describes the decoration automaton. \pgfpathlineto{\pgfpoint{0pt}{\pgfdecoratedremainingdistance}} \pgfpathlineto{\pgfpoint{5pt}{\pgfdecoratedremainingdistance}} \pgfpathlineto{\pgfpoint{5pt}{0pt}} - \fi% + \fi% } \state{down}[width=5pt,next state=up] { @@ -518,7 +518,7 @@ this command describes the decoration automaton. \pgfpathlineto{\pgfpoint{0pt}{-\pgfdecoratedremainingdistance}} \pgfpathlineto{\pgfpoint{5pt}{-\pgfdecoratedremainingdistance}} \pgfpathlineto{\pgfpoint{5pt}{0pt}} - \fi% + \fi% } \state{final} { @@ -548,21 +548,21 @@ decorations. \subsection{Using Decorations} -Once a decoration has been declared, it can be used. +Once a decoration has been declared, it can be used. \begin{environment}{{pgfdecoration}\marg{decoration list}} The \meta{environment contents} should contain commands for creating an path. This path is the basis for the \emph{input paths} for the decorations in the \meta{decoration list}. In detail, the - following happens: + following happens: \begin{enumerate} \item The preexisting unused path is saved. - \item + \item The path commands specified in \meta{environment contents} are executed and this resulting path is saved. The path is then divided into different \emph{input paths} as follows: - The format for each item in \marg{decoration list} is + The format for each item in \marg{decoration list} is \begin{quote} \marg{decoration}\marg{length}\opt{\marg{before code}\marg{after code}} \end{quote} @@ -590,35 +590,35 @@ Once a decoration has been declared, it can be used. (and possibly using) the output paths. These output paths extend (unless they are used) the current path. \end{enumerate} - + Some important points should be noted regarding the use of this environment: - + \begin{itemize} \item - If \meta{environment contents} does not begin with - |\pgfpathmoveto|, he last known point on the preexisting path is + If \meta{environment contents} does not begin with + |\pgfpathmoveto|, he last known point on the preexisting path is assumed as the starting point. \item - All except the last of any sequence of consecutive move-to commands + All except the last of any sequence of consecutive move-to commands in \meta{environment contents} are discarded. \item - Any move-to commands at end of \meta{environment contents} are + Any move-to commands at end of \meta{environment contents} are ignored. \item - Any close-path commands on the input path are interpreted as + Any close-path commands on the input path are interpreted as straight lines. - Internally somthing a little more complicated is going on, - however, a closed path on the input path has no effect on the - output path, other than causing the automaton to travel in a - straight line towards the location of the last move-to command on + Internally something a little more complicated is going on, + however, a closed path on the input path has no effect on the + output path, other than causing the automaton to travel in a + straight line towards the location of the last move-to command on the input path. \item Although tangent computations for the input path work with the last point on the preexisting path, no automatic move-to - operations are issued for the output path. - If an output path commences with a line-to or curve-to when the - existing path is empty, an appropriate move-to command should be + operations are issued for the output path. + If an output path commences with a line-to or curve-to when the + existing path is empty, an appropriate move-to command should be inserted before the decoration commences. \item If a decoration uses its own path, the first time this happens the @@ -628,8 +628,8 @@ Once a decoration has been declared, it can be used. When the decoration automata ``work on'' their respective input paths, before the automaton starts, \meta{before code} is executed. After the decoration automaton has finished, \meta{after - code} is executed. - + code} is executed. + \begin{codeexample}[] \begin{tikzpicture}[decoration={segment length=5pt}] \draw [help lines] grid (3,2); @@ -674,9 +674,9 @@ Once a decoration has been declared, it can be used. Returns the point corresponding to the end of the current input path. \end{command} - This means that if decorations do not use their own path, it is - possible to do something with them and and continue from the - correct place. + This means that if decorations do not use their own path, it is + possible to do something with them and continue from the + correct place. \begin{codeexample}[] \begin{tikzpicture} @@ -708,7 +708,7 @@ Once a decoration has been declared, it can be used. \end{tikzpicture} \end{codeexample} - After the |{decoration}| environment has finished, the following + After the |{decoration}| environment has finished, the following macros are available: \begin{command}{\pgfdecorateexistingpath} @@ -727,7 +727,7 @@ Once a decoration has been declared, it can be used. \begin{command}{\pgfpointdecoratedpathlast} The final point of the input path. \end{command} - + \begin{command}{\pgfpointdecorationpathlast} The final point of the output path. \end{command} @@ -735,12 +735,12 @@ Once a decoration has been declared, it can be used. The following style is executed each time a decoration is used. You may use it to setup default options for decorations. \begin{stylekey}{/pgf/every decoration (initially \normalfont empty)} - This sytle is executed for every decoration. + This style is executed for every decoration. \end{stylekey} \end{environment} \begin{plainenvironment}{{pgfdecoration}\marg{name}} - The plain-\TeX{} version of the |{pgfdecorate}| environment. + The plain-\TeX{} version of the |{pgfdecorate}| environment. % TODOsp: `pgfdecorate' right or `pgfdecoration'? really no idea \end{plainenvironment} \begin{contextenvironment}{{pgfdecoration}\marg{name}} @@ -758,7 +758,7 @@ environment). \pgfdecorate{{name}{\pgfdecoratedpathlength} {\pgfdecoratebeforecode}{\pgfdecorateaftercode}} // the path commands. -\endpgfdecorate +\endpgfdecorate \end{codeexample} \end{command} @@ -766,21 +766,21 @@ environment). Decorate the preexisting path with the decoration \meta{name}. \end{command} -Both the above commands use the current definitons of the following +Both the above commands use the current definitions of the following macros: \begin{command}{\pgfdecoratebeforecode} Code executed as \meta{before code}, see the description of - |\pgfdecorate|. + |\pgfdecorate|. \end{command} \begin{command}{\pgfdecorateaftercode} Code executed as \meta{after code}, see the description of - |\pgfdecorate|. + |\pgfdecorate|. \end{command} It may sometimes be useful to add an additional transformation -for each segment of a decoration. The following command allows +for each segment of a decoration. The following command allows you to define such a ``last minute transformation.'' \begin{command}{\pgfsetdecorationsegmenttransformation\marg{code}} @@ -817,11 +817,11 @@ you to define such a ``last minute transformation.'' \label{section-base-meta-decorations} -A meta-decoration provides an alternative way to decorate a path with -mutiple decorations. It is, in essence, an automaton that decorates +A meta-decoration provides an alternative way to decorate a path with +multiple decorations. It is, in essence, an automaton that decorates an input path with decoration automatons. In general, however, the end -effect is still that a path is decorated with other paths, and the input -path should be thought of as being divided into sub-input-paths, each with +effect is still that a path is decorated with other paths, and the input +path should be thought of as being divided into sub-input-paths, each with their own decoration. Like ordinary decorations, before a meta-decoration can be used it must be declared. @@ -833,105 +833,105 @@ meta-decoration can be used it must be declared. \meta{states} argument contains a description of the meta-decoration automaton's states and the transitions between them. The \meta{initial state} is the state in which the automaton starts. - - The |\state| command is similar to the one found in + + The |\state| command is similar to the one found in decoration declarations, and takes the same form: - + \begin{command}{\state\marg{name}\oarg{options}\marg{code}} Declares the state \meta{name} inside the current meta-decoration automaton. Unlike decorations, states in meta-decorations are not executed within a group, which makes the persistent computation options superfluous. Consider using an initial state with |width=0pt| to do precalculations that could speed the execution - of the meta-decoration. - + of the meta-decoration. + The \meta{options} are executed with the key path set to - |/pgf/meta-decorations automaton/|, and the following keys are defined for - this path: - + |/pgf/meta-decorations automaton/|, and the following keys are defined for + this path: + \begin{key}{/pgf/meta-decoration automaton/switch if less than=\meta{dimension}| to |\meta{new state}} This causes \pgfname\ to check whether the remaining distance to the end of the input path is less than - \meta{dimension}, and, if so, to immediately switch to the state - \meta{new state}. When this key is evaluated, the macro - |\pgfmetadecoratedpathlength| will be defined as the total length of + \meta{dimension}, and, if so, to immediately switch to the state + \meta{new state}. When this key is evaluated, the macro + |\pgfmetadecoratedpathlength| will be defined as the total length of the decoration path, allowing for values such as |\pgfmetadecoratedpathlength/8|. \end{key} - + \begin{key}{/pgf/meta-decoration automaton/width=\meta{dimension}} As always, this option will cause an immediate switch to the state |final| if the remaining distance on the input path is less than - \meta{dimension}. + \meta{dimension}. Otherwise, this option tells \pgfname\ the width of the ``meta-segment'', that is, the length of the sub-input-path which the decoration automaton specified in \meta{code} will decorate. \end{key} - + \begin{key}{/pgf/meta-decoration automaton/next state=\meta{new state}} After the code for a state has been executed, a state switch to \meta{new state} is performed. If this option is not given, the next state is the same as the current state. \end{key} - - The code in \meta{code} is quite different from the code in a + + The code in \meta{code} is quite different from the code in a decoration state. In almost all cases only the following three - macros will be required: - + macros will be required: + \begin{command}{\decoration\marg{name}} This sets the decoration for the current state to \meta{name}. If this command is omitted, the |moveto| decoration will be used. \end{command} - + \begin{command}{\beforedecoration\marg{before code}} Defines \marg{before code} as (typically) \pgfname{} commands to be executed before the decoration is applied to the current segment. This command can be omitted. - If you wish to set up some decoration specific parameters + If you wish to set up some decoration specific parameters such as segment length, or segment amplitude, then they can be set in \meta{before code}. \end{command} - + \begin{command}{\afterdecoration\marg{after code}} - Defines \marg{after code} as commands to be executed afer the + Defines \marg{after code} as commands to be executed after the decoration has been applied to the current segment. This command can be omitted. \end{command} - - There are some macros that may be usedful when creating + + There are some macros that may be useful when creating meta-decorations (note that they are all macros): - + \begin{command}{\pgfpointmetadecoratedpathfirst} When the \meta{before code} is executed, this macro stores the first point on the current - sub-input-path. + sub-input-path. \end{command} \begin{command}{\pgfpointmetadecoratedpathlast} When the \meta{after code} is executed, this macro stores the last point on the current - sub-input-path. + sub-input-path. \end{command} - + \begin{command}{\pgfmetadecoratedpathlength} The entire length of the entire input path. - \end{command} - + \end{command} + \begin{command}{\pgfmetadecoratedcompleteddistance} The completed distance on the entire input path. \end{command} - + \begin{command}{\pgfmetadecoratedremainingdistance} The remaining distance on the entire input path. \end{command} - + \begin{command}{\pgfmetadecoratedinputsegmentcompleteddistance} The completed distance on the current input segment of the entire input path. \end{command} - + \begin{command}{\pgfmetadecoratedinputsegmentremainingdistance} The remaining distance on the current input segment of the entire input path. @@ -951,12 +951,12 @@ meta-decoration can be used it must be declared. } \state{arrow}[ switch if less than=\pgfmetadecorationsegmentlength to final, - width=\pgfmetadecorationsegmentlength/3, + width=\pgfmetadecorationsegmentlength/3, next state=zigzag] { \decoration{curveto} \beforedecoration - { + { \pgfmathparse{\pgfmetadecoratedcompleteddistance*\factor} \pgfsetcolor{red!\pgfmathresult!yellow} \pgfpathmoveto{\pgfpointmetadecoratedpathfirst} @@ -975,7 +975,7 @@ meta-decoration can be used it must be declared. \pgfsetarrowsend{to} \pgfusepath{stroke} } - } + } \state{move}[width=\pgfmetadecorationsegmentlength/2, next state=arrow]{} \state{final}{} } @@ -1001,7 +1001,7 @@ Using meta-decorations is ``simpler'' than using decorations, because you can only use one meta-decoration per path. \begin{environment}{{pgfmetadecoration}\marg{name}} - This environment decorates the input path described in + This environment decorates the input path described in \meta{environment contents}, with the meta-decoration \meta{name}. \end{environment} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex index 742e9bd8d7b..fc4606b0848 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex @@ -123,7 +123,9 @@ As we see in Figure~\ref{fig1}, the world is flat. \item A more complex situation arises when a graphic file named \meta{file name prefix}|.|\meta{suffix} \emph{does} exist. In this case, this graphic file is included using the - |\includegraphics| command. Furthermore, the text between + |\includegraphics| command% + \footnote{Actually, the command key \texttt{/pgf/images/include external} is invoked which calls an appropriate \texttt{\textbackslash includegraphics} command.}. + Furthermore, the text between |\beginpgfgraphicnamed| and |\endpgfgraphicnamed| is ignored. When the text is ``ignored,'' what actually happens is that all @@ -266,11 +268,37 @@ way: You input the file |pgfexternal.tex|. in your main file. \end{filedescription} -As a final remark, note that the |baseline| option does not work -together with pictures written to an external graphic file. The simple -reason is that there is no way to store this baseline information is -an external graphic file. +As a final remark, note that the |baseline| option does not work directly +with pictures written to an external graphic file. The simple +reason is that there is no way to store this baseline information in +an external graphic file. To allow the |baseline| option (or any \TeX\ construction +with non-zero depth), the baseline information is stored into a separate file. +This file is named \marg{image file}|.dpth| and contains something like |5pt|. + +So, if you need baseline information, you will have to keep the external graphic file +together with its~|.dpth| file. Furthermore, the short command in |\input pgfexternal.tex| +is no longer enough because it ignores any baseline information. You will need to use +|\input pgfexternalwithdepth.tex| instead (it is shown below). It is slightly longer, +but it can be used in the same way as |pgfexternal.tex|. + +\begin{key}{/pgf/images/include external (initially \textbackslash pgfimage\{\#1\})} +\label{pgf:includeexternalkey} +\index{External Graphics!Bounding Box Issues} + This key constitutes the public interface to exchange the |\includegraphics| command used for the image inclusion. + + Redefining this key allows to provide bounding box or viewport options: +\begin{codeexample}[code only] +\pgfkeys{/pgf/images/include external/.code={\includegraphics[viewport=0 0 211.28 175.686]{#1}}} +\end{codeexample} + Do not forget the |.code| here which redefines the command. + + One application could be image externalization and bounding box restrictions: + As far as I know, a |.pdf| graphics with restricted bounding box + is always cropped (which is not always desired). One solution could be to use |latex| and |dvips| + which doesn't have this restriction. Another is to manually provide the |viewport| option as shown above. + A possible value for |viewport| can be found in the |.pdf| image, search for |/MediaBox = [ ... ]|. +\end{key} \subsection{A Complete Example} @@ -415,7 +443,7 @@ Output written on survey.pdf (1 page, 10006 bytes). Transcript written on survey.log. \end{codeexample} -To our editor, we send the following files: + To our editor, we send the following files: \begin{itemize} \item The last |survey.tex| shown above. \item The graphic file |survey-f1.pdf|. @@ -427,6 +455,23 @@ To our editor, we send the following files: (Alternatively, we can also directly add this line to our |survey.tex| file). \end{itemize} +In case we have used the |baseline| option, we also need to include any |.dpth| files and we need to use the file |pgfexternalwithdepth.tex| instead of |pgfexternal.tex|. This file also checks for the existence of |.dpth| files containing baseline information, its contents is +\begin{codeexample}[code only] +\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{% + \begingroup + \setbox1=\hbox{\includegraphics{#1}}% + \openin1=#1.dpth + \ifeof1 \box1 + \else + \read1 to\pgfincludeexternalgraphicsdp\closein1 + \dimen0=\pgfincludeexternalgraphicsdp\relax + \hbox{\lower\dimen0 \box1 }% + \fi + \endgroup +} +\end{codeexample} +Again, we could simply copy these lines to our |survey.tex| file. + %%% Local Variables: %%% mode: latex diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex index b60a49c091d..2267999f3df 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex @@ -35,7 +35,7 @@ inclusion facilities of \pgfname: package. Thus, in plain \TeX, this does not really help. It might be a good idea to fix this in the future such that \pgfname\ becomes independent of \LaTeX, thereby providing a uniform image abstraction - for all formats. + for all formats. \item You wish to use masking. This is a feature that is only supported by \pgfname, though I hope that someone will implement this also for @@ -62,7 +62,7 @@ option: In draft mode boxes showing the image name replace the images. It is checked whether the image files exist, but they are not read. If either height or width is not given, 1cm is used - instead. + instead. \end{packageoption} \subsection{Declaring an Image} @@ -73,7 +73,7 @@ option: use |\pgfuseimage{|\meta{image name}|}|. The \meta{filename} may not have an extension. For \textsc{pdf}, the extensions |.pdf|, |.jpg|, and |.png| will automatically tried. For PostScript, the extensions - |.eps|, |.epsi|, and |.ps| will be tried. + |.eps|, |.epsi|, and |.ps| will be tried. The following options are possible: \begin{itemize} @@ -97,7 +97,7 @@ option: \meta{filename}|.|\meta{extension} and if a recent version of |pdflatex| is used, only the selected page is inserted. For older versions of |pdflatex| and for |dvips| the complete document is - inserted and a warning is printed. + inserted and a warning is printed. \item \declare{|interpolate=|\meta{true or false}} selects whether the image should ``smoothed'' when zoomed. False by default. @@ -105,7 +105,7 @@ option: \declare{|mask=|\meta{mask name}} selects a transparency mask. The mask must previously be declared using |\pgfdeclaremask| (see below). This option only has an effect for |pdf|. Not all viewers - support masking. + support masking. \end{itemize} \begin{codeexample}[code only] @@ -145,7 +145,7 @@ option: original image is used. The |xxcolor| package sets the alternate extension to the current - color mixin. + color mixin. % TODOsp: `color mixin': meant `color mixing' or the `colormixin' environment? \begin{codeexample}[] \pgfdeclareimage[interpolate=true,width=1cm,height=1cm] @@ -165,7 +165,7 @@ option: \end{codeexample} The following example demonstrates the effect of using - |\pgfuseimage| inside a color mixin environment. + |\pgfuseimage| inside a colormixin environment. \begin{codeexample}[] \pgfdeclareimage[interpolate=true,width=1cm,height=1cm] @@ -201,7 +201,7 @@ option: Declares the image under the name |pgflastimage| and immediately uses it. You can ``save'' the image for later usage by invoking |\pgfaliasimage| on |pgflastimage|. - + \begin{codeexample}[] \begin{colormixin}{25!white} \begin{pgfpicture} @@ -271,7 +271,7 @@ color(14cm)=(green)} \end{codeexample} \end{command} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex new file mode 100644 index 00000000000..ec5d715f168 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex @@ -0,0 +1,92 @@ +% Copyright 2008 by Christian Feuersaenger +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Adding libraries to \pgfname: temporary registers} + +\label{section-internal-registers} + +This section is intended for those who like to write libraries to extend \pgfname. Of course, this requires a good deal of knowledge about \TeX-programming and the structure of the \pgfname\ basic layer. Besides, one will encounter the need of temporary variables and, especially, temporary \TeX\ registers. This section describes how to use a set of pre-allocated temporary registers of the basic layer without needing to allocate more of them. + +A part of these internals are already mentioned in section~\ref{section-internal-pointcmds}, but the basic layer provides more temporaries than |\pgf@x| and |\pgf@y|. + +\begin{internallist}[dimen register]{\pgf@x,\pgf@y} + These registers are used to process point coordinates in the basic layer of \pgfname, see section~\ref{section-internal-pointcmds}. After a |\pgfpoint|$\dotsc$ command, they contain the final $x$ and $y$ coordinate, respectively. + + The values of |\pgf@x| and |\pgf@y| are set \emph{globally} in contrast to other available \pgfname\ registers. You should never assume anything about their value unless the context defines them explicitly. + + + Please prefer the |\pgf@xa|, |\pgf@xb|, $\dotsc$ registers for temporary dimen registers unless you are writing point coordinate commands. +\end{internallist} + +\begin{internallist}[dimen register]{ + \pgf@xa, + \pgf@xb, + \pgf@xc, + \pgf@ya, + \pgf@yb, + \pgf@yc} + Temporary registers for \TeX\ dimensions which can be modified freely. Just make sure changes occur only within \TeX\ groups. + + \paragraph{Attention:} + \pgfname\ uses these registers to perform path operations. For reasons of efficiency, path commands do not always guard them. As a consequence, the code +\begin{codeexample}[code only] +\pgfpointadd{\pgfpoint{\pgf@xa}{\pgf@ya}}{\pgfpoint{\pgf@xb}{\pgf@yb}} +\end{codeexample} +\noindent +may fail: Inside |\pgfpointadd|, the |\pgf@xa| and friend registers might be +modified. In particular, it might happen that |\pgf@xb| is changed +before |\pgfpoint{\pgf@xb}{\pgf@yb}| is evaluated. The right thing to do +would be to first expand everything using |\edef| and process the values afterwards, +resulting in unnecessary expensive operations. Of course, one can avoid this by simply +looking into the source code of |\pgfpointadd| to see which registers are used. +\end{internallist} + +\begin{internallist}[dimen register]{\pgfutil@tempdima,\pgfutil@tempdimb} + Further multi-purpose temporary dimen registers. For \LaTeX, these registers are already allocated as |\@tempdima| and |\@tempdimb| and are simply |\let| to the |\pgfutil@|$\dotsc$ names. +\end{internallist} + +\begin{internallist}[count register]{ + \c@pgf@counta, + \c@pgf@countb, + \c@pgf@countc, + \c@pgf@countd} + These multiple-purpose count registers are used throughout \pgfname\ to perform integer computations. Feel free to use them as well, just make sure changes are scoped by local \TeX\ groups. +\end{internallist} + +\begin{internallist}[openout handle]{\w@pgf@writea} + An |\openout| handle which is used to generate complete output files within locally scoped parts of \pgfname\ (for example, to interact with |gnuplot|). You should always use |\immediate| in front of output operations involving |\w@pgf@writea| and you should always close the file before returning from your code. +\begin{codeexample}[code only] +\immediate\openout\w@pgf@writea=myfile.dat +\immediate\write\w@pgf@writea{...}% +\immediate\write\w@pgf@writea{...}% +\immediate\closeout\w@pgf@writea% +\end{codeexample} +\end{internallist} + +\begin{internallist}[openin handle]{\r@pgf@reada} + An |\openin| handle which is used to read files within locally scoped parts of \pgfname, for example to check if a file exists or to read data files. You should always use |\immediate| in front of output operations involving |\w@pgf@writea| and you should always close the file before returning from your code. +\begin{codeexample}[code only] +\immediate\openin\r@pgf@reada=myfile.dat +% do something with \macro +\ifeof\r@pgf@reada + % end of file or it doesn't exist +\else + % loop or whatever + \immediate\read\r@pgf@reada to\macro + ... +\fi +\immediate\closein\r@pgf@reada +\end{codeexample} +\end{internallist} + +\begin{internallist}[box]{\pgfutil@tempboxa} + A box for temporary use inside of local \TeX\ scopes. For \LaTeX, this box is the same as the already pre-allocated |\@tempboxa|. +\end{internallist} + diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex index 201fe734c2c..d77f1312123 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex @@ -18,7 +18,7 @@ \subsection{Overview} -Matrices are a mechanism for aligning several so-called cell pictures +Matrices are a mechanism for aligning several so-called cell pictures horizontally and vertically. The resulting alignment is placed in a normal node and the command for creating matrices, |\pgfmatrix|, takes options very similar to the |\pgfnode| command. @@ -36,7 +36,7 @@ the special command |\pgfmatrixnextcell|, rows are ended using the command |\pgfmatrixendrow| (the command |\\| is setup to mean the same as |\pgfmatrixendrow| by default). Each cell contains a \emph{cell picture}, although cell pictures are not complete pictures as they -lack layers. However, each cell picture has its own bouding box like a +lack layers. However, each cell picture has its own bounding box like a normal picture does. These bounding boxes are important for the alignment as explained in the following. @@ -96,7 +96,7 @@ All matrices are typeset using the following command: path(s) of the resulting node are stroked or filled or whatever. \medskip - \textbf{Specifiying the cells and rows.\ } + \textbf{Specifying the cells and rows.\ } Even though this command uses |\halign| internally, there are two special rules for indicating cells: \begin{enumerate} @@ -112,12 +112,12 @@ All matrices are typeset using the following command: like |{minipage}| redefine |\\|, so it is good to have |\pgfmatrixendrow| as a ``fallback.'' \item Every row \emph{including the last row} must be ended using - the command |\\| or |\pgfmatrixendrow|. + the command |\\| or |\pgfmatrixendrow|. \end{enumerate} Both |\pgfmatrixnextcell| and |\pgfmatrixendrow| (and, thus, also |\\|) take an optional argument as explained in the - Section~\ref{section-matrix-spacing} + Section~\ref{section-matrix-spacing} \begin{codeexample}[] \begin{tikzpicture} @@ -142,15 +142,15 @@ All matrices are typeset using the following command: box. The origin of this coordinate system is at the left baseline end of the matrix box, which corresponds to the |text| anchor. The position \meta{shift} is then interpreted inside this coordinate - system and then used for shifting. + system and then used for shifting. This allows you to use the parameter \meta{shift} in the following way: If you use |text| as the \meta{anchor} and specify |\pgfpointanchor{inner node}{some anchor}| for the parameter - \meta{shift}, where |inner node| is a node that + \meta{shift}, where |inner node| is a node that is created in the matrix, then the whole matrix will be shifted such that |inner node.some anchor| lies at the origin of the whole - picture. + picture. \medskip \textbf{Rotations and scaling.\ } @@ -166,10 +166,10 @@ All matrices are typeset using the following command: \medskip \textbf{Callbacks.\ } - At the beginning and at the end of each cell the special macros + At the beginning and at the end of each cell the special macros |\pgfmatrixbegincode|, |\pgfmatrixendcode| and possibly |\pgfmatrixemptycode| are called. The effect is explained in - Section~\ref{section-matrix-callbacks}. + Section~\ref{section-matrix-callbacks}. \medskip \textbf{Executing extra code.\ } @@ -180,14 +180,14 @@ All matrices are typeset using the following command: \begin{enumerate} \item It can be used to simplify the next cell macro. For example, saying |\let\&=\pgfmatrixnextcell| allows you to use |\&| instead - of |\pgfmatrixnextcell|. You can also set the catcode of |&| to + of |\pgfmatrixnextcell|. You can also set the catcode of |&| to active. \item It can be used to issue an |\aftergroup| command. This allows you to regain control after the |\pgfmatrix| command. (If you do not know the |\aftergroup| command, you are probably blessed with a simple and happy life.) \end{enumerate} - + \medskip \textbf{Special considerations concerning macro expansion.\ } As said before, the matrix is typeset using |\halign| @@ -200,7 +200,7 @@ All matrices are typeset using the following command: that the macros inside \meta{matrix cells} expand to these macros sooner or later. \item In particular, you can define clever macros that insert - columns and rows as needed for special effects. + columns and rows as needed for special effects. \end{itemize} \end{command} @@ -218,7 +218,7 @@ commands for the column spacing. \end{command} \begin{command}{\pgfmatrixnextcell\opt{\oarg{additional sep list}}} - This command has two puposes: First, it is used to separate + This command has two purposes: First, it is used to separate cells. Second, by providing the optional argument \meta{additional sep list} you can modify the spacing between the columns that are separated by this command. @@ -241,11 +241,11 @@ commands for the column spacing. argument is missing, only the default separation list is processed. \item Both lists may contain dimensions, separated by commas, as - well as occurences of the keywords |between origins| and + well as occurrences of the keywords |between origins| and |between borders|. - \item All dimensions occuring in either list are added together to + \item All dimensions occurring in either list are added together to arrive at an dimension $d$. - \item The last occurence of either of the keywords is located. If + \item The last occurrence of either of the keywords is located. If neither keyword is present, we proceed as if |between borders| were present. \end{enumerate} @@ -264,7 +264,7 @@ commands for the column spacing. distance between these two lines is exactly $d$. This mode may only be used between columns \emph{already - introduced in the first row}. + introduced in the first row}. \end{itemize} All of the above rules boil down to the following effects: \begin{itemize} @@ -281,7 +281,7 @@ commands for the column spacing. \item You can now use the optional argument of |\pgfmatrixnextcell| to locally overrule the spacing between two columns. By saying |\pgfmatrixnextcell[5pt]| you \emph{add} 5pt to the space between - of the two columns, regadless of the mode. + of the two columns, regardless of the mode. You can also (locally) change the spacing mode for these two columns. For example, even if the normal spacing mode is @@ -370,7 +370,7 @@ change the appearance of cells in a very general manner. \begin{command}{\pgfmatrixemptycode} This macro is executed for empty cells. This means that \pgfname\ uses some macro magic to determine whether a cell is empty (it - immediatly ends with |\pgfmatrixemptycode| or |\pgfmatrixendrow|) + immediately ends with |\pgfmatrixemptycode| or |\pgfmatrixendrow|) and, if so, put this macro inside the cell. \begin{codeexample}[] \begin{tikzpicture} @@ -422,15 +422,15 @@ current column in a callback: \begin{command}{\pgfmatrixcurrentrow} This counter stores the current row of the current cell of the - matrix. Do not even think of changing this counter. + matrix. Do not even think of changing this counter. \end{command} \begin{command}{\pgfmatrixcurrentcolumn} This counter stores the current column of the current cell of the - matrix. + matrix. \end{command} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex index 8251a7e96ce..5df4c13b6bb 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex @@ -17,7 +17,7 @@ This section describes the |shapes| module. \begin{pgfmodule}{shapes} This module defines commands both for creating nodes and for creating shapes. The package is loaded automatically by |pgf|, but - you can load it manually if you have only included |pgfcore|. + you can load it manually if you have only included |pgfcore|. \end{pgfmodule} @@ -41,7 +41,7 @@ You create a node by calling the macro |\pgfnode| or the more general |\pgfmultipartnode|. These macro takes several parameters and draws the requested shape at a certain position. In addition, it will ``remember'' the node's position within the current -|{pgfpicture}|. You can then, later on, refer to the +|{pgfpicture}|. You can then, later on, refer to the node's position. Coordinate transformations are ``fully supported,'' which means that if you used coordinate transformations to shift or rotate the shape of a node, the node's position will still be correctly @@ -150,10 +150,11 @@ the description of |\pgfmultipartnode| for more details. \subsection{Creating Nodes} -You create a node using one of the following commands: + +\subsubsection{Creating Simple Nodes} \begin{command}{\pgfnode\marg{shape}\marg{anchor}\marg{label - text}\marg{name}\marg{path usage command}} + text}\marg{name}\marg{path usage command}} This command creates a new node. The \meta{shape} of the node must have been declared previously using |\pgfdeclareshape|. @@ -190,7 +191,7 @@ You create a node using one of the following commands: anchored, but you do not wish the shape itself to the transformed. In this case, you should call |\pgftransformresetnontranslations| prior to calling the |\pgfnode| - command. + command. \begin{codeexample}[] \begin{tikzpicture} @@ -212,6 +213,10 @@ You create a node using one of the following commands: |\pgfmultipartnode| for details. \end{command} + + +\subsubsection{Creating Multi-Part Nodes} + \begin{command}{\pgfmultipartnode\marg{shape}\marg{anchor}\marg{name}\marg{path usage command}} This command is the more general (and less user-friendly) version of @@ -223,7 +228,7 @@ You create a node using one of the following commands: have setup one \TeX-box. Suppose the shape has two parts: The |text| part and the |lower| part. Then, prior to calling |\pgfmultipartnode|, you must have setup the boxes - |\pgfnodeparttextbox| and |\pgfnodepartlowerbox|. These boxes may + |\pgfnodeparttextbox| and |\pgfnodepartlowerbox|. These boxes may contain any \TeX-text. The shape code will then compute the positions of the shape's anchors based on the sizes of the these shapes. Finally, when the node is drawn, the boxes are placed at the @@ -253,7 +258,7 @@ You create a node using one of the following commands: exhausting \TeX's limited number of box registers, you can say \begin{codeexample}[code only] \newbox\pgfnodepartlowerbox -\let\pgfnodepartmethodsbox=\pgfnodepartlowerbox +\let\pgfnodepartmethodsbox=\pgfnodepartlowerbox \end{codeexample} Also, when you have a node part name with spaces like |class name|, it may be useful to create an alias: @@ -263,12 +268,27 @@ You create a node using one of the following commands: \end{codeexample} \end{command} +\begin{command}{\pgfcoordinate\marg{name}\marg{coordinate}} + This command creates a node of shape |coordinate| at the given + \meta{coordinate}. Exactly the same effect can be achieved using + first a shift of the coordinate system to \meta{coordinate}, + followed by creating a node of shape |coordinate| named + \meta{name}. However, this command is easier and more natural to use + and, more importantly, it is much faster. +\end{command} + \begin{command}{\pgfnodealias\marg{new name}\marg{existing node}} This command does not actually create a new node. Rather, it allows you to subsequently access the node \meta{existing node} using the name \meta{new name}. \end{command} + +\begin{command}{\pgfnoderename\marg{new name}\marg{existing node}} + This command renames an existing node. +\end{command} + + There are a number of values that have an influence on the size of a node. These values are stored in the following keys. @@ -277,11 +297,11 @@ node. These values are stored in the following keys. This key stores the \emph{recommended} minimum width of a shape. Thus, when a shape is drawn and when the shape's width would be smaller than \meta{dimension}, the shape's width is enlarged by - adding some empty space. + adding some empty space. Note that this value is just a recommendation. A shape may choose to ignore this key. - + \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (-2,0) grid (2,1); @@ -299,7 +319,7 @@ node. These values are stored in the following keys. \begin{key}{/pgf/minimum size=\meta{dimension}} \keyalias{tikz} - This sytle both |/pgf/minimum width| and |/pgf/minimum height| to \meta{dimension}. + This style both |/pgf/minimum width| and |/pgf/minimum height| to \meta{dimension}. \end{key} @@ -309,7 +329,7 @@ node. These values are stored in the following keys. inner separation between the label text and the background path. As before, this value is just a recommendation and a shape may choose to ignore this key. - + \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (-2,0) grid (2,1); @@ -337,9 +357,9 @@ node. These values are stored in the following keys. This key stores the recommended horizontal separation between the background path and the ``outer anchors.'' For example, if \meta{dimension} is |1cm| then the |east| anchor will be 1cm to the - right of the right border of the background path. + right of the right border of the background path. As before, this value is just a recommendation. - + \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (-2,0) grid (2,1); @@ -368,6 +388,110 @@ node. These values are stored in the following keys. \end{key} +\subsubsection{Deferred Node Positioning} + +Normally, when a node is created using a command like |\pgfnode|, the +node is immediately inserted into the current picture. In particular, +you have no chance to change the position of a created node after it +has been create. Using |\pgfpositionnodelater| in concert with +|\pgfpositionnodenow|, you can create a node whose position is +determined only at some later time. + +\begin{command}{\pgfpositionnodelater\marg{macro name}} + This command is not a replacement for |\pgfnode|. Rather, when this + command is used in a scope, all subsequent node creations in this + scope will be affected in the following way: When a node is + created, it is not inserted into the current picture. Instead, it + is stored in the box |\pgfpositionnodelaterbox|. Furthermore, the + node is not relevant for the picture's bounding box, but a bounding + box for the node is computed and stored in the macros + |\pgfpositionnodelaterminx| to |\pgfpositionnodelatermaxy|. Then, + the \meta{macro name} is called with the following macros setup: + + \begin{command}{\pgfpositionnodelaterbox} + A box register number (|0| currently) that stores the node's paths + and texts. You should move the contents of this box to a box of + your choice inside \meta{macro name}. + \end{command} + + \begin{command}{\pgfpositionnodelatername} + The name of the just-created-node. This name will be the + originally "desired" name of the box plus the fixed prefix + |not yet positioned@|. The idea is to ensure that the original + name is not inadvertently used before the node is actually + positioned. When |\pgfpositionnodenow| is called, it will change + the name to the original name. + \end{command} + + \begin{command}{\pgfpositionnodelaterminx} + The minimal $x$-position of a bounding box of the node. This + bounding box refers to the node when it is positioned with the + anchor at the origin. + \end{command} + \begin{command}{\pgfpositionnodelaterminy} + \end{command} + \begin{command}{\pgfpositionnodelatermaxx} + \end{command} + \begin{command}{\pgfpositionnodelatermaxy} + \end{command} + + Once a late node has been created, you can add arbitrary code in the + same picture. Then, at some later point, you call + |\pgfpositionnodenow| to finally position the node at a given + position. At this point, the above macros must have the exact same + values they had when \meta{macro name} was called. Note that the + above macros are local to a scope that ends right after the call to + \meta{macro name}, so it is your job to copy the values to safety + inside \meta{macro name}. + + By setting \meta{macro name} to |\relax| (which is the default), you + can switch off the whole mechanism. When a picture is interrupted, + this is done automatically. +\end{command} + + +\begin{command}{\pgfpositionnodenow\marg{coordinate}} + This command is used to position a node that has previously been + created with |\pgfpositionnodelater|. When |\pgfpositionnodenow| is + called, the macros and boxes mentioned in the description of + |\pgfpositionnodenow| must be set to the value they had when the + \meta{macro name} was called. Provided this is the case, this + command will insert the box into the current picture, shifted by + \meta{coordinate}. Subsequently, you can refer to the node with its + original name as if it had just been created. + + \begin{codeexample}[] +\newbox\mybox + +\def\mysaver{ + \global\setbox\mybox=\box\pgfpositionnodelaterbox + \global\let\myname=\pgfpositionnodelatername + \global\let\myminx=\pgfpositionnodelaterminx + \global\let\myminy=\pgfpositionnodelaterminy + \global\let\mymaxx=\pgfpositionnodelatermaxx + \global\let\mymaxy=\pgfpositionnodelatermaxy +} + +\begin{tikzpicture} + { + \pgfpositionnodelater{\mysaver} + \node [fill=blue!20,below,rotate=30] (hi) {Hello world}; + } + \draw [help lines] (0,0) grid (3,2); + + \let\pgfpositionnodelatername=\myname + \let\pgfpositionnodelaterminx=\myminx + \let\pgfpositionnodelaterminy=\myminy + \let\pgfpositionnodelatermaxx=\mymaxx + \let\pgfpositionnodelatermaxy=\mymaxy + \setbox\pgfpositionnodelaterbox=\box\mybox + \pgfpositionnodenow{\pgfqpoint{2cm}{2cm}} + + \draw (hi) -- (0,0); +\end{tikzpicture} + \end{codeexample} +\end{command} + \subsection{Using Anchors} @@ -435,7 +559,7 @@ following commands: \pgfpointanchor{x}{east} \xdef\mycoordinate{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}} } - + \pgfpathcircle{\mycoordinate}{2pt} \pgfusepath{fill} \end{pgfpicture} @@ -453,7 +577,7 @@ following commands: then |\pgfpointanchor| will return a coordinate that corresponds to the position of the node's anchor on the page, transformed into the current coordinate system. For examples and more details see - Section~\ref{section-cross-pictures-pgf}. + Section~\ref{section-cross-pictures-pgf}. \end{command} \begin{command}{\pgfpointshapeborder\marg{node}\marg{point}} @@ -518,7 +642,7 @@ automatically. Rather, you have to proceed as follows: second run. \item You have to switch off automatic bounding bound computations. The reason is that the node in the other picture - should not influence the size of the bouding box of the current + should not influence the size of the bounding box of the current picture. You should say |\pgfusepath{use as bounding box}| before using a coordinate in another picture. \end{enumerate} @@ -538,7 +662,7 @@ should not attempt to redefine. \pgfpointanchor{current bounding box}{south east} \end{codeexample} returns the lower left corner of the bounding box of the current - picture. + picture. \end{predefinednode} \begin{predefinednode}{current path bounding box} @@ -579,7 +703,7 @@ should not attempt to redefine. Text absolutely positioned in the lower left corner.} } -\end{pgfpicture} +\end{pgfpicture} \end{codeexample} \end{predefinednode} @@ -588,7 +712,7 @@ There is also an option that allows you to create new special nodes quite similar to the above: \begin{key}{/pgf/local bounding box=\meta{node name}} \keyalias{tikz} - This defines a new node \meta{node name} whose size is the bouding + This defines a new node \meta{node name} whose size is the bounding box around all objects in the current scope starting at the position where this option was given. After the end of the scope, the \meta{node name} is still available. You can use this option to keep track of @@ -619,7 +743,7 @@ circumstances) and they need to be constructed reasonably ``fast.'' \pgfname\ must be able to handle pictures with several hundreds of nodes and documents with thousands of nodes in total. It would not do if \pgfname\ had to compute and store, say, dozens of anchor positions -for every node. +for every node. \subsubsection{What Must Be Defined For a Shape?} @@ -630,7 +754,7 @@ In order to define a new shape, you must provide: a \emph{shape name}, \item code for computing the \emph{saved anchors} and \emph{saved - dimensions}, + dimensions}, \item code for computing \emph{anchor} positions in terms of the saved anchors, \item @@ -648,21 +772,21 @@ In order to define a new shape, you must provide: Anchors are special places in shape. For example, the |north east| anchor, which is a normal anchor, lies at the upper right corner of the |rectangle| shape, as does |\northeast|, which is a saved -anchor. The difference is the following: \emph{saved anchors are +anchor. The difference is the following: \emph{saved anchors are computed and stored for each node, anchors are only computed as needed.} The user only has access to the normal anchors, but a normal anchor can just ``copy'' or ``pass through'' the location of a -saved anchor. +saved anchor. The idea behind all this is that a shape can declare a very large number of normal anchors, but when a node of this shape is created, these anchors are not actually computed. However, this causes a problem: When we wish to reference an anchor of a node at some later -time, we must still able to compute the position of the anchor. For +time, we must still able to compute the position of the anchor. For this, we may need a lot of information: What was the transformation matrix that was in force when the node was created? What was the size of the text box? What were the values of the different separation -dimensions? And so on. +dimensions? And so on. To solve this problem, \pgfname\ will always compute the locations of all \emph{saved anchors} and store these positions. Then, when an @@ -673,17 +797,17 @@ As an example, consider the |rectangle| shape. For this shape two anchors are saved: The |\northeast| corner and the |\southwest| corner. A normal anchor like |north west| can now easily be expressed in terms of these coordinates: Take the $x$-position of the -|\southwest| point and the $y$-position of the |\northeast| point. +|\southwest| point and the $y$-position of the |\northeast| point. The |rectangle| shape currently defines 13 normal anchors, but needs only two saved anchors. Adding new anchors like a |south south east| anchor would not increase the memory and computation requirements of -pictures. +pictures. All anchors (both saved and normal) are specified in a local \emph{shape coordinate space}. This is also true for the background and foreground paths. The |\pgfnode| macro will automatically apply appropriate transformations to the coordinates so that the shape is -shifted to the right anchor or otherwise transformed. +shifted to the right anchor or otherwise transformed. \subsubsection{Command for Declaring New Shapes} @@ -749,12 +873,12 @@ The following command declares a new shape: The \meta{code} will be executed each time |\pgfnode| (or |\pgfmultipartnode|) is called to create a node of the shape - \meta{shape name}. When the \meta{code} + \meta{shape name}. When the \meta{code} is executed, the \TeX-boxes of the node parts will contain the text labels of the node. Possibly, these box are void. For example, if there is just a |text| part, the node |\pgfnodeparttextbox| will be setup when the \meta{code} is - executed. + executed. The \meta{code} can use the width, height, and depth of the box(es) to compute the location of the saved anchor. In addition, @@ -791,7 +915,7 @@ The following command declares a new shape: origin. Either will be fine, for the final shape this will make no difference since the shape will be shifted anyway. So, let us assume that the text label is centered on the origin (this will be - specified later on using the |text| anchor). We get + specified later on using the |text| anchor). We get the following code for the upper right corner: \begin{codeexample}[code only] \savedanchor{\upperrightcorner}{ @@ -802,7 +926,7 @@ The following command declares a new shape: If we wanted to take, say, the |\pgfshapeminwidth| into account, we could use the following code: - + \begin{codeexample}[code only] \savedanchor{\upperrightcorner}{ \pgf@y=.\ht\pgfnodeparttextbox % height of the box @@ -814,13 +938,13 @@ The following command declares a new shape: } \end{codeexample} Note that we could not have written |.5\pgfshapeminwidth| since - the minium width is stored in a ``plain text macro,'' not as a - real dimension. So if |\pgfshapeminwidth| depth were + the minimum width is stored in a ``plain text macro,'' not as a + real dimension. So if |\pgfshapeminwidth| depth were 2cm, writing |.5\pgfshapeminwidth| would yield the same as |.52cm|. In the ``real'' |rectangle| shape the code is somewhat more complex, but you get the basic idea. - \end{command} + \end{command} \begin{command}{\saveddimen\marg{command}\marg{code}} This command is similar to |\savedanchor|, only instead of setting \meta{command} to |\pgfpoint{|$x$|}{|$y$|}|, the \meta{command} is @@ -828,13 +952,13 @@ The following command declares a new shape: In the |simple rectangle| shape we might use a saved dimension to store the depth of the shape box. - + \begin{codeexample}[code only] \saveddimen{\depth}{ - \pgf@x=\dp\pgfnodeparttextbox + \pgf@x=\dp\pgfnodeparttextbox } \end{codeexample} - \end{command} + \end{command} \begin{command}{\savedmacro\marg{command}\marg{code}} This command is similar to |\saveddimen|, only at some point in \meta{code}, \meta{command} should be defined appropriately, @@ -842,11 +966,11 @@ The following command declares a new shape: In the |regular polygon| shape, a saved macro is used to store the number of sides of the polygon. - + \begin{codeexample}[code only] \savedmacro{\sides}{\let\sides\pgfpolygonsides} \end{codeexample} - \end{command} + \end{command} \begin{command}{\anchor\marg{name}\marg{code}} This command declares an anchor named \meta{name}. Unlike for saved anchors, the \meta{code} will not be executed each time a node is @@ -870,7 +994,7 @@ The following command declares a new shape: Let us consider some example for the |simple rectangle| shape. First, we would like to make the upper right corner publicly available, for example as |north east|: - + \begin{codeexample}[code only] \anchor{north east}{\upperrightcorner} \end{codeexample} @@ -882,7 +1006,7 @@ The following command declares a new shape: Next, let us define a |north west| anchor. For this anchor, we can negate the |\pgf@x| variable: - + \begin{codeexample}[code only] \anchor{north west}{ \upperrightcorner @@ -921,18 +1045,51 @@ The following command declares a new shape: \end{codeexample} to center the text label on the origin in the shape coordinate space. Note that we could \emph{not} have written the following: - + \begin{codeexample}[code only] \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}} \end{codeexample} Do you see why this is wrong? The problem is that the box |\pgfnodeparttextbox| will most likely not have the correct size when the anchor is computed. After all, the anchor position might - be recomputed at a time when several other nodes have been created. + be recomputed at a time when several other nodes have been created. If a shape has several node parts, we would have to define an - anchor for each part. - \end{command} + anchor for each part. + \end{command} + + \begin{command}{\deferredanchor\marg{name}\marg{code}} + This command declares an anchor named \meta{name}. It works like + |\anchor|. However, unlike for + anchors declared by |\anchor|, \meta{name} will \emph{not} be + expanded during the shape declaration (i.e.\ not during + |\pgfdeclareshape|). Rather, the \meta{name} is expanded when the + \emph{node} is actually used (with |\pgfnode| or more likely with + |\node|). This may be useful if the anchor name is context + dependent (depending, for example, on the value of a key). + +\begin{codeexample}[code only] +\makeatletter +\def\foo{foo} +\pgfdeclareshape{simple shape}{% + \savedanchor{\center}{% + \pgfpointorigin} + \anchor{center}{\center} + \savedanchor{\anchorfoo}{% + \pgf@x=1cm + \pgf@y=0cm} + \deferredanchor{anchor \foo}{\anchorfoo}} + +\begin{tikzpicture} + \node[simple shape] (Test1) at (0,0) {}; + \fill (Test1.anchor foo) circle (2pt) node[below] {anchor foo anchor}; + % + \def\foo{bar} + \node[simple shape] (Test2) at (2,2) {}; + \fill (Test2.anchor bar) circle (2pt) node[below] {anchor bar anchor}; +\end{tikzpicture} +\end{codeexample} + \end{command} \begin{command}{\anchorborder\marg{code}} A \emph{border anchor} is an anchor point on the border of the shape. What exactly is considered as the ``border'' of the shape @@ -963,7 +1120,7 @@ The following command declares a new shape: \pgfpointborderrectangle{\pgfpoint{\@tempdima}{\@tempdimb}}{\upperrightcorner} } \end{codeexample} - \end{command} + \end{command} \begin{command}{\backgroundpath\marg{code}} This command specifies the path that ``makes up'' the background of the shape. Note that the shape cannot prescribe what is going @@ -984,17 +1141,17 @@ The following command declares a new shape: \pgfpathrectanglecorners {\upperrightcorner} {\pgfpointscale{-1}{\upperrightcorner}} -} +} \end{codeexample} As the name suggests, the background path is used ``behind'' the text labels. Thus, this path is used first, then the text labels are drawn, possibly obscuring part of the path. - \end{command} + \end{command} \begin{command}{\foregroundpath\marg{code}} This command works like |\backgroundpath|, only it is invoked after the text labels have been drawn. This means that this path can possibly obscure (part of) the text labels. - \end{command} + \end{command} \begin{command}{\behindbackgroundpath\marg{code}} Unlike the previous two commands, \meta{code} should not only construct a path, it should also use this path in whatever way is @@ -1006,19 +1163,19 @@ The following command declares a new shape: path. Note that the \meta{code} is protected with a |{pgfscope}|. - \end{command} + \end{command} \begin{command}{\beforebackgroundpath\marg{code}} This command works like |\behindbackgroundpath|, only the \meta{code} is executed after the background path has been used, but before the texts label are drawn. - \end{command} + \end{command} \begin{command}{\behindforegroundpath\marg{code}} The \meta{code} is executed after the text labels have been drawn, but before the foreground path is used. - \end{command} + \end{command} \begin{command}{\beforeforegroundpath\marg{code}} This \meta{code} is executed at the very end. - \end{command} + \end{command} \begin{command}{\inheritsavedanchors|[from=|\marg{another shape name}|]|} This command allows you to inherit the code for saved anchors from \meta{another shape name}. The idea is that if you wish to create @@ -1032,32 +1189,32 @@ The following command declares a new shape: always have to inherit all saved anchors from another shape. However, you can inherit the saved anchors of more than one shape by calling this command several times. - \end{command} + \end{command} \begin{command}{\inheritbehindbackgroundpath|[from=|\marg{another shape name}|]|} This command can be used to inherit the code used for the - drawings behind the background path from \meta{another shape name}. - \end{command} + drawings behind the background path from \meta{another shape name}. + \end{command} \begin{command}{\inheritbackgroundpath|[from=|\marg{another shape name}|]|} Inherits the background path code from \meta{another shape name}. - \end{command} + \end{command} \begin{command}{\inheritbeforebackgroundpath|[from=|\marg{another shape name}|]|} Inherits the before background path code from \meta{another shape name}. - \end{command} + \end{command} \begin{command}{\inheritbehindforegroundpath|[from=|\marg{another shape name}|]|} Inherits the behind foreground path code from \meta{another shape name}. - \end{command} + \end{command} \begin{command}{\inheritforegroundpath|[from=|\marg{another shape name}|]|} Inherits the foreground path code from \meta{another shape name}. - \end{command} + \end{command} \begin{command}{\inheritbeforeforegroundpath|[from=|\marg{another shape name}|]|} Inherits the before foreground path code from \meta{another shape name}. - \end{command} + \end{command} \begin{command}{\inheritanchor|[from=|\marg{another shape name}|]|\marg{name}} Inherits the code of one specific anchor named \meta{name} from \meta{another shape name}. Thus, unlike saved anchors, which must be inherited collectively, normal anchors can and must be inherited individually. - \end{command} + \end{command} \begin{command}{\inheritanchorborder|[from=|\marg{another shape name}|]|} Inherits the border anchor code from \meta{another shape name}. \end{command} @@ -1101,16 +1258,16 @@ The following command declares a new shape: \node[fill=examplefill,draw,ellipse,double] at ([shift=(-80:3cm)]x) (y) {Use Case}; - \draw[dashed] (x) -- (y); + \draw[dashed] (x) -- (y); \end{tikzpicture} \end{codeexample} - + \end{command} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex index e113ec72d3a..5284f22bb36 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex @@ -31,7 +31,7 @@ path (in red) consisting of two parts, one open, one closed: (ab) node[below right] {straight segment} (b) node[right] {end first segment} (c) node[right] {end part 1} - (x) node[above right] {part 2 (closed)}; + (x) node[above right] {part 2 (closed)}; \end{tikzpicture} \end{codeexample} @@ -68,7 +68,7 @@ see Section~\ref{section-soft-paths}). The most basic operation is the move-to operation. It must be given at the beginning of paths, though some path construction command (like |\pgfpathrectangle|) generate move-tos implicitly. A move-to operation -can also be used to start a new part of a path. +can also be used to start a new part of a path. \begin{command}{\pgfpathmoveto\marg{coordinate}} This command expects a \pgfname-coordinate like |\pgfpointorigin| as @@ -103,7 +103,7 @@ can also be used to start a new part of a path. to \meta{coordinate} before using it. The command will update the bounding box of the current path and - picture, if necessary. + picture, if necessary. \end{command} @@ -115,7 +115,7 @@ can also be used to start a new part of a path. of path without any other path construction command given before (in particular without a move-to operation), the \TeX\ file may compile without an error message, but a viewer application may display an - error message when trying to render the picture. + error message when trying to render the picture. \begin{codeexample}[] \begin{pgfpicture} \pgfpathmoveto{\pgfpointorigin} @@ -129,11 +129,11 @@ can also be used to start a new part of a path. to \meta{coordinate} before using it. The command will update the bounding box of the current path and - picture, if necessary. + picture, if necessary. \end{command} -\subsection{The Curve-To Path Operation} +\subsection{The Curve-To Path Operations} \begin{command}{\pgfpathcurveto\marg{support 1}\marg{support 2}\marg{coordinate}} This command extends the current path with a Bézier curve from the @@ -161,9 +161,59 @@ can also be used to start a new part of a path. large enough such that it encompasses all of the support points and the \meta{coordinate}. This will guarantee that the curve is completely inside the bounding box, but the bounding box will - typically be quite a bit too large. It is not clear (to me) how this + typically be quite a bit too large. It is not clear (to me) how this can be avoided without resorting to ``some serious math'' in order - to calculate a precise bounding box. + to calculate a precise bounding box. +\end{command} + +\begin{command}{\pgfpathquadraticcurveto\marg{support}\marg{coordinate}} + This command works like |\pgfpathcurveto|, only it uses a quadratic + Bézier curve rather than a cubic one. This means that only one + support point is needed. +\begin{codeexample}[] +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathquadraticcurveto + {\pgfpoint{1cm}{1cm}}{\pgfpoint{2cm}{0cm}} + \pgfsetfillcolor{examplefill} + \pgfusepath{fill,stroke} +\end{pgfpicture} +\end{codeexample} + Internally, the quadratic curve is converted into a cubic + curve. The only noticeable effect of this is that the points used for + computing the bounding box are the control points of the converted + curve rather than \meta{support}. The main effect of this is that + the bounding box will be a bit tighter than might be expected. In + particular, \meta{support} will not always be part of the bounding + box. +\end{command} + + +There exist two commands to draw only part of a cubic Bézier curve: + +\begin{command}{\pgfpathcurvebetweentime\marg{time $t_1$}\marg{time $t_2$}\marg{point p}\marg{point $s_1$}\marg{point $s_2$}\marg{point q}} + + This command draws the part of the curve described by $p$, $s_1$, + $s_2$ and $q$ between the times $t_1$ and $t_2$. A time value of 0 + indicates the point $p$ and a time value of 1 indicates point $q$. + This command includes a moveto operation to the first point. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw [thin] (0,0) .. controls (0,2) and (3,0) .. (3,2); + \pgfpathcurvebetweentime{0.25}{0.9}{\pgfpointxy{0}{0}}{\pgfpointxy{0}{2}} + {\pgfpointxy{3}{0}}{\pgfpointxy{3}{2}} + \pgfsetstrokecolor{red} + \pgfsetstrokeopacity{0.5} + \pgfsetlinewidth{2pt} + \pgfusepath{stroke} +\end{tikzpicture} +\end{codeexample} +\end{command} + +\begin{command}{\pgfpathcurvebetweentimecontinue\marg{time $t_1$}\marg{time $t_2$}\marg{point p}\marg{point $s_1$}\marg{point $s_2$}\marg{point q}} + This command works like |\pgfpathcurvebetweentime|, except that a + moveto operation is \emph{not} made to the first point. \end{command} @@ -175,7 +225,7 @@ can also be used to start a new part of a path. \emph{is} a difference between closing a path and using the line-to operation to add a straight line to the start of the current path. The difference is demonstrated by the upper corners of the triangles - in the following example: + in the following example: \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); @@ -213,7 +263,7 @@ circles to a path are described. counterclockwise, otherwise clockwise). This curve is now moved such that the point where the curve starts is the previous last point of the path. Note that this command will \emph{not} start a new part of the - path, which is important for example for filling purposes. + path, which is important for example for filling purposes. \begin{codeexample}[] \begin{tikzpicture} @@ -279,15 +329,130 @@ circles to a path are described. \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); \draw (0,0) -- (2cm,5mm) (0,0) -- (0cm,1cm); - + \pgfpathmoveto{\pgfpoint{2cm}{5mm}} \pgfpatharcaxes{0}{90}{\pgfpoint{2cm}{5mm}}{\pgfpoint{0cm}{1cm}} \pgfusepath{draw} \end{tikzpicture} \end{codeexample} -\end{command} +\end{command} +\begin{command}{\pgfpatharcto\marg{x-radius}\marg{y-radius}\marg{rotation} + \marg{large arc flag}\marg{counterclockwise flag}\\\marg{target point}} + This command (which directly corresponds to the arc-path command of + \textsc{svg}) is used to add an arc to the path that starts at the + current point and ends at \meta{target point}. This arc is part of + an ellipse that is determined in the following way: Imagine an + ellipse with radii \meta{x-radius} and \meta{y-radius} that is + rotated around its center by \meta{rotation} degrees. When you move + this ellipse around in the plane, there will be exactly two + positions such that the two current point and the target point lie + on the border of the ellipse (excluding pathological cases). The + flags \meta{large arc flag} and \meta{clockwise flag} are then used to + decide which of these ellipses should be picked and which arc on the + picked ellipsis should be used. +\begin{codeexample}[] +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \pgfpathmoveto{\pgfpoint{0mm}{20mm}} + \pgfpatharcto{3cm}{1cm}{0}{0}{0}{\pgfpoint{3cm}{1cm}} + \pgfusepath{draw} +\end{tikzpicture} +\end{codeexample} + Both flags are considered to be false exactly if they evaluate to + |0|, otherwise they are true. If the \meta{large arc flag} is true, + then the angle spanned by the arc will be greater than $180^\circ$, + otherwise it will be less than $180^\circ$. The \meta{clockwise + flag} is used to determine which of the two ellipses should be + used: if the flag is true, then the arc goes from the current point + to the target point in a counterclockwise direction, otherwise in a + clockwise fashion. +\begin{codeexample}[] +\begin{tikzpicture} + \pgfsetlinewidth{2pt} + % Flags 0 0: red + \pgfsetstrokecolor{red} + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharcto{20pt}{10pt}{0}{0}{0}{\pgfpoint{20pt}{10pt}} + \pgfusepath{stroke} + % Flags 0 1: blue + \pgfsetstrokecolor{blue} + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharcto{20pt}{10pt}{0}{0}{1}{\pgfpoint{20pt}{10pt}} + \pgfusepath{stroke} + % Flags 1 0: orange + \pgfsetstrokecolor{orange} + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharcto{20pt}{10pt}{0}{1}{0}{\pgfpoint{20pt}{10pt}} + \pgfusepath{stroke} + % Flags 1 1: black + \pgfsetstrokecolor{black} + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharcto{20pt}{10pt}{0}{1}{1}{\pgfpoint{20pt}{10pt}} + \pgfusepath{stroke} +\end{tikzpicture} +\end{codeexample} + \emph{Warning:} The internal computations necessary for this command + are numerically very unstable. In particular, the arc will not + always really end at the \meta{target coordinate}, but may be off by + up to several points. A more precise positioning is currently + infeasible due to \TeX's numerical weaknesses. The only case that + works quite nicely is when the resulting angle is a multiple + of~$90^\circ$. +\end{command} + +\begin{command}{\pgfpatharctoprecomputed\marg{center point}\marg{start angle}\marg{end angle}\marg{end point}\\\marg{x-radius}\marg{y-radius}\marg{ratio x-radius/y-radius}\marg{ratio y-radius/x-radius}} + A specialized arc operation which is fast and numerically stable, provided a lot of information is given in advance. + + In contrast to |\pgfpatharc|, it explicitly interpolates start- and end points. + + In contrast to |\pgfpatharcto|, this routine is numerically stable and quite fast since it relies on a lot of available information. +\begin{codeexample}[] +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \def\cx{1.5cm}% center x + \def\cy{1cm}% center y + \def\startangle{0}% + \def\endangle{270}% + \def\a{1.5cm}% xradius + \def\b{0.5cm}% yradius + \pgfmathparse{\a/\b}\let\abratio=\pgfmathresult + \pgfmathparse{\b/\a}\let\baratio=\pgfmathresult + % + % start point: + \pgfpathmoveto{\pgfpoint{\cx+\a*cos(\startangle)}{\cy+\b*sin(\startangle)}}% + \pgfpatharctoprecomputed + {\pgfpoint{\cx}{\cy}} + {\startangle} + {\endangle} + {\pgfpoint{\cx+\a*cos(\endangle)}{\cy+\b*sin(\endangle)}}% end point + {\a} + {\b} + {\abratio} + {\baratio} + \pgfusepath{draw} +\end{tikzpicture} +\end{codeexample} + + \begin{command}{\pgfpatharctomaxstepsize} + The quality of arc approximation taken by |\pgfpatharctoprecomputed| by means of Bezier splines is % TODOsp: Bezier --> Bézier? + controlled by a mesh width, which is initially + + |\def\pgfpatharctoprecomputed{45}|. + + The mesh width is provided in (full!) degrees. The smaller the mesh + width, the more precise the arc approximation. + + Use an empty value to disable spline approximation (uses a single + cubic polynomial for the complete arc). + + The value must be an integer! + \end{command} +\end{command} + \begin{command}{\pgfpathellipse\marg{center}\marg{first axis}\marg{second axis}} The effect of this command is to append an ellipse to the current @@ -296,7 +461,7 @@ circles to a path are described. \meta{second axis} are the axis \emph{vectors}. The same effect as this command can also be achieved using an appropriate sequence of move-to, arc, and close operations, but this command is easier and - faster. + faster. \begin{codeexample}[] \begin{tikzpicture} @@ -305,7 +470,7 @@ circles to a path are described. {\pgfpoint{1.5cm}{0cm}} {\pgfpoint{0cm}{1cm}} \pgfusepath{draw} - \color{red} + \color{red} \pgfpathellipse{\pgfpoint{1cm}{0cm}} {\pgfpoint{1cm}{1cm}} {\pgfpoint{-0.5cm}{0.5cm}} @@ -321,12 +486,12 @@ circles to a path are described. of the two axis vectors. The command will update the bounding box of the current path and - picture, if necessary. + picture, if necessary. \end{command} -\begin{command}{\pgfpathcirlce\marg{center}\marg{radius}} +\begin{command}{\pgfpathcircle\marg{center}\marg{radius}} A shorthand for |\pgfpathellipse| applied to \meta{center} and the - two axis vectors $(\meta{radius},0)$ and $(0,\meta{radius})$. + two axis vectors $(\meta{radius},0)$ and $(0,\meta{radius})$. \end{command} @@ -379,7 +544,7 @@ start a new part of the path. number of parts are added to the path, each part consisting of a single horizontal or vertical straight line segment. - Conceptually, the origin is part of the grid and the grid is clipped + Conceptually, the origin is part of the grid and the grid is clipped to the rectangle specified by the \meta{lower left} and the \meta{upper right} corner. However, no clipping occurs (this command just adds parts to the current path). Rather, the points @@ -411,7 +576,7 @@ start a new part of the path. \end{codeexample} The command will apply coordinate transformations and update the bounding boxes tightly. As for ellipses, the transformations are - applied to the ``conceptually finished'' grid. + applied to the ``conceptually finished'' grid. \begin{codeexample}[] \begin{pgfpicture} \pgftransformrotate{10} @@ -491,7 +656,7 @@ cosine curves in intervals that are multiples of $\pi/2$. \end{tikzpicture} \end{codeexample} The command will apply coordinate transformations and update the - bounding boxes. + bounding boxes. \end{command} \begin{command}{\pgfpathcosine\marg{vector}} @@ -512,10 +677,11 @@ cosine curves in intervals that are multiples of $\pi/2$. \end{pgfpicture} \end{codeexample} The command will apply coordinate transformations and update the - bounding boxes. + bounding boxes. \end{command} + \subsection{Plot Path Operations} There exist several commands for appending @@ -583,7 +749,7 @@ following two commands. More or less ``all'' corners will be rounded, even the corner generated by a |\pgfpathclose| command. (The author is a bit proud of this feature.) - + \begin{codeexample}[] \begin{pgfpicture} \pgfsetcornersarced{\pgfpoint{4pt}{4pt}} @@ -603,7 +769,7 @@ following two commands. Note that the rounding will produce strange and undesirable effects if the lines at the corners are too short. In this case the shortening may cause the lines to ``suddenly extend over the other - end'' which is rarely desirable. + end'' which is rarely desirable. \end{command} @@ -617,7 +783,13 @@ following two commands. The path construction commands keep track of two bounding boxes: One for the current path, which is reset whenever the path is used and -thereby flushed, and a bounding box for the current |{pgfpicture}|. +thereby flushed, and a bounding box for the current |{pgfpicture}|. + +\begin{command}{\pgfresetboundingbox} + Resets the picture's bounding box. The picture will simply forget any previous bounding box updates and start collecting from scratch. + + You can use this together with |\pgfusepath{use as bounding box}| to replace the bounding box by the one of a particular path (ignoring subsequent paths). +\end{command} The bounding boxes are not accessible by ``normal'' macros. Rather, two sets of four dimension variables are used for this, all of which @@ -690,4 +862,3 @@ will set this if to false, as will certain other commands. \begin{command}{\pgf@relevantforpicturesizetrue} Causes updating of the picture's bounding box. \end{command} - diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex index 4bf133174fd..cfb74f5b51b 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex @@ -22,7 +22,7 @@ tiling pattern and it is explained in the following how this is done. A tiling pattern can be imagined as a rectangular tile (hence the name) on which a small picture is painted. There is not a single tile, -but (conceptually) an infinite number of tiles, all showing the same +but (conceptually) an infinite number of tiles, all showing the same picture, and these tiles are arranged horizontally and vertically to fill the plane. When you use a tiling pattern to fill a path, what happens is that the path clips out a ``window'' through which we see @@ -31,7 +31,7 @@ part of this infinite plane. Patterns come in two versions: \emph{inherently colored patterns} and \emph{form-only patterns}. (These are often called ``color patterns'' and ``uncolored patterns,'' but these names are misleading since -uncolored patterns do have a color and the color changes. As I said, +uncolored patterns do have a color and the color changes. As I said, the name is misleading\dots) An inherently colored pattern is just a colored tile like, say, a red star with a black outline. A form-only pattern can be imagined as a tile that is a kind of rubber stamp. When @@ -52,7 +52,10 @@ it anymore. In particular, it is not possible to enlarge it or change the line width. Such flexibility would require that the repeating of the pattern were not done by the graphic language, but on the \pgfname\ level. This would make patterns orders of magnitude slower -to produce and to render. +to produce and to render. However, \pgfname{} does provide a +more-or-less successful emulation of ``mutable'' patterns, although +internally, a new (fixed) instance of a pattern is declared when +the parameters of a pattern change. Second, the phase of patterns is not well-defined, that is, it is not clear where origin of the ``first'' tile is. To be more precise, @@ -73,12 +76,14 @@ Before a pattern can be used, it must be declared. The following command is used for this: \begin{command}{\pgfdeclarepatternformonly% - \marg{name}% - \marg{lower left}% - \marg{upper right}% - \marg{tile size}% - \marg{code}} - This command declares a new form-only pattern. The \marg{name} is a + \opt{\oarg{variables}}% + \marg{name}% + \marg{bottom left}% + \marg{top right}% + \marg{tile size}% + \marg{code}} + + This command declares a new form-only pattern. The \marg{name} is a name for later reference. The two parameters \marg{lower left} and \marg{upper right} must describe a bounding box that is large enough to encompass the complete tile. @@ -94,7 +99,7 @@ command is used for this: The \meta{code} should be \pgfname\ code than can be protocolled. It should not contain any color code. - + \begin{codeexample}[] \pgfdeclarepatternformonly{stars} {\pgfpointorigin}{\pgfpoint{1cm}{1cm}} @@ -110,14 +115,72 @@ command is used for this: \pgfusepath{fill} } \begin{tikzpicture} - \filldraw[pattern=stars] (0,0) rectangle (1.5,2); + \filldraw[pattern=stars] (0,0) rectangle (1.5,2); \filldraw[pattern=stars,pattern color=red] - (1.5,0) rectangle (3,2); + (1.5,0) rectangle (3,2); +\end{tikzpicture} +\end{codeexample} + + The optional argument \meta{variables} consists of a comma + separated list of macros, registers or keys, representing the + parameters of the pattern that may vary. If a variable is a key, + then the full path name must be used (specifically, it must start + with |/|). + As an example, a list might look like the following: + |\mymacro,\mydimen,/pgf/my key|. Note that macros and keys should + be ``simple''. They should only store values in themselves. + + The effect of \meta{variables}, is the following: + Normally, when this argument is empty, once a pattern has been + declared, it becomes ``frozen''. This means that it is not possible + to enlarge the pattern or change the line width later on. + By specifying \meta{variables} no pattern is actually created. + Instead, the arguments are stored away + (so the macros, registers or keys do not have to be defined in advance). + + When the fill patten is set, \pgfname{} checks if the pattern has + already been created with the \meta{variables} set to their current + values (\pgfname{} is usually ``smart enough'' to distinguish between + macros, registers and keys). If so, this already-declared-pattern + is used as the fill pattern. + If not, a new instance of the pattern (which will have a + unique internal name) is declared using the current values of + \meta{variables}. These values are then saved and the fill pattern + set accordingly. + + The following shows an example of a pattern which varies + according to the values of the macro |\size|, the key |/tikz/radius|, + and the \TeX{} dimension |\thickness|. + +\begin{codeexample}[] +\pgfdeclarepatternformonly[/tikz/radius,\thickness,\size]{rings} +{\pgfpoint{-0.5*\size}{-0.5*\size}} +{\pgfpoint{0.5*\size}{0.5*\size}} +{\pgfpoint{\size}{\size}} +{ + \pgfsetlinewidth{\thickness} + \pgfpathcircle\pgfpointorigin{\pgfkeysvalueof{/tikz/radius}} + \pgfusepath{stroke} +} +\newdimen\thickness +\tikzset{ + radius/.initial=4pt, + size/.store in=\size, size=20pt, + thickness/.code={\thickness=#1}, + thickness=0.75pt +} +\begin{tikzpicture}[rings/.style={pattern=rings}] + \filldraw [rings, radius=2pt, size=6pt] (0,0) rectangle +(1.5,2); + \filldraw [rings, radius=2pt, size=8pt] (2,0) rectangle +(1.5,2); + \filldraw [rings, radius=6pt, thickness=2pt] (0,2.5) rectangle +(1.5,2); + \filldraw [rings, radius=8pt, thickness=4pt] (2,2.5) rectangle +(1.5,2); \end{tikzpicture} \end{codeexample} \end{command} + \begin{command}{\pgfdeclarepatterninherentlycolored + \opt{\oarg{variables}} \marg{name} \marg{lower left} \marg{upper right} @@ -126,8 +189,8 @@ command is used for this: This command works like |\pgfdeclarepatternuncolored|, only the pattern will have an inherent color. To set the color, you should use \pgfname's color commands, not the |\color| command, since this - fill not be protocolled. - + fill is not protocolled. + \begin{codeexample}[] \pgfdeclarepatterninherentlycolored{green stars} {\pgfpointorigin}{\pgfpoint{1cm}{1cm}} @@ -144,12 +207,14 @@ command is used for this: \pgfusepath{stroke,fill} } \begin{tikzpicture} - \filldraw[pattern=green stars] (0,0) rectangle (3,2); + \filldraw[pattern=green stars] (0,0) rectangle (3,2); \end{tikzpicture} \end{codeexample} \end{command} + + \subsection{Setting a Pattern} Once a pattern has been declared, it can be used. @@ -163,17 +228,17 @@ Once a pattern has been declared, it can be used. \begin{codeexample}[] \begin{tikzpicture} \pgfsetfillpattern{stars}{red} - \filldraw (0,0) rectangle (1.5,2); + \filldraw (0,0) rectangle (1.5,2); \pgfsetfillpattern{green stars}{red} - \filldraw (1.5,0) rectangle (3,2); + \filldraw (1.5,0) rectangle (3,2); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{command} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex index 0ce8c0df587..89b51dffbad 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex @@ -18,7 +18,7 @@ This section describes the |plot| module. This module provides a set of commands that are intended to make it reasonably easy to plot functions using \pgfname. It is loaded automatically by |pgf|, but you can load it manually if you have - only included |pgfcore|. + only included |pgfcore|. \end{pgfmodule} @@ -32,7 +32,7 @@ for whatever reason -- you wish to use \pgfname\ for generating a plot. \pgfname\ (conceptually) uses a two-stage process for generating plots. First, a \emph{plot stream} must be produced. This stream -consists (more or less) of a large number of coordinates. Second a +consists (more or less) of a large number of coordinates. Second a \emph{plot handler} is applied to the stream. A plot handler ``does something'' with the stream. The standard handler will issue line-to operations to the coordinates in the stream. However, a @@ -118,7 +118,7 @@ file and converts it into a plot stream. \begin{codeexample}[code only] 2 -5 some text \end{codeexample} - is turned into + is turned into \begin{codeexample}[code only] \pgfplotstreampoint{\pgfpointxy{2}{-5}} \end{codeexample} @@ -128,7 +128,7 @@ file and converts it into a plot stream. either of them is empty and, hence, ignored. When the file has been read completely, |\pgfplotstreamend| is - called. + called. \end{command} @@ -158,10 +158,10 @@ Currently, there is no command that can decide automatically whether the xy-coordinate system should be used or whether the xyz-system should be used. However, it would not be terribly difficult to write a ``smart file reader'' that parses coordinate files a bit more -intelligently. +intelligently. -\begin{command}{\pgfplotfunction\marg{variable}\marg{sample list}\marg{point}} +\begin{command}{\pgfplotfunction\marg{variable}\marg{sample list}\marg{point}} This command will produce coordinates by iterating the \meta{variable} over all values in \meta{sample list}, which should be a list in the |\foreach| syntax. For each value of @@ -172,7 +172,7 @@ intelligently. \begin{tikzpicture}[x=3.8cm/360] \pgfplothandlerlineto \pgfplotfunction{\x}{0,5,...,360}{\pgfpointxy{\x}{sin(\x)+sin(3*\x)}} - \pgfusepath{stroke} + \pgfusepath{stroke} \end{tikzpicture} \end{codeexample} @@ -180,11 +180,11 @@ intelligently. \begin{tikzpicture}[y=3cm/360] \pgfplothandlerlineto \pgfplotfunction{\y}{0,5,...,360}{\pgfpointxyz{sin(2*\y)}{\y}{cos(2*\y)}} - \pgfusepath{stroke} + \pgfusepath{stroke} \end{tikzpicture} \end{codeexample} - Be warnded that if the expressions that need to evaluated for each + Be warned that if the expressions that need to evaluated for each point are complex, then this command can be very slow. \end{command} @@ -217,7 +217,7 @@ set terminal table; set output "#1.table"; set format "%.5f" Assuming that the call succeeded, the next step is to invoke |\pgfplotxyfile| on the file \meta{prefix}|.table|; which is exactly the file that has just been created by |gnuplot|. - + \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,-1) grid (4,1); @@ -284,7 +284,7 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and \end{command} \begin{command}{\pgfsetmovetofirstplotpoint} - Specifies that the line-to plot handler (and also some other plot + Specifies that the line-to plot handler (and also some other plot handlers) should issue a move-to command for the first point of the plot instead of a line-to. This will start a new part of the current path, which is not always, but often, @@ -311,6 +311,11 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and \end{codeexample} \end{command} +\begin{command}{\pgfplothandlerpolygon} + This handler works like the line-to plot handler, only the line is + closed at the end using |\pgfpathclose|, resulting in a polygon. +\end{command} + \begin{command}{\pgfplothandlerdiscard} This handler will simply throw away the stream. \end{command} @@ -322,7 +327,7 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and commands that were issued on the stream. You can then install another handler and invoke \meta{macro} to ``replay'' the stream (possibly many times). - + \begin{codeexample}[] \begin{pgfpicture} \pgfplothandlerrecord{\mystream} @@ -338,10 +343,10 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and \mystream \pgfusepath{stroke} \end{pgfpicture} -\end{codeexample} +\end{codeexample} \end{command} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex index ae7e3e142b2..931a6a7bcf9 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex @@ -38,7 +38,7 @@ coordinate. \pgfpathcircle{\pgfpoint{2cm}{5pt}} {2pt} \pgfpathcircle{\pgfpoint{0pt}{.5in}}{2pt} \pgfusepath{fill} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} @@ -69,7 +69,7 @@ coordinate. \foreach \angle in {0,10,...,90} {\pgfpathcircle{\pgfpointpolar{\angle}{1cm/2cm}}{2pt}} \pgfusepath{fill} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} @@ -94,19 +94,19 @@ $y$-vector do not necessarily point ``horizontally'' and \pgfpathmoveto{\pgfpointxy{1}{0}} \pgfpathlineto{\pgfpointxy{2}{2}} \pgfusepath{stroke} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} \begin{command}{\pgfsetxvec\marg{point}} Sets that current $x$-vector for usage in the $xyz$-coordinate - system. + system. \example \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); - + \pgfpathmoveto{\pgfpointxy{1}{0}} \pgfpathlineto{\pgfpointxy{2}{2}} \pgfusepath{stroke} @@ -116,7 +116,7 @@ $y$-vector do not necessarily point ``horizontally'' and \pgfpathmoveto{\pgfpointxy{1}{0}} \pgfpathlineto{\pgfpointxy{2}{2}} \pgfusepath{stroke} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} @@ -131,7 +131,7 @@ $y$-vector do not necessarily point ``horizontally'' and \meta{radius} is now a factor to be interpreted in the $xy$-coordinate system. This means that a degree of |0| is the same as the $x$-vector of the $xy$-coordinate system times \meta{radius} - and a degree of |90| is the $y$-vecotr times \meta{radius}. As for + and a degree of |90| is the $y$-vector times \meta{radius}. As for |\pgfpointpolar|, a \meta{radius} can also be a pair separated by a slash. In this case, the $x$- and $y$-vectors are multiplied by different factors. @@ -163,7 +163,7 @@ three dimensional graphics. \begin{codeexample}[] \begin{pgfpicture} \pgfsetarrowsend{to} - + \pgfpathmoveto{\pgfpointorigin} \pgfpathlineto{\pgfpointxyz{0}{0}{1}} \pgfusepath{stroke} @@ -214,7 +214,7 @@ using spherical and cylindrical coordinates. \pgfsetfillcolor{lightgray} \foreach \latitude in {-90,-75,...,30} - { + { \foreach \longitude in {0,20,...,360} { \pgfpathmoveto{\pgfpointspherical{\longitude}{\latitude}{1}} @@ -245,7 +245,7 @@ coordinates. \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); \pgfpathcircle{\pgfpointadd{\pgfpoint{1cm}{0cm}}{\pgfpoint{1cm}{1cm}}}{2pt} - \pgfusepath{fill} + \pgfusepath{fill} \end{tikzpicture} \end{codeexample} \end{command} @@ -256,7 +256,7 @@ coordinates. \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); \pgfpathcircle{\pgfpointscale{1.5}{\pgfpoint{1cm}{0cm}}}{2pt} - \pgfusepath{fill} + \pgfusepath{fill} \end{tikzpicture} \end{codeexample} \end{command} @@ -267,7 +267,7 @@ coordinates. \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); \pgfpathcircle{\pgfpointdiff{\pgfpoint{1cm}{0cm}}{\pgfpoint{1cm}{1cm}}}{2pt} - \pgfusepath{fill} + \pgfusepath{fill} \end{tikzpicture} \end{codeexample} \end{command} @@ -293,9 +293,9 @@ coordinates. \pgfpathcircle{\pgfpoint{2cm}{1cm}}{2pt} \pgfpathcircle{\pgfpointscale{20} {\pgfpointnormalised{\pgfpoint{2cm}{1cm}}}}{2pt} - \pgfusepath{fill} + \pgfusepath{fill} \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{command} @@ -331,7 +331,7 @@ on Bézier curves. \foreach \t in {0,0.25,...,1.25} {\pgftext[at= \pgfpointlineattime{\t}{\pgfpointorigin}{\pgfpoint{2cm}{2cm}}]{\t}} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} @@ -350,12 +350,12 @@ on Bézier curves. \foreach \d in {0pt,20pt,40pt,70pt} {\pgftext[at= \pgfpointlineatdistance{\d}{\pgfpointorigin}{\pgfpoint{3cm}{2cm}}]{\d}} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} \begin{command}{\pgfpointcurveattime\marg{time $t$}\marg{point - $p$}\marg{point $s_1$}\marg{point $s_2$}\marg{point $q$}} + $p$}\marg{point $s_1$}\marg{point $s_2$}\marg{point $q$}} Yields a point that is on the Bézier curve from $p$ to $q$ with the support points $s_1$ and $s_2$. The time $t$ is used to determine the location, where $t=0$ yields $p$ and $t=1$ yields $q$. @@ -372,7 +372,7 @@ on Bézier curves. {\pgfpoint{0cm}{2cm}} {\pgfpoint{0cm}{2cm}} {\pgfpoint{3cm}{2cm}}]{\t}} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} @@ -407,7 +407,7 @@ mechanism to determine border points of shapes. \pgfpathcircle{\pgfpointborderrectangle {\pgfpoint{-10pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt} \pgfusepath{fill} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} @@ -432,7 +432,7 @@ mechanism to determine border points of shapes. \pgfpathcircle{\pgfpointborderellipse {\pgfpoint{-10pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt} \pgfusepath{fill} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} @@ -456,7 +456,7 @@ mechanism to determine border points of shapes. {\pgfpointxy{1}{2}}{\pgfpointxy{2}{0}}} {2pt} \pgfusepath{stroke} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} @@ -481,15 +481,92 @@ mechanism to determine border points of shapes. {1cm}{0.8cm}{1}} {2pt} \pgfusepath{stroke} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{command} +\subsubsection{Points on the Intersection of Two Paths} + + +\begin{pgflibrary}{intersections} + This library defines the below command and allows you to calculate + the intersections of two arbitrary paths. However, due to the low accuracy of + \TeX, the paths should not be ``too complicated''. + In particular, you should not try to intersect paths consisting + lots of very small segments such as plots or decorated paths. +\end{pgflibrary} + +\begin{command}{\pgfintersectionofpaths\marg{path 1}\marg{path 2}} + This command finds the intersection points on the paths + \meta{path 1} and \meta{path 2}. The number of intersection points + (``solutions'') that are found will be stored, and each point + can be accessed afterward. The code for \meta{path 1} and + \meta{path 2} is executed within a \TeX{} group and so can contain + transformations (which will be in addition to any existing + transformations). The code should not use the path in any way, + unless the path is saved first and restored afterward. + \pgfname{} will regard solutions as ``a bit + special'', in that the points returned will be ``absolute'' and + unaffected by any further transformations. + +\begin{codeexample}[] +\begin{pgfpicture} +\pgfintersectionofpaths +{ + \pgfpathellipse{\pgfpointxy{0}{0}}{\pgfpointxy{1}{0}}{\pgfpointxy{0}{2}} + \pgfgetpath\temppath + \pgfusepath{stroke} + \pgfsetpath\temppath +} +{ + \pgftransformrotate{-30} + \pgfpathrectangle{\pgfpointorigin}{\pgfpointxy{2}{2}} + \pgfgetpath\temppath + \pgfusepath{stroke} + \pgfsetpath\temppath +} +\foreach \s in {1,...,\pgfintersectionsolutions} + {\pgfpathcircle{\pgfpointintersectionsolution{\s}}{2pt}} +\pgfusepath{stroke} +\end{pgfpicture} +\end{codeexample} + + \begin{command}{\pgfintersectionsolutions} + After using the |\pgfintersectionofpaths| command, this \TeX-macro + will indicate the number of solutions found. + \end{command} + + \begin{command}{\pgfpointintersectionsolution\marg{number}} + After using the |\pgfintersectionofpaths| command, this command + will return the point for solution \meta{number} or the origin + if this solution was not found. + By default, the intersections are simply returned in the order that + the intersection algorithm finds them. Unfortunately, this is not + necessarily a ``helpful'' ordering. However the following two + commands can be used to order the solutions more helpfully. + \end{command} + +\let\ifpgfintersectionsortbyfirstpath=\relax + \begin{command}{\pgfintersectionsortbyfirstpath} + Using this command will mean the solutions will be sorted along + \meta{path 1}. + \end{command} + +\let\ifpgfintersectionsortbysecondpath=\relax + \begin{command}{\pgfintersectionsortbysecondpath} + Using this command will mean the solutions will be sorted along + \meta{path 2}. + \end{command} + +\end{command} + + + \subsection{Extracting Coordinates} There are two commands that can be used to ``extract'' the $x$- or -$y$-coordinate of a coordinate. +$y$-coordinate of a coordinate. \begin{command}{\pgfextractx\marg{dimension}\marg{point}} Sets the \TeX-\meta{dimension} to the $x$-coordinate of the point. @@ -505,18 +582,31 @@ $y$-coordinate of a coordinate. Like |\pgfextractx|, except for the $y$-coordinate. \end{command} +\begin{command}{\pgfgetlastxy\marg{macro for $x$}\marg{macro for $y$}} + Stores the most recently used $(x,y)$ coordinates into two macros. +\begin{codeexample}[] +\pgfpoint{2cm}{4cm} +\pgfgetlastxy{\macrox}{\macroy} +Macro $x$ is `\macrox' and macro $y$ is `\macroy'. +\end{codeexample} + Since $(x,y)$ coordinates are usually assigned globally, it is safe to use this command after path operations. +\end{command} \subsection{Internals of How Point Commands Work} +\label{section-internal-pointcmds} + As a normal user of \pgfname\ you do not need to read this section. It is relevant only if you need to understand how the point commands work -internally. +internally. When a command like |\pgfpoint{1cm}{2pt}| is called, all that happens is that the two \TeX-dimension variables |\pgf@x| and |\pgf@y| are set -to |1cm| and |2pt|, respectively. A command like |\pgfpathmoveto| that +to |1cm| and |2pt|, respectively. These variables belong to the set of +internal \pgfname\ registers, see section~\ref{section-internal-registers} +for details. A command like |\pgfpathmoveto| that takes a coordinate as parameter will just execute this parameter and then use the values of |\pgf@x| and |\pgf@y| as the coordinates to which it will move the pen on the current path. @@ -534,7 +624,7 @@ command like |\pgfpoint| in a \TeX-scope and then make the changes of \global\pgf@y=\pgf@y % make the change of \pgf@y persist past the scope } % \pgf@x and \pgf@y are now set correctly, all other variables are -% unchanged +% unchanged \end{codeexample} \makeatletter @@ -564,7 +654,7 @@ the code of the command |\pgfpointadd|: -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex index fbc3bdae870..f43e9d29de8 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex @@ -17,7 +17,7 @@ only if you either have a very large number of commands that need to be processed or if you expect your commands to be executed very often. -\subsection{Quick Coordiante Commands} +\subsection{Quick Coordinate Commands} \begin{command}{\pgfqpoint\marg{x}\marg{y}} This command does the same as |\pgfpoint|, but \meta{x} and \meta{y} @@ -25,6 +25,19 @@ be processed or if you expect your commands to be executed very often. |2cm+1pt| are not allowed. \end{command} +\begin{command}{\pgfqpointxy\marg{$s_x$}\marg{$s_y$}} + This command does the same as |\pgfpointxy|, but \meta{$s_x$} and \meta{$s_y$} + must be simple numbers without unit, like |1.234| or |5.0|. Mathematical expressions or units are not allows. +\end{command} + +\begin{command}{\pgfqpointxyz\marg{$s_x$}\marg{$s_y$}\marg{$s_z$}} + As |\pgfqpointxy|, but for three-dimensional coordinates. Any argument needs to be a number without unit. +\end{command} + +\begin{command}{\pgfqpointscale\marg{factor}\marg{coordinate}} + As |\pgfpointscale|, but \marg{factor} must be a simple number without unit, as for the other ``quick'' commands. +\end{command} + \subsection{Quick Path Construction Commands} The difference between the quick and the normal path commands is that diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex index 03e1f13aeb5..ceb90cb8adf 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex @@ -49,7 +49,7 @@ The \pgfname\ system consists of several layers: \end{description} Each layer will automatically load the necessary files of the layers below -it. +it. In addition to the packages of these layers, there are also some library packages. These packages provide additional definitions of @@ -109,7 +109,7 @@ apply. In essence, the following scoping mechanisms are available: Unfortunately, this is not always the case. \emph{Some} graphic parameters only persist till the end of the current \TeX\ group. For - example, when you use |\pgfsetarrows| to set the arrow tip + example, when you use |\pgfsetarrows| to set the arrow tip inside a \TeX\ group, the effect lasts only till the end of the current \TeX\ group. \item @@ -128,14 +128,14 @@ apply. In essence, the following scoping mechanisms are available: constructed and used in the same |{pgfscope}|. However, we might wish to have different coordinate transformations apply to different points on the path. In this case, we can use \TeX\ groups to keep - the effect local, but we could not use |{pgfscope}|. + the effect local, but we could not use |{pgfscope}|. \item The |\pgftext| command can be used to create a scope in which \TeX\ ``escapes back'' to normal \TeX\ mode. The text passed to the |\pgftext| is ``heavily guarded'' against having any effect on the scope in which it is used. For example, it is possibly to use another |{pgfpicture}| environment inside the argument of - |\pgftext|. + |\pgftext|. \end{enumerate} @@ -169,7 +169,7 @@ To use \pgfname, include the following package: \pgfname, but not any modules. That is, it will load all of the commands described in the current part of this manual, but it will not load frontends like \tikzname. It will also load the system - layer. To load additional modules, use the |\usepgfmodule| command + layer. To load additional modules, use the |\usepgfmodule| command explained below. \end{package} @@ -177,20 +177,20 @@ The following package is just a convenience. \begin{package}{pgf} This package loads the |pgfcore| and the two modules |shapes| and - |plot|. + |plot|. In \LaTeX, the package takes two options: \begin{packageoption}{draft} When this option is set, all images will be replaced by empty rectangles. This can speedup compilation. \end{packageoption} - + \begin{packageoption}{version=\meta{version}} Indicates that the commands of version \meta{version} need to be defined. If you set \meta{version} to |0.65|, then a large bunch of ``compatibility commands'' are loaded. If you set \meta{version} to |0.96|, then these compatibility commands will not be loaded. - + If this option is not given at all, then the commands of all versions are defined. \end{packageoption} @@ -206,7 +206,7 @@ The following package is just a convenience. be separated by commas. Instead of curly braces, you can also use square brackets, which is something Con\TeX t users will like. If you try to load a module a second time, nothing will - happen. + happen. \example |\usepgfmodule{matrix,shapes}| @@ -225,12 +225,12 @@ The following modules are available for use with |pgfcore|: commands are explained in Section~\ref{section-plots}. \item The |shapes| module provides commands for drawing shapes and nodes. These commands are explained in - Section~\ref{section-shapes}. + Section~\ref{section-shapes}. \item The |decorations| module provides commands for adding decorations to paths. These commands are explained in - Section~\ref{section-base-decorations}. + Section~\ref{section-base-decorations}. \item The |matrix| module provides the |\pgfmatrix| command. The - commands are documented in Section~\ref{section-base-matrices}. + commands are documented in Section~\ref{section-base-matrices}. \end{itemize} @@ -248,15 +248,15 @@ defines the whole code for handling decorations. Use this command to load further libraries. The list of libraries should contain the names of libraries separated by commas. Instead of curly braces, you can also use square brackets. If you try to - load a library a second time, nothing will happen. + load a library a second time, nothing will happen. \example |\usepgflibrary{arrows}| - This command causes the the file + This command causes the file |pgflibrary|\meta{library}|.code.tex| to be loaded for each \meta{library} in the \meta{list of libraries}. This means that in order to write your own library file, place a file of the appropriate name somewhere - where \TeX\ can find it. \LaTeX, plain \TeX, and Con\TeX t + where \TeX\ can find it. \LaTeX, plain \TeX, and Con\TeX t users can then use your library. You should also consider adding a \tikzname\ library that simply @@ -280,7 +280,7 @@ environment. \begin{environment}{{pgfpicture}} This environment will insert a \TeX\ box containing the graphic drawn by - the \meta{environment contents} at the current position. + the \meta{environment contents} at the current position. \medskip \textbf{The size of the bounding box.} @@ -320,7 +320,7 @@ Hello \begin{pgfpicture} graphic. For this reason, the following two sets of code lines have the same effect, despite the fact that the second graphic uses ``higher'' coordinates than the first: - + \begin{codeexample}[] Rectangles \begin{pgfpicture} \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}} @@ -332,7 +332,7 @@ Rectangles \begin{pgfpicture} \end{codeexample} You can change the baseline using the |\pgfsetbaseline| command, see - below. + below. \begin{codeexample}[] Rectangles \begin{pgfpicture} @@ -357,7 +357,7 @@ Rectangles \begin{pgfpicture} \medskip \textbf{Remembering a picture position for later reference.} - After a picture has been typset, its position on the page is + After a picture has been typeset, its position on the page is normally forgotten by \pgfname\ and also by \TeX. This means that is not possible to reference a node in this picture later on. In particular, it is normally impossible to draw lines between nodes in @@ -405,7 +405,7 @@ Rectangles \begin{pgfpicture} two runs of \TeX.) The position is not directly accessible. Rather, the nodes mechanism will use this position if you access a node from another picture. See Sections~\ref{section-cross-pictures-pgf} - and~\ref{section-cross-picture-tikz} for more details. + and~\ref{section-cross-picture-tikz} for more details. \end{command} } @@ -500,7 +500,7 @@ using the following environment: \pgfusepath{stroke} \end{pgfpicture} \end{codeexample} - + \begin{codeexample}[] \begin{pgfpicture} \begin{pgfscope} @@ -608,7 +608,7 @@ user. This environment temporarily interrupts the computation of the bounding box and sets up a new bounding box. At the beginning of the environment the old bounding box is saved and an empty bounding box - is installed. After the environment the orginal bounding box is + is installed. After the environment the original bounding box is reinstalled as if nothing has happened. \end{environment} @@ -658,15 +658,15 @@ a shading into a |{pgfpicture}|. following keys are defined for this path: \begin{key}{/pgf/text/left} The key causes the text box to be placed such that its left - border is on the origin. + border is on the origin. \begin{codeexample}[] \tikz{\draw[help lines] (-1,-.5) grid (1,.5); \pgftext[left] {lovely}} \end{codeexample} \end{key} \begin{key}{/pgf/text/right} - Thie key causes the text box to be placed such that its right - border is on the origin. + The key causes the text box to be placed such that its right + border is on the origin. \begin{codeexample}[] \tikz{\draw[help lines] (-1,-.5) grid (1,.5); \pgftext[right] {lovely}} @@ -711,7 +711,7 @@ a shading into a |{pgfpicture}|. \end{key} \begin{key}{/pgf/text/at=\meta{point}} Translates the origin (that is, the point where the text is - shown) to \meta{point}. + shown) to \meta{point}. \begin{codeexample}[] \tikz{\draw[help lines] (-1,-.5) grid (1,.5); \pgftext[base,at={\pgfpoint{1cm}{0cm}}] {lovely}} @@ -735,7 +735,5 @@ a shading into a |{pgfpicture}|. \pgftext[base,x=1cm,y=-0.5cm,rotate=30] {lovely}} \end{codeexample} \end{key} - -\end{command} - +\end{command} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex index c3af156d25a..d38f6bf3759 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex @@ -50,10 +50,10 @@ should be red, which has red-green-blue (rgb) components (1,0,0). At Instead of |rgb|, you can currently also specify |gray| as color model, in which case only one value is needed, or |color|, in which case you must provide the name of a color in parentheses. In -a color specification the individual specifications must +a color specification the individual specifications must be separated using a semicolon, which may be followed by a whitespace (like a space or a newline). Individual specifications must be given -in increasing order. +in increasing order. \subsection{Declaring Shadings} @@ -80,12 +80,12 @@ in increasing order. change. By specifying a \meta{color list} you can specify that the shading should be recalculated whenever one of the colors listed in the list changes (this includes effects like color - mixins). Thus, when you specify a \meta{color list}, + mixins). Thus, when you specify a \meta{color list}, % TODOsp: mixins --> mixings? (ff) (or is here really the object meant?) whenever the shading is used, \pgfname\ first converts the colors in the list to \textsc{rgb} triples using the current values of the colors and taking any mixins and blends into account. If the resulting \textsc{rgb} triples have not yet been used, a new - shading is internally created and used. Note that if the + shading is internally created and used. Note that if the option \meta{color list} is used, then no shading is created until the first use of |\pgfuseshading|. In particular, the colors mentioned in the shading need not be defined when the declaration is @@ -96,7 +96,7 @@ in increasing order. is recalculated. Thus even colors not mentioned in the list will be used with their current values, not with the values they had upon declaration. - + \begin{codeexample}[] \pgfdeclarehorizontalshading[mycolor]{myshadingB} {1cm}{rgb(0cm)=(1,0,0); color(2cm)=(mycolor)} @@ -133,13 +133,13 @@ in increasing order. will be the color specified for 0cm and the color of the border of the circle will be the color for the maximum dimension given in the \meta{color specified}. This maximum will also be the radius of - the circle. If the \meta{center point} is not at the + the circle. If the \meta{center point} is not at the origin, the whole shading inside the circle (whose size remains exactly the same) will be distorted such that the given center now has the color specified for 0cm. The effect of \meta{color list} is - the same as for horizontal shadings. + the same as for horizontal shadings. -\begin{codeexample}[] +\begin{codeexample}[] \pgfdeclareradialshading{sphere}{\pgfpoint{0.5cm}{0.5cm}}% {rgb(0cm)=(0.9,0,0); rgb(0.7cm)=(0.7,0,0); @@ -162,10 +162,10 @@ in increasing order. This command creates a \emph{functional shading}. For such a shading, the color of each point is calculated by calling a function that gets the coordinates of the point as input and yields the - color as an output. Note that the function is evaluated by the + color as an output. Note that the function is evaluated by the \emph{renderer}, not by \pgfname\ or \TeX or someone else at compile-time. This means that the evaluation of this function has to - be done \emph{extremely quickly} and the funciton should be + be done \emph{extremely quickly} and the function should be \emph{very simple}. For this reason, only a very restricted set of operations are possible in the function and functions should be kept small. Any errors in the function will only be noticed by the @@ -175,8 +175,8 @@ in increasing order. simplified form of a subset of the PostScript language. This subset will be understood by the PDF-renderer (yes, PDF-renderers do have a basic understanding of PostScript) and also by PostScript - renders. This subset is detailed in Seciton 3.9.4 of the - PDF-specification (version 1.7). In essence, the specificaiton + renders. This subset is detailed in Section~3.9.4 of the + PDF-specification (version 1.7). In essence, the specification states that these functions may contain ``expressions involving integers, real numbers, and boolean values only. There are no composite data structures such as strings or arrays, no procedures, @@ -196,7 +196,7 @@ in increasing order. coordinates of the point for which the color should be computed. The coordinates are dimensionless and given in big points, so for the coordinate $(50bp, 72.27pt)$ the top two stack elements would be - \texttt{50.0} and \texttt{72.0}. Ohterwise, the (virtual) stack is + \texttt{50.0} and \texttt{72.0}. Otherwise, the (virtual) stack is empty (or should be treated as if it were empty). The function should then replace these two values by three values, representing the red, green, and blue color of the point. The numbers should be @@ -208,11 +208,11 @@ in increasing order. which should be a \pgfname-point expression like |\pgfpoint{100bp}{100bp}|. A renderer may choose to evaluate the function at less points, but, in principle, the function will be - evaluated for each pixel independently. + evaluated for each pixel independently. Because of the rather difficult PostScript syntax, use this macro only \emph{if you know what you are doing} (or if you are - advanterous, of course). + advantageous, of course). As for other shadings, the optional \meta{color list} is used to determine whether a shading needs to be recalculated when a color @@ -220,16 +220,7 @@ in increasing order. The \meta{init code} is executed each time a shading is (re)calculated. Typically, it will contain code to extract - coordinates from colors (see below). - - Inside the PostScript function \meta{type 4 function} you cannot use - colors directly. Rather, you must push the color components on the - stack. For this, it is useful to call |\pgfshadecolorrgb| in the - \meta{init code}. The macro takes a color name as input and stores - the color's red/green/blue components real numbers between 0.0 and - 1.0 separated by spaces (which is exactly what you need if you want - to push it on a stack) in a macro. You can then use this macro in - the argument \meta{type 4 function}. + coordinates from colors. \begin{codeexample}[] \pgfdeclarefunctionalshading{twospots} @@ -239,9 +230,9 @@ in increasing order. % Compute distance from (40bp,45bp), with x doubled 45 sub dup mul exch 40 sub dup mul 0.5 mul add sqrt - % expontial decay + % exponential decay dup mul neg 1.0005 exch exp 1.0 exch sub - % Compute distance form (70bp,70bp) from stored coordiante, scaled + % Compute distance form (70bp,70bp) from stored coordinate, scaled 3 1 roll 70 sub dup mul .5 mul exch 70 sub dup mul add sqrt @@ -253,18 +244,33 @@ in increasing order. \pgfuseshading{twospots} \end{codeexample} + Inside the PostScript function \meta{type 4 function} you cannot use + colors directly. Rather, you must push the color components on the + stack. For this, it is useful to call |\pgfshadecolorrgb| in the + \meta{init code}: + +\begin{command}{\pgfshadecolortorgb\marg{color name}\marg{macro}} + This command takes \meta{color name} as input and stores + the color's red/green/blue components real numbers between 0.0 and + 1.0 separated by spaces (which is exactly what you need if you want + to push it on a stack) in \meta{macro}. This macro can then be used + inside the + \meta{type 4 function} argument for |\pgfdeclarefunctionalshading|. + + \begin{codeexample}[] \pgfdeclarefunctionalshading[mycol]{sweep}{\pgfpoint{-1cm}{-1cm}} {\pgfpoint{1cm}{1cm}}{\pgfshadecolortorgb{mycol}{\myrgb}}{ 2 copy % whirl - atan + % Calculate "safe" atan of position + 2 copy abs exch abs add 0.0001 ge { atan } { pop } ifelse 3 1 roll dup mul exch dup mul add sqrt 30 mul add sin - 1 add 2 div + 1 add 2 div dup \myrgb % push mycol 5 4 roll % multiply all components by calculated value @@ -282,6 +288,51 @@ in increasing order. \colorlet{mycol}{red}% \pgfuseshading{sweep} \end{codeexample} + + +In addition, three macros suffixed with |red|, |green| and |blue| +are defined, which store the individual components of +\meta{color name}. These can also +be used in the \meta{type 4 function} argument. + +\begin{codeexample}[] +\pgfshadecolortorgb{orange}{\mycol} +|\mycol|=\mycol |\mycolred|=\mycolred |\mycolgreen|=\mycolgreen |\mycolblue|=\mycolblue +\end{codeexample} +\end{command} + +\begin{codeexample}[] +\pgfdeclarefunctionalshading[col1,col2,col3,col4]{bilinear interpolation} +{\pgfpointorigin}{\pgfpoint{100bp}{100bp}} +{ +\pgfshadecolortorgb{col1}{\first}\pgfshadecolortorgb{col2}{\second} +\pgfshadecolortorgb{col3}{\third}\pgfshadecolortorgb{col4}{\fourth} +}{ + 100 div exch 100 div 2 copy % Calculate y/100 x/100. + neg 1 add exch neg 1 add % Calculate 1-y/100 1-x/100. + 3 1 roll 2 copy exch 5 2 roll 6 copy 6 copy % Set up stack. + \firstred mul exch \secondred mul add mul % Process red component. + 4 1 roll + \thirdred mul exch \fourthred mul add mul + add + 13 1 roll + \firstgreen mul exch \secondgreen mul add mul % Process green component. + 4 1 roll + \thirdgreen mul exch \fourthgreen mul add mul + add + 7 1 roll + \firstblue mul exch \secondblue mul add mul % Process blue component. + 4 1 roll + \thirdblue mul exch \fourthblue mul add mul + add +} + +\colorlet{col1}{blue} +\colorlet{col2}{yellow} +\colorlet{col3}{red} +\colorlet{col4}{green} +\pgfuseshading{bilinear interpolation} +\end{codeexample} \end{command} @@ -292,7 +343,7 @@ in increasing order. Inserts a previously declared shading into the text. If you wish to use it in a |pgfpicture| environment, you should put a |\pgfbox| around it. - + \begin{codeexample}[] \begin{pgfpicture} \pgfdeclareverticalshading{myshadingD} @@ -318,16 +369,16 @@ in increasing order. the bounding box of the current path. This bounding box is computed automatically when a path is computed; however, it can sometimes be (quite a bit) too large, especially when complicated curves are - involved. + involved. Inside the scope, the low-level transformation matrix is modified. The center of the shading is translated (moved) such that it lies on the center of the bounding box of the path. The low-level coordinate - system is also scaled such that the shading ``covers'' the shading (the + system is also scaled such that the shading ``covers'' the shading (the details are a bit more complex, see below). Then, the coordinate - system is rotated by \meta{angle}. Finally, if the macro + system is rotated by \meta{angle}. Finally, if the macro |\pgfsetadditionalshadetransform| has been used, an additional - transformation is applied. + transformation is applied. After everything has been set up, the shading is inserted. Due to the transformations and clippings, the effect will be that the @@ -341,9 +392,9 @@ in increasing order. rectangle itself. For these reasons, things work slightly differently ``in reality.'' - The shading is scaled and translated such that the + The shading is scaled and translated such that the point $(50\mathrm{bp},50\mathrm{bp})$, which is the middle of - the shading, is at the middle of the path and such that the the + the shading, is at the middle of the path and such that the point $(25\mathrm{bp},25\mathrm{bp})$ is at the lower left corner of the path and that $(75\mathrm{bp},75\mathrm{bp})$ is at upper right corner. @@ -354,9 +405,9 @@ in increasing order. shading. Here is an example that demonstrates this effect: \begin{codeexample}[] -\pgfdeclareverticalshading{myshadingE}{100bp} +\pgfdeclareverticalshading{myshadingE}{100bp} {color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)} -\pgfuseshading{myshadingE} +\pgfuseshading{myshadingE} \hskip 1cm \begin{pgfpicture} \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} @@ -380,10 +431,10 @@ in increasing order. place, then the rotation is done. The following graphics show which part of the shading are actually - shown: + shown: \begin{codeexample}[] -\pgfdeclareverticalshading{myshadingF}{100bp} +\pgfdeclareverticalshading{myshadingF}{100bp} {color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)} \begin{tikzpicture} \draw (50bp,50bp) node {\pgfuseshading{myshadingF}}; @@ -403,7 +454,7 @@ in increasing order. \end{scope} \end{tikzpicture} \end{codeexample} - + An advantage of this approach is that when you rotate a radial shading, no distortion is introduced: @@ -430,9 +481,9 @@ in increasing order. and if the path is not a square, but an elongated rectangle, the ``desired'' effect results: The shading will exactly vary between the colors at the 25bp and 75bp boundaries. Here is an example: - + \begin{codeexample}[] -\pgfdeclareverticalshading{myshadingG}{100bp} +\pgfdeclareverticalshading{myshadingG}{100bp} {color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)} \begin{pgfpicture} \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} @@ -462,17 +513,17 @@ in increasing order. \end{codeexample} Note that rainbow shadings are \emph{way} to colorful in almost all - applications. + applications. \end{command} \begin{command}{\pgfsetadditionalshadetransform\marg{transformation}} This command allows you to specify an additional transformation that should be applied to shadings when the |\pgfshadepath| command is used. The \meta{transformation} should be - transformation code like |\pgftransformrotate{20}|. + transformation code like |\pgftransformrotate{20}|. \end{command} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex index 738158f2348..44774b573b3 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex @@ -453,6 +453,15 @@ transformation matrices. saved using |\pgfgettransform|. \end{command} +\begin{command}{\pgfgettransformentries\marg{macro for a}\marg{macro for b}\marg{macro for c}\marg{macro for d}\marg{macro for shift x}\marg{macro for shift y}} + This command is similar to |\pgfgettransform| except that it stores the current coordinate transformation matrix in a set of six macros. + + The matrix can later on be reinstalled using |\pgfsettransformentries|. Furthermore, all these macros (or just a few of them) can be used as arguments for |\pgftransformcm|. +\end{command} + +\begin{command}{\pgfsettransformentries\marg{a}\marg{b}\marg{c}\marg{d}\marg{shiftx}\marg{shifty}} + Reinstalls a coordinate transformation matrix that was previously saved using the storage command |\pgfgettransformentries|. This command can also be used to replace any previously existing coordinate transformation matrix (it is thus equivalent to |\pgftransformreset| followed by |\pgftransformcm|). +\end{command} \subsection{Canvas Transformations} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex index ad6c465cef6..a286fcfcd34 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex @@ -14,7 +14,7 @@ For an introduction to the notion of transparency, fadings, and -transparency groups, please consult Section~\ref{section-tikz-transparency}. +transparency groups, please consult Section~\ref{section-tikz-transparency}. \subsection{Specifying a Uniform Opacity} @@ -26,7 +26,7 @@ Specifying a stroke and/or fill opacity is quite easy. a number between |0| and |1|, where |1| means ``fully opaque'' and |0| means ``fully transparent.'' A value like |0.5| will cause paths to be stroked in a semitransparent way. - + \begin{codeexample}[] \begin{pgfpicture} \pgfsetlinewidth{5mm} @@ -44,8 +44,8 @@ Specifying a stroke and/or fill opacity is quite easy. Sets the opacity of filling operations. As for stroking, the \meta{value} should be a number between |0| and~|1|. - The ``filling transparency'' will also be used for text and images. - + The ``filling transparency'' will also be used for text and images. + \begin{codeexample}[] \begin{tikzpicture} \pgfsetfillopacity{0.5} @@ -79,7 +79,7 @@ general: You ``paint'' the fading using any of the standard graphics commands. In more detail: You create a normal picture, which may even contain text, image, and shadings. Then, you create a fading based on this picture. For this, the \emph{luminosity} of each pixel of the -picture is analysed (the brighter the pixel, the higher the luminosity +picture is analyzed (the brighter the pixel, the higher the luminosity -- a black pixel has luminosity $0$, a white pixel has luminosity $1$, a gray pixel has some intermediate value as does a red pixel). Then, when the fading is used, the luminosity of the pixel determines the @@ -101,7 +101,7 @@ transparent. Let's start with an easy example. Our first fading picture is just some text: \begin{codeexample}[] -\pgfdeclarefading{fading1}{\color{white}Ti\emph{k}Z} +\pgfdeclarefading{fading1}{\color{white}Ti\emph{k}Z} \begin{tikzpicture} \fill [black!20] (0,0) rectangle (2,2); \fill [black!30] (0,0) arc (180:0:1); @@ -122,7 +122,7 @@ transparent. |pgftransparent| is defined to be the same as |black|. This allows one to write |pgftransparent| for completely transparent parts of a fading picture and |pgftransparent!0| for the opaque parts and - things liek |pgftransparent!20| for parts that are 20\% + things like |pgftransparent!20| for parts that are 20\% transparent. Furthermore, the color |pgftransparent!0| (which is the same as @@ -134,11 +134,11 @@ transparent. we go from left to right. For this, we put a shading inside the fading picture that has the color |pgftransparent!0| at the left-hand side and the color |pgftransparent!100| at the right-hand - side. + side. \begin{codeexample}[] \pgfdeclarefading{fading2} {\tikz \shade[left color=pgftransparent!0, - right color=pgftransparent!100] (0,0) rectangle (2,2);} + right color=pgftransparent!100] (0,0) rectangle (2,2);} \begin{tikzpicture} \fill [black!20] (0,0) rectangle (2,2); \fill [black!30] (0,0) arc (180:0:1); @@ -191,7 +191,7 @@ are two different commands for using fadings: \begin{codeexample}[] \pgfdeclarefading{fading2} {\tikz \shade[left color=pgftransparent!0, - right color=pgftransparent!100] (0,0) rectangle (2,2);} + right color=pgftransparent!100] (0,0) rectangle (2,2);} \begin{tikzpicture} \fill [black!20] (0,0) rectangle (2,2); \fill [black!30] (0,0) arc (180:0:1); @@ -216,12 +216,12 @@ are two different commands for using fadings: \begin{enumerate} \item If the current path is empty, the command has the same effect as - |\pgfsetfading|. + |\pgfsetfading|. \item Otherwise it is assumed that the fading has a size of 100bp times - 100bp. + 100bp. \item - The fading is resized and shiften (using appropriate + The fading is resized and shifted (using appropriate transformations) such that the position $(25\mathrm{bp},25\mathrm{bp})$ lies at the lower-left corner of the current path and the position $(75\mathrm{bp},75\mathrm{bp})$ @@ -244,7 +244,7 @@ are two different commands for using fadings: \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} \pgfsetfadingforcurrentpath{fading}{} \pgfusepath{discard} - + \fill [red] (0,0) rectangle (2,1); \pgfpathrectangle{\pgfpoint{0cm}{1cm}}{\pgfpoint{2cm}{1cm}} @@ -272,9 +272,9 @@ Transparency groups are declared using the following commands. \meta{environment contents} you stroke a pixel three times in black, it is just black. Stroking it white afterwards yields a white pixel, and so on. - \item When the group is finished, it is painted as a whole. The + \item When the group is finished, it is painted as a whole. The \emph{fill} transparency settings are now applied to the resulting - picutre. For instance, the pixel that has been painted three times + picture. For instance, the pixel that has been painted three times in black and once in white is just white at the end, so this white color will be blended with whatever is ``behind'' the group on the page. @@ -289,12 +289,13 @@ Transparency groups are declared using the following commands. since the picture's bounding box contains everything anyway. However, if you have switched off the picture size tracking or if you are using canvas transformations, you may have to make - sure that the bounding box is big enough. The trick is to locallly + sure that the bounding box is big enough. The trick is to locally create a picture that is ``large enough'' and then insert this picture into the main picture while ignoring the size. The following example shows how this is done: - + +{\tikzexternaldisable \begin{codeexample}[] \begin{tikzpicture} \draw [help lines] (0,0) grid (2,2); @@ -307,10 +308,11 @@ Transparency groups are declared using the following commands. \node at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking}; \endpgftransparencygroup - \end{tikzpicture} + \end{tikzpicture} }; \end{tikzpicture} \end{codeexample} +}% \begin{plainenvironment}{{pgftransparencygroup}} @@ -325,7 +327,7 @@ Transparency groups are declared using the following commands. -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex index e6a6621dbde..a9483064435 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex @@ -74,14 +74,14 @@ The files in the |generic/pgf| directory do the actual work. When using the plain \TeX\ format, you say |\input{pgf.tex}| or |\input{tikz.tex}|. Then, instead of |\begin{pgfpicture}| and - |\end{pgfpicture}| you use |\pgfpicture| and |\endpgfpicture|. + |\end{pgfpicture}| you use |\pgfpicture| and |\endpgfpicture|. Unlike for the \LaTeX\ format, \pgfname\ is not as good at discerning the appropriate configuration for the plain \TeX\ format. In particular, it can only automatically determine the correct output format if you use |pdftex| or |tex| plus |dvips|. For all other output formats you need to set the macro |\pgfsysdriver| to the correct -value. See the description of using output formats later on. +value. See the description of using output formats later on. \pgfname\ was originally written for use with \LaTeX\ and this shows in a number of places. Nevertheless, the plain \TeX\ support is @@ -94,14 +94,15 @@ also just include the correct |tikz.code.tex| file. \subsubsection{Using the Con\TeX t Format} -When using the Con\TeX t format, you say |\usemodule[pgf]| or -|\usemodule[tikz]|. As for the plain \TeX\ format you also have -to replace the start- and end-of-environment tags as follows: Instead -of |\begin{pgfpicture}| and |\end{pgfpicture}| you use -|\startpgfpicture| and |\stoppgfpicture|; similarly, instead of -|\begin{tikzpicture}| and |\end{tikzpicture}| you use must now use -|\starttikzpicture| and |\stoptikzpicture|; and so on for other -environments. +When using the Con\TeX t format\footnote{Note that \pgfname/\tikzname{} + is not supported by recent Con\TeX t versions (like mark IV, the + Lua\TeX-aware part of Con\TeX t).}, you say |\usemodule[pgf]| or +|\usemodule[tikz]|. As for the plain \TeX\ format you also have to +replace the start- and end-of-environment tags as follows: Instead of +|\begin{pgfpicture}| and |\end{pgfpicture}| you use |\startpgfpicture| +and |\stoppgfpicture|; similarly, instead of |\begin{tikzpicture}| and + |\end{tikzpicture}| you use must now use |\starttikzpicture| and +|\stoptikzpicture|; and so on for other environments. The Con\TeX t support is very similar to the plain \TeX\ support, so the same restrictions apply: You may have to set the output @@ -128,7 +129,7 @@ typeset. Producing the output is (conceptually) a two-stage process: \begin{enumerate} \item \TeX\ typesets your text and graphics. The result of this - typesetting is mainly a long list of letter--coordinate pairs, plus + typesetting is mainly a long list of letter--coordinate pairs, plus (possibly) some ``special'' commands. This long list of pairs is written to something called a |.dvi|-file. \item @@ -145,7 +146,7 @@ its output. The |dvips| program takes this output and produces a converted using, say, |ps2pdf|, whose name is supposed to mean ``PostScript to PDF.'' Another example of programs using this process is the combination of |tex| and |dvipdfm|. The |dvipdfm| -program takes a |.dvi|-file as +program takes a |.dvi|-file as input and translates the letter--coordinate pairs therein into \pdf-commands, resulting in a |.pdf| file directly. Finally, the |tex4ht| is also a program that takes a |.dvi|-file and produces an @@ -165,7 +166,7 @@ commands. One of the main jobs of \pgfname\ is to ``abstract way'' the difference in the syntax of the different programs. However, this means that support for each program has to be ``programmed,'' which is -a time-consuming and complicated process. +a time-consuming and complicated process. \subsubsection{Selecting the Backend Driver} @@ -205,7 +206,7 @@ exactly the same. This driver has the ``complete'' functionality. This means, everything \pgfname\ ``can do at all'' is implemented in this - driver. + driver. \end{filedescription} \begin{filedescription}{pgfsys-dvipdfm.def} @@ -245,7 +246,7 @@ exactly the same. \textsc{pdf} output, depending on the command line parameters. However, whether you produce Postscript or \textsc{pdf} output does not change anything with respect to the - driver. + driver. This driver supports most of \pgfname's features, except for the following restrictions: @@ -262,7 +263,7 @@ exactly the same. Opacity is not supported. \item Remembering of pictures (inter-picture connections) is not - supported. + supported. \end{enumerate} \end{filedescription} @@ -286,11 +287,11 @@ conversion program like |ps2pdf| or the Acrobat Distiller. \item In plain \TeX\ mode it does not support image inclusion. \item - Shading is fully implemented, but the results will not be - as good as with a driver producing |.pdf| as output. + Shading is fully implemented, but the results will not be + as good as with a driver producing |.pdf| as output. \item Opacity works only in conjunction with newer versions of - GhostScript. + Ghostscript. \item For remembering of pictures (inter-picture connections) you need to use a recent version of |pdftex| running in DVI-mode. @@ -299,10 +300,10 @@ conversion program like |ps2pdf| or the Acrobat Distiller. \begin{filedescription}{pgfsys-textures.def} This is a driver file for use with the \textsc{textures} program. It - includes |pgfsys-common-postscript.def|. + includes |pgfsys-common-postscript.def|. This driver has exactly the same restrictions as the driver for - |dvips|. + |dvips|. \end{filedescription} You can also use the |vtex| program together with |pgfsys-vtex.def| to @@ -323,32 +324,22 @@ graphic in your text. |pgfsys-common-svg.def|. When using this driver you should be aware of the following - restrictions: + restrictions: \begin{enumerate} \item In \LaTeX\ mode it uses |graphicx| for the graphics - inclusion. + inclusion. \item In plain \TeX\ mode it does not support image inclusion. \item Remembering of pictures (inter-picture connections) is not - supported. + supported. \item Text inside |pgfpicture|s is not supported very well. The reason is that the \textsc{svg} specification currently does not support - text very well and it is also not possible to correctly ``escape - back'' to \textsc{html}. All these problems will hopefully - disappear in the future, but currently only two kinds of text work - reasonably well: First, plain text without math mode, special - characters or anything else special. Second, \emph{very} simple - mathematical text that contains subscripts or superscripts. Even - then, variables are not correctly set in italics and, in general, - text simple does not look very nice. - \item - If you use text that contains anything special, even something as - simple as |$\alpha$|, this may corrupt the graphic since |text4ht| - does not always produce valid \textsc{xml} code. So, once more, - \emph{stick to very simple node text inside graphics.} Sorry. + text very well and, although it is possible to ``escape + back'' to \textsc{html}, |Tikz| has then to guess what size the text + rendered by the browser would have. \item Unlike for other output formats, the bounding box of a picture ``really crops'' the picture. @@ -368,6 +359,74 @@ graphic in your text. imaging model and the processing model of PostScript/\pdf\ and \textsc{svg} are not quite the same; but they are ``close enough'' for \pgfname's purposes. + + Because text is not supported very well in the + \textsc{svg} standard, you may wish to use the following options to + modify the way text is handled: + + \begin{key}{/tikz/tex4ht node/escape=\meta{boolean} (default |false|)} + Selects the rendering method for a text node with the tex4ht driver. + + When this key is set to |false|, text is translated into + \textsc{svg} text, which is somewhat limited: simple + characters (letters, numerals, punctuation, $\sum$, $\int$, \ldots), + subscripts and superscripts (but not subsubscripts) will display but + everything else will be filtered out, ignored or will produce + invalid \textsc{html} code (in the worst case). This means that two + kind of texts render reasonably well: + \begin{enumerate} + \item First, plain text without math mode, special characters or + anything else special. + \item Second, \emph{very} simple mathematical text that contains + subscripts or superscripts. Even then, variables are not correctly + set in italics and, in general, text simple does not look very + nice. + \end{enumerate} + If you use text that contains anything special, even something as + simple as |$\alpha$|, this may corrupt the graphic. + +\begin{codeexample}[code only] +\tikz \node[draw,tex4ht node/escape=false] {Example : $(a+b)^2=a^2+2ab+b^2$}; +\end{codeexample} + + When you write |node[tex4ht node/escape=true] {|\meta{text}|}|, + \tikzname\ escapes back to \textsc{html} to render the + \meta{text}. This method produces valid \textsc{html} code in most + cases and the support for complicated text nodes is much better since + code that renders well outside a |{tikzpicture}|, should also + render well inside a text node. Another advantage is that inside + text nodes with fixed width, \textsc{html} will produce line + breaks for long lines. On the other hand, you need a browser with + good \textsc{svg} support to display the picture. Also, the text + will display differently, depending on your browsers, the fonts + you have on your system and your settings. Finally, + \tikzname\ has to guess the size of the text rendered by the + browser to scale it and prevent it from sticking from the + node. When it fails, the text will be either cropped or too small. +\begin{codeexample}[code only] +\tikz \node[draw,tex4ht node/escape=true] + {Example : $\int_0^\infty\frac{1}{1+t^2}dt=\frac{\pi}{2}$}; +\end{codeexample} + \end{key} + + \begin{key}{/tikz/tex4ht node/css=\meta{filename} (default |\string\jobname|)} + This option allows you to tell the browser what \textsc{css} file + it should use to style the display of the node (only with + |tex4ht node/escape=true|). + \end{key} + + \begin{key}{/tikz/tex4ht node/class=\meta{class name} (default foreignobject)} + This option allows you to give a class name to the node, allowing + it to be styled by a \textsc{css} file (only with + |tex4ht node/escape=true|). + \end{key} + + \begin{key}{/tikz/tex4ht node/id=\meta{id name} (default + |\string\jobname\ picture number-node number|)} + This option allows you to give a unique id to the node, allowing + it to be styled by a \textsc{css} file (only with + |tex4ht node/escape=true|). + \end{key} \end{filedescription} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex new file mode 100644 index 00000000000..bb7b9eb0400 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex @@ -0,0 +1,800 @@ +% Copyright 2010 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Axes} +\label{section-dv-axes} + +\subsection{Overview} + +To be written... + + +\subsection{Concepts} + +\subsubsection{Axes} + +\subsubsection{Mayor, Minor, and Subminor Ticks} + +\subsubsection{Tick Placement Strategies} +\label{section-dv-concept-tick-placement-strategies} + +Consider the following problem: The data visualization engine +determines that in a +plot the $x$-values vary between $17.4$ and $34.5$. In this case, we +certainly do not want, say, ten ticks at exactly ten evenly spaced +positions starting with $17.4$ and ending with $34.5$, because this +would yield ticks at positions like $32.6$. Ticks should be placed at +``nice'' positions like $20$, $25$, and $30$. + +Determining which positions are ``nice'' is somewhat difficult. In the +above example, the positions $20$, $25$, and $30$ are certainly nice, +but only three ticks may be a bit few of them. Better might be the +tick positions $17.5$, $20$, $22.5$, through to $32.5$. However, users +might prefer even numbers over fractions like $2.5$ as the stepping. + +A \emph{tick placement strategy} is a method of automatically deciding +which positions are \emph{good} for placing ticks. The data +visualization engine comes with a number of predefined strategies, see +Section~\ref{section-dv-tick-placement-strategies}, but you can also +define new ones yourself. When the data visualization is requested to +automatically determine +``good'' positions for the placement of ticks on an axis, it uses one +of several possible \emph{basic strategies}. These strategies differ +dramatically in which tick positions they will choose: For a range of +values between $5$ and $1000$, a |linear steps| strategy might place +ticks at positions $100$, $200$, through to $1000$, while an +|exponential steps| strategy would prefer the tick positions $10$, +$100$ and $1000$. The exact number and values of the tick positions +chosen by either strategy can be fine-tuned using additional options +like |step| or |about|. + +Here is an example of the different stepping chosen when one varies +the tick placement strategy: + +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [scientific axes, visualize as smooth line] + data [format=function] { + var x : interval [1:11]; + func y = \value x*\value x; + }; +\end{tikzpicture} +\qquad +\begin{tikzpicture} + \datavisualization [scientific axes, visualize as smooth line, + y axis={exponential steps}, + x axis={ticks={quarter about strategy}}, + ] + data [format=function] { + var x : interval [1:11]; + func y = \value x*\value x; + }; +\end{tikzpicture} +\end{codeexample} + + + +\subsubsection{Grids} + +\subsection{Usage} + + +\subsection{Reference: Standard Axis Systems} + +In this section the axis system commonly used in data visualizations +are described. + +\subsubsection{Scientific Axis Systems} + +\begin{key}{/tikz/data visualization/scientific axes} + This key installs a two-dimensional coordinate system based on the + attributes |/data point/x| and |/data point/y|. + +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [scientific axes, visualize as smooth line] + data [format=function] { + var x : interval [0:100]; + func y = sqrt(\value x); + }; +\end{tikzpicture} +\end{codeexample} + + This axis system is usually a good choice to depict ``arbitrary two + dimensional data.'' Because the axes are automatically scaled, you + do not need to worry about how large or small the values will + be. The name |scientific axes| is intended to indicate that this + axis system is often used in scientific publications. + + Note, however, that this axis system will always distort the + relative magnitudes of the units on the two axis. If you wish the + units on both axes to be equal, consider directly specifying the + unit length ``by hand'': + +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [visualize as smooth line, + scientific axes, + all axes={unit length=1cm per 10 units, ticks={few}}] + data [format=function] { + var x : interval [0:100]; + func y = sqrt(\value x); + }; +\end{tikzpicture} +\end{codeexample} + + The |scientific axes| have the following properties: + \begin{itemize} + \item The |x|-values are surveyed and the $x$-axis is then scaled + and shifted so that it has the length specified by the following key. + \begin{key}{/tikz/data visualization/scientific + axes/width=\meta{dimension} (initially 5cm)} + \end{key} + The minimum value is at the left end of the axis and at the canvas + origin. The maximum value is at the right end of the axis. + \item The |y|-values are surveyed and the $y$-axis is then scaled so + that is has the length specified by the following key. + \begin{key}{/tikz/data visualization/scientific + axes/height=\meta{dimension}} + By default, the |height| is the golden ratio times the |width|. + \end{key} + The minimum value is at the bottom of the axis and at the canvas + origin. The maximum value is at the top of the axis. + \item Lines (forming a frame) are depicted at the minimum and + maximum values of the axes in 50\% black. + \item Ticks are drawn `` on the outside'' of the frame so that they + interfere as little as possible with the data. + \item Tick labels and axis labels (if present) are drawn left and + below. + \end{itemize} +\end{key} + +\begin{key}{/tikz/data visualization/scientific inner axes} + This axis system works like |scientific axes|, only the ticks are on + the ``inside'' of the frame. + +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [scientific inner axes, visualize as smooth line] + data [format=function] { + var x : interval [-12:12]; + func y = \value x*\value x*\value x; + }; +\end{tikzpicture} +\end{codeexample} + + This axis system is also common in publications, but the ticks tend + to interfere with marks if they are near to the border as can be + seen in the following example: +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [scientific inner axes, scientific axes/width=3.2cm, + visualize as scatter/.list={a,b}] + data [a] { + x, y + 0, 0 + 1, 1 + 0.5, 0.5 + 2, 1 + } + data [b] { + x, y + 0.05, 0 + 1.5, 1 + 0.5, 0.75 + 2, 0.5 + }; +\end{tikzpicture} +\end{codeexample} + +\end{key} + +\begin{key}{/tikz/data visualization/scientific clean axes} + This axis system is another version of |scientific axes|. However, the + axes and the ticks are completely removed from the actual data, + making this axis system especially useful for scatter plots, but + also for most other scientific plots. + +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [scientific clean axes, visualize as smooth line] + data [format=function] { + var x : interval [-12:12]; + func y = \value x*\value x*\value x; + }; +\end{tikzpicture} +\end{codeexample} + + The distance of the axes from the actual plot is given by the + padding of the axes. +\end{key} + + +For all scientific axis systems, different label placement strategies +can be specified. They are discussed in the following. + + +\begin{key}{/tikz/data visualization/scientific axes standard labels} + As the name suggests, this is the standard placement strategy. The + label of the $x$-axis is placed below the center of the $x$-axis, + the label of the $y$-axis is rotated by $90^\circ$ and placed left + of the center of the $y$-axis. +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [scientific clean axes, + visualize as smooth line, + scientific axes standard labels, + x axis={label=degree $d$, ticks={tick unit=${}^\circ$}}, + y axis={label=$\sin d$}] + data [format=function] { + var x : interval [-10:10] samples 10; + func y = sin(\value x); + }; +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/data visualization/scientific axes upright labels} + Works like |scientific axes standard labels|, only the label of the + $y$-axis is not rotated. +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [scientific clean axes, + visualize as smooth line, + scientific axes upright labels, + x axis={label=degree $d$, ticks={tick unit=${}^\circ$}}, + y axis={label=$\cos d$, + ticks={style={/pgf/number format/.cd,precision=4,fixed zerofill}}}] + data [format=function] { + var x : interval [-10:10] samples 10; + func y = cos(\value x); + }; +\end{tikzpicture} +\end{codeexample} +\end{key} + + +\begin{key}{/tikz/data visualization/scientific axes end labels} + Places the labels at the end of the $x$- and the $y$-axis, similar + to the axis labels of a school book axis system. +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [scientific clean axes, + visualize as smooth line, + scientific axes end labels, + x axis={label=degree $d$, ticks={tick unit=${}^\circ$}}, + y axis={label=$\tan d$}] + data [format=function] { + var x : interval [-10:10] samples 10; + func y = tan(\value x); + }; +\end{tikzpicture} +\end{codeexample} +\end{key} + + + + + +\subsubsection{School Book Axis Systems} + +\begin{key}{/tikz/data visualization/school book axes} + This axis system is intended to ``look like'' the coordinate systems + often used in school books: The axes are drawn in such a way that + they intersect to origin. Furthermore, no automatic + scaling is done to ensure that the lengths of units are the same in + all directions. + + This axis system must be used with care -- it is nearly always + necessary to specify the desired unit length by hand using the + option |unit length|. If the magnitudes of the units on the two axes + differ, different unit lengths typically need to be specified for + the different axes. + + Finally, if the data is ``far removed'' from the origin, this + axis system will also ``look bad.'' + +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as smooth line] + data [format=function] { + var x : interval [-1.3:1.3]; + func y = \value x*\value x*\value x; + }; +\end{tikzpicture} +\end{codeexample} + + The stepping of the ticks is one unit by default. Using keys like + |ticks=some| may help to give better steppings. +\end{key} + + +\begin{key}{/tikz/data visualization/school book axes standard labels} + This key makes the label of the $x$-axis appear at the right end of + this axis and it makes the label of the $y$-axis appear at the top + of the $y$-axis. + + Currently, this is the only supported placement strategy for the + school book axis system. +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, + visualize as smooth line, + school book axes standard labels, + clean ticks, + x axis={label=$x$}, + y axis={label=$f(x)$}] + data [format=function] { + var x : interval [-1:1]; + func y = \value x*\value x + 1; + }; +\end{tikzpicture} +\end{codeexample} +\end{key} + + + + + +\subsubsection{Advanced: Underlying Cartesian Axis Systems} + +The axis systems described in the following are typically not used +directly by the user. The systems setup \emph{directions} for several +axes in some sensible way, but they do not actually draw anything on +these axes. For instance, the |xy Cartesian| creates two axes called +|x axis| and |y axis| and makes the $x$-axis point right and the +$y$-axis point up. In contrast, an axis system like |scientific axes| +uses the axis system |xy Cartesian| internally and then proceeds to +setup a lot of keys so that the axis lines are drawn, +ticks and grid lines are drawn, and labels are placed at the correct +positions. + +\begin{key}{/tikz/data visualization/xy Cartesian} + This axis system creates two axes called |x axis| and |y axis| that + point right and up, respectively. By default, one unit is mapped to + one cm. + +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [xy Cartesian, visualize as smooth line] + data [format=function] { + var x : interval [-1.25:1.25]; + func y = \value x*\value x*\value x; + }; +\end{tikzpicture} +\end{codeexample} + + + \begin{key}{/tikz/data visualization/xy axes=\meta{options}} + This key applies the \meta{options} both to the |x axis| and the + |y axis|. + \end{key} + +\end{key} + + +\begin{key}{/tikz/data visualization/xyz Cartesian cabinet} + This axis system works like |xy Cartesian|, only it + \emph{additionally} creates an axis called |z axis| that points left + and down. For this axis, one unit corresponds to $\frac{1}{2}\sin + 45^\circ\mathrm{cm}$. This is also known as a cabinet projection. + + \begin{key}{/tikz/data visualization/xyz axes=\meta{options}} + This key applies the \meta{options} both to the |x axis| and the + |y axis|. + \end{key} + +\end{key} + + +\begin{key}{/tikz/data visualization/uv Cartesian} + This axis system works like |xy Cartesian|, but it introduces two + axes called |u axis| and |v axis| rather than the |x axis| and the + |y axis|. The idea is that in addition to a ``major'' + $xy$-coordinate system this is also a ``smaller'' or ``minor'' + coordinate system in use for depicting, say, small vectors with + respect to this second coordinate system. + + \begin{key}{/tikz/data visualization/uv axes=\meta{options}} + Applies the \meta{options} to both the |u axis| and the |y axis|. + \end{key} + +\end{key} + +\begin{key}{/tikz/data visualization/uvw Cartesian cabinet} + Like |xyz Cartesian cabinet|, but for the $uvw$-system. + + \begin{key}{/tikz/data visualization/uvw axes=\meta{options}} + Like |xyz axes|. + \end{key} +\end{key} + + + +\subsection{Reference: Tick Placement Strategies} +\label{section-dv-tick-placement-strategies} + +As described in \ref{section-dv-concept-tick-placement-strategies}, +it is not a trivial task for the data visualization engine to +correctly automatically determine good positions for the placement of +ticks on axes. When the values on an axis range between, say, $17.4$ +and $34.5$, it is somewhat unclear where ticks should be placed. + + +\subsubsection{Predefined Strategies} + +The following strategies are always available: + +\begin{key}{/tikz/data visualization/axis options/linear steps} + This strategy placed ticks at positions that are evenly spaced by + the current value of |step|. + + In detail, the following happens: Let $a$ be the minimum value of the + data values along the axis and let $b$ be the maximum. Let the + current \emph{stepping} be $s$ (the stepping is set using the |step| + option, see below) and let the current \emph{phasing} be $p$ (set + using the |phase|) option. Then ticks are placed all positions + $i\cdot s + p$ that lie in the interval $[a,b]$, where $i$ ranges + over all integers. + + The tick positions computed in the way described above are + \emph{mayor} step positions. In addition to these, if the key + |minor steps between steps| is set to some number $n$, then $n$ many + minor ticks are introduced between each two mayor ticks (and also + before and after the last mayor tick, provided the values still lie + in the interval $[a,b]$). Note that is $n$ is $1$, then one minor tick + will be added in the middle between any two mayor ticks. Use a value + of $9$ (not $10$) to partition the interval between two mayor ticks + into ten equally sized minor intervals. + +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization + [scientific inner axes, scientific axes/width=3cm, + x axis={ticks={step=3, minor steps between steps=2}}, + y axis={ticks={step=.36}}, + visualize as scatter] + data { + x, y + 17, 30 + 34, 32 + }; +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/data visualization/axis options/exponential steps} + This strategy produces ticks at positions that are appropriate for + logarithmic plots. It is automatically selected when you use the + |logarithmic| option with an axis. + + In detail, the following happens: As for |linear steps| let numbers + $a$, $b$, $s$, and $p$ be given. Then, mayor ticks are placed at all + positions $10^{i\cdot s+p}$ that lie in the interval $[a,b]$ for $i + \in \mathbb Z$. + + The minor steps are added in the same way as for |linear steps|. In + particular, they interpolate \emph{linearly} between mayor steps. + +\begin{codeexample}[] +\begin{tikzpicture} + \datavisualization + [scientific axes, + x axis={logarithmic, length=2cm, ticks={step=1.5}}, + y axis={logarithmic, ticks={step=1, minor steps between steps=9}}, + visualize as scatter] + data { + x, y + 1, 10 + 1000, 1000000 + }; +\end{tikzpicture} +\end{codeexample} +\end{key} + + + + +\subsubsection{Choosing a Stepping Explicitly} + +The following options are used to configure tick placement strategies +like |linear steps|. Unlike the basic choice of a placement strategy, +which is an axis option, the following should be passed to the option +|ticks| or |grid| only.. So, you would write +things like |x axis={ticks={step=2}}|, but |x axis=linear steps|. + +\begin{key}{/tikz/data visualization/step=\meta{value} (initially 1)} + The value of this key is used to determine the spacing of the major + ticks. The key is used by the |linear steps| and |exponential steps| + strategies described above, see the explanations there. +\end{key} + +\begin{key}{/tikz/data visualization/minor steps between + steps=\meta{number} (default 9)} + As for |step|, see the explanation of |linear steps|. +\end{key} + +\begin{key}{/tikz/data visualization/phase=\meta{value} (initially 0)} + As for |step|, see the explanation of |linear steps|. +\end{key} + + + +\subsubsection{Choosing a Stepping Automatically} + +The |step| option gives you ``total control'' over the stepping of +ticks on an axis, but you often do not know the correct stepping in +advance. In this case, you may prefer to have a good value for |step| +being computed for you automatically. + +Like the |step| key, these options are passed to the |ticks| +option. So, for instance, you would write |x axis={ticks={about=4}}| +to request about four ticks to be placed on the $x$-axis. + + +\begin{key}{/tikz/data visualization/about=\meta{number}} + This key asks the data visualization to place \emph{about} + \meta{number} many ticks on an axis. It is not guaranteed that + \emph{exactly} \meta{number} many ticks will be used, rather the + actual number will be the closest number of ticks to \meta{number} + so that their stepping is still ``good''. For instance, when you say + |about=10|, it may happen that exactly |10|, but perhaps even |13| ticks are + actually selected, provided that these numbers of ticks lead to good + stepping values like |5| or |2.5| rather than numbers like |3.4| or + |7|. The method that is used to determine which steppings a deemed to + be ``good'' depends on the current tick placement strategy. + + \medskip + \textbf{Linear steps.} + Let us start with |linear steps|: First, the difference between the + maximum value $v_{\max}$ and the minimum value $v_{\min}$ on the + axis is computed; let us call it $r$ for ``range.'' Then, $r$ is + divided by \meta{number}, + yielding a target stepping~$s$. If $s$ is a number like $1$ or $5$ + or $10$, then this number could be used directly as the new value of + |step|. However, $s$ will typically something strange like $0.02345$ + or $345223.76$, so $s$ must be replaced by a better value like $0.02$ + in the first case and perhaps $250000$ in the second case. + + In order to determine which number is to be used, $s$ is rewritten + in the form $m \cdot 10^k$ with $1 \le m < 10$ and $k \in \mathbb + Z$. For instance, $0.02345$ would be rewritten as $2.345 \cdot + 10^{-2}$ and $345223.76$ as $3.4522376 \cdot 10^5$. The next step + is to replace the still not-so-good number $m$ like $2.345$ or + $3.452237$ by a ``good'' value $m'$. For this, the current value of + the |about strategy| is used: + \begin{key}{/tikz/data visualization/about strategy=\meta{list}} + The \meta{list} is a comma-separated sequence of pairs + \meta{threshold}/\meta{value} like for instance |1.5/1.0| or + |2.3/2.0|. When a good value $m'$ is sought for a given $m$, we + iterate over the list and find the first pair + \meta{threshold}/\meta{value} where \meta{threshold} + exceeds~$m$. Then $m'$ is set to \meta{value}. For instance, if + \meta{list} is |1.5/1.0,2.3/2.0,4/2.5,7/5,11/10|, which is the + default, then for $m=3.141$ we would get $m'=2.5$ since $4 > + 3.141$, but $2.3 \le 3.141$. For $m=6.3$ we would get $m'=5$. + \end{key} + Once $m'$ has been determined, the stepping is set to $s' = m' + \cdot 10^k$. + + % Define an axis type + \tikzdatavisualizationset{ + one dimensional axis/.style={ + new Cartesian axis=axis, + axis={ + attribute=main, + unit vector={(0pt,1pt)}, + visualize axis={style=->}, + visualize ticks={major={tick text at low},direction axis=perpendicular}, + length=3cm + }, + new Cartesian axis=perpendicular, + perpendicular={ + attribute=perp, + unit vector={(1pt,0pt)}, + include values=0, + include values=1 + } + } + } + + \def\showstrategy#1{ + + % Show the effect for the different strategies + \medskip + \begin{tikzpicture} + \foreach \max/\about [count=\c] in {10/5,20/5,30/5,40/5,50/5,60/5,70/5,80/5,90/5,100/5,100/3,100/10} + { + \begin{scope}[xshift=\c pt*30] + \datavisualization [#1, + one dimensional axis, + axis={ + ticks={about=\about}, + include values=0, + include values=\max + } + ]; + + \node at (0,-5mm) [anchor=mid] {\texttt{\about}}; + \end{scope} + } + + \node at (30pt,-5mm) [anchor=mid east] {\texttt{about=\ \ }}; + \end{tikzpicture} +} + + The net effect of all this is that for the default strategy, the + only valid stepping are the values $1$, $2$, $2.5$ and $5$ and every + value obtainable by multiplying one of these values by a power of + ten. The following example shows the effects of, first, setting + |about=5| (corresponding to the |some| option) and then having axes + where the minimum value is always |0| and where the maximum value + ranges from |10| to |100| and, second, setting |about| to the values + from |3| (corresponding to the |few| option) and to |10| + (corresponding to the |many| option) while having the + minimum at |0| and the maximum at |100|: + + \showstrategy{standard about strategy} + + \medskip + \textbf{Exponential steps.} + For |exponential steps| the strategy for determining a good stepping + value is similar to |linear steps|, but with the following + differences: + \begin{itemize} + \item Naturally, since the stepping value refers to the exponent, + the whole computation of a good stepping value needs to be done + ``in the exponent.'' Mathematically spoken, instead of considering + the difference $r = v_{\max} - v_{\min}$, we consider the difference $r = + \log v_{\max} - \log v_{\min}$. With this difference, we still + compute $s = r / \meta{number}$ and let $s = m \cdot 10^k$ with $1 + \le m < 10$. + \item It makes no longer sense to use values like $2.5$ for $m'$ + since this would yield a fractional exponent. Indeed, the only + sensible values for $m'$ seem to be $1$, $3$, $6$, and + $10$. Because of this, the |about strategy| is ignored and one of + these values or a multiple of one of them by a power of ten is + used. + \end{itemize} + + The following example shows the chosen steppings for a maximum + varying from $10^1$ to $10^5$ and from $10^{10}$ to $10^{50}$ as + well as for $10^{100}$ for |about=3|: + + \medskip + \begin{tikzpicture} + \foreach \max [count=\c] in {1,...,5,10,20,...,50,100} + { + \begin{scope}[xshift=\c pt*40] + \datavisualization [ + one dimensional axis, + axis={ + logarithmic, + ticks={about=3}, + include values=1, + include values=1e\max + } + ]; + \end{scope} + } + \end{tikzpicture} + + + \medskip + \textbf{Alternative strategies.} + + In addition to the standard |about strategy|, there are some + additional strategies that you might wish to use instead: + + \begin{key}{/tikz/data visualization/standard about + strategy} + Permissible values for $m'$ are: $1$, $2$, $2.5$, and~$5$. This + strategy is the default strategy. + \end{key} + + \begin{key}{/tikz/data visualization/euro about strategy} + Permissible values for $m'$ are: $1$, $2$, and~$5$. These are the + same values as for the Euro coins, hence the + name. + + \showstrategy{euro about strategy} + \end{key} + + \begin{key}{/tikz/data visualization/half about strategy} + Permissible values for $m'$: $1$ and $5$. Use this + strategy if only powers of $10$ or halves thereof seem logical. + + \showstrategy{half about strategy} + \end{key} + + \begin{key}{/tikz/data visualization/quarter about strategy} + Permissible values for $m'$ are: $1$, $2.5$, and $5$. + + \showstrategy{quarter about strategy} + \end{key} + + \begin{key}{/tikz/data visualization/int about strategy} + Permissible values for $m'$ are: $1$, $2$, $3$, $4$, and $5$. + + \showstrategy{int about strategy} + \end{key} +\end{key} + +\begin{key}{/tikz/data visualization/many} + This is an abbreviation for |about=10|. +\end{key} + +\begin{key}{/tikz/data visualization/some} + This is an abbreviation for |about=5|. +\end{key} + +\begin{key}{/tikz/data visualization/few} + This is an abbreviation for |about=3|. +\end{key} + +\begin{key}{/tikz/data visualization/none} + Switches off the automatic step computation. Unless you use |step=| + explicitly to set a stepping, no ticks will be (automatically) + added. +\end{key} + + + + +\subsubsection{Advanced: Defining New Placing Strategies} + +\begin{key}{/tikz/data visualization/axis options/tick placement strategy=\meta{macro}} + This key can be used to install a so-called \emph{tick placement + strategy}. Whenever |visualize ticks| is used to request some + ticks to be visualized, it is checked whether some automatic ticks + should be created. This is the case when the following key is set: + \begin{key}{/tikz/data visualization/compute step=\meta{code}} + The \meta{code} should compute a suitable value for the stepping + to be used by the \meta{macro} in the tick placement strategy. + + For instance, the |step| key sets |compute step| to + |\def\tikz@lib@dv@step{#1}|. Thus, when you say |step=5|, then the + desired stepping of |5| is communicated to the \meta{macro} via the + macro |\tikz@lib@dv@step|. + \end{key} + + Provided |compute step| is set to some nonempty value, upon + visualization of ticks the \meta{macro} is executed. Typically, + \meta{macro} will first call the \meta{code} stored in the key + |compute step|. Then, it should implement some strategy then uses + the value of the computed or desired stepping to create appropriate + |at| commands. To be precise, it should set the keys |major|, + |minor|, and/or |subminor| with some appropriate |at| values. + + Inside the call of \meta{macro}, the macro |\tikzdvaxis| will have + been set to the name of the axis for which default ticks need to be + computed. This allows you to access the minimum and the maximum + value stored in the |scaling mapper| of that axis. + \begin{codeexample}[] +\def\silly{ + \tikzdatavisualizationset{major={at={2,3,5,7,11,13}}} +} +\begin{tikzpicture} + \datavisualization [ + scientific axes, visualize as scatter, + x axis={tick placement strategy=\silly} + ] + data { + x, y + 0, 0 + 15, 15 + }; +\end{tikzpicture} +\end{codeexample} +\end{key} + +\subsection{Advanced: Creating New Axes} + +\subsection{Advanced: Creating New Axis Systems} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex new file mode 100644 index 00000000000..ef7f0be25f1 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex @@ -0,0 +1,22 @@ +% Copyright 2008 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{The Data Visualization Backend} +\label{section-dv-backend} + +\subsection{Overview} + +The present section explains the mechanisms behind the data +visualization engine. + +\subsection{The Rendering Pipeline} + +\subsection{Usage} + diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex new file mode 100644 index 00000000000..fa6ea38fcbb --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex @@ -0,0 +1,94 @@ +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +A first example: + +\begin{codeexample}[] +\begin{tikzpicture}[baseline] + \datavisualization [ + school book axes, + visualize as smooth line, + clean ticks, + all axes={grid={step=1,minor steps between steps=1}}, + x axis={ + ticks={some, + major={ + also at={(0.5*pi) as $\pi/2$}, + also at={(pi) as $\pi$}, + options at=3 as [no tick text] + } + }, + label=$x$ + }, + y axis={ + label=$y$, + } + ] + data [format=function] { + var x : interval [-0.5*pi:4] samples 50; + func y = sin(\value x r); + }; +\end{tikzpicture} +\end{codeexample} +\begin{codeexample}[] +\begin{tikzpicture}[baseline] + \datavisualization [ + scientific clean axes, + visualize as line, + all axes={padding=4pt}, + x axis={logarithmic, + ticks={many, tick unit={ms}, + node style={rotate=45,anchor=north east}}, + label={time}, + grid=many}, + y axis={ticks={some},label={distance}}, + ] + data { + x, y, z + 0.001, 0, 0 + 2000, 2.23, 2 + 20670, 1, 3 + 501, -2, 0 + }; +\end{tikzpicture} +\end{codeexample} + +\begin{codeexample}[] +\begin{tikzpicture}[baseline,mark=*] + \datavisualization [ + scientific inner axes, + all axes={padding=4pt}, + euro about strategy, + visualize as scatter, + x axis={attribute=x2}, + y axis={attribute=y2} + ] + data [separator=\space] { +x y x1 y1 x2 y2 x3 y3 +10.0 8.04 10.0 9.14 10.0 7.46 8.0 6.58 +8.0 6.95 8.0 8.14 8.0 6.77 8.0 5.76 +13.0 7.58 13.0 8.74 13.0 12.74 8.0 7.71 +9.0 8.81 9.0 8.77 9.0 7.11 8.0 8.84 +11.0 8.33 11.0 9.26 11.0 7.81 8.0 8.47 +14.0 9.96 14.0 8.10 14.0 8.84 8.0 7.04 +6.0 7.24 6.0 6.13 6.0 6.08 8.0 5.25 +4.0 4.26 4.0 3.10 4.0 5.39 19.0 12.50 +12.0 10.84 12.0 9.13 12.0 8.15 8.0 5.56 +7.0 4.82 7.0 7.26 7.0 6.42 8.0 7.91 +5.0 5.68 5.0 4.74 5.0 5.73 8.0 6.89 + }; +\end{tikzpicture} +\end{codeexample} + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: "pgfmanual" +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex new file mode 100644 index 00000000000..2afb9568a2b --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex @@ -0,0 +1,536 @@ +% Copyright 2008 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Providing Data for a Data Visualization} +\label{section-dv-formats} + +\subsection{Overview} + +The data visualization system needs a stream of data points as +input. These data points can be directly generated by repeatedly +calling the |\pgfdatapoint| command, but usually data is available in +some special (text) format and one would like to visualize this +data. The present section explains how data in some specific format +can be fed to the data visualization system. + +This section starts with an explanation of the main concepts. Then, +the standard formats are listed in the reference section. It is also +possible to define new formats, but this an advanced concept which +requires an understanding of some of the internals of the parsing mechanism, +explained in Section~\ref{section-dv-parsing}, and the usage of a +rather low-level command, explained in Section~\ref{section-dv-declaring-formats}. + + +\subsection{Concepts} + +For the purposes of this section, let call a \emph{data format} some +standardized way of writing down a list of data points. A simple +example of a data format is the \textsc{csv} format (the acronym +stands for \emph{comma separated values}), where each line contains a +data point, specified by values separated by commas. A different +format is the \emph{key--value format}, where data points are +specified by lists of key--value pairs. A far more complex format is +the \textsc{pdb}-format used by the protein database to describe +molecules. + +The data visualization system does not use any specific +format. Instead, whenever data is read by the data visualization +system, you must specify a format parser (or it is chosen +automatically for you). It is the job of the parser to read (parse) +the data lines and to turn them into data points, that is, to setup +appropriate subkeys of |/data point/|. + +To give a concrete example, suppose a file contains the following +lines: +\begin{codeexample}[code only] +x, y, z +0, 0, 0 +1, 1, 0 +1, 1, 0.5 +0, 1, 0.5 +\end{codeexample} +This file is in the \textsc{csv}-format. This format can be read by +the |table| parser (which is called thus, rather than ``|csv|,'' since +it can also read files in which the columns are separated by, say, a +semicolon or a space). The |table| format will then read the data and +for each line of the data, except for the headline of course, it will +produce one data point. For instance, for the last data point the key +|/data point/x| will be set to |0|, the key |/data point/y| will be +set to |1|, and the key |/data point/z| will be set to |0.5|. + +All parsers are basically line-oriented. This means that, normally, +each line in the input data should contain one data point. This rule +may not always apply, for instance empty lines are typically ignored +and sometimes a data point may span several lines, but deviating from +this ``one data point per line'' rule makes parsers harder to +program. + + +\subsection{Reference: Build-In Formats} + +The following format is the default format, when no |format=...| is +specified. + +\begin{dataformat}{table} + This format is used to parse data that is formatted in the following + manner: Basically, each line consists of \emph{values} that are + separated by a \emph{separator} like a comma or a space. The values + are stored in different \emph{attributes}, that is, subkeys of + |/data point| like |/data point/x|. In order to decide which + attribute is chosen for a give value, the headline is + important. This is the first non-empty line of a table. It is + formatted in the same way as normal data lines (value separated by + the separator), but the meaning of the values is different: The + first value in the headline is the name of the attribute where the + first values in the following lines should go each time. Similarly, + the second value in the headline is the name of the attribute for + the second values in the following lines, and so on. + + A simple example is the following: +\begin{codeexample}[code only] +angle, radius +0, 1 +45, 2 +90, 3 +135, 4 +\end{codeexample} + The headline states that the values in the first column should be + stored in the |angle| attribute (|/data point/angle| to be precise) + and that the values in the second column should be stored in the + |radius| attribute. There are four data points in this data set. + + The format will tolerate too few or too many values in a line. If + there are less values in a line than in the headline, the last + attributes will simply be empty. If there are more values in a line + than in the headline, the values are stored in attributes called + |/data point/attribute |\meta{column number}, where the first value + of a line gets \meta{column number} equal to |1| and so on. + + The |table| format can be configured using the following options: + \begin{key}{/pgf/data/separator=\meta{character} (initially ,)} + Use this key to change which character is used to separate values + in the headline and in the data lines. To set the separator to a + space, either set this key to an empty value or say + |separator=\space|. Note that you must surround a comma by curly + braces if you which to (re)set the separator character to a space. + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as line] + data [separator=\space] { + x y + 0 0 + 1 1 + 2 1 + 3 0 + } + data [separator=;] { + x; y; z + 3; 1; 0 + 2; 2; 0 + }; +\end{tikzpicture} + \end{codeexample} + \end{key} + \begin{key}{/pgf/data/headline=\meta{headline}} + When this key is set to a non-empty value, the value of + \meta{headline} is used as the headline and the first line of the + data is treated as a normal line rather than as a headline. + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as line] + data [headline={x, y}] { + 0, 0 + 1, 1 + 2, 1 + 3, 0 + }; +\end{tikzpicture} + \end{codeexample} + \end{key} +\end{dataformat} + + +\begin{dataformat}{key value pairs} + Each line of the data is simply passed to the |\pgfkeys| command + with the path set to |/data point/|. This means that each data line + will typically consist of comma-separated assignments of the form + \meta{attribute}|=|\meta{value}. + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as line] + data [format=key value pairs] { + x=0, y=0 + x=1, y=1 + x=2, y=1 + x=3, y=0 + }; +\end{tikzpicture} + \end{codeexample} +\end{dataformat} + +\begin{dataformat}{TeX code} + This format will simply execute each line of the data, each of which + should contain some normal TeX code. Note that at the end of each + line control returns to the format handler, so for instance the + arguments of a command may not be spread over several + lines. However, not each line needs to produce a data point. + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as line] + data [format=TeX code] { + \pgfkeys{/data point/.cd,x=0, y=0} \pgfdatapoint + \pgfkeys{/data point/.cd,x=1, y=1} \pgfdatapoint + \pgfkeys{/data point/x=2} \pgfdatapoint + \pgfkeyssetvalue{/data point/x}{3} + \pgfkeyssetvalue{/data point/y}{0} \pgfdatapoint + }; +\end{tikzpicture} + \end{codeexample} +\end{dataformat} + + +\subsection{Reference: Advanced Formats} + +\begin{tikzlibrary}{datavisualization.formats.functions} + This library defines the formats described in the following, which + allow you to specify the data points indirectly, namely via a + to-be-evaluated function. + + \begin{dataformat}{function} + This format allows you to specify a function that is then + evaluated in order to create the desired data points. In other + words, the data lines do not contain the data itself, but rather + a functional description of the data. + + The format used to specify the function works as follows: Each + nonempty line of the data should contain at least one of either a + \emph{variable declaration} or a \emph{function declaration}. A + variable declaration signals that a certain attribute will range + over a given interval. The function declarations will then, later, + be evaluated for values inside this interval. The syntax for a + variable declaration is as follows: + \begin{quote} + |var |\declare{\meta{variable}}| : interval[|\meta{low}|:|\meta{high}|]| + \opt{|samples |\meta{number}} \opt{|step |\meta{step}}|;| + \end{quote} + The |samples| and |step| options cannot be given both at the same + time. If both are missing, |samples| is used with the value stored + in the following key: + \begin{key}{/pgf/data/samples=\meta{number} (initially 25)} + Sets the number of samples to be used when no sample number is + specified. + \end{key} + The meaning of a declaration like the above is the following: The + attribute named \meta{variable}, that is, the key + |/data point/|\meta{variable}, will range over the interval + $[\meta{low},\meta{high}]$. If the number of |samples| is given + (directly or indirectly), the interval is evenly divided into + \meta{number} many points and the attribute is set to each of + these values. Similarly, when a \meta{step} is specified, this + stepping is used to increase \meta{low} iteratively up to the + largest value that is still less or equal to \meta{high}. + + You can specify more than one variable. In this case, each + variable is varied independently of the other variables. For + instance, if you declare an $x$-variable to range over the + interval $[0,1]$ in $25$ steps and you also declare a $y$-variable + to range over the same interval, you get a total of $625$ value + pairs. + + The variable declarations specify which (input) variables will + take which values. It is the job of the \emph{function + declarations} to specify how some additional attributes are to + be computed. The syntax of a function declaration is as follows: + \begin{quote} + |func |\declare{\meta{attribute}}| = |\meta{expression}|;| + \end{quote} + The meaning of such a declaration is the following: For each + setting of the input variables (the variables specified using the + |var| declaration), evaluate the \meta{expression} using the + standard mathematical parser of \tikzname. The resulting value is + then stored in |/data point/|\meta{attribute}. + + Inside \meta{expression} you can reference data point attributes + using the following command, which is only defined inside such an + expression: + \begin{command}{\value\marg{variable}} + This expands to the current value of the key |/data point/|\meta{variable}. + \end{command} + + There can be multiple function declarations in a single data + specification. In this case, all of these functions will be + evaluated for each setting of input variables. + + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as smooth line] + data [format=function] { + var x : interval [-1.5:1.5]; + + func y = \value x * \value x; + }; +\end{tikzpicture} + \end{codeexample} + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as smooth line, + all axes={ticks={few},unit length=3mm}] + data [format=function] { + var t : interval [0:2*pi]; + + func x = \value t * cos(\value t r); + func y = \value t * sin(\value t r); + }; +\end{tikzpicture} + \end{codeexample} + \end{dataformat} + +\end{tikzlibrary} + + + +\subsection{Advanced: The Data Parsing Process} + +\label{section-dv-parsing} + +Whenever data is fed to the data visualization system, it will be +handled by the |\pgfdata| command, declared in the |datavisualization| +module. The command is both used to parse data stored in external +sources (that is, in external files or which is produced on the fly by +calling an external command) as well as data given inline. A data +format does not need to know whether data comes from a file or is +given inline, the |\pgfdata| command will take care of this. + +Since \TeX\ will always read files in a line-wise fashion, data is +always fed to data format parsers in such a fashion. Thus, even it +would make more sense for a format to ignore line-breaks, the parser +must still handle data given line-by-line. + +Let us now have a look at how |\pgfdata| works. + +\begin{command}{\pgfdata\opt{\oarg{options}\marg{inline data}}} + This command is used to feed data to the visualization + pipeline. This command can only be used when a data visualization + object has been properly setup, see + Section~\ref{section-dv-main-setup}. + + \medskip + \textbf{Basic options.} + The |\pgfdata| command may be followed by \meta{options}, which are + executed with the path |/pgf/data/|. Depending + on these options, the \meta{options} may either be followed by + \meta{inline data} or, alternatively, no \meta{inline data} is + present and the data is read from an external source. + + The first important option is \meta{source}, which governs which of these + two alternatives applies: + \begin{key}{/pgf/data/source=\meta{filename} (initially \normalfont empty)} + If you set the |source| attribute to a non-empty \meta{filename}, + the data will be read from this file. In this case, no + \meta{inline data} may be present, not even empty curly braces + should be provided. If |source| is empty, the data must directly + follow as \meta{inline data}. +\begin{codeexample}[code only] +% Data is read from two external files: +\pgfdata[format=table,source=file1.csv] +\pgfdata[format=table,source=file2.csv] +\end{codeexample} +\begin{codeexample}[code only] +% Data is given inline: +\pgfdata[format=table] +{ + x, y + 1, 2 + 2, 3 +} +\end{codeexample} + \end{key} + The second important key is |format|, which is used to specify the + data format: + \begin{key}{/pgf/data/format=\meta{format} (initially table)} + Use this key to locally set the format used for parsing the + data. The \meta{format} must be a format that has been previously + declared using the |\pgfdeclaredataformat| command. See the + reference section for a list of the predefined formats. + \end{key} + In case all your data is in a certain format, you may wish to + generally set the above key somewhere at the beginning of your + file. Alternatively, you can use the following style to setup the + |format| key and possibly further keys concerning the data format: + \begin{stylekey}{/pgf/every data} + This style is executed by |\pgfdata| before the \meta{options} are + parsed. + + Note that the path of this key is just |/pgf/|, not + |/pgf/data/|. Also note that \tikzname\ internally sets the value + of this key up in such a way that the keys |/tikz/every data| and + also |/tikz/data visualization/every data| are executed. The + bottom line of this is that when using \tikzname, you should not + set this key directly, set |/tikz/every data| instead. + \end{stylekey} + + \medskip + \textbf{Gathering of the data.} + Once the data format and the source have been decided upon, the data + is ``gathered.'' During this phase the data is not actually parsed + in detail, but just gathered so that it can later be parsed during + the visualization. There are two different ways in which the data is + gathered: + \begin{itemize} + \item In case you have specified an external source, the data + visualization object is told (by means of invoking the |add data| + method) that it should (later) read data from the file specified + by the |source| key using the format specified + by the |format| key. The file is not read at this point, but only + later during the actual visualization. + \item Otherwise, namely when data is given inline, depending on + which format is used, some catcodes get changed. This is necessary + since \TeX's special characters are often not-so-special in a + certain format. + + Independently of the format, the end-of-line character + (carriage return) is made an active character. + + Finally, the \meta{inline data} is then read as a normal argument + and the data visualization object is told that later on it should + parse this data using the given format parser. Note that in this + case the data visualization object must store the whole data + internally. + \end{itemize} + In both cases the ``data visualization object'' is the object stored + in the |/pgf/data visualization/obj| key. + + \medskip + \textbf{Parsing of the data.} + During the actual data visualization, all code that has been added + to the data visualization object by means of the |add data| method + is executed several times. It is the job of this code to call the + |\pgfdatapoint| method for all data points present in the data. + + When the |\pgfdata| method calls |add data|, the code that is passed + to the data visualization object is just a call to internal macros + of |\pgfdata|, which are able to parse the data stored in an + external file or in the inlined data. Independently of where the + data is stored, these macros always do the following: + \begin{enumerate} + \item The catcodes are setup according to what the data + format requires. + \item Format-specific startup code gets called, which can initialize + internal + variables of the parsing process. (The catcode changes are not + part of the startup code since in order to read inline data + |\pgfdata| must be able to setup to temporarily setup the catcodes + needed later on by the parsers, but since no reading is to be + done, no startup code should be called at this point.) + \item For each line of the data a format-specific code handler, + which depends on the + data format, is called. This handler gets the current line as + input and should call |\pgfdatapoint| once for each data point + that is encoded by this line (a line might define multiple data + points or none at all). Empty lines are handled by special + format-specific code. + \item At the end, format-specific end code is executed. + \end{enumerate} + For an example of how this works, see the description of the + |\pgfdeclaredataformat| command. +\end{command} + + +\subsection{Advanced: Defining New Formats} +\label{section-dv-declaring-formats} + +In order to define a new data format you can use the following +command, which is basic layer command defined in the module +|datavisualization|: + +\begin{command}{\pgfdeclaredataformat\marg{format name}\marg{catcode + code}\marg{startup code}\marg{line arguments}\\\marg{line + code}\marg{empty line code}\marg{end code}} + This command defines a new data format called \meta{format name}, + which can subsequently be used in the |\pgfdata| command. (The + \tikzname's |data| maps directly to |\pgfdata|, so the following + applies to \tikzname\ as well.) + + As explained in the description of the |\pgfdata| command, when data + is being parsed that is formatted according to \meta{format name}, + the following happens: + \begin{enumerate} + \item The \meta{catcode code} is executed. This code should just + contain catcode changes. The \meta{catcode code} will also be + executed when inline data is read. + \item Next, the \meta{startup code} is executed. + \item Next, for each non-empty line of the data, the line is passed + to a macro whose argument list is given by \meta{line + arguments} and whose body is given by \meta{line code}. The idea + is that you can use \TeX's powerful pattern matching capabilities + to parse the non-empty lines. See also the below example. + \item Empty lines are not processed by the \meta{line code}, but + rather by the \meta{empty line code}. Typically, empty lines can + simply be ignored and in this case you can let this parameter be + empty. + \item At the end of the data, the \meta{end code} is executed. + \end{enumerate} + + As an example, let us now define a simple data format for reading + files formatted in the following manner: Each line should contain a + coordinate pair as in |(1.2,3.2)|, so two numbers separated by a + comma and surrounded by parentheses. To make things more + interesting, suppose that the hash mark symbol can be used to + indicate comments. Here is an example of some data given in this + format: +\begin{codeexample}[code only] +# This is some data formatted according to the "coordinates" format +(0,0) +(0.5,0.25) +(1,1) +(1.5,2.25) +(2,4) +\end{codeexample} + + A format parser for this format could be defined as follows: +\begin{codeexample}[code only] +\pgfdeclaredataformat{coordinates} +% First comes the catcode argument. We turn the hash mark into a comment character. +{\catcode`\#=14\relax} +% Second comes the startup code. Since we do not need to setup things, we can leave +% it empty. Note that we could also set it to something like \begingroup, provided we +% put an \endgroup in the end code +{} +% Now comes the arguments for non-empty lines. Well, these should be of the form +% (#1,#2), so we specify that: +{(#1,#2)} +% Now we must do something with a line of this form. We store the #1 argument in +% /data point/x and #2 in /data point/y. Then we call \pgfdatapoint to create a data point. +{ + \pgfkeyssetvalue{/data point/x}{#1} + \pgfkeyssetvalue{/data point/y}{#2} + \pgfdatapoint +} +% We ignore empty lines: +{} +% And we also have no end-of-line code. +{} +\end{codeexample} +This format could now be used as follows: +\begin{codeexample}[code only] +\begin{tikzpicture} + \datavisualization[school book axes, visualize as smooth line] + data [format=coordinates] { + # This is some data formatted according + # to the "coordinates" format + (0,0) + (0.5,0.25) + (1,1) + (1.5,2.25) + (2,4) + }; +\end{tikzpicture} +\end{codeexample} +\end{command} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex new file mode 100644 index 00000000000..b480f2ed589 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex @@ -0,0 +1,159 @@ +% Copyright 2008 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Introduction to Data Visualization} + +\emph{Data visualization} is the process of converting \emph{data + points,} which typically consist of multiple numerical values, into +a graphical representation. Examples include the well-known function +plots, but pie charts, bar diagrams, box plots, or vector fields are +also examples of data visualizations. + +The data visualization subsystem of \pgfname\ takes a general, open +approach to data visualization. Like everything else in \pgfname, +there is a powerful, but not-so-easy-to-use basic layer in the data +visualization system and a less flexible, but much simpler-to-use +frontend layer. The present section gives an overview of the +basic ideas behind the data visualization system. + + +\subsection{Concept: Data Points} + +\label{section-dv-intro-data-points} + +The most important input for a data visualization is always raw +data. This data is typically present in different formats and the data +visualization subsystem provides methods for reading such formats and +also for defining new input formats. However, independently of the +input format, we may ask what kind of data the data visualization +subsystem should be able to process. For two-dimensional plots we +need lists of pairs of real numbers. For a bar plot we usually need a +list of numbers, possibly together with some colors and labels. For a +surface plot we need a matrix of triples of real numbers. For a vector +field we need even more complex data. + +The data visualization subsystem makes no assumption concerning which +kind of data is being processed. Instead, the whole +``rendering pipeline'' is centered around a concept called the +\emph{data point}. Conceptually, a data point is an arbitrarily +complex record that represents one piece of data that should be +visualized. Data points are \emph{not} just coordinates in the plane +or the numerical values that need to be visualized. Rather, they +represent the basic units of the data that needs to be visualized. + +Consider the following example: In an experiment we drive a car along +a road and have different measurement instruments installed. We +measure the position of the car, the time, the speed, the direction +the car is heading, the acceleration, and perhaps some further +values. A data point would consist of a record consisting of a +timestamp together with the current position of the car (presumably +two or three numbers), the speed vector (another two or three +numbers), the acceleration (another two or three numbers), and perhaps +the label text of the current experiment. + +Data points should be ``information rich.'' They might even contain +more information than what will actually be visualized. It is the job +of the rendering pipeline to pick out the information relevant to one +particular data visualization -- another visualization of the same +data might pick different aspects of the data points, thereby +hopefully allowing new insights into the data. + +Technically, there is no special data structure for data +points. Rather, when a special macro called |\pgfdatapoint| is called, +the ``totality'' of all currently set keys with the |/data point/| +prefix in the current scope forms the data point. This is both a very +general approach and quite fast since no extra data structures need to +be created. + + +\subsection{Concept: Visualization Pipeline} + +The \emph{visualization pipeline} is a series of actions that are +performed on the to-be-visualized data. The +data is presented to the visualization pipeline in the form of a long +stream of complex data points. The visualization pipeline makes +several passes over this stream of data points. During the first +pass(es), called the \emph{survey phase(s)}, information is gathered +about the data points such as minimal and maximal values, which can be +useful for automatic fitting of the data into a given area. In the +main pass over the data, called the \emph{visualization phase}, the +data points are actually visualized, for instance in the form of lines +or points. + +Like as for data points, the visualized pipeline makes no assumptions +concerning what kind of visualization is desired. Indeed, one could even use +it to produce a plain-text table. This flexibility is achieved by +extensive use of objects and signals: When a data visualization +starts, a number of signals (see Section~\ref{section-signals} for an +introduction to signals) are initialized. Then, numerous +``visualization objects'' are created that listen to these +signals. These objects are all involved in processing the data +points. For instance, the job of an |interval mapper| object is to +map one attribute of a data point, such as a car's velocity, to +another, such as the $y$-axis of a plot. For each data point the +different signals are raised in a certain order and the different +visualization objects now have a chance of preparing the data point +for the actual visualization. Continuing the above example, there +might be a second |interval mapper| that takes the computed +$y$-position and applies a logarithm to it, because a log-plot was +requested. Then another mapper, this time a |polar mapper| might be +used to map everything to polar coordinates. Following this, a +|plot mark visualizer| might actually draw something at the computed +position. + +The whole idea behind the rendering pipeline is that new kinds of data +visualizations can be implemented, ideally, just by adding one or two +new objects to the visualization pipeline. Furthermore, different +kinds of plots can be combined in novel ways in this manner, which is +usually very hard to do. For instance, the visualization pipeline +makes it easy to create, say, polar-semilog-box-plots. At first sight, +such new kinds of plots may seem frivolous, but data visualization +is all about gaining insights into the data from as many different +angles as possible. + +Naturally, creating new classes and objects for the rendering pipeline +is not trivial, so most users will just use the existing classes, +which should, thus, be as flexible as possible. But even when one only +intends to use existing classes, it is still tricky to setup the +pipeline correctly since the ordering is obviously important and since +things like axes and ticks need to be configured and taken care +of. For this reason, the frontend libraries provide +preconfigured rendering pipelines so that one can simply say that a +data visualization should look like a |line plot| with +|school book axes| or with |scientific axes|, which selects a certain +visualization pipeline that is appropriate for this kind of plot: +\begin{codeexample}[] +\begin{tikzpicture}[scale=.7] + \datavisualization [school book axes, visualize as smooth line] + data [format=function] { + var x : interval [-2:2]; + func y = \value x*\value x + 1; + }; +\end{tikzpicture} +\end{codeexample} +\begin{codeexample}[] +\begin{tikzpicture}[scale=.7] + \datavisualization [scientific axes, visualize as smooth line] + data [format=function] { + var x : interval [-2:2]; + func y = \value x*\value x + 1; + }; +\end{tikzpicture} +\end{codeexample} +One must still configure such a plot (choose styles and themes +and also specify which attributes of a data point should be used), but +on the whole the plot is quite simple to specify. + + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: "pgfmanual" +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex new file mode 100644 index 00000000000..a2743a9fb57 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex @@ -0,0 +1,721 @@ +% Copyright 2008 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Creating Data Visualizations} +\label{section-dv-main} +\label{section-dv-main-setup} + +\subsection{Overview} + +The present section explains how a data visualization is created in +\tikzname. For this, you need to include the |datavisualization| +library and then use the command |\datavisualization| whose syntax is +explained in the rest of the present section. This command is part of +the following library: + +\begin{tikzlibrary}{datavisualization} + This library must be loaded if you wish to use the + |\datavisualization| command. It defines all styles needed to create + basic data visualizations; additional, more specialized libraries + need to be loaded for more advanced features. +\end{tikzlibrary} + + +In order to visualize, you basically need to do three things: +\begin{enumerate} +\item You need to select what kind of plot you would like to have (a + ``school book plot'' or a ``scientific 2d plot'' or a ``scientific + spherical plot'' etc.). This is done by passing an option to the + |\datavisualization| command that selects this kind of plot. +\item You need to provide data points, which is done using the |data| + command. +\item Additionally, you can add options that give you more + fine-grained control over the way the visualization will look. You + can configure the number of ticks and grid lines, where the labels + are placed, the colors, or the fonts. Indeed, since the + data visualization engine internally uses \tikzname-styles, you can + have extremely fine-grained control over how a plot will look like. +\end{enumerate} + +The syntax of the |\datavisualization| command is designed in such a +way that if you only need to provide very few options to create plots +that ``look good by default''. + +This section is structured as follows: First, the philosophy behind +concepts like ``data points,'' ``axes,'' or ``visualizers'' is +explained. Each of these concepts is further detailed in later +section. Then, the syntax of the |\datavisualization| command is +covered. The reference sections explain which predefined plot kinds +are available. + + +\subsection{Concept: Data Points and Data Formats} + +As explained in Section~\ref{section-dv-intro-data-points}, data +points are the basic entities that are processed by the data +visualization engine. In order to specify data points, you use the +|data| command, whose syntax is explained in more detail in +Section~\ref{section-dv-data-syntax}. The |data| command allows you to +either specify points ``inline,'' directly inside your \TeX-file; or +you can specify the name of file that contains the data points. + +\medskip +\textbf{Specifying data points.} +Data points can be formatted in different ways. For instance, in the so +called \emph{comma separated values} format, there is one line for +each data point and the different attributes of a data point are +separated by commas. Another common format is to specify data points +using the so called \emph{key-value} format, where on each line the +different attributes of a data point are set using a comma-separated +list of strings of the form |attribute=value|. + +Here are two examples, where similar data is given in different +formats: + + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as smooth line] + data { + x, y + -1.5, 2.25 + -1, 1 + -.5, .25 + 0, 0 + .5, .25 + 1, 1 + 1.5, 2.25 + }; +\end{tikzpicture} + \end{codeexample} + + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as smooth line] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} + \end{codeexample} + +In the first example, no format needed to be specified explicitly +since the default format is the one used for the data following the +|data| keyword: A list of comma-separated values, where each line +represents a data point. + +\medskip +\textbf{Number accuracy.} +Data visualizations typically demand a much higher accuracy and range +of values than \TeX\ provides: \TeX\ numbers are limited to 13 bits +for the integer part and 16 bits for the fractional part. Because of +this, the data visualization engine does not use \pgfname's standard +representation of numbers and \TeX\ dimensions and is does not use the +standard parser when reading numbers in a data point. Instead, the +|fpu| library, described in Section~\ref{section-library-fpu}, is used +to handle numbers. + +This use of the |fpu| library has several effects that users of the data +visualization system should be aware of: +\begin{enumerate} +\item You can use numbers like |100000000000000| or |0.00000000001| in + a data points. +\item Since the |fpu| library does not support advanced parsing, you + currently \emph{cannot} write things like |3+2| in a data point + number. This will result in an error +\item However, there is a loop-hole: If a ``number'' in a data point + starts with a parenthesis, the value between the parentheses + \emph{is} parsed using the normal parser: + \begin{itemize} + \item |100000| is allowed. + \item |2+3| yields an error. + \item |(2+3)| is allowed and evaluates to |5|. + \item |(100000)| yields an error since $100000$ is beyond the normal + parser's precision. + \end{itemize} + The bottom line is that any normal calculations should be set inside + round parentheses, while large numbers should not be surrounded by + parentheses. Hopefully, in the future, these restrictions will be + lifted. +\end{enumerate} + + +Section~\ref{section-dv-formats} gives an +in-depth coverage of the available data formats and explains how new +data formats can be defined. + + + + +\subsection{Concept: Axes, Ticks, and Grids} + +Most plots have two or three axes: A horizontal axis usually called +the $x$-axis, a vertical axis called the $y$-axis, and possibly some +axis pointing in a sloped direction called the $z$-axis. Axes are +usually drawn as lines with \emph{ticks} indicating interesting +positions on the axes. The data visualization engine gives you +detailed control over where these ticks are rendered and how many of +them are used. Great care is taken to ensure that the position of +ticks are chosen well by default. + +From the point of view of the data visualization engine, axes are a +somewhat more general concept than ``just'' lines that point ``along'' +some dimension: The data visualization engine uses axes to visualize +any change of an attribute by varying the position of data points in the +plane. For instance, in a polar plot, there is an ``axis'' for the +angle and another ``axis'' for the distance if the point from the +center. Clearly these axes vary the position of data points in the +plane according to some attribute of the data points; but just as +clearly they do not point in any ``direction.'' + +A great benefit of this approach is that the powerful methods for +specifying and automatic inference of ``good'' positions for ticks or +grid lines apply to all sorts of situations. For instance, you can use +it to automatically put ticks and grid lines at well-chosen angles of +a polar plot. + +Typically, you will not need to specify axes explicitly. Rather, +predefined styles take care of this for you: + + + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [ + scientific axes, + x axis={length=3cm, ticks=few}, + visualize as smooth line + ] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} + \end{codeexample} + + + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [ + scientific clean axes, + x axis={length=3cm, ticks=few}, + all axes={grid}, + visualize as smooth line + ] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} + \end{codeexample} + +Section~\ref{section-dv-axes} explains in more detail how axes, ticks, +and grid lines can be chosen and configured. + + +\subsection{Concept: Visualizers} + +Data points and axes specify \emph{what} is visualized and +\emph{where}. A \emph{visualizer} specifies \emph{how} they are +visualized. One of the most common visualizers is a \emph{line + visualizer} which connects the positions of the data points in the +plane using a line. Another common visualizer is the \emph{scatter + plot visualizer} where small marks are drawn at the positions of the +data points. More advanced visualizers include, say, box plot +visualizers or pie chart visualizers. + + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [ + scientific clean axes, + x axis={length=3cm, ticks=few}, + visualize as smooth line + ] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} + \end{codeexample} + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [ + scientific clean axes, + x axis={length=3cm, ticks=few}, + visualize as scatter + ] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} + \end{codeexample} + +Section~\ref{section-dv-visualizers} provides more information on +visualizers as well as reference lists. + + +\subsection{Concept: Style Sheets and Legends} + +A single data visualizations may use more than one visualizer. For +instance, if you wish to create a plot containing several lines, a +separate visualizer is used for each line. In this case, two problems +arise: + +\begin{enumerate} +\item You may wish to make it easy for the reader to differentiate + between the different visualizers. For instance, one line should be + black, another should be red, and another blue. Alternatively, you + might wish one line to be solid, another to be dashed, and a third + to be dotted. + + Specifying such styles is trickier than one might expect; experience + shows that many plots use ill-chosen and inconsistent + styling. For this reason, the data visualization introduces the + notion of \emph{style sheets} for visualizers and comes with some + well-designed predefined style sheets. +\item You may wish to add information concerning what the different + visualizers represent. This is typically done using a legend, but it + is even better to add labels directly inside the visualization. Both + approaches are supported. +\end{enumerate} + +An example where three functions are plotted and a legend is added is +shown below. Two style sheets are used so that \emph{both} the +coloring and the dashing is varied. + +\begin{codeexample}[] +\begin{tikzpicture}[baseline] + \datavisualization [ scientific clean axes, + y axis=grid, + visualize as smooth line/.list={sin,cos,tan}, + visualizer style sheet=strong colors, + visualizer style sheet=vary dashing, + sin={label in legend={text=$\sin x$}}, + cos={label in legend={text=$\cos x$}}, + tan={label in legend={text=$\tan x$}}, + data/format=function ] + data [sin] { + var x : interval [-0.5*pi:4]; + func y = sin(\value x r); + } + data [cos] { + var x : interval [-0.5*pi:4]; + func y = cos(\value x r); + } + data [tan] { + var x : interval [-0.3*pi:.3*pi]; + func y = tan(\value x r); + }; +\end{tikzpicture} +\end{codeexample} + +Section~\ref{section-dv-style-sheets} details style sheets and +legends. + + +\subsection{Usage} +\label{section-dv-data-syntax} + +Inside a \tikzname\ picture you can use the |\datavisualization| +command to create a data visualization. You can use this command +several times in a picture to create pictures containing multiple data +visualizations. + +\begin{command}{\datavisualization\opt{\oarg{data visualization + options}}\meta{data specification}|;|} + This command is available only inside a |{tikzpicture}| environment. + + The \meta{data visualization options} are used to configure the data visualization, + that is, how the data is to be depicted. The options are executed + with the path prefix |/tikz/data visualization|. This means that + normal \tikzname\ options like |thin| or |red| cannot be used + here. Rather, a large number of options specific to data + visualizations are available. + + As a minimum, you should specify at least two options: First, you + should use an option that selects an axis system that is appropriate + for your plot. Typical possible keys are |school book axes| or + |scientific axes|, detailed information on them can be found in + Section~\ref{section-dv-axes}. + + Second, you use an option to select + \emph{how} the data should be visualized. This is done using a key + like |visualize as line| which will, as the name suggests, visualize + the data by connecting data points in the plane using a + line. Similarly, |visualize as smooth cycle| will try to fit a smooth + cycle through the data points. Detailed information on possible + visualizers can be found in Section~\ref{section-dv-visualizers}. + + Following these options, the \meta{data specification} is used to + provide the actual to-be-visualized data. The syntax is somewhat + similar to commands like |\path|: The \meta{data + specification} is a sequence of keywords followed by local options + and parameters, terminated with a semicolon. (Indeed, like for the + |\path| command, the \meta{data visualizers options} need not be + specified at the beginning, but additional option surrounded by + square brackets may be given anywhere inside the \meta{data specification}.) + + The different possible keywords inside the \meta{data specification} + are explained in the following. +\end{command} + + +\begin{datavisualizationoperation}{data}{\opt{\oarg{options}}\opt{\marg{inline + data}}} + This command is used to specify data for the data visualization. It + can be used several times inside a single visualization and each + time the to-be-read data may have a different format, but the data + will be visualized as if it have been specified inside a single |data| + command. + + The behaviour of the |data| command depends on + whether the \meta{inline data} is present. If it is not present, the + \meta{options} must be used to specify a source file from which the + data is read; if the \meta{inline data} is present no file will be + used, instead the data should directly reside inside the \TeX-file + and be given between the curly braces surrounding the \meta{inline + data}. + + The \meta{options} are executed with the prefix |/pgf/data|. The + following options are always available: + \begin{key}{/pgf/data/source=\meta{filename} (initially \normalfont empty)} + If you set the |source| attribute to a non-empty \meta{filename}, + the data will be read from this file. In this case, no + \meta{inline data} may be present, not even empty curly braces + should be provided. +\begin{codeexample}[code only] +\datavisualization ... + data [source=file1.csv] + data [source=file2.csv]; +\end{codeexample} + The other way round, if |source| is empty, the data must directly + follow as \meta{inline data}. +\begin{codeexample}[code only] +\datavisualization ... + data { + x, y + 1, 2 + 2, 3 + }; +\end{codeexample} + \end{key} + The second important key is |format|, which is used to specify the + data format: + \begin{key}{/pgf/data/format=\meta{format} (initially table)} + Use this key to locally set the format used for parsing the + data, see Section~\ref{section-dv-formats} for a list of + predefined formats. + + The default format is the |table|-format, also known as + ``comma-separated values.'' The first line contains names of + attributes separated by commas, all following lines constitute a + data point where the attributes are given by the comma-separated + values in that line. + \end{key} + + \medskip + \textbf{Presetting attributes.} + Normally, the inline data or the external data contains for each + data point the values of the different attributes. However, + sometimes you may also wish to set an attribute to a fixed value for + all data points of a data set. Suppose, for instance, that you have + to source files |experiment007.csv| and |experiment023.csv| and you + would like that for all data points of the first file the attribute + |/data point/experiment id| is set to 7 while for the data points of + the second file they are set to 23. In this case, you can specify + the desired settings using an absolute path inside the + \meta{options}. The effect will be local to the current |data| + command: +\begin{codeexample}[code only] +\datavisualization... + data [/data point/experiment=7, source=experiment007.csv] + data [/data point/experiment=23, source=experiment023.csv]; +\end{codeexample} + + \begin{codeexample}[] +\begin{tikzpicture} + \datavisualization [school book axes, visualize as line] + data [/data point/x=1] { + y + 1 + 2 + } + data [/data point/x=2] { + y + 2 + 0.5 + }; +\end{tikzpicture} +\end{codeexample} + + \medskip + \textbf{Setting options for multiple |data| commands.} + You may wish to generally set the format once and for all. This can + be done by using the following key: + \begin{stylekey}{/tikz/every data} + This key is executed for every |data| command. + \end{stylekey} + + Another way of passing options to multiple |data| commands is to use + the following facility: Whenever an option with the path + |/tikz/data visualization/data| is used, the path will be remapped + to |/pgf/data|. This means, in particular, that you can pass an + option like |data/format=table| to the |\datavisualization| command + to set the data format for all |data| commands of the data + visualization. + + \medskip + \textbf{Parsing inline data.} + When you specify data inline, \TeX\ needs to read the data + ``line-by-line,'' while \TeX\ normally largely ignores end-of-line + characters. For this reason, the data visualization system + temporarily changes the meaning of the end-of-line character. This + is only possible if \TeX\ has not already processed the data in some + other way (namely as the parameter to some macro). + + The bottom line is that you cannot use inline data when the whole + |\datavisualization| command is passed as a parameter to some + macro that is not setup to handle ``fragile'' code. For instance, in + a \textsc{beamer} |frame| you need to add the |fragile| option when + a data visualization contains inline data. + + The problem does not arise when an external data |source| is + specified. +\end{datavisualizationoperation} + + + +\begin{datavisualizationoperation}{scope}{\opt{\oarg{options}}\marg{data + specification}} + Scopes can be used to nest hierarchical data sets. The + \meta{options} will be executed with the path |/pgf/data| and will + only apply to the data sets specified inside the \meta{data + specification}, which may contain |data| or |scope| commands once more: +\begin{codeexample}[code only] +\datavisualization... + scope [/data point/experiment=7] + { + data [source=experiment007-part1.csv] + data [source=experiment007-part2.csv] + data [source=experiment007-part3.csv] + } + scope [/data point/experiment=23, format=foo] + { + data [source=experiment023-part1.foo] + data [source=experiment023-part2.foo] + }; +\end{codeexample} +\end{datavisualizationoperation} + + +\begin{datavisualizationoperation}{info}{\opt{\oarg{options}}\marg{code}} + This command will execute normal \tikzname\ \meta{code} at the end + of a data visualization. The \meta{options} are executed with the + normal path |/tikz/|. + + The only difference between this command and just giving the + \meta{code} directly following the data visualization is that inside + the \meta{code} following an |info| command you still have access + to the coordinate system of the data visualization. In sharp + contrast, \tikzname\ code given after a data visualization can no + longer access this coordinate system. + + +\begin{codeexample}[] +\begin{tikzpicture}[baseline] + \datavisualization [ school book axes, visualize as line ] + data [format=function] { + var x : interval [-0.1*pi:2]; + func y = sin(\value x r); + } + info { + \draw [red] (visualization cs: x={(.5*pi)}, y=1) circle (1pt) + node [above,font=\footnotesize] {extremal point}; + }; +\end{tikzpicture} +\end{codeexample} + + As can be seen, inside a data visualization a special coordinate + system is available: + + \begin{coordinatesystem}{visualization} + As for other coordinate systems, the syntax is + \declare{|(visualization cs:|\meta{list + of attribute-value pairs}|)|}. The effect is the following: + For each pair \meta{attribute}|=|\meta{value} in the \meta{list} + the key |/data point/|\meta{attribute} is set to + \meta{value}. Then, it is computed where the resulting data point + ``would lie'' on the canvas (however, no data point is passed to + the visualizers). + \end{coordinatesystem} +\end{datavisualizationoperation} + +In order to put information \emph{behind} the data visualization, +you should usually use the |background| library and the background +layer. However, it is also possible to execute code at other points +during the data visualization process. Since this is potentially +more disruptive, special keys documented in +Section~\ref{section-dv-user-code} must be used. + + + +\subsection{Advanced: Executing User Code During a Data Visualization} +\label{section-dv-user-code} + +The following keys can be passed to the |\datavisualization| command +and allow you to execute some code at some special time during the +data visualization process. For details of the process and on which +signals are emitted when, +see Section~\ref{section-dv-backend}. + +\begin{key}{/tikz/data visualization/before survey=\meta{code}} + The \meta{code} is passed to the |before survey| method of the data + visualization object and then executed at the appropriate time (see + Section~\ref{section-dv-backend} for details). + + The following commands work likewise: +\end{key} +\begin{key}{/tikz/data visualization/at start survey=\meta{code}} +\end{key} +\begin{key}{/tikz/data visualization/at end survey=\meta{code}} +\end{key} +\begin{key}{/tikz/data visualization/after survey=\meta{code}} +\end{key} +\begin{key}{/tikz/data visualization/before visualization=\meta{code}} +\end{key} +\begin{key}{/tikz/data visualization/at start visualization=\meta{code}} +\end{key} +\begin{key}{/tikz/data visualization/at end visualization=\meta{code}} +\end{key} +\begin{key}{/tikz/data visualization/after visualization=\meta{code}} +\end{key} + + + +\subsection{Advanced: Creating New Objects} + +You will need the following key only when you wish to create new +rendering pipelines from scratch -- instead of modifying an existing +pipeline as you would normally do. In the following it is assumed that +you are familiar with the concepts of Section~\ref{section-dv-backend}. + +\begin{key}{/tikz/data visualization/new object=\meta{options}} + This key servers two purposes: + \begin{enumerate} + \item + This method makes it easy to create a new object as part of the + rendering pipeline, using \meta{options} to specify arguments rather + that directly calling |\pgfoonew|. Since you have the full power + of the keys mechanism at your disposal, it is easy, for instance, + to control whether or not parameters to the constructor are + expanded or not. + \item + The object is not created immediately, but only just before the + visualization starts. This allows you to specify that an object + must be created, but the parameter values of for its constructor + may depend on keys that are not yet set. A typical application is + the creating of an axis object: When you say |scientific axes|, + the |new object| command is used internally to create two + objects representing these axes. However, keys like + |x={length=5cm}| can only \emph{later} be used to specify the + parameters that need to be passed to the constructor of the + objects. + \end{enumerate} + + The following keys may be used inside the \meta{options}: + \begin{key}{/tikz/data visualization/class=\meta{class name}} + The class of the to-be-created object. + \end{key} + \begin{key}{/tikz/data visualization/when=\meta{phase name} + (initially before survey)} + This key is used to specify when the object is to be created. As + described above, the object is not created immediately, but at + some time during the rendering process. You can specify any of the + phases defined by the data visualization object, see + Section~\ref{section-dv-backend} for details. + \end{key} + \begin{key}{/tikz/data visualization/store=\meta{key name}} + If the \meta{key name} is not empty, once the object has been + created, a handle to the object will be stored in \meta{key + name}. If a handle is already stored in \meta{key name}, the + object is not created twice. + \end{key} + \begin{key}{/tikz/data visualization/before creation=\meta{code}} + This code is executed right before the object is finally + created. It can be used to compute values that are then passed to + the constructor. + \end{key} + \begin{key}{/tikz/data visualization/after creation=\meta{code}} + This code is executed right after the object has just been + created. A handle to the just-created object is available in + |\tikzdvobj|. + \end{key} + \begin{key}{/tikz/data visualization/arg1=\meta{value}} + The value to be passed as the first parameter to the + constructor. Similarly, the keys |arg2| to |arg8| specify further + parameters passed. Naturally, only as many arguments are passed as + parameters are set. Here is an example: +\begin{codeexample}[code only] +\tikzdatavisualizationset{ + new object={ + class = example class, + arg1 = foo, + arg2 = \bar + } +} +\end{codeexample} + causes the following object creation code to be executed later on: +\begin{codeexample}[code only] +\pgfoonew \tikzdvobj=new example class(foo,\bar) +\end{codeexample} + Note that you key mechanisms like |.expand once| to pass the value of + a macro instead of the macro itself: +\begin{codeexample}[code only] +\tikzdatavisualizationset{ + new object={ + class = example class, + arg1 = foo, + arg2/.expand once = \bar + } +} +\end{codeexample} + Now, if |\bar| is set to |This \emph{is} it.| at the moment to + object is created later on, the following object creation code is executed: +\begin{codeexample}[code only] +\pgfoonew \tikzdvobj=new example class(foo,This \emph{is} it) +\end{codeexample} + \end{key} + + \begin{key}{/tikz/data visualization/arg1 from key=\meta{key}} + Works like the |arg1|, only the value that is passed to the + constructor is the current value of the specified \meta{key} at + the moment when the object is created. +\begin{codeexample}[code only] +\tikzdatavisualizationset{ + new object={ + class = example class, + arg1 from key = /tikz/some key + } +} +\tikzset{some key/.initial=foobar} +\end{codeexample} + causes the following to be executed: +\begin{codeexample}[code only] +\pgfoonew \tikzdvobj=new example class(foobar) +\end{codeexample} + Naturally, the keys |arg2 from key| to |arg8 from key| are also + provided. + \end{key} + + \begin{key}{/tikz/data visualization/arg1 handle from key=\meta{key}} + Works like the |arg1 from key|, only the key must store an object + and instead of the object a handle to the object is passed to the + constructor. + \end{key} +\end{key} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex new file mode 100644 index 00000000000..44c866cd04b --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex @@ -0,0 +1,29 @@ +% Copyright 2010 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Style Sheets and Legends} +\label{section-dv-style-sheets} + +\subsection{Overview} + +To be written... + +\subsection{Concepts: Style Sheets} + +\subsection{Concepts: Legends} + +\subsection{Usage: Selecting Style Sheets} + +\subsection{Usage: Labeling Visualizations} + +\subsection{Reference: Style Sheets for Lines} + +\subsection{Reference: Color Style Sheets} + diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex new file mode 100644 index 00000000000..f7633ceae70 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex @@ -0,0 +1,22 @@ +% Copyright 2010 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Visualizers} +\label{section-dv-visualizers} + +\subsection{Overview} + +To be written... + +\subsection{Concepts} + +\subsection{Usage} + +\subsection{Reference: Basic Visualizers} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex index 9d7617d6c38..4436a3ab3fb 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex @@ -18,11 +18,11 @@ The guidelines in this section come from different sources. Many of them are just what I would like to claim is ``common sense,'' some reflect my personal experience (though, hopefully, not my personal preferences), some come from books (the bibliography is still missing, -sorry) on graphic design and typography. +sorry) on graphic design and typography. The most influential source are the brilliant books by Edward Tufte. While I do not agree with everything written in these books, many of Tufte's arguments are so convincing that I decided to -repeat them in the following guidelines. +repeat them in the following guidelines. The first thing you should ask yourself when someone presents a bunch of guidelines is: Should I really follow these guidelines? This is an @@ -60,7 +60,7 @@ creation of \emph{a first draft} of a half page graphic. Later on, I expect another one to two hours before the final graphic is finished. In many publications, even in good journals, the authors and editors -have obviously invested a lot of time on the text, but seem to +have obviously invested a lot of time on the text, but seem to have spend about five minutes to create all of the graphics. Graphics often seem to have been added as an ``afterthought'' or look like a screen shot of whatever the authors's @@ -69,14 +69,14 @@ graphics that programs like \textsc{gnuplot} produce by default are of poor quality. Creating informative graphics that help the reader and that fit -together with the main text is a difficult, lengthy process. +together with the main text is a difficult, lengthy process. \begin{itemize} \item Treat graphics as first-class citizens of your papers. They deserve as much time and energy as the text does. Indeed, the creation of graphics might deserve \emph{even more} time than the writing of the main text since more attention will be paid - to the graphics and they will be looked at first. + to the graphics and they will be looked at first. \item Plan as much time for the creation and revision of a graphic as you would plan for text of the same size. @@ -87,7 +87,7 @@ together with the main text is a difficult, lengthy process. Very simple graphics will require less time, but most likely you do not want to have ``very simple graphics'' in your paper, anyway; just as you would not like to have a ``very simple text'' of the - same size. + same size. \end{itemize} @@ -99,7 +99,7 @@ like to report about. The creation of the paper will typically start with compiling a rough outline. Then, the different sections are filled with text to create a first draft. This draft is then revised repeatedly until, often after substantial revision, a final paper -results. In a good journal paper there is typically not be a single +results. In a good journal paper there is typically not be a single sentence that has survived unmodified from the first draft. Creating a graphics follows the same pattern: @@ -126,12 +126,12 @@ Creating a graphics follows the same pattern: Graphics can be placed at different places in a text. Either, they can be inlined, meaning they are somewhere ``in the middle of the text'' -or they can be placed in standalone ``figures.'' Since printers (the +or they can be placed in stand-alone ``figures.'' Since printers (the people) like to have their pages ``filled,'' (both for aesthetic and -economic reasons) standalone figures may traditionally be placed on +economic reasons) stand-alone figures may traditionally be placed on pages in the document far removed from the main text that refers to them. \LaTeX\ and \TeX\ tend to encourage this ``drifting away'' of -graphics for technical reasons. +graphics for technical reasons. When a graphic is inlined, it will more or less automatically be linked with the main text in the sense that the labels of the graphic @@ -139,13 +139,13 @@ will be implicitly explained by the surrounding text. Also, the main text will typically make it clear what the graphic is about and what is shown. -Quite differently, a standalone figure will often be viewed at a time +Quite differently, a stand-alone figure will often be viewed at a time when the main text that this graphic belongs to either has not yet been read or has been read some time ago. For this reason, you should -follow the following guidelines when creating standalone figures: +follow the following guidelines when creating stand-alone figures: \begin{itemize} \item - Standalone figures should have a caption than should make them + Stand-alone figures should have a caption than should make them ``understandable by themselves.'' For example, suppose a graphic shows an example of the different @@ -176,9 +176,9 @@ follow the following guidelines when creating standalone figures: did not end after all. The argument in favor of abbreviations is that they save space. - + Personally, I am not really convinced by either argument. On the one - hand, I have not yet seen any hard evidence that abbreviations slow + hand, I have not yet seen any hard evidence that abbreviations slow readers down. On the other hand, abbreviating all ``Figure'' by ``Fig.''\ is most unlikely to save even a single line in most documents. I avoid abbreviations. @@ -190,7 +190,7 @@ follow the following guidelines when creating standalone figures: Perhaps the most common ``mistake'' people do when creating graphics (remember that a ``mistake'' in design is always just ``ignorance'') -is to have a mismatch between the way their graphics look and the way +is to have a mismatch between the way their graphics look and the way their text looks. It is quite common that authors use several different programs for @@ -228,10 +228,10 @@ following guidelines: $0.4\,\mathrm{pt}$. However, some journals will not accept graphics with a normal line width below $0.5\,\mathrm{pt}$. \item - When using colors, use a consistent color coding in the text and in + When using colors, use a consistent color coding in the text and in graphics. For example, if red is supposed to alert the reader to something in the main text, use red also in graphics for important - parts of the graphic. If blue is used for structural elements like + parts of the graphic. If blue is used for structural elements like headlines and section titles, use blue also for structural elements of your graphic. @@ -265,7 +265,7 @@ following guidelines: main text, also use ``$1/2$'' as labels in graphics, not ``0.5''. A $\pi$ is a ``$\pi$'' and not ``$3.141$''. Finally, $\mathrm e^{-\mathrm i \pi}$ is ``$\mathrm e^{-\mathrm i \pi}$'', - not ``$-1$'', let alone ``-1''. + not ``$-1$'', let alone ``-1''. \item Labels should be legible. They should not only have a reasonably large size, they also should not be obscured by lines or other @@ -277,7 +277,7 @@ following guidelines: necessary, add a (subdued) line from the label to the labeled object. Try to avoid labels that only reference explanations in external legends. Reader have to jump back and forth between the - explanation and the object that is described. + explanation and the object that is described. \item Consider subduing ``unimportant'' labels using, for example, a gray color. This will keep the focus on the actual graphic. @@ -299,14 +299,14 @@ bad plots. The first question you should ask yourself when creating a plot is, Are there enough data points to merit a plot? If the answer is ``not -really,'' use a table. +really,'' use a table. A typical situation where a plot is unnecessary is when people present a few numbers in a bar diagram. Here is a real-life example: At the end of a seminar a lecturer asked the participants for feedback. Of the 50 participants, 30 returned the feedback form. According to the feedback, three participants considered the seminar ``very good,'' -nine considered it ``good,'' ten ``ok,'' eight ``bad,'' and no one thought +nine considered it ``good,'' ten ``ok,'' eight ``bad,'' and no one thought that the seminar was ``very bad.'' A simple way of summing up this information is the following table: @@ -343,7 +343,7 @@ were near-unreadable): \draw (\x,0) node[rotate=90,anchor=east] {\xtext}; \begin{scope}[xshift=\x cm] - + \filldraw[fill=blue!50] (-.3,0,0) rectangle (.3,\height,0); \filldraw[fill=blue!30] (.3,0,0) -- (.3,0,1) -- (.3,\height,1) -- (.3,\height,0) --cycle; \filldraw[fill=blue!20] (-.3,\height,0) -- (.3,\height,0) -- @@ -356,7 +356,7 @@ were near-unreadable): Both the table and the ``plot'' have about the same size. If your first thought is ``the graphic looks nicer than the table,'' try to answer the following questions based on the information in the table or in -the graphic: +the graphic: \begin{enumerate} \item How many participants where there? @@ -390,7 +390,7 @@ Here is the list of things that went wrong with the 3D-bar diagram: \item The labels at the bottom are rotated, making them hard to read. - (In the real presentation that I saw, the text was rendered at a very + (In the real presentation that I saw, the text was rendered at a very low resolution with about 10 by 6 pixels per letter with wrong kerning, making the rotated text almost impossible to read.) \item @@ -418,7 +418,7 @@ important for the graphic. The important things is the ``message,'' which is that there are more ``very good'' and ``good'' ratings than ``bad'' and ``very bad.'' However, to convey this message either use a sentence that says so or use a graphic that conveys this message more -clearly: +clearly: \medskip \par @@ -428,7 +428,7 @@ clearly: \colorlet{neutral}{black!60} \colorlet{none}{white} - \node[text centered,text width=3cm]{Ratings given by 50~participants}; + \node[align=center,text width=3cm]{Ratings given by 50~participants}; \begin{scope}[line width=4mm,rotate=270] \draw[good] (-123:2cm) arc (-123:-101:2cm); @@ -443,14 +443,14 @@ clearly: \divide\mycount by 10\relax \draw[black!15,thick] (\the\mycount:18mm) -- (\the\mycount:22mm); } - + \draw (0:2.2cm) node[below] {``ok'': 10 (20\%)}; \draw (165:2.2cm) node[above] {none: 20 (40\%)}; \draw (-111:2.2cm) node[left] {``very good'': 3 (6\%)}; \draw (-68:2.2cm) node[left] {``good'': 9 (18\%)}; \draw (65:2.2cm) node[right] {``bad'': 8 (16\%)}; \draw (93:2.2cm) node[right] {``very bad'': 0 (0\%)}; - \end{scope} + \end{scope} \draw[gray] (0,0) circle (2.2cm) circle (1.8cm); \end{tikzpicture} @@ -460,7 +460,7 @@ The above graphic has about the same information density as the table can directly ``see'' that there are more good or very good ratings than bad ones. One can also ``see'' that the number of people who gave no rating at all is not negligible, which is quite common for feedback -forms. +forms. Charts are not always a good idea. Let us look at an example that I redrew from a pie chart in \emph{Die Zeit}, June 4th, 2005: @@ -484,7 +484,7 @@ that I redrew from a pie chart in \emph{Die Zeit}, June 4th, 2005: {\footnotesize Gesamte Netto-Stromerzeugung in Prozent, in Milliarden Kilowattstunden (Mrd.\ kWh)} rectangle ([xshift=1mm]right border); - + % The 3D stuff \pgfdeclarehorizontalshading{zeit}{100bp} {color(0pt)=(black); @@ -515,7 +515,7 @@ that I redrew from a pie chart in \emph{Die Zeit}, June 4th, 2005: \draw (0,0) -- (145:1cm); \draw (0,0) -- (135:1cm); \draw (0,0) -- (92:1cm); - + \draw(0,0) circle (1cm); \end{scope} @@ -554,7 +554,7 @@ that I redrew from a pie chart in \emph{Die Zeit}, June 4th, 2005: \node[above right] at (Sonstige label) {Sonstige\ \ \footnotesize (16,5 kWh) \hskip1.5cm\ \normalsize\textbf{2,9\%}}; - \end{scope} + \end{scope} \end{tikzpicture} This graphic has been redrawn in \tikzname, but the original looks @@ -575,7 +575,7 @@ are a lot of things that went wrong: Braunkohle is less than the percentage of Kernenergie}. \item The 3D-distortion gets worse for small areas. The area of - ``Regenerative'' somewhat larger than the area of ``Erdgas.'' + ``Regenerative'' somewhat larger than the area of ``Erdgas.'' The area of ``Wind'' is slightly smaller than the area of ``Mineral\"olprodukte'' \emph{although the percentage of Wind is nearly three times larger than the percentage of @@ -585,13 +585,13 @@ are a lot of things that went wrong: distortion. The designer(s) of the original graphic have also made the ``Wind'' slice too small, even taking distortion into account. (Just compare the size of ``Wind'' to ``Regenerative'' in - general.) + general.) \item According to its caption, this chart is supposed to inform us that coal was the most important energy source in Germany in 2004. Ignoring the strong distortions caused by the superfluous and misleading 3D-setup, it takes quite a while for this message to get - across. + across. Coal as an energy source is split up into two slices: one for ``Steinkohle'' and one for ``Braunkohle'' (two different kinds of @@ -625,7 +625,7 @@ Here are a few recommendations that may help you avoid producing chart junk: \item Consider using a table instead of a pie chart. \item - Due not apply colors randomly; use them to direct the readers's + Do not apply colors randomly; use them to direct the readers's focus and to group things. \item Do not use background patterns, like a crosshatch or diagonal @@ -657,7 +657,7 @@ from going quickly and evenly from line to line will make the text harder to read. Now, pick up your favorite weekly magazine or newspaper and have a -look at a typical +look at a typical page. You will notice that there is quite a lot ``going on'' on the page. Fonts are used at different sizes and in different arrangements, the text is organized in narrow columns, typically interleaved with @@ -719,7 +719,6 @@ Here is a non-exhaustive list of things that can distract readers: Background images and shadings distract and only seldom add anything of importance to a graphic. \item - Cute little cliparts can easily draw attention away from the + Cute little clip arts can easily draw attention away from the data. \end{itemize} - diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex index e556e2000f3..97c2968088b 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex @@ -13,18 +13,18 @@ There are different ways of installing \pgfname, depending on your system and needs, and you may need to install other packages as well as, see below. Before installing, you may wish to review the licenses under which the package is -distributed, see Section~\ref{section-license}. +distributed, see Section~\ref{section-license}. Typically, the package will already be installed on your system. Naturally, in this case you do not need to worry about the installation process at all and you can skip the rest of this -section. +section. \subsection{Package and Driver Versions} This documentation is part of version \pgfversion\ of the \pgfname\ -package. In order to run \pgfname, you need a reasonably recent +package. In order to run \pgfname, you need a reasonably recent \TeX\ installation. When using \LaTeX, you need the following packages installed (newer versions should also work): \begin{itemize} @@ -32,7 +32,7 @@ installed (newer versions should also work): |xcolor| version \xcolorversion. \end{itemize} With plain \TeX, |xcolor| is not needed, but you obviously do not -get its (full) functionality. +get its (full) functionality. Currently, \pgfname\ supports the following backend drivers: \begin{itemize} @@ -65,9 +65,11 @@ Currently, \pgfname\ supports the following formats: \item |plain| with complete functionality, except for graphics inclusion, which works only for pdf\TeX. -\item - |context| with complete functionality, except for graphics inclusion, - which works only for pdf\TeX. +\item + |context| with complete functionality\footnote{Note that + \pgfname/\tikzname{} is not supported by recent Con\TeX t versions + (like mark IV, the Lua\TeX-aware part of Con\TeX t).}, except for + graphics inclusion, which works only for pdf\TeX. \end{itemize} For more details, see Section~\ref{section-formats}. @@ -81,13 +83,13 @@ fortunately, nice other people do. I cannot give detailed instructions on how to install these packages, since I do not manage them, but I \emph{can} tell you were to find them. If you have a problem with installing, you might wish to have a look at the Debian page or the -Mik\TeX\ page first. +MiK\TeX\ page first. \subsubsection{Debian} The command ``|aptitude install pgf|'' should do the trick. Sit back -and relax. In detail, the following packages are installed: +and relax. In detail, the following packages are installed: \begin{verbatim} http://packages.debian.org/pgf http://packages.debian.org/latex-xcolor @@ -97,15 +99,15 @@ http://packages.debian.org/latex-xcolor \subsubsection{MiKTeX} For MiK\TeX, use the update wizard to install the (latest versions of -the) packages called |pgf| and |xcolor|. +the) packages called |pgf| and |xcolor|. \subsection{Installation in a texmf Tree} -For a permanent installation, you place the files of the -the \textsc{pgf} package in an appropriate |texmf| tree. +For a permanent installation, you place the files of +the \textsc{pgf} package in an appropriate |texmf| tree. When you ask \TeX\ to use a certain class or package, it usually looks for the necessary files in so-called |texmf| trees. These trees @@ -120,7 +122,7 @@ are simply huge directories that contain these files. By default, |/usr/local/share/texmf/| or |c:\localtexmf\| or somewhere similar. \item Your personal |texmf| tree, which is usually located in your home - directory at |~/texmf/| or |~/Library/texmf/|. + directory at |~/texmf/| or |~/Library/texmf/|. \end{itemize} You should install the packages either in the local tree or in @@ -143,8 +145,8 @@ tree that you have chosen create a sub-sub-directory called |texmf/tex/generic/pgf-|\texttt{\pgfversion}, if you prefer. Then place all files of the |pgf| package in this directory. Finally, rebuild \TeX's filename database. This is done by running the command -|texhash| or |mktexlsr| (they are the same). In Mik\TeX, there is a -menu option to do this. +|texhash| or |mktexlsr| (they are the same). In MiK\TeX, there is a +menu option to do this. \subsubsection{Installation that is TDS-Compliant} @@ -187,5 +189,4 @@ installation). The easiest way to do this is to first delete the old version and then proceed as described above. Sometimes, there are changes in the syntax of certain command from version to version. If things no longer work that used to work, you may wish to have a look -at the release notes and at the change log. - +at the release notes and at the change log. diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex index 6cfcd4bbd96..7db4aa68733 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex @@ -12,7 +12,7 @@ The \pgfname\ package, where ``\pgfname'' is supposed to mean ``portable graphics format'' (or ``pretty, good, functional'' if you -prefer\dots), is a package for creating graphics in an ``inline'' +prefer\dots), is a package for creating graphics in an ``inline'' manner. It defines a number of \TeX\ commands that draw graphics. For example, the code |\tikz \draw (0pt,0pt) -- (20pt,6pt);| yields the line \tikz \draw (0pt,0pt) -- (20pt,6pt); and the code @@ -20,13 +20,13 @@ yields the line \tikz \draw (0pt,0pt) -- (20pt,6pt); and the code \fill[orange] (1ex,1ex) circle (1ex);. In a sense, when you use \pgfname\ you ``program'' your graphics, just -as you ``program'' your document when you use \TeX. You get all -the advantages of the ``\TeX-approach to typesetting'' for your +as you ``program'' your document when you use \TeX. You get all +the advantages of the ``\TeX-approach to typesetting'' for your graphics: quick creation of simple graphics, precise positioning, the use of macros, often superior typography. You also inherit all the disadvantages: steep learning curve, no \textsc{wysiwyg}, small changes require a long recompilation time, and the code does not -really ``show'' how things will look like. +really ``show'' how things will look like. @@ -46,7 +46,7 @@ The \pgfname\ system consists of different layers: differences. For example, the system command |\pgfsys@lineto{10pt}{10pt}| extends the current path to the coordinate $(10\mathrm{pt},10\mathrm{pt})$ of the current - |{pgfpicture}|. Depending on whether |dvips|, + |{pgfpicture}|. Depending on whether |dvips|, |dvipdfm|, or |pdftex| is used to process the document, the system command will be converted to different |\special| commands. The system layer is as ``minimalistic'' as possible since each @@ -83,7 +83,7 @@ The \pgfname\ system consists of different layers: the third, one for closing the path, and one for actually painting the triangle (as opposed to filling it). With the |tikz| frontend all this boils down to a single simple \textsc{metafont}-like - command: + command: \begin{verbatim} \draw (0,0) -- (1,0) -- (1,1) -- cycle; \end{verbatim} @@ -94,10 +94,10 @@ The \pgfname\ system consists of different layers: The \tikzname\ frontend is the ``natural'' frontend for \pgfname. It gives you access to all features of \pgfname, but it is intended to be easy to use. The syntax is a mixture of \textsc{metafont} and - \textsc{pstricks} and some ideas of myself. This frontend is + \textsc{pstricks} and some ideas of myself. This frontend is % TODOsp: change all `pstricks' to `PStricks'? (ff) \emph{neither} a complete \textsc{metafont} compatibility layer nor a \textsc{pstricks} compatibility layer and it is not intended to - become either. + become either. \item The |pgfpict2e| frontend reimplements the standard \LaTeX\ |{picture}| environment and commands like |\line| or |\vector| @@ -157,15 +157,15 @@ other packages. \item The |xypic| package is an older package for creating graphics. However, it is more difficult to use and to learn because - the syntax and the documentation are a bit cryptic. + the syntax and the documentation are a bit cryptic. \item The |dratex| package is a small graphic package for creating a graphics. Compared to the other package, including \pgfname, it is - very small, which may or may not be an advantage. + very small, which may or may not be an advantage. \item The |metapost| program is a very powerful alternative to \pgfname. However, it is an external program, which entails a - bunch of problems. The time needed both to create a small graphic + bunch of problems. The time needed both to create a small graphic and also to compile it is much greater than in \pgfname. The main problem with |metapost|, however, is the inclusion of labels. This is \emph{much} easier to achieve using \pgfname. @@ -182,11 +182,11 @@ other packages. \subsection{Utility Packages} -The \pgfname\ package comes along with a numer of utility package that +The \pgfname\ package comes along with a number of utility package that are not really about creating graphics and which can be used independently of \pgfname. However, they are bundled with \pgfname, partly out of convenience, partly because their functionality is -closely intertwined with \pgfname. These utility packages are: +closely intertwined with \pgfname. These utility packages are: \begin{enumerate} \item The |pgfkeys| package defines a powerful key management facility. It can be used completely independently of \pgfname. @@ -208,7 +208,7 @@ closely intertwined with \pgfname. These utility packages are: \LaTeX\ without the use of any external programs. However, |pgfpages| can do quite a lot more than that. You can use it to put logos and watermark on pages, print up to 16 pages on one page, add - borders to pages, and more. + borders to pages, and more. \end{enumerate} @@ -223,7 +223,7 @@ esoteric features are discussed later. If you have not yet installed \pgfname, please read the installation first. Second, it might be a good idea to read the tutorial. Finally, -you might wish to skim through the description of \tikzname. Typically, +you might wish to skim through the description of \tikzname. Typically, you will not need to read the sections on the basic layer. You will only need to read the part on the system layer if you intend to write your own frontend or if you wish to port \pgfname\ to a new driver. @@ -238,12 +238,21 @@ in green is optional and can be left out. \label{section-authors} The bulk of the \pgfname\ system and its documentation was written by -Till Tantau. The \pgfname\ mathematical engine, many shapes, and the -decoration engine were written and documented by Mark -Wibrow. Additionally, numerous people have contributed to the -\pgfname\ system by writing emails, spotting bugs, or sending -libraries. Many thanks to all these people, who are too numerous to -name them all! +Till Tantau. A further member of the main team is Mark Wibrow, who +is responsible, for example, for the \pgfname\ mathematical engine, +many shapes, the decoration engine, and matrices. The third member is +Christian Feuers\"anger who contributed the floating point library, +image externalization, extended key processing, and automatic hyperlinks +in the manual. + +Furthermore, occasional contributions have been made by Christophe +Jorssen, Jin-Hwan Cho, Olivier Binda, Matthias Schulz, Ren\'ee Ahrens, +Stephan Schuster, and Thomas Neumann. + +Additionally, numerous people have contributed to the \pgfname\ system +by writing emails, spotting bugs, or sending libraries and patches. +Many thanks to all these people, who are too numerous to name them +all! @@ -284,4 +293,3 @@ following: Please, do not phone me in my office (unless, of course, you attend one of my lectures). \end{enumerate} - diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex index 8e8f4649ce3..da4523a9ff1 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex @@ -13,17 +13,34 @@ \begin{pgflibrary}{arrows} The package defines additional arrow tips, which are described - below. See page~\pageref{standard-arrows} for the arrows tips that - are defined by default. Note that neither the standard packages nor + below. Note that neither the standard packages nor this package defines an arrow name containing |>| or |<|. These are left for the user to defined as he or she sees fit. \end{pgflibrary} +The arrow tips |to|, |stealth|, |latex|, |space|, their reversed +forms, and \verb!|! are predefined, but listed below for completeness, +nevertheless. + + +\subsection{Mathematical Arrow Tips} + +\begin{tabular}{ll} + \symarrow{to} \\ + \symarrow{to reversed} \\ + \symarrowdouble{implies} \\ +\end{tabular} + + \subsection{Triangular Arrow Tips} \begin{tabular}{ll} + \symarrowdouble{latex} \\ + \symarrowdouble{latex reversed} \\ \symarrow{latex'} \\ \symarrow{latex' reversed} \\ + \symarrowdouble{stealth} \\ + \symarrowdouble{stealth reversed} \\ \symarrow{stealth'} \\ \symarrow{stealth' reversed}\\ \symarrow{triangle 90} \\ @@ -40,6 +57,7 @@ \symarrow{open triangle 45 reversed} \\ \end{tabular} + \subsection{Barbed Arrow Tips} \begin{tabular}{ll} @@ -56,14 +74,29 @@ \subsection{Bracket-Like Arrow Tips} +{ +\bigskip +\catcode`\|=12 \begin{tabular}{ll} \sarrow{[}{]} \\ \sarrow{]}{[} \\ \sarrow{(}{)} \\ - \sarrow{)}{(} + \sarrow{)}{(} \\ + \index{*vbar@\protect\texttt{\protect\myvbar} arrow tip}% + \index{Arrow tips!*vbar@\protect\texttt{\protect\myvbar}} + \texttt{\char`\|-\char`\|} & yields thick + \begin{tikzpicture}[arrows={|-|},thick] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw (0,0) -- (1,0); + \end{tikzpicture} and thin + \begin{tikzpicture}[arrows={|-|},thin] + \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); + \draw (0,0) -- (1,0); + \end{tikzpicture} \end{tabular} +} -\subsection{Circle and Diamond Arrow Tips} +\subsection{Circle, Diamond and Square Arrow Tips} \begin{tabular}{ll} @@ -71,6 +104,8 @@ \symarrow{*} \\ \symarrow{diamond} \\ \symarrow{open diamond} \\ + \symarrow{square} \\ + \symarrow{open square} \\ \end{tabular} @@ -109,6 +144,16 @@ \end{tabular} +\subsection{Spacing Tips} + +The spacing arrow tips are useful for combining them with other arrows +to get arrows that do not touch the end of the line. + +\begin{tabular}{ll} + \symarrow{space} \\ +\end{tabular} + + %%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex index 2cc4021316e..2684d96c71d 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex @@ -12,7 +12,7 @@ \begin{tikzlibrary}{automata} This packages provides shapes and styles for drawing finite state - automata and Turing machines. + automata and Turing machines. \end{tikzlibrary} @@ -22,7 +22,7 @@ The automata drawing library is intended to make it easy to draw finite automata and Turing machines. It does not cover every situation imaginable, but most finite automata and Turing machines found in text books can be drawn in a nice and convenient fashion -using this library. +using this library. To draw an automaton, proceed as follows: \begin{enumerate} @@ -41,8 +41,8 @@ To draw an automaton, proceed as follows: \end{enumerate} Let us now see how this works for a real example. Let us consider a -nondeterminsitic four state automaton that checks whether an contains -the sequence $0^*1$ or the sequence $1^*0$. +nondeterministic four state automaton that checks whether an contains +the sequence $0^*1$ or the sequence $1^*0$. \begin{codeexample}[] \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] \draw[help lines] (0,0) grid (3,2); @@ -86,7 +86,7 @@ By default, the following state styles are defined: \draw[help lines] (0,0) grid (3,2); \node[state without output] {$q_0$}; - + \node[state with output] at (2,0) {$q_1$ \nodepart{lower} $00$}; \end{tikzpicture} \end{codeexample} @@ -103,7 +103,7 @@ By default, the following state styles are defined: \end{codeexample} \end{stylekey} -\begin{stylekey}{/tikz/every state (initially \normalfont empyt)} +\begin{stylekey}{/tikz/every state (initially \normalfont empty)} This style is used by |state with output| and also by |state without output|. By default, it does nothing, but you can use it to make your state look more fancy: @@ -177,10 +177,10 @@ Let us start with the initial states. \end{stylekey} \begin{stylekey}{/tikz/initial by diamond} - This style uses a diamond to indicate an initial node. + This style uses a diamond to indicate an initial node. \end{stylekey} -For the accepting states, the sitation is similar: There is also an +For the accepting states, the situation is similar: There is also an |accepting| style that selects the way accepting states are rendered. There are now two options: First, |accepting by arrow|, which works the same way as |initial by arrow|, @@ -194,7 +194,7 @@ where accepting states get a double line around them. \end{stylekey} \begin{stylekey}{/tikz/accepting by double} - This style causes a double line to be drawn arond a state. + This style causes a double line to be drawn around a state. \end{stylekey} \begin{stylekey}{/tikz/accepting by arrow} @@ -217,7 +217,7 @@ where accepting states get a double line around them. \begin{stylekey}{/tikz/every accepting by arrow (initially \normalfont empty)} Executed at the beginning of every path that contains the arrow and the text. - \end{stylekey} + \end{stylekey} \begin{codeexample}[] \begin{tikzpicture} [shorten >=1pt,node distance=2cm,on grid,>=stealth',initial text=, @@ -260,7 +260,7 @@ In the following example, we once more typeset the automaton presented in the previous sections. This time, we use the following rule for accepting/initial state: Initial states are red, accepting states are green, and normal states are orange. Then, we must find a path from a -red state to a green state. +red state to a green state. \begin{codeexample}[] \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>=stealth',thick, @@ -298,10 +298,10 @@ beaver: \path [every node/.style={font=\footnotesize}] (A) edge node {0,1,L} (B) edge node {1,1,R} (C) - (B) edge [loop above] node {1,1,L} (B) + (B) edge [loop above] node {1,1,L} (B) edge node {0,1,L} (C) (C) edge node {0,1,L} (D) - edge [bend left] node {1,0,R} (E) + edge [bend left] node {1,0,R} (E) (D) edge [loop below] node {1,1,R} (D) edge node {0,1,R} (A) (E) edge [bend left] node {1,0,R} (A); @@ -309,7 +309,7 @@ beaver: \end{codeexample} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex index 8144d8aec42..ed7ed14b624 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex @@ -21,6 +21,35 @@ your picture or |gridded| to put a grid behind your picture. \end{tikzlibrary} + +The first use of this library is to make the following key available: +\begin{key}{/tikz/on background layer} + This key can be used with a |{scope}|. It will cause everything + inside the scope to be typeset on a background layer. Note that the + scope should not be ``deeply nested'' inside the picture since + changes to the graphic state (like the color or the transformation + matrix) ``do not survive a layer switch.'' For more details on + layers see Section~\ref{section-layers}. + +\begin{codeexample}[] +\begin{tikzpicture} + % On main layer: + \fill[blue] (0,0) circle (1cm); + + \begin{scope}[on background layer] + \fill[yellow] (-1,-1) rectangle (1,1); + \end{scope} + + \begin{scope}[on background layer] + \fill[black] (-.8,-.8) rectangle (.8,.8); + \end{scope} + + % On main layer again: + \fill[blue!50] (-.5,-1) rectangle (.5,1); +\end{tikzpicture} +\end{codeexample} +\end{key} + When this package is loaded, the following styles become available: \begin{stylekey}{/tikz/show background rectangle} This style causes a rectangle to be drawn behind your graphic. This diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex new file mode 100644 index 00000000000..5641ec11b6b --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex @@ -0,0 +1,6 @@ +\section{Calc Library} + +\begin{tikzlibrary}{calc} + The library allows advanced Coordinate Calculations. It is documented in all detail in Section~\ref{tikz-lib-calc} on page~\pageref{tikz-lib-calc}. +\end{tikzlibrary} + diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex index 679a22a0332..a61feb19de7 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex @@ -26,7 +26,7 @@ The core command for creating calendars in \tikzname\ is the |\calendar| command. It is available only inside |{tikzpicture}| -environments (similar to, say, the |\draw| command). +environments (similar to, say, the |\draw| command). \begin{command}{\calendar \meta{calendar specification}|;|} The syntax for this command is similar to commands like |\node| or @@ -43,14 +43,14 @@ environments (similar to, say, the |\draw| command). \item |[|\meta{options}|]| You provide \meta{options} in square brackets as - in |[red,draw=none]|. These \meta{options} can be any \tikzname\ + in |[red,draw=none]|. These \meta{options} can be any \tikzname\ option and they apply to the whole calendar. You can provide this element multiple times, the effect accumulates. \item |(|\meta{name}|)| This has the same effect as saying |[name=|\meta{name}|]|. The effect of providing a \meta{name} is explained later. Note - alreadys that \emph{a calendar is not a node} and the \meta{name} + already that \emph{a calendar is not a node} and the \meta{name} is \emph{not the name of a node}. \item |at (|\meta{coordinate}|)| @@ -65,7 +65,7 @@ environments (similar to, say, the |\draw| command). \begin{stylekey}{/tikz/every calendar (initially \normalfont empty)} This style is used with every calendar. \end{stylekey} - + \medskip \textbf{The date range.} The overall effect of the |\calendar| command is to execute code for @@ -88,20 +88,20 @@ environments (similar to, say, the |\draw| command). current date code is executed, which will be called the \emph{current date code}. The current date code consists of different parts, to be detailed later. - + The central part of the current date code is the execution of the code |\tikzdaycode|. By default, this code simply produces a node whose text is set to the day of month. This means that unless further action is taken, all days of a calendar will be put on top of each other! To avoid this, you must modify the current date code to shift - days around appropriately. Predefined arrangements like + days around appropriately. Predefined arrangements like |day list downward| or |week list| do this for you, but you can define arrangements yourself. Since defining an arrangement is a bit tricky, it is explained only later on. For the time being, let us use a predefined arrangement to produce our first calendar: \begin{codeexample}[] -\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list]; +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list]; \end{codeexample} \medskip @@ -114,7 +114,7 @@ environments (similar to, say, the |\draw| command). horizontal shift between days. This is not the gap between days, but the shift between the anchors of their nodes. \begin{codeexample}[] -\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day xshift=3ex]; +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day xshift=3ex]; \end{codeexample} \end{key} \begin{key}{/tikz/day yshift=\meta{dimension} (initially 3ex)} @@ -122,7 +122,7 @@ environments (similar to, say, the |\draw| command). vertical shift between days. Again, this is the shift between the anchors of their nodes. \begin{codeexample}[] -\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day yshift=2ex]; +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day yshift=2ex]; \end{codeexample} \end{key} \begin{key}{/tikz/month xshift=\meta{dimension}} @@ -131,14 +131,14 @@ environments (similar to, say, the |\draw| command). \end{key} \begin{key}{/tikz/month yshift=\meta{dimension}} Specifies an - additional vertical shift between different months. + additional vertical shift between different months. \begin{codeexample}[] \tikz \calendar[dates=2000-01-01 to 2000-02-last,week list, - month yshift=0pt]; + month yshift=0pt]; \end{codeexample} \begin{codeexample}[] \tikz \calendar[dates=2000-01-01 to 2000-02-last,week list, - month yshift=1cm]; + month yshift=1cm]; \end{codeexample} \end{key} @@ -164,15 +164,15 @@ environments (similar to, say, the |\draw| command). placed in such a way the center of 2000-01-20 lies on the position $(2,2)$: \begin{codeexample}[] -\begin{tikzpicture} +\begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); \matrix [anchor=cal-2000-01-20.center] at (2,2) { \calendar(cal)[dates=2000-01-01 to 2000-01-31,week list]; \\}; \end{tikzpicture} \end{codeexample} Unfortunately, the matrix-base positions, which is the cleanest way, - isnot as portable as the other approaches (it currently does not - work with the \textsc{svg} backend for instance). + isn't as portable as the other approaches (it currently does not + work with the \textsc{svg} backend for instance). \medskip \textbf{Changing the appearance of days.} @@ -187,7 +187,7 @@ environments (similar to, say, the |\draw| command). name, but you can change this: \begin{codeexample}[] \tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, - day code={\fill[blue] (0,0) circle (2pt);}]; + day code={\fill[blue] (0,0) circle (2pt);}]; \end{codeexample} The default code is the following: \begin{codeexample}[code only] @@ -201,7 +201,7 @@ environments (similar to, say, the |\draw| command). day that is currently being processed in ISO format . For example, if January 1, 2006 is being processed and the - calendar has been named |mycal|, then the node containg the |1| + calendar has been named |mycal|, then the node containing the |1| for this date will be names |mycal-2006-01-01|. You can later reference this node. \begin{codeexample}[] @@ -219,7 +219,7 @@ environments (similar to, say, the |\draw| command). change it arbitrarily. Here is a silly example: \begin{codeexample}[] \tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, - day text=x]; + day text=x]; \end{codeexample} More useful examples are based on using the |\%| command. This command is redefined inside a |\pgfcalendar| to mean the same as @@ -229,7 +229,7 @@ environments (similar to, say, the |\draw| command). The |\%| inserts the current day/month/year/day of week in a certain format into the text. The first letter following the |\%| - selects the type (permisslbe values are |d|, |m|, |y|, |w|), the + selects the type (permissible values are |d|, |m|, |y|, |w|), the second letter specifies how the value should be displayed (|-| means numerically, |=| means numerically with leading space, |0| means numerically with leading zeros, |t| means @@ -242,7 +242,7 @@ environments (similar to, say, the |\draw| command). leading zero: \begin{codeexample}[leave comments] \tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, - day text=\%d0]; + day text=\%d0]; \end{codeexample} \end{key} @@ -285,10 +285,10 @@ environments (similar to, say, the |\draw| command). \begin{key}{/tikz/month text=\meta{text}} This option allows you to change the macro |\tikzmonthtext|. By default, the month text is a long textual presentation of the - current month being typeset. + current month being typeset. \begin{codeexample}[leave comments] \tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, - month label above centered, + month label above centered, month text=\textcolor{red}{\%mt} \%y-]; \end{codeexample} \end{key} @@ -310,7 +310,7 @@ environments (similar to, say, the |\draw| command). \begin{key}{/tikz/every year} Works like |every month|, only for years. \end{key} - + \medskip \textbf{Date ifs.} Much of the power of the |\calendar| command comes from the use of @@ -321,20 +321,20 @@ environments (similar to, say, the |\draw| command). code or options}. You can have multiple such conditionals (but you cannot nest them in this simple manner). The second way is to use the following option: - \begin{key}{/tikz/if=|(|\meta{coditions}|)|\meta{code or + \begin{key}{/tikz/if=|(|\meta{conditions}|)|\meta{code or options}\opt{|else|\meta{else code or options}}} This option has the same effect as giving a corresponding if in the \meta{calendar specification}. The option is mostly useful for use in the |every calendar| style, where you cannot provide if conditionals - otherwise. + otherwise. \end{key} Now, regardless of how you specify a conditional, it has the following effect (individually and independently for each date in the calendar): \begin{enumerate} \item It is checked whether the current date is one of the - possibilities listed in \meta{coditions}. An example of such a + possibilities listed in \meta{conditions}. An example of such a condition is |Sunday|. Thus, when you write |if (Saturday,Sunday) {foo}|, then |foo| will be executed for every day in the calendar that is a Saturday \emph{or} a Sunday. @@ -394,7 +394,7 @@ environments (similar to, say, the |\draw| command). correctly. For this, we can change the day text to |\%d=|, which adds a space at the beginning of single day text. - + In the following, more technical information is covered. Most readers may wish to skip it. @@ -405,7 +405,7 @@ environments (similar to, say, the |\draw| command). nodes, to render the date nodes, to draw the month labels and to do all other stuff that is necessary to draw a calendar. - The current daet code consists of the following parts, in this order: + The current date code consists of the following parts, in this order: \begin{enumerate} \item The before-scope code. \item A scope is opened. @@ -439,7 +439,7 @@ environments (similar to, say, the |\draw| command). \begin{key}{/tikz/execute before day scope=\meta{code}} The \meta{code} is executed before everything else for each - date. Multiple + date. Multiple calls of this option have an accumulative effect. Thus, if you use this option twice, the code from the first use is used first for each day, followed by the code given the second time. @@ -455,15 +455,15 @@ environments (similar to, say, the |\draw| command). commands in at-begin- and at-end-code. \end{key} \begin{key}{/tikz/execute after day scope=\meta{code}} - This is executed at the very end of the current date, outside the + This is executed at the very end of the current date, outside the scope. The accumulation is also in reverse. - \end{key} + \end{key} \end{command} In the rest of the following subsections we have a look at how the different scope codes can be used to create different calendar -arrangements. +arrangements. \subsubsection{Creating a Simple List of Days} @@ -472,7 +472,7 @@ We start with a list the days of the calendar, one day below the other. For this, we simply shift the coordinate system downward at the end of the code for each day. This shift must be \emph{outside} the day scope as we want day shifts to accumulate. Thus, we use the -following code: +following code: \begin{codeexample}[] \tikz \calendar [dates=2000-01-01 to 2000-01-08, @@ -496,7 +496,7 @@ month. The idea is to do two things: We have two options where we should add the month code: Either we add it at the beginning of the day scope or before. Either will work fine, but it might be safer to put the code inside the scope to ensure that -settings to not inadventerdly ``leak outside.'' +settings to not inadvertently ``leak outside.'' \begin{codeexample}[] \tikz \calendar @@ -527,7 +527,7 @@ the Monday of each week. That means that at the end of each week the origin is moved downward one line. On all other days, the origin at the end of the day code is the same as at the beginning. To position each day correctly, we use code inside and at the beginning of the day -scope to horizontally shift the day according to its day of week. +scope to horizontally shift the day according to its day of week. \begin{codeexample}[] \tikz \calendar @@ -543,7 +543,7 @@ scope to horizontally shift the day according to its day of week. \subsubsection{Creating a Month List Arrangement} -For another example, let us create an arrangment that contains one +For another example, let us create an arrangement that contains one line for each month. This is easy enough to do as for weeks, unless we add the following requirement: Again, we want all days in a column to have the same day of week. Since months start on different days of @@ -587,7 +587,7 @@ on the page. The calendar library defines a number of predefined arrangements. We start with arrangements in which the days are listed in a long -line. +line. \begin{stylekey}{/tikz/day list downward} This style causes the days of a month to be typeset one below the @@ -624,7 +624,7 @@ line. As above, but the list grows left. \end{stylekey} -The next arrangement lists days weekwise. +The next arrangement lists days by the week. \begin{stylekey}{/tikz/week list} This style creates one row for each week in the range. The value @@ -659,15 +659,15 @@ The following arrangement gives a very compact view of a whole year. \begin{stylekey}{/tikz/month list} In this arrangement there is a row for each month. As for the |week list|, the |day xshift| is used for the horizontal distance. - For the vertical shft, |month yshift| is used. + For the vertical shift, |month yshift| is used. In each row, all days of the month are listed alongside each other. However, it is once more ensured that days in each column lie on the same day of week. Thus, the very first column contains only Mondays. If a month does not start with a Monday, its days are - shifted to the right such that the days lie on the correct columns. + shifted to the right such that the days lie on the correct columns. \begin{codeexample}[] -\sffamily\scriptsize +\sffamily\scriptsize \tikz \calendar [dates=2000-01-01 to 2000-12-31, month list,month label left,month yshift=1.25em] @@ -850,10 +850,10 @@ The following example is a futuristic calendar that is all about circles: \begin{codeexample}[] \sffamily -\colorlet{winter}{blue} -\colorlet{spring}{green!60!black} -\colorlet{summer}{orange} -\colorlet{fall}{red} +\colorlet{winter}{blue} +\colorlet{spring}{green!60!black} +\colorlet{summer}{orange} +\colorlet{fall}{red} % A counter, since TikZ is not clever enough (yet) to handle % arbitrary angle systems. @@ -880,7 +880,7 @@ The following example is a futuristic calendar that is all about circles: ] if (day of month=1) {\color{\monthcolor}\tikzmonthcode} if (Sunday) [red] - if (all) + if (all) { % Again, compute angle \mycount=1 @@ -906,7 +906,7 @@ Next, lets us have a whole year in a tight column: \end{codeexample} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex index 6354593d91d..25f0c1f3433 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex @@ -23,12 +23,12 @@ in an o row or a column and that are -- typically -- connected by edges. More generally, they can be used to position nodes of a branching network in a systematic manner. For the positioning of nodes -in rows and columns you can also use matrices, see -Section~\ref{section-matrices}, but chains can also be used +in rows and columns you can also use matrices, see +Section~\ref{section-matrices}, but chains can also be used to describe the connections between nodes that have already been connected using, say, matrices. Thus, it often makes sense to use matrices for the positioning of elements and chains to describe the -connections. +connections. @@ -79,7 +79,7 @@ option. explained in the description of the |on chain| option. Right now, just remember that the \meta{direction} you provide with the |chain| option applies to the whole chain. - + Other than this, this key has no further effect. In particular, to place nodes on the chain, you must use the |on chain| option, described next. @@ -115,8 +115,8 @@ option. \node [on chain=2] at (0.5,-.5) {0}; \node [on chain=2] {1}; \node [on chain=2] {2}; - - \node [on chain=1] {D}; + + \node [on chain=1] {D}; \end{tikzpicture} \end{codeexample} \end{key} @@ -182,7 +182,7 @@ option. direction used for this node, otherwise the \meta{direction} that was given to the original |start chain| option is used (or of the last |continue chain| option, which allows you to change this - default). + default). The effects of this option are the following: \begin{enumerate} @@ -218,7 +218,7 @@ option. with |going| or with |placed|. The difference is that in the first case, the placement rule is not applied to the first node of the chain, while in the second case the placement rule is applied also - to this first node. The idea is that a |going|-direciton indicates + to this first node. The idea is that a |going|-direction indicates that we are ``going somewhere relative to the previous node'' whereas a |placed| indicates that we are ``placing nodes according to their number.'' @@ -228,10 +228,10 @@ option. compulsory space) can have two different effects: \begin{enumerate} \item If it contains an equal sign, then this \meta{text} is used - as the placement rule, that is, it is simply executed. + as the placement rule, that is, it is simply executed. \item If it does not contain an equal sign, then \meta{text}|=of \tikzchainprevious| is used as the placement - rule. + rule. \end{enumerate} Note that in the first case, inside the \meta{text} you have @@ -241,7 +241,7 @@ option. \begin{tikzpicture}[start chain=circle placed {at=(\tikzchaincount*30:1.5)}] \foreach \i in {1,...,10} \node [on chain] {\i}; - + \draw (circle-1) -- (circle-10); \end{tikzpicture} \end{codeexample} @@ -249,12 +249,12 @@ option. The following style is executed: \begin{stylekey}{/tikz/every on chain} This key is executed for every node of a chain, including the - first one. + first one. \end{stylekey} \end{enumerate} Recall that the standard replacement rule has a form like - |right=of (\tikzchainprevious)|. This means that each + |right=of (\tikzchainprevious)|. This means that each new node is placed to the right of the previous one, spaced by the current value of |node distance|. \begin{codeexample}[] @@ -319,15 +319,15 @@ following command, which is only defined inside scopes where a It is permissible to give the |on chain| option inside the \meta{options} in order to specify on which chain the node should be - put. - + put. + This command is just a shortcut for \begin{quote} |\path (|\meta{existing name}|) [late options={on chain,every chain in,|\meta{options}|}]| \end{quote} In particular, it is possible to continue to path after a |\chainin| command, though that does not seem very useful. - + \begin{codeexample}[] \begin{tikzpicture}[node distance=5mm, every node/.style=draw,every join/.style=->] @@ -341,13 +341,13 @@ following command, which is only defined inside scopes where a \chainin (existing) [join]; \node [draw,on chain,join] {this}; \node [draw,on chain,join] {is}; - } + } \end{tikzpicture} \end{codeexample} Here is an example where nodes are positioned using a matrix and then connected using a chain -{\catcode`\|=12 +{\catcode`\|=12 \begin{codeexample}[] \begin{tikzpicture}[every node/.style=draw] \matrix [matrix of nodes,column sep=5mm,row sep=5mm] @@ -356,7 +356,7 @@ following command, which is only defined inside scopes where a |(c)| be & |(d) [isosceles triangle]| would \\ |(e) [ellipse]| great & |(f)| ! \\ }; - + { [start chain,every on chain/.style={join=by ->}] \chainin (a); \chainin (b); @@ -364,7 +364,7 @@ following command, which is only defined inside scopes where a \chainin (c); \chainin (e); \chainin (f); - } + } \end{tikzpicture} \end{codeexample} } @@ -382,7 +382,7 @@ following command, which is only defined inside scopes where a is used. This |edge| command gets the \meta{options} as parameter and the current node as its target. If there is no previous node and no |with| is given, no |edge| command gets - executed. + executed. \begin{stylekey}{/tikz/every join} This style is executed each time this command is used. \end{stylekey} @@ -452,7 +452,7 @@ was just described. \node [on chain] {$\beta$}; \node [on chain] {$\gamma$}; } - + \node [on chain,join=with trunk/numbers-end,join=with trunk/greek-end] {C}; { [start branch=symbols going below] \node [on chain] {$\star$}; @@ -465,7 +465,7 @@ was just described. \end{key} \begin{key}{/tikz/continue branch=\meta{branch name}\opt{\meta{direction}}} - This option works like the |continue chain| option, only + This option works like the |continue chain| option, only \meta{current chain}|/|\meta{branch name} is used as the chain name, rather than just \meta{branch name}. \begin{codeexample}[] diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex new file mode 100644 index 00000000000..496eac52179 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex @@ -0,0 +1,2166 @@ +% Copyright 2008 by Till Tantau and Mark Wibrow +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\section{Circuit Libraries} +\label{section-library-circuits} + +\emph{Written and documented by Till Tantau, and Mark Wibrow. Inspired +by the work of Massimo Redaelli.} + +\subsection{Introduction} + +The circuit libraries can be used to draw different kinds of +electrical or logical circuits. There is not a single library for +this, but a whole hierarchy of libraries that work in concert. The +main design goal was to create a balance between ease-of-use and +ease-of-extending, while creating high-quality graphical +representations of circuits. + +\subsubsection{A First Example} + +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC,x=3cm,y=2cm,semithick, + every info/.style={font=\footnotesize}, + small circuit symbols, + set resistor graphic=var resistor IEC graphic, + set diode graphic=var diode IEC graphic, + set make contact graphic= var make contact IEC graphic] + % Let us start with some contacts: + \foreach \contact/\y in {1/1,2/2,3/3.5,4/4.5,5/5.5} + { + \node [contact] (left contact \contact) at (0,\y) {}; + \node [contact] (right contact \contact) at (1,\y) {}; + } + \draw (right contact 1) -- (right contact 2) -- (right contact 3) + -- (right contact 4) -- (right contact 5); + + \draw (left contact 1) to [diode] ++(down:1) + to [voltage source={near start, + direction info={volt=3}}, + resistor={near end,ohm=3}] ++(right:1) + to (right contact 1); + \draw (left contact 1) to [resistor={ohm=4}] (right contact 1); + \draw (left contact 1) to [resistor={ohm=3}] (left contact 2); + \draw (left contact 2) to [voltage source={near start, + direction info={<-,volt=8}}, + resistor={ohm=2,near end}] (right contact 2); + \draw (left contact 2) to [resistor={near start,ohm=1}, + make contact={near end,info'={[red]$S_1$}}] + (left contact 3); + \draw (left contact 3) to [current direction'={near start,info=$\iota$}, + resistor={near end,info={$R=4\Omega$}}] + (right contact 3); + \draw (left contact 4) to [voltage source={near start, + direction info={<-,volt=8}}, + resistor={ohm=2,near end}] (right contact 4); + \draw (left contact 3) to [resistor={ohm=1}] (left contact 4); + \draw (left contact 4) to [resistor={ohm=3}] (left contact 5); + \draw (left contact 5) to [resistor={ohm=4}] (right contact 5); + \draw (left contact 5) to [diode] ++(up:1) + to [voltage source={near start, + direction info={volt=3}}, + resistor={near end,ohm=3}] ++(right:1) + to (right contact 5); +\end{tikzpicture} +\end{codeexample} + +An important feature of the circuit library is that the appearance of +a circuit can be configured in general ways and that the labels are +placed automatically by default. Here is the graphic once more, +generated from \emph{exactly the same source code}, with only +the options of the |{tikzpicture}| environment replaced by +|[rotate=-90,circuit ee IEC,x=3.25cm,y=2.25cm]|: + +\begin{tikzpicture}[rotate=-90,circuit ee IEC,x=3cm,y=2.25cm] + % Let us start with some contacts: + \foreach \contact/\y in {1/1,2/2,3/3.5,4/4.5,5/5.5} + { + \node [contact] (left contact \contact) at (0,\y) {}; + \node [contact] (right contact \contact) at (1,\y) {}; + } + \draw (right contact 1) -- (right contact 2) -- (right contact 3) + -- (right contact 4) -- (right contact 5); + + \draw (left contact 1) to [diode] ++(down:1) + to [voltage source={near start,direction info={volt=3}}, + resistor={near end,ohm=3}] ++(right:1) + to (right contact 1); + \draw (left contact 1) to [resistor={ohm=4}] (right contact 1); + \draw (left contact 1) to [resistor={ohm=3}] (left contact 2); + \draw (left contact 2) to [voltage source={near start, + direction info={<-,volt=8}}, + resistor={ohm=2,near end}] (right contact 2); + \draw (left contact 2) to [resistor={near start,ohm=1}, + make contact={near end,info'={[red]$S_1$}}] (left contact 3); + \draw (left contact 3) to [current direction'={near start,info=$\iota$}, + resistor={near end,info={$R=4\Omega$}}] + (right contact 3); + \draw (left contact 4) to [voltage source={near start, + direction info={<-,volt=8}}, + resistor={ohm=2,near end}] (right contact 4); + \draw (left contact 3) to [resistor={ohm=1}] (left contact 4); + \draw (left contact 4) to [resistor={ohm=3}] (left contact 5); + \draw (left contact 5) to [resistor={ohm=4}] (right contact 5); + \draw (left contact 5) to [diode] ++(up:1) + to [voltage source={near start,direction info={volt=3}}, + resistor={near end,ohm=3}] ++(right:1) + to (right contact 5); +\end{tikzpicture} + + +\subsubsection{Symbols} + +A circuit typically consists of numerous electronic elements like +logical gates or resistors or diodes that are connected by wires. In +\pgfname/\tikzname, we use nodes for the +electronic elements and normal lines for the wires. \tikzname\ offers +a large number of different ways of positioning and connecting nodes +in general, all of which can be used here. Additionally, the +|circuits| library defines an additional useful |to|-path that is +particularly useful for elements like a resistor on a line. + +There are many different names that are used to refer to electrical +``elements,'' so a bit of terminology standardization is useful: We +will call such elements \emph{symbols}. A \emph{symbol shape} is a +\pgfname\ shape declared using the |\pgfdeclareshape| command. A +\emph{symbol node} is a node whose shape is a symbol shape. + + +\subsubsection{Symbol Graphics} + +Symbols can be created by +|\node[shape=some symbol shape]|. However, in order to represent some +symbols correctly, just using standard \pgfname\ shapes is not +sufficient. For instance, most symbols have a visually appealing +``default size,'' but the size of a symbol shape depends only on the +current values of parameters like |minimum height| or |inner xsep|. + +For these reasons, the circuit libraries introduce the concept of a +\emph{symbol graphic}. This is a style that causes a |\node| to +not only have the correct shape, but also the correct size and the +correct path usage. More generally, this style may setup things in any +way so that the ``symbol looks correct''. When you write, for +instance, |\node[diode]|, then the style called |diode graphic| is +used, which in turn is set to something like +|shape=diode IEC,draw,minimum height=...|. + +Here is an overview of the different kinds of circuit libraries: + +\begin{itemize} +\item The \tikzname-library |circuits| defines general keys for + creating circuits. Mostly, these keys are useful for defining more + specialized libraries. + + You normally do not use this library directly since it does not + define any symbol graphics. +\item The \tikzname-library |circuits.logic| defines keys for creating + logical gates like and-gates or xor-gates. However, this library + also does not actually define any symbol graphics; this is done by + two sublibraries: + \begin{itemize} + \item The library |circuits.logic.US| defines symbol graphics that + cause the logical gates to be rendered in the ``US-style.'' It + includes all of the above libraries and you can use this library + directly. + \item The library |circuits.logic.IEC| also defines symbol graphics + for logical gates, but it uses rectangular gates rather that the + round US-gates. This library can coexist peacefully with the above + library, you can change which symbol graphics are used ``on the + fly.'' + \end{itemize} +\item The \tikzname-library |cirucits.ee| defines keys for symbols + from electrical engineering like resistors or capacitors. Again, + sublibraries define the actual symbol graphics. + \begin{itemize} + \item The library |circuits.ee.IEC| defines symbol shapes that + follow the IEC norm. + \end{itemize} +\item The \pgfname-libraries |shapes.gates.*| define (circuit) symbol + shapes. However, you normally do not use these shapes directly, + rather you use a style that uses an appropriate symbol graphic, + which in turn uses one of these shapes. +\end{itemize} + +Let us have a look at a simple example. Suppose we wish to create a +logical circuit. Then we first have to decide which symbol graphics we +would like to use. Suppose we wish to use the US-style, then we would +include the library |circuits.logic.US|. If you wish to use IEC-style +symbols, use |circuits.logic.IEC|. If you cannot decide, include both: +\begin{codeexample}[code only] +\usetikzlibrary{circuits.logic.US,circuits.logic.IEC} +\end{codeexample} +To create a picture that contains a US-style circuit you can now use +the option |circuit logic US|. This will setup keys like |and gate| to +create use an appropriate symbol graphic for rendering an and +gate. Using the |circuit logic IEC| instead will setup |and gate| to +use another symbol graphic. + +\begin{codeexample}[] +\begin{tikzpicture}[circuit logic US] + \matrix[column sep=7mm] + { + \node (i0) {0}; & & \\ + & \node [and gate] (a1) {}; & \\ + \node (i1) {0}; & & \node [or gate] (o) {};\\ + & \node [nand gate] (a2) {}; & \\ + \node (i2) {1}; & & \\ + }; + \draw (i0.east) -- ++(right:3mm) |- (a1.input 1); + \draw (i1.east) -- ++(right:3mm) |- (a1.input 2); + \draw (i1.east) -- ++(right:3mm) |- (a2.input 1); + \draw (i2.east) -- ++(right:3mm) |- (a2.input 2); + \draw (a1.output) -- ++(right:3mm) |- (o.input 1); + \draw (a2.output) -- ++(right:3mm) |- (o.input 2); + \draw (o.output) -- ++(right:3mm); +\end{tikzpicture} +\end{codeexample} + + +\begin{codeexample}[] +\begin{tikzpicture}[circuit logic IEC] + \matrix[column sep=7mm] + { + \node (i0) {0}; & & \\ + & \node [and gate] (a1) {}; & \\ + \node (i1) {0}; & & \node [or gate] (o) {};\\ + & \node [nand gate] (a2) {}; & \\ + \node (i2) {1}; & & \\ + }; + \draw (i0.east) -- ++(right:3mm) |- (a1.input 1); + \draw (i1.east) -- ++(right:3mm) |- (a1.input 2); + \draw (i1.east) -- ++(right:3mm) |- (a2.input 1); + \draw (i2.east) -- ++(right:3mm) |- (a2.input 2); + \draw (a1.output) -- ++(right:3mm) |- (o.input 1); + \draw (a2.output) -- ++(right:3mm) |- (o.input 2); + \draw (o.output) -- ++(right:3mm); +\end{tikzpicture} +\end{codeexample} + + + +\subsubsection{Annotations} + +An \emph{annotation} is a little extra drawing that can be added to a +symbol. For instance, when you add two little parallel arrows pointing +away from some electrical element, this usually means that the element +is light emitting. + +Instead of having one symbol for ``diode'' and another for ``light +emitting diode,'' there is just one |diode| symbol, but you can add +the |light emitting| annotation to it. This is done by passing the +annotation as a parameter to the symbol as in the following example: + +\begin{codeexample}[] +\tikz [circuit ee IEC] + \draw (0,0) to [diode={light emitting}] (3,0) + to [resistor={adjustable}] (3,2); +\end{codeexample} + + + +\subsection{The Base Circuit Library} + +\begin{tikzlibrary}{circuits} + This library is a base library that is included by other circuit + libraries. You do not include it directly, but you will typically + use some of the general keys, described below. +\end{tikzlibrary} + +\begin{key}{/tikz/circuits} + This key should be passed as an option to a picture or a scope that + contains a circuit. It will do some internal setups. This key is + normally called by more specialized keys like |circuit ee IEC|. +\end{key} + + + + +\subsubsection{Symbol Size} + +\begin{key}{/tikz/circuit symbol unit=\meta{dimension} (initially 7pt)} + This dimension is a ``unit'' for the size of symbols. The libraries + generally define the sizes of symbols relative to this + dimension. For instance, the longer side of an inductor is, by + default, in the IEC library equal to five times this + \meta{dimension}. When you change this \meta{dimension}, the size of + all symbols will automatically change accordingly. + + Note, that it is still possible to overwrite the size of any + particular symbol. These settings apply only to the default sizes. + +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC] + \draw (0,1) to [resistor] (3.5,1); + \draw[circuit symbol unit=14pt] + (0,0) to [resistor] (3.5,0); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{stylekey}{/tikz/huge circuit symbols} + This style sets the default circuit symbol unit to |10pt|. +\end{stylekey} +\begin{stylekey}{/tikz/large circuit symbols} + This style sets the default circuit symbol unit to |8pt|. +\end{stylekey} +\begin{stylekey}{/tikz/medium circuit symbols} + This style sets the default circuit symbol unit to |7pt|. +\end{stylekey} +\begin{stylekey}{/tikz/small circuit symbols} + This style sets the default circuit symbol unit to |6pt|. +\end{stylekey} +\begin{stylekey}{/tikz/tiny circuit symbols} + This style sets the default circuit symbol unit to |5pt|. +\end{stylekey} + +\begin{key}{/tikz/circuit symbol size=|width| \meta{width} |height| + \meta{height}} + This key sets |minimum height| to \meta{height} times the current + value of the circuit symbol unit and the |minimum width| to + \meta{width} times this value. Thus, this option can be used with a + node command to set the size of the node as a multiple of the + circuit symbol unit. + +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC] + \draw (0,1) to [resistor] (2,1) to[inductor] (4,1); + + \begin{scope} + [every resistor/.style={circuit symbol size=width 3 height 1}] + \draw (0,0) to [resistor] (2,0) to[inductor] (4,0); + \end{scope} +\end{tikzpicture} +\end{codeexample} +\end{key} + + + +\subsubsection{Declaring New Symbols} + + +\begin{key}{/tikz/circuit declare symbol=\meta{name}} + This key is used to declare a symbol. It does not cause this symbol + to be shown nor does it set a graphic to be used for the symbol, it + simply ``prepares'' several keys that can later be used to draw a + symbol and to configure it. + + In detail, the first key that is defined is just called + \meta{name}. This key should be given as an option to a |node| or on + a |to| path, as explained below. The key will take options, which + can be used to influence the way the symbol graphic is rendered. + + Let us have a look at an example. Suppose we want to define a symbol + called |foo|, which just looks like a simple rectangle. We could + then say +\begin{codeexample}[code only] +\tikzset{circuit declare symbol=foo} +\end{codeexample} + The symbol could now be used like this: +\begin{codeexample}[code only] + \node [foo] at (1,1) {}; + \node [foo={red}] at (2,1) {}; +\end{codeexample} + + However, in the above example we would not actually see anything + since we have not yet setup the graphic to be used by |foo|. For + this, we must use a key called |set foo graphic| or, generally, + |set| \meta{name} |graphic|. This key gets graphic options as parameter + that will be set when a symbol |foo| should be shown: +\begin{codeexample}[] +\begin{tikzpicture} + [circuit declare symbol=foo, + set foo graphic={draw,shape=rectangle,minimum size=5mm}] + + \node [foo] at (1,1) {}; + \node [foo={red}] at (2,1) {}; +\end{tikzpicture} +\end{codeexample} + + In detail, when you use the key \meta{name}=\meta{options} with a + node, the following happens: + \begin{enumerate} + \item The |inner sep| is set to |0.5pt|. + \item The following style is executed: + \begin{stylekey}{/tikz/every circuit symbol} + Use this style to setup things in general. + \end{stylekey} + \item The graphic options that have been set using + |set| \meta{name} |graphic| are set. + \item The style |every |\meta{name} is executed. You can use it to + configure the symbol further. + \item The \meta{options} are executed. + \end{enumerate} + + The key \meta{name} will have a different effect when it is used on + a |to| path command inside a |circuit| environment (the |circuit| + environment sets up |to| paths in such a way that the use of a key + declared using |circuit declare symbol| is automatically detected). + When \meta{name} is used on a |to| path, the above actions also + happen (setting the inner separation, using the symbol graphic, and + so on), but they are passed to the key |circuit handle symbol|, + which is explained next. +\end{key} + + +\begin{key}{/tikz/circuit handle symbol=\meta{options}} + This key is mostly used internally. Its purpose is to render a + symbol. The effect of this key differs, depending on whether it is + used as the optional argument of a |to| path command or elsewhere. + + If the key is not used as an argument of a |to| path command, the + \meta{options} are simply executed. + + The more interesting case happens when the key is given on a |to| + path command. In this case, several things happen: + \begin{enumerate} + \item The |to| path is locally changed and set to an internal + path (which you should not try to change) that consists mostly of + a single straight line. + \item The \meta{options} are tentatively executed with filtering + switched on. Everything is filtered out, except for the key |pos| + and also the styles |at start|, |very near start|, |near start|, + |midway|, |near end|, |very near end|, and |at end|. If none of + them is found, |midway| is used. + \item The filtered option is used to determine a position for the + symbol on the path. At the given position (with |pos=0| + representing the start and |pos=1| representing the end), a node + will be added to the path (in a manner to be described presently). + \item This node gets \meta{options} as its option list. + \item The node is added by virtue of a special |markings| + decoration. This means that a |mark| command is executed that + causes the node to placed as a mark on the path. + \item The marking decoration will automatically subdivide the path + and cause a line to be drawn to from the start of the path to the + node's border (at the position that lies on a line from the node's + center to the start of the path) and then from the node's border + (at a position on the other side of the node) to the end of the + path. + \item The marking decoration will also take care of the case that + multiple marks are present on a path, in this case the lines from + and to the borders of the nodes are only between consecutive + nodes. + \item The marking decoration will also rotate the coordinate system + in such a way that the $x$-axis points along the path. Thus, if + you use the |transform shape| option, the node will ``point + along'' the path. + \item In case a node is at |pos=0| or at |pos=1| some special code + will suppress the superfluous lines to the start or end of the + path. + \end{enumerate} + + The net effect of all of the above is that a node will be placed + ``on the path'' and the path will have a ``gap'' just large enough + to encompass the node. Another effect is that you can use this key + multiple times on a path to add several node to a path, provided + they do not overlap. +\begin{codeexample}[] +\begin{tikzpicture}[circuit] + \draw (0,0) to [circuit handle symbol={draw,shape=rectangle,near start}, + circuit handle symbol={draw,shape=circle,near end}] (3,2); + \end{tikzpicture} +\end{codeexample} +\begin{codeexample}[] +\begin{tikzpicture}[transform shape,circuit] + \draw (0,0) to [circuit handle symbol={draw,shape=rectangle,at start}, + circuit handle symbol={draw,shape=circle,near end}] (3,2); +\end{tikzpicture} +\end{codeexample} +\end{key} + + + +\subsubsection{Pointing Symbols in the Right Direction} + +Unlike normal nodes, which generally should not be rotated since this +will make their text hard to read, symbols often need to be +rotated. There are two ways of achieving such rotations: + +\begin{enumerate} +\item When you place a symbol on a |to| path, the graphic symbol is + automatically rotated such that it ``points along the path.'' Here + is an examples that show how the inductor shape (which looks, + unrotated, like this: \tikz[circuit ee IEC]\node[inductor]{};) is + automatically rotated around: +\begin{codeexample}[] +\tikz [circuit ee IEC] + \draw (3,0) to[inductor] (1,0) to[inductor] (0,2); +\end{codeexample} +\item Many shapes cannot be placed ``on'' a path in this way, namely + whenever there are more than two possible inputs. Also, you may wish + to place the nodes first, possibly using a matrix, and connect them + afterwards. In this case, you can simply add rotations like + |rotate=90| to the shapes to rotate them. The following four keys + make this slightly more convenient: + \begin{key}{/tikz/point up} + This is the same as |rotate=90|. +\begin{codeexample}[] +\tikz [circuit ee IEC] \node [diode,point up] {}; +\end{codeexample} + \end{key} + \begin{key}{/tikz/point down} + This is the same as |rotate=-90|. +\begin{codeexample}[] +\tikz [circuit ee IEC] \node [diode,point down] {}; +\end{codeexample} + \end{key} + \begin{key}{/tikz/point left} + This is the same as |rotate=-180|. +\begin{codeexample}[] +\tikz [circuit ee IEC] \node [diode,point left] {}; +\end{codeexample} + \end{key} + \begin{key}{/tikz/point right} + This key has no effect. +\begin{codeexample}[] +\tikz [circuit ee IEC] \node [diode,point right] {}; +\end{codeexample} + \end{key} +\end{enumerate} + + +\subsubsection{Info Labels} + +Info labels are used to add text to a circuit symbol. Unlike normal +nodes like a rectangle, circuit symbols typically do not have text +``on'' them, but the text is placed next to them (like the text +``$3\Omega$'' next to a resistor). + +\tikzname\ already provides the |label| option for this purpose. The +|info| option is build on top of this option, but it comes in some +predefined variants that are especially useful in conjunction with +circuits. + +\begin{key}{/tikz/info=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}} + This key has nearly the same effect as the |label| key, only the + following style is used additionally automatically: + \begin{stylekey}{/tikz/every info} + Set this style to configure the styling of info labels. Since this + key is \emph{not} used with normal labels, it provides an easy way + of changing the way info labels look without changing other + labels. + \end{stylekey} + The \meta{options} and \meta{angle} are passed directly to the + |label| command. +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC,every info/.style=red] + \node [resistor,info=$3\Omega$] {}; +\end{tikzpicture} +\end{codeexample} + + You will find a detailed discussion of the |label| option on + page~\pageref{label-option}. + + Hint: To place some text \emph{on} the main node, use |center| as + the \meta{angle}: +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC,every info/.style=red] + \node [resistor,info=center:$3\Omega$] {}; + \node [resistor,point up,info=center:$R_1$] at (2,0) {}; +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/info'=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}} + This key works exactly like the |info| key, only in case the + \meta{angle} is missing, it defaults to |below| instead of the + current value of |label position|, which is usually |above|. This + means that when you use |info|, you get a label above the node, + while when you use the |info'| key you get a label below the + node. In case the node has been rotated, the positions of the info + nodes are rotated accordingly. +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC,every info/.style=red] + \draw (0,0) to[resistor={info={$3\Omega$},info'={$R_1$}}] (3,0) + to[resistor={info={$4\Omega$},info'={$R_2$}}] (3,2); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/info sloped=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}} + This key works like |info|, only the |transform shape| option is set + when the label is drawn, causing it to follow the sloping of the + main node. +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC,every info/.style=red] + \draw (0,0) to[resistor={info sloped={$3\Omega$}}] (3,0) + to[resistor={info sloped={$4\Omega$}}] (3,2); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/info' sloped=} + This is a combination of |info'| and |info sloped|. +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC,every info/.style=red] + \draw (0,0) to[resistor={info' sloped={$3\Omega$}}] (3,0) + to[resistor={info' sloped={$4\Omega$}}] (3,2); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/circuit declare unit=\marg{name}\marg{unit}} + This key is used to declare keys that make it easy to attach + physical units to nodes. The idea is that instead of + |info=$3\Omega$| you can write |ohm=3| or instead of + |info'=$5\mathrm{S}$| you can write |siemens'=5|. + + In detail, four keys are defined, namely |/tikz/|\meta{name}, + |/tikz/|\meta{name}|'|, |/tikz/|\meta{name} |sloped|, and + |/tikz/|\meta{name}|'| |sloped|. The arguments of all of these keys + are of the form + \opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{value} and it is + passed (slightly modified) to the corresponding key |info|, |info'|, + |info| |sloped|, or |info'| |sloped|. The ``slight modification'' is the + following: The text that is passed to the, say, |info| key is not + \meta{value}, but rather |$\mathrm{|\meta{value}\meta{unit}|}$| + + This means that after you said |circuit declare unit={ohm}{\Omega}|, + then |ohm=5k| will have the same effect as + |info={[every ohm]$\mathrm{5k\Omega}$}|. Here, |every ohm| is a + style that allows you to configure the appearance of this unit. + Since the |info| key is used internally, by changing the + |every info| style, you can change the appearance of all units + infos. +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC,circuit declare unit={my ohm}{O}] + \draw (0,0) to[resistor={my ohm' sloped=3}] (3,2); +\end{tikzpicture} +\end{codeexample} +\end{key} + + +\subsubsection{Declaring and Using Annotations} + +Annotations are quite similar to info labels. The main difference is +that they generally cause something to be drawn by default rather than +some text to be added (although an annotation might also add some +text). + +Annotations can be declared using the following key: + +\begin{key}{/tikz/circuit declare annotation=\marg{name}\marg{distance}\marg{path}} + This key is used to declare an annotation named \meta{name}. Once + declared, it can be used as an argument of a symbol and will add the + drawing in \meta{path} to the symbol. In detail, the following + happens: + + \textbf{The Main Keys.} + Two keys called \meta{name} and \meta{name}|'| are + defined. The second causes the annotation to be ``mirrored and + placed on the other side'' of the symbol. Both of these keys may + also take further keys as parameter like |info| keys. + Whenever the \meta{name} key is used, a local scope is opened and in + this scope the following things are done: + \begin{enumerate} + \item The style |every| \meta{name} is executed. + \item The following style is executed and then |arrows=->|: + \begin{stylekey}{/tikz/annotation arrow} + This style should set the |>| key to some desirable arrow tip. + \end{stylekey} + \item The coordinate system is shifted such that the origin is at + the north anchor of the symbol. (For the \meta{name}|'| key the + coordinate system is flipped and shifted such that the origin is + at the south anchor of the symbol.) + \item The |label distance| is locally set to \meta{distance}. + \item The parameter options given to the \meta{name} key are + executed. + \item The \meta{path} is executed. + \end{enumerate} + + \textbf{Usage.} + What all of the above amounts to is best explained by an + example. Suppose we wish to create an annotation that looks like a + little circular arrow (like \tikz \draw [->] (0,0) arc + (-270:80:1ex);). We could then say: +\begin{codeexample}[code only] +\tikzset{circuit declare annotation= + {circular annotation} + {9pt} + {(0pt,8pt) arc (-270:80:3.5pt)} +} +\end{codeexample} + We can then use it like this: +\tikzset{circuit declare annotation= + {circular annotation} + {8pt} + {(0pt,8pt) arc (-270:80:3.5pt)} +} +\begin{codeexample}[] +\tikz[circuit ee IEC] + \draw (0,0) to [resistor={circular annotation}] (3,0); +\end{codeexample} + Well, not very impressive since we do not see anything. This is due to + the fact that the \meta{path} becomes part of a path that contains + the symbol node an nothing else. This path is not drawn or filled, + so we do not see anything. What we must do is to use an |edge| path + operation: +\begin{codeexample}[] +\tikzset{circuit declare annotation={circular annotation}{9pt} + {(0pt,8pt) edge[to path={arc(-270:80:3.5pt)}] ()} +} +\tikz[circuit ee IEC] + \draw (0,0) to [resistor={circular annotation}] (3,0) + to [capacitor={circular annotation'}] (3,2); +\end{codeexample} + The \meta{distance} is important for the correct placement of + additional |info| labels. When an annotation is present, the info + labels may need to be moved further away from the symbol, but not + always. For this reason, an annotation defines an additional + \meta{distance} that is applied to all info labels given + as parameters to the annotation. Here is an example, that shows the + difference: +\tikzset{circuit declare annotation={circular annotation}{9pt} + {(0pt,8pt) edge[to path={arc (-270:80:3.5pt)}] ()} +} +\begin{codeexample}[] +\tikz[circuit ee IEC] + \draw (0,0) to [resistor={circular annotation,ohm=5}] (2,0) + to [resistor={circular annotation={ohm=5}}] (4,0); +\end{codeexample} +\end{key} + + +\subsubsection{Theming Symbols} +\label{section-theming-symbols} +For each symbol, a certain graphical representation is chosen to +actually show the symbol. You can modify this graphical representation +in several ways: + +\begin{itemize} +\item You can select a different library and use a different + |circuit ...| key. This will change all graphics used for the + symbols. +\item You can generally change the size of graphic symbols by setting + |circuit size unit| to a different value or using a key like + |small circuit symbols|. +\item + You can add options to the graphics used by symbols either globally + by setting the |every circuit| |symbol| style or locally by setting the + |every| \meta{name} style, where \meta{name} is the name of a + symbol. For instance, in the following picture the symbols are + ridiculously thick and resistors are red. +\begin{codeexample}[] +\begin{tikzpicture} + [circuit ee IEC, + every circuit symbol/.style={ultra thick}, + every resistor/.style={red}] + + \draw (0,0) to [inductor] ++(right:3) to [resistor] ++(up:2); +\end{tikzpicture} +\end{codeexample} +\item You can selectively change the graphic used for a symbol + by saying |set resistor graphic=|. +\item You can change one or more of the following styles: + \begin{stylekey}{/tikz/circuit symbol open (initially draw)} + This style is used with symbols that consist of lines that + surround some area. For instance, the IEC version of a resistor is + an open symbol. +\begin{codeexample}[] +\tikz [circuit ee IEC, + circuit symbol open/.style={thick,draw,fill=yellow}] + \draw (0,0) to [inductor] ++(right:3) to [resistor] ++(up:2); +\end{codeexample} + \end{stylekey} + \begin{stylekey}{/tikz/circuit symbol filled (initially {draw,fill=black})} + This style is used with symbols that are completely filled. For + instance, the variant IEC version of an inductor is a filled, + black rectangle. + \end{stylekey} + \begin{stylekey}{/tikz/circuit symbol lines (initially draw)} + This style is used with symbols that consist only of lines the do + not surround anything. Examples are a capacitor. +\begin{codeexample}[] +\tikz [circuit ee IEC, + circuit symbol lines/.style={thick,draw=red}] + \draw (0,0) to [capacitor] ++(right:3) to [resistor] ++(up:2); +\end{codeexample} + \end{stylekey} + \begin{stylekey}{/tikz/circuit symbol wires (initially draw)} + This style is used for symbols that consist only of ``wires.'' The + difference to the previous style is that a symbol consisting of + wires will look strange when the lines are thicker than the lines + of normal wires, while for symbols consisting of lines (but not + wires) it may look nice to make them thicker. An example is the + |make contact| symbol. + + Compare +\begin{codeexample}[] +\tikz [circuit ee IEC,circuit symbol lines/.style={draw,very thick}] + \draw (0,0) to [capacitor={near start}, + make contact={near end}] (3,0); +\end{codeexample} + to +\begin{codeexample}[] +\tikz [circuit ee IEC,circuit symbol wires/.style={draw,very thick}] + \draw (0,0) to [capacitor={near start}, + make contact={near end}] (3,0); +\end{codeexample} + \end{stylekey} +\end{itemize} + +All circuit environments like |circuit logic IEC| mainly use options +like |set and gate graphic=...| to setup the graphics used for a certain +symbol. It turns out that graphic hidden in the ``|...|'' part is also +always available as a separate style, whose name contains the +library's initials. For instance, the |circuit logic IEC| option +actually contains the following command: +\begin{codeexample}[code only] + set and gate graphic = and gate IEC graphic, +\end{codeexample} +The |and gate IEC graphic| style, in turn, is defined as follows: +\begin{codeexample}[code only] +\tikzset{and gate IEC graphic/.style= + { + circuit symbol open, + circuit symbol size=width 2.5 height 4, + shape=and gate IEC, + inner sep=.5ex + } +} +\end{codeexample} + +Normally, you do not need to worry about this, since you will not need +to access a style like |and gate IEC graphic| directly; you will only +use the |and gate| key. However, sometimes libraries define +\emph{variants} of a graphic; for instance, there are two variants for +the resistor graphic in the IEC library. In this case you can set the +graphic for the resistor to this variant (or back to the original) by +saying |set resistor graphic| yourself: + +\begin{codeexample}[] +\begin{tikzpicture}[circuit ee IEC] + % Standard resistor + \draw (0,2) to [resistor] (3,2); + + % Var resistor + \begin{scope}[set resistor graphic=var resistor IEC graphic] + \draw (0,1) to [resistor] (3,1); + + % Back to original + \draw [set resistor graphic=resistor IEC graphic] + (0,0) to [resistor] (3,0); + \end{scope} +\end{tikzpicture} +\end{codeexample} + + + +\subsection{Logical Circuits} + + +\subsubsection{Overview} + +A \emph{logical circuit} is a circuit that contains what we call +\emph{logical gates} like an and-gate or an xor-gate. The logical +libraries are intended to make it easy to draw such circuits. + +In the following, we first have a look at the different libraries that +can be used in principle and how the symbols look like. Then we have a +more detailed look at how the symbols are used. Finally, we discuss +the implementation details. + +There are different ways of depicting logical gates, which is why there +are different (sub-)libraries for drawing them. They provide the +necessary graphical representations of the symbols declared in the +following library: + +\begin{tikzlibrary}{circuits.logic} + This library declares the logical gate symbols, but does not + provide the symbol graphics. + The library also defines the following key which, however, is also + only used indirectly, namely by other libraries: + \begin{key}{/tikz/circuit logic} + This style calls the keys |circuit| (which internally calls + |every circuit|, then it defines the |inputs| key and it calls the + |every circuit logic| key. + \begin{key}{/tikz/inputs=\meta{inputs}} + This key is defined only inside the scope of a + |circuit logic|. There, it has the same effect as + |logic gate inputs|, described on + page~\pageref{logic-gate-inputs}. + \end{key} + \begin{stylekey}{/tikz/every circuit logic} + Use this key to configure the appearance of logical circuits. + \end{stylekey} + \end{key} +\end{tikzlibrary} + +Since the |circuit.logic| library does not define any actual graphics, +you need to use one of the following libraries, instead: + +\begin{pgflibrary}{circuits.logic.IEC} + This library provides graphics based on gates + recommended by the International Electrotechnical Commission. When + you include this library, you can use the following key to + setup a scope that contains a logical circuit where the gates are + shown in this style. + + \begin{key}{/tikz/circuit logic IEC} + This key calls |circuit logic| and installs the IEC-like + graphics for the logical symbols like |and gate|. + + As explained in Section~\ref{section-theming-symbols}, for each + graphic symbol of the library there is also a style that stores this + particular appearance. These keys are called |and gate IEC graphic|, + |or gate IEC graphic|, and so on. +\begin{codeexample}[] +\begin{tikzpicture}[circuit logic IEC, + every circuit symbol/.style={ + logic gate IEC symbol color=black, + fill=blue!20,draw=blue,very thick}] + \matrix[column sep=7mm] + { + \node (i0) {0}; & & \\ + & \node [and gate] (a1) {}; & \\ + \node (i1) {0}; & & \node [or gate] (o) {};\\ + & \node [nand gate] (a2) {}; & \\ + \node (i2) {1}; & & \\ + }; + \draw (i0.east) -- ++(right:3mm) |- (a1.input 1); + \draw (i1.east) -- ++(right:3mm) |- (a1.input 2); + \draw (i1.east) -- ++(right:3mm) |- (a2.input 1); + \draw (i2.east) -- ++(right:3mm) |- (a2.input 2); + \draw (a1.output) -- ++(right:3mm) |- (o.input 1); + \draw (a2.output) -- ++(right:3mm) |- (o.input 2); + \draw (o.output) -- ++(right:3mm); +\end{tikzpicture} +\end{codeexample} + \end{key} +\end{pgflibrary} + +\begin{pgflibrary}{circuits.logic.US} + This library provides graphics showing ``American'' logic + gates. It defines the following key: + + \begin{key}{/tikz/circuit logic US} + This style calls |circuit logic| and installs US-like graphics + for the logical symbols like |and gate|. For instance, it says + \begin{codeexample}[code only] +set and gate graphic = and gate US graphic + \end{codeexample} + + Here is an example: +\begin{codeexample}[] +\begin{tikzpicture}[circuit logic CDH, + tiny circuit symbols, + every circuit symbol/.style={ + fill=white,draw}] + \matrix[column sep=7mm] + { + \node (i0) {0}; & & \\ + & \node [and gate] (a1) {}; & \\ + \node (i1) {0}; & & \node [or gate] (o) {};\\ + & \node [nand gate] (a2) {}; & \\ + \node (i2) {1}; & & \\ + }; + \draw (i0.east) -- ++(right:3mm) |- (a1.input 1); + \draw (i1.east) -- ++(right:3mm) |- (a1.input 2); + \draw (i1.east) -- ++(right:3mm) |- (a2.input 1); + \draw (i2.east) -- ++(right:3mm) |- (a2.input 2); + \draw (a1.output) -- ++(right:3mm) |- (o.input 1); + \draw (a2.output) -- ++(right:3mm) |- (o.input 2); + \draw (o.output) -- ++(right:3mm); +\end{tikzpicture} +\end{codeexample} + \end{key} +\end{pgflibrary} + +\begin{pgflibrary}{circuits.logic.CDH} + This library provides graphics based on the logic symbols used in + A. Croft, R. Davidson, and M. Hargreaves (1992), \emph{Engineering + Mathematics}, Addison-Wesley, 82--95. They are identical to the + US-style symbols, except for the and- and nand-gates. + + \begin{key}{/tikz/circuit logic CDH} + This key calls |circuit logic US| and installs the two special + and- and nand-gates, that is, it uses |set and gate graphic| with + |and gate CDH graphic| and likewise for nand-gates. + \end{key} +\end{pgflibrary} + + +Inside |circuit logic XYZ| scopes, you can now use the keys shown in +Section~\ref{section-logic-symbols}. We have a more detailed look at +one of them, all the other work the same way: + +\begin{key}{/tikz/and gate} + This key should be passed to a |node| command. It will cause the + node to ``look like'' an and-gate, where the exact appearance of the + gate is dictated by the which circuit environment is used. To + further configure the appearance of the |and gate|, see + Section~\ref{section-theming-symbols}. + +\begin{codeexample}[] +\tikz [circuit logic IEC] \node [and gate] {$A$}; +\end{codeexample} +\begin{codeexample}[] +\tikz [circuit logic US] +{ + \node [and gate,point down] {$A$}; + \node [and gate,point down,info=center:$A$] at (1,0) {}; +} +\end{codeexample} + + \medskip\textbf{Inputs.} + Multiple inputs can be specified for a logic gate (provided they + support multiple inputs: a not gate---also known as an + inverter---does not). However, there is an upper limit for the + number of inputs which has been set at 1024, which should be \emph{way} + more than would ever be needed. + + The following key is used to configure the inputs. It is available + only inside a |circuit logic| environment. + + \begin{key}{/tikz/inputs=\meta{input list} (initially \char`\{normal,normal\char`\})} + If a gate has $n$ inputs, the \meta{input list} should consists of + $n$ letters, each being |i| for ``inverted'' or |n| for + ``normal.'' Inverted gates will be indicated by a little + circle. In any case the anchors for the inputs will be set + up appropriately, numbered from top to bottom |input 1|, |input 2|, + \ldots and so on. If the gate only supports one input the anchor + is simply called |input| with no numerical index. +\begin{codeexample}[] +\begin{tikzpicture}[circuit logic IEC] + \node[and gate,inputs={inini}] (A) {}; + \foreach \a in {1,...,5} + \draw (A.input \a -| -1,0) -- (A.input \a); + \draw (A.output) -- ++(right:5mm); +\end{tikzpicture} +\end{codeexample} + \end{key} + + (This key is just a shorthand for |logic gate inputs|, described + in detail on page~\pageref{logic-gate-inputs}. There you will also + find descriptions of how to configure the size of the inverted + circles and the way the symbol size increases when there are too + many inputs.) + + \textbf{Output.} + Every logic gate has one anchor called |output|. +\end{key} + + +\subsubsection{Symbols: The Gates} + +\label{section-logic-symbols} + +The following table shows which symbols are declared by the main +|circuits.logic| library and their appearance in the different +sublibraries. +\medskip + +\def\gateexamples#1{% + \texttt{#1} + \indexkey{#1} & + \tikz[baseline,circuit logic IEC] \node[#1,label=] {}; & + \tikz[baseline,circuit logic US] \node[#1] {}; & + \tikz[baseline,circuit logic CDH] \node[#1] {}; +} +\begin{tabular}{lccc} + \emph{Key} & \emph{Appearance inside} & \emph{Appearance inside} & \emph{Appearance inside} \\ + & |circuit logic IEC| & |circuit logic US| & |circuit logic CDH| \\ + \gateexamples{/tikz/and gate}\\ + \gateexamples{/tikz/nand gate}\\ + \gateexamples{/tikz/or gate}\\ + \gateexamples{/tikz/nor gate}\\ + \gateexamples{/tikz/xor gate}\\ + \gateexamples{/tikz/xnor gate}\\ + \gateexamples{/tikz/not gate}\\ + \gateexamples{/tikz/buffer gate} +\end{tabular} + + +\subsubsection{Implementation: The Logic Gates Shape Library} + +The previous sections described the \tikzname\ interface for creating +logical circuits. In this section we take a closer look at the +underlying \pgfname\ libraries. + +Just as there are several \tikzname\ circuit libraries, there are two +underlying \pgfname\ shape libraries, one for creating US-style gates +and one for IEC-style gates. These libraries define \emph{shapes} +only. It is the job of the circuit libraries to ``theme'' them so that +they ``look nice.'' However, in principle, you can also use these +shapes directly. + +Let us begin with the base library that defines the handling of +inputs. + +\begin{pgflibrary}{shapes.gates.logic} + This library defines common keys used by all logical gate shapes. + +\begin{key}{/pgf/logic gate inputs=\meta{input list} (initially \char`\{normal,normal\char`\})} + \label{logic-gate-inputs}% + Specify the inputs for the logic gate. The keyword |inverted| + indicates an inverted input which will mean \pgfname{} will draw a + circle attached to the main shape of the logic gate. Any keyword + that is not |inverted| will be treated as a ``normal'' or + ``non-inverted'' input (however, for readability, you may wish to + use |normal| or |non-inverted|), and \pgfname{} will not draw the + circle. + In both cases the anchors for the inputs will be set + up appropriately, numbered from top to bottom |input 1|, |input 2|, + \ldots and so on. If the gate only supports one input the anchor + is simply called |input| with no numerical index. + +\begin{codeexample}[] +\begin{tikzpicture}[minimum height=0.75cm] + \node[and gate IEC, draw, logic gate inputs={inverted, normal, inverted}] + (A) {}; + \foreach \a in {1,...,3} + \draw (A.input \a -| -1,0) -- (A.input \a); + \draw (A.output) -- ([xshift=0.5cm]A.output); +\end{tikzpicture} +\end{codeexample} + + For multiple inputs it may be somewhat unwieldy to specify a long + list, thus, the following ``shorthand'' is permitted (this is an + extension of ideas due to Juergen Werber and Christoph Bartoschek): + Using |i| for inverted and |n| for normal inputs, \meta{input list} + can be specified \emph{without the commas}. So, for example, + |ini| is equivalent to |inverted, normal, inverted|. + +\begin{codeexample}[] +\begin{tikzpicture}[minimum height=0.75cm] + \node[or gate US, draw,logic gate inputs=inini] (A) {}; + \foreach \a in {1,...,5} + \draw (A.input \a -| -1,0) -- (A.input \a); + \draw (A.output) -- ([xshift=0.5cm]A.output); +\end{tikzpicture} +\end{codeexample} + +\end{key} + +The height of the gate may be increased to accommodate the number +of inputs. In fact, it depends on three variables: +$n$, the number of inputs, $r$, the radius of the circle used +to indicate an inverted input and $s$, the distance between +the centers of the inputs. +The default height is then calculated according to the expression +$(n+1)\times\max(2r,s)$. This then may +be increased to accommodate the node contents or any +minimum size specifications. + +The radius of the inverted input circle and the distance between the +centers of the inputs can be customized using the following keys: + +\begin{key}{/pgf/logic gate inverted radius=\meta{length} (initially 2pt)} + Set the radius of the circle that is used to indicate inverted + inputs. This is also the radius of the circle used for the inverted + output of the |nand|, |nor|, |xnor| and |not| gates. + +\begin{codeexample}[] +\begin{tikzpicture}[minimum height=0.75cm] + \tikzset{every node/.style={shape=nand gate CDH, draw, logic gate inputs=ii}} + \node[logic gate inverted radius=2pt] {A}; + \node[logic gate inverted radius=4pt] at (0,-1) {B}; +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/logic gate input sep=\meta{length} (initially .125cm)} + Set the distance between the \emph{centers} of the inputs to the + logic gate. + +\begin{codeexample}[] +\begin{tikzpicture}[minimum size=0.75cm] + \draw [help lines] grid (3,2); + \tikzset{every node/.style={shape=and gate IEC, draw, logic gate inputs=ini}} + \node[logic gate input sep=0.33333cm] at (1,1)(A) {A}; + \node[logic gate input sep=0.5cm] at (3,1) (B) {B}; + \foreach \a in {1,...,3} + \draw (A.input \a -| 0,0) -- (A.input \a) + (B.input \a -| 2,0) -- (B.input \a); +\end{tikzpicture} +\end{codeexample} +\end{key} + + \pgfname{} will increase the size of the + logic gate to accommodate the number of inputs, and the size + of the inverted radius and the separation between the inputs. + However with all shapes in this library, any increase in size + (including any minimum size requirements) will be applied so that + the default aspect ratio is unaltered. This means that changing + the height will change the width and vice versa. + +\end{pgflibrary} + + +\subsubsection{Implementation: The US-Style Logic Gates Shape Library} + +\begin{pgflibrary}{shapes.gates.logic.US} + This library provides ``American'' logic gate shapes whose names are + suffixed with the identifier |US|. Additionally, + alternative |and| and |nand| gates are provided which are based on the + logic symbols used in A. Croft, R. Davidson, and M. Hargreaves (1992), + \emph{Engineering Mathematics}, Addison-Wesley, 82--95. These two + shapes are suffixed with |CDH|. + + The ``compass point'' anchors apply to the main part of the shape + and do not include any inverted inputs or outputs. This library + provides an additional feature to facilitate the relative positioning + of logic gates: + +\begin{key}{/pgf/logic gate anchors use bounding box=\meta{boolean} (initially false)} + When set to |true| this key will ensure that the + compass point anchors use the bounding rectangle of the + main shape, which, ignore any inverted inputs or outputs, but + includes any |outer sep|. + This \emph{only} affects the compass point anchors + and is not set on a shape by shape basis: whether the bounding + box is used is determined by value of this key when the anchor + is accessed. + +\begin{codeexample}[] +\begin{tikzpicture}[minimum height=1.5cm] + \node[xnor gate US, draw, gray!50,line width=2pt] (A) {}; + \foreach \x/\y/\z in {false/blue/1pt, true/red/2pt} + \foreach \a in {north, south, east, west, north east, + south east, north west, south west} + \draw[logic gate anchors use bounding box=\x, color=\y] + (A.\a) circle(\z); +\end{tikzpicture} +\end{codeexample} + +\end{key} + + The library defines a number of shapes. For each shape the allowed + number of inputs is also shown: + \begin{itemize} + \item |and gate US|, two or more inputs + \item |and gate CDH|, two or more inputs + \item |nand gate US|, two or more inputs + \item |nand gate CDH|, two or more inputs + \item |or gate US|, two or more inputs + \item |nor gate US|, two or more Inputs + \item |xor gate US|, two inputs + \item |xnor gate US|, two inputs + \item |not gate US|, one input + \item |buffer gate US|, one input + \end{itemize} + + In the following, we only have a detailed look at the anchors + defined by one of them. We choose the |nand gate US| because it + shows all the ``interesting'' anchors. + + \begin{shape}{nand gate US} + This shape is a nand gate, which supports two or more inputs. If + less than two inputs are specified an error will result. + The anchors for this gate with two + non-inverted inputs (using the normal compass point anchors) are + shown below. Anchor |30| is an example of a border anchor. + +\begin{codeexample}[] +\Huge +\begin{tikzpicture} + \node[name=s,shape=nand gate US,shape example, inner sep=0cm, + logic gate inputs={in}, + logic gate inverted radius=.5cm] {Nand Gate\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {center/above, text/above, 30/above right, + mid/right, mid east/left, mid west/above, + base/below, base east/below, base west/left, + north/above, south/below, east/above, west/above, + north east/above, south east/below, south west/below, north west/above, + output/right, input 1/above, input 2/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} + \end{shape} +\end{pgflibrary} + + + +\subsubsection{Implementation: The IEC-Style Logic Gates Shape Library} + +\begin{pgflibrary}{shapes.gates.logic.IEC} + This library provides rectangular logic gate shapes. These shapes + are suffixed with |IEC| as they are based on gates recommended by + the International Electrotechnical Commission. + + By default each gate is drawn with a symbol, $\char`\&$ for |and| and + |nand| gates, $\geq1$ for |or| and |nor| gates, $1$ for |not| and + |buffer| gates, and $=1$ for |xor| and |xnor| gates. These symbols + are drawn automatically (internally they are drawn using the + ``foreground'' path), and are not strictly speaking part of the node + contents. However, the gate is enlarged to make sure the symbols are + within the border of the node. + It is possible to change + the symbols and their position within the node using the following + keys: + +\begin{key}{/pgf/and gate IEC symbol=\meta{text} (initially \char`\\char\char`\`\char`\\\char`\&)} + Set the symbol for the |and gate|. Note that if the node is filled, + this color will be used for the symbol, making it invisible, so + it will be necessary set \meta{text} to something like + |\color{black}\char`\&|. Alternatively, the + |logic gate IEC symbol color| key can be used to set the color + of all symbols simultaneously. + + In \tikzname, when the |use IEC style logic gates| key has been + used, this key can be replaced by |and gate symbol|. +\end{key} + +\begin{key}{/pgf/nand gate IEC symbol=\meta{text} (initially \char`\\char\char`\`\char`\\\char`\&)} + Set the symbol for the |nand gate|. + In \tikzname, when the |use IEC style logic gates| key has been + used, this key can be replaced by |nand gate symbol|. +\end{key} + +\begin{key}{/pgf/or gate IEC symbol=\meta{text} (initially \char`\$\char`\\geq1\char`\$)} + Set the symbol for the |or gate|. + In \tikzname, when the |use IEC style logic gates| key has been + used, this key can be replaced by |or gate symbol|. +\end{key} + +\begin{key}{/pgf/nor gate IEC symbol=\meta{text} (initially \char`\$\char`\\geq1\char`\$)} + Set the symbol for the |nor gate|. + In \tikzname, when the |use IEC style logic gates| key has been + used, this key can be replaced by |nor gate symbol|. +\end{key} + +\begin{key}{/pgf/xor gate IEC symbol=\meta{text} (initially \char`\{\char`\$=1\char`\$\char`\})} + Set the symbol for the |xor gate|. Note the necessity for braces, + as the symbol contains |=|. + In \tikzname, when the |use IEC style logic gates| key has been + used, this key can be replaced by |or gate symbol|. +\end{key} + +\begin{key}{/pgf/xnor gate IEC symbol=\meta{text} (initially \char`\{\char`\$=1\char`\$\char`\})} + Set the symbol for the |xnor gate|. + In \tikzname, when the |use IEC style logic gates| key has been + used, this key can be replaced by |xnor gate symbol|. +\end{key} + +\begin{key}{/pgf/not gate IEC symbol=\meta{text} (initially 1)} + Set the symbol for the |not gate|. + In \tikzname, when the |use IEC style logic gates| key has been + used, this key can be replaced by |not gate symbol|. +\end{key} + +\begin{key}{/pgf/buffer gate IEC symbol=\meta{text} (initially 1)} + Set the symbol for the |buffer gate|. + In \tikzname, when the |use IEC style logic gates| key has been + used, this key can be replaced by |buffer gate symbol|. +\end{key} + +\begin{key}{/pgf/logic gate IEC symbol align=\meta{align} (initially top)} + Set the alignment of the logic gate symbol (in \tikzname, when the + |use IEC style logic gates| key has been used, |IEC| can be omitted. + The specification in \meta{align} is a comma separated list from + |top|, |bottom|, |left| or |right|. The distance between the border + of the node and the outer edge of the symbol is determined by the values + of the |inner xsep| and |inner ysep|. + +\begin{codeexample}[] +\begin{tikzpicture}[minimum size=1cm, use IEC style logic gates] + \tikzset{every node/.style={nor gate, draw}} + \node (A) at (0,1.5) {}; + \node [logic gate symbol align={bottom, right}] (B) at (0,0) {}; + \foreach \g in {A, B}{ + \foreach \i in {1,2} + \draw ([xshift=-0.5cm]\g.input \i) -- (\g.input \i); + \draw (\g.output) -- ([xshift=0.5cm]\g.output); + } +\end{tikzpicture} +\end{codeexample} + +\end{key} + + +\begin{key}{/pgf/logic gate IEC symbol color=\meta{color}} + This key sets the color for all symbols simultaneously. This color + can be overridden on a case by case basis by specifying a color + when setting the symbol text. +\end{key} + + The library defines the following shapes: + \begin{itemize} + \item |and gate IEC|, two or more inputs + \item |nand gate IEC|, two or more inputs + \item |or gate IEC|, two or more inputs + \item |nor gate IEC|, two or more inputs + \item |xor gate IEC|, two inputs + \item |xnor gate IEC|, two inputs + \item |not gate IEC|, one input + \item |buffer gate IEC|, one input + \end{itemize} + + Again, we only have a look at the nand-gate in more detail: + +\begin{shape}{nand gate IEC} + This shape is a nand gate. It supports two or more inputs. + If less than two inputs are specified an error will result. + The anchors for this gate with two + non-inverted inputs are + shown below. Anchor |30| is an example of a border anchor. + +\begin{codeexample}[] +\Huge +\begin{tikzpicture} + \node[name=s,shape=nand gate IEC ,shape example, inner xsep=1cm, inner ysep=1cm, + minimum height=6cm, nand gate IEC symbol=\color{black!30}\char`\&, + logic gate inputs={in}, + logic gate inverted radius=0.65cm] + {Nand Gate\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {center/above, text/above, 30/above right, + mid/right, mid east/left, mid west/above, + base/below, base east/below, base west/left, + north/above, south/below, east/above, west/above, + north east/above, south east/below, south west/below, north west/above, + output/right, input 1/above, input 2/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} +\end{pgflibrary} + + + + +\subsection{Electrical Engineering Circuits} + +\subsubsection{Overview} + +An \emph{electrical engineering circuit} contains symbols like +resistors or capacitors or voltage sources and annotations like the +two arrows pointing toward an element whose behaviour is light +dependent. The electrical engineering libraries, abbreviated +ee-libraries, provide such symbols and annotations. + +Just as for logical gates, there are different ways of drawing +ee-symbols. Currently, there is one main library for drawing circuits, +which uses the graphics from the International Electrotechnical +Commission, but you can add your own libs. This is why, just as for +logical gates, there are a base library and more specific libraries. + +\begin{tikzlibrary}{circuits.ee} + This library declares the ee symbols, but (mostly) does not + provide the symbol graphics, which is left to the sublibraries. + Just like the logical gates library, a key is defined that is + normally only used internally: + \begin{key}{/tikz/circuit ee} + This style calls the keys |circuit| (which internally calls + |every circuit| and the following style: + \begin{stylekey}{/tikz/every circuit ee} + Use this key to configure the appearance of logical circuits. + \end{stylekey} + \end{key} + + The library also declares some standard annotations and units. +\end{tikzlibrary} + +As for logical circuits, to draw a circuit the first step is to +include a library containing the symbols graphics. Currently, you have to +include |circuits.ee.IEC|. + +\begin{tikzlibrary}{circuit.ee.IEC} + When this library is loaded, you can use the following style: + \begin{key}{/tikz/circuit ee IEC} + This style calls |circuit ee| and installs the IEC-like + graphics for the logical symbols like |resistor|. + \end{key} +\end{tikzlibrary} + +Inside the |circuit ee IEC| scope, you can now use the keys for +symbols, units, and annotations listed in the later sections. We have +a more detailed look at one of each of them, all the other work the +same way. + +Let us start with an example of a symbol: the resistor symbol. The +other predefined symbols are listed in +Section~\ref{section-circuits-ee-symbols} and later sections. + +\begin{key}{/tikz/resistor=\opt{\meta{options}}} + This key should be used with a |node| path command or with the |to| + path command. + + \medskip\textbf{Using the Key with Normal Nodes.} + When used with a node, it will cause this node to + ``look like'' a resistor (by default, in the IEC library, this is + just a simple rectangle). +\begin{codeexample}[] +\tikz [circuit ee IEC] + \node [resistor] {}; +\end{codeexample} + + Unlike normal nodes, a resistor node generally should not take any + text (as in |node [resistor] {foo}|). Instead, the labeling of + resistors should be done using the |label|, |info| and |ohm| + options. +\begin{codeexample}[] +\tikz [circuit ee IEC] + \node [resistor,ohm=5] {}; +\end{codeexample} + + The \meta{options} make no real sense when the |resistor| option is + used with a normal node, you can just as well given them to the + |node| itself. Thus, the following has the same effect as the above + example: +\begin{codeexample}[] +\tikz [circuit ee IEC] + \node [resistor={ohm=5}] {}; +\end{codeexample} + + In a circuit, you will often wish to rotate elements. For this, the + options |point up|, |point down|, |point left| or |point right| may + be especially useful. They are just shorthands for appropriate + rotations like |rotate=90|. +\begin{codeexample}[] +\tikz [circuit ee IEC] { + \node (R1) [resistor,point up,ohm=5] at (3,1) {}; + \node (R2) [resistor,ohm=10k] at (0,0) {}; + \draw (R2) -| (R1); +} +\end{codeexample} + + \medskip\textbf{Using the Key on a To Path.} + When the |resistor| key is used on a |to| path inside a + |circuit ee IEC|, the |circuit handle symbol| key is called + internally. This has a whole bunch of effects: + \begin{enumerate} + \item The path currently being constructed is cut up to make place + for a node. + \item This node will be a |resistor node| that is rotated so that it + points ``along'' the path (unless an option like |shift only| or + an extra rotation is used to change this). + \item The \meta{options} passed to the |resistor| key are passed on + to the node. + \item The \meta{options} are pre-parsed to identify a |pos| key or + a key like |at start| or |midway|. These keys are used to + determine where on the |to| path the node will lie. + \end{enumerate} + + Since the \meta{options} of the |resistor| key are passed on to the + resistor node on the path, you can use it to add labels to the + node. Here is a simple example: + +\begin{codeexample}[] +\tikz [circuit ee IEC] + \draw (0,0) to [resistor=red] (3,0) + to [resistor={ohm=2\mu}] (3,2); +\end{codeexample} + + You can add multiple labels to a resistor and you can have multiple + resistors (or other elements) on a single path. + + \medskip\textbf{Inputs, Outputs, and Anchors.} + Like the logical gates, all ee-symbols have an |input| + and an |output| anchor. Special purpose nodes may have even more + anchors of this type. Furthermore, the ee-symbols nodes also for + standard compass direction anchors. + + \medskip\textbf{Changing the Appearance.} + To configure the appearance of all |resistor|s, see + Section~\ref{section-theming-symbols}. You can use the + \meta{options} to locally change the appearance of a single + resistor. +\end{key} + +Let us now have a look at an example of a unit: the Ohm unit. The +other predefined units are listed in Section~\ref{section-circuits-units}. + +\begin{key}{/tikz/ohm=\meta{value}} + This key is used to add an |info| label to a node with a special + text: |$\mathrm{|\meta{value}|\Omega}$|. In other words, the |ohm| + key can only be used with the options of a node and, when used, it + will cause the \meta{value} to be placed next to the node, followed + by $\Omega$. Since the \meta{value} is typeset inside a |\mathrm| + command, when you write |ohm=5k| you get $\mathrm{5k\Omega}$, + |ohm=5p| yields $\mathrm{5p\Omega}$, and |ohm=5.6\cdot 10^{2}\mu| + yields $\mathrm{5.6\cdot 10^{2}\mu\Omega}$. +\begin{codeexample}[] +\tikz [circuit ee IEC] \draw (0,0) to [resistor={ohm=5M}] (0,2); +\end{codeexample} + + Instead of |ohm| you can also use |ohm'|, which places the label on + the other side. +\begin{codeexample}[] +\tikz [circuit ee IEC] \draw (0,0) to [resistor={ohm'=5M}] (0,2); +\end{codeexample} + + Finally, there are also keys |ohm sloped| and |ohm' sloped| for + having the info label rotate together with the main node. +\begin{codeexample}[] +\tikz [circuit ee IEC] + \draw (0,0) to [resistor={ohm sloped=5M}] (0,2) + (2,0) to [resistor={ohm' sloped=6f}] (2,2); +\end{codeexample} + + You can configure the appearance of an Ohm info label using the key + |every ohm|. +\end{key} + +Finally, let us have a look at an annotation: the |light emitting| +annotation. The other predefined units are listed in +Section~\ref{section-circuits-annotations}. + +\begin{key}{/tikz/light emitting=\opt{\meta{options}}} + Like a unit, an annotation should be given as an additional option + to a node. It causes some drawings (in this case, two parallel + lines) to be placed next to the node. + +\begin{codeexample}[] +\tikz [circuit ee IEC] \draw (0,0) to [diode=light emitting] (2,0); +\end{codeexample} + + The \meta{options} can be used for three different things: + \begin{enumerate} + \item You can use keys like |red| to change the appearance of this + annotation, locally. + \item You can use keys like |<-| or |-latex| to change the + direction and kinds of arrows used in the annotation. + \item You can use info labels like |ohm=5| or |info=foo| inside the + \meta{options}. These info labels will be added to the main node + (not to the annotation itself), but the label distance will have + been changed to accommodate for the space taken up by the + annotation. +\begin{codeexample}[] +\tikz [circuit ee IEC] +{ + \draw (0,2) to [diode={light emitting,info=not good}] (2,2); + \draw (0,0) to [diode={light emitting={info=better}, + info'=also good}] (2,0); +} +\end{codeexample} + \end{enumerate} + + In addition to |light emitting| there is also a key called + |light emitting'|, which simply places the annotation on the other + side of the node. + + You can configure the appearance of annotations in three ways: + \begin{itemize} + \item You can set the |every circuit annotation| style. + \item You can set the |every light emitting| style. + \item You can set the following key: + \begin{stylekey}{/tikz/annotation arrow} + This style should set the default |>| arrow to some nice value. + \end{stylekey} + \end{itemize} +\end{key} + + + + + +\def\eelineexample#1#2{% + \texttt{#1}\indexkey{#1} + & + \tikz[baseline=-.5ex,circuit ee IEC] \draw (0,0) to [#1] (3,0); + & + \relax\def\temp{#2} + \ifx\temp\empty\else + {\tikz[baseline=-.5ex,circuit ee IEC,set #2 graphic=var #2 IEC graphic] + \draw (0,0) to [#2] (3,0);} + \fi \\[.2em] +} +\def\eeendexample#1#2{% + \texttt{#1}\indexkey{#1} + & + \tikz[baseline=-.5ex,circuit ee IEC] \draw (0,0) to [#1={at end}] (1.5,0)(3,0); + & + \relax\def\temp{#2} + \ifx\temp\empty\else + {\tikz[baseline=-.5ex,circuit ee IEC,set #2 graphic=var #2 IEC graphic] + \draw (0,0) to [#2={at end}] (1.5,0)(3,0);} + \fi \\[.2em] +} +\def\unitexample#1{% + \texttt{#1}\indexkey{#1} + & + \tikz [baseline,inner sep=0pt] \node[#1=1] {};\\ +} +\def\annotationexample#1{% + \texttt{#1}\indexkey{#1} + & + \tikz[baseline=-.5ex,circuit ee IEC] + \draw (0,0) to [resistor={#1}] (2,0) + to [diode ={#1'}] (4,0);\\ +} +\def\empty{} + + +\subsubsection{Symbols: Indicating Current Directions} + +\label{section-ee-symbols} +\label{section-circuits-ee-symbols} + +There are two symbols for indicating current directions. These symbols +are defined directly inside |circuit ee|. +\medskip + +\noindent +\begin{tabular}{p{5cm}ll} + \emph{Key} & \emph{Appearance}\\[.25em] + \eelineexample{/tikz/current direction}{} + \eelineexample{/tikz/current direction'}{} +\end{tabular} + +\medskip +The examples have been produced by (in essence) +|\draw (0,0) to[|\meta{symbol name}|] (3,0);|. + + +\subsubsection{Symbols: Basic Elements} + +The following table show basic symbols as they are depicted inside the +|circuit ee IEC| environment. To install one of alternate graphics, +you have to say |set| \meta{symbol name} |graphic=var| \meta{symbol name} +|IEC graphic|. +\medskip + +\noindent +\begin{tabular}{p{5cm}ll} + \emph{Key} & \emph{Appearance} & \emph{Alternate appearance} \\[.25em] + \eelineexample{/tikz/resistor}{resistor} + \eelineexample{/tikz/inductor}{inductor} + \eelineexample{/tikz/capacitor}{} + \eelineexample{/tikz/battery}{} + \eelineexample{/tikz/bulb}{} + \eelineexample{/tikz/current source}{} + \eelineexample{/tikz/voltage source}{} + \eeendexample{/tikz/ground}{} +\end{tabular} + + +\subsubsection{Symbols: Diodes} + +The following table shows diodes as they are depicted inside the +|circuit ee IEC| environment. +\medskip + +\noindent +\begin{tabular}{p{5cm}ll} + \emph{Key} & \emph{Appearance} & \emph{Alternate appearance} \\[.25em] + \eelineexample{/tikz/diode}{diode} + \eelineexample{/tikz/Zener diode}{Zener diode} + \eelineexample{/tikz/Schottky diode}{Schottky diode} + \eelineexample{/tikz/tunnel diode}{tunnel diode} + \eelineexample{/tikz/backward diode}{backward diode} + \eelineexample{/tikz/breakdown diode}{breakdown diode} +\end{tabular} + + +\subsubsection{Symbols: Contacts} + +The following table shows contacts as they are depicted inside the +|circuit ee IEC| environment. +\medskip + +\noindent +\begin{tabular}{p{5cm}ll} + \emph{Key} & \emph{Appearance} & \emph{Alternate appearance} \\[.25em] + \eelineexample{/tikz/contact}{} + \eelineexample{/tikz/make contact}{make contact} + \eelineexample{/tikz/break contact}{} +\end{tabular} + + +\subsubsection{Units} + +\label{section-circuits-units} + +The |circuit.ee| library predefines the following unit keys: +\medskip + +\noindent +\begin{tabular}{p{5cm}c} + \emph{Key} & \emph{Appearance of $1$ unit} \\[.25em] + \unitexample{/tikz/ampere} + \unitexample{/tikz/volt} + \unitexample{/tikz/ohm} + \unitexample{/tikz/siemens} + \unitexample{/tikz/henry} + \unitexample{/tikz/farad} + \unitexample{/tikz/coulomb} + \unitexample{/tikz/voltampere} + \unitexample{/tikz/watt} + \unitexample{/tikz/hertz} +\end{tabular} + + + +\subsubsection{Annotations} + +\label{section-circuits-annotations} + +The |circuit.ee.IEC| library defines the following annotations: +\medskip + +\noindent +\begin{tabular}{p{5cm}ll} + \emph{Key} & \emph{Appearance} \\[.25em] + \annotationexample{/tikz/light emitting} + \annotationexample{/tikz/light dependent} + \annotationexample{/tikz/direction info} + \annotationexample{/tikz/adjustable} +\end{tabular} +\medskip + +The lines have been produced using, in essence, +\begin{codeexample}[code only] +\draw (0,0) to [resistor=light emitting] (2,0) to [diode=light emitting'] (4,0); +\end{codeexample} +and similarly for the other annotations. + + +\subsubsection{Implementation: The EE-Symbols Shape Library} + +The \tikzname\ libraries depend on two shape libraries, which are +included automatically. Usually, you will not need to use these shapes +directly. + +\begin{pgflibrary}{shapes.gates.ee} + This library defines basic shapes that can be used by all ee-circuit + libraries. Currently, it defines the following shapes: + \begin{itemize} + \item |rectangle ee| + \item |circle ee| + \item |direction ee| + \end{itemize} + Additionally, the library defines the following arrow tip: + The |direction ee| arrow tip is basically the same as a |triangle 45| + arrow tip with rounded joins. + + \begin{tabular}{ll} + \symarrow{direction ee} + \end{tabular} + + However, unlike normal arrow tips, its size does \emph{not} depend on + the current line width. Rather, it depends on the value of its + arrow options, which should be set to the desired size. Thus, you + should say something like |\pgfsetarrowoptions{direction ee}{5pt}| to + set the size of the arrow. +\end{pgflibrary} + +\begin{shape}{rectangle ee} + This shape is completely identical to a normal |rectangle|, only + there are two additional anchors: The |input| anchor is an alias for + the |west| anchor, while the |output| anchor is an alias for the + |east| anchor. +\end{shape} + +\begin{shape}{circle ee} + Like the |rectangle ee| shape, only for circles. +\end{shape} + +\begin{shape}{direction ee} + This shape is rather special. It is intended to be used to ``turn an + arrow tip into a shape.'' First, you should set the following key to + the name of an arrow tip: + \begin{key}{/pgf/direction ee arrow=\meta{right arrow tip name}} + The value of this key will be used for the arrow tip depicted in + an |direction ee| shape. + \end{key} + When a node of shape |direction ee| is created, several things + happen: + \begin{enumerate} + \item The size of the shape is computed according to the following + rules: The width of the shape is setup so that the left border of + the shape is at the left end of the arrow tip and the right border + is at the right end of the arrow tip. These left and right + ``ends'' of the arrow are the left and right extends specified by + the arrow itself (see the documentation of the |\pgfarrowsdeclare| + for details). You usually need not worry about this width + setting. + + By comparison, the height of the arrow is given my the current + setting of |minimum height|. Thus, this key must have been setup + correctly to reflect the ``real'' height of the arrow tip. The + reason is that the height of an arrow is not specified when arrows + are declared and is, thus, not available, here. + + Possibly, the height computation will change in the future to + reflect the real height of the arrow, so you should generally + setup the |minimum height| to be the same as the real height. + \item A straight line from left to right inside the shape's + boundaries is added to the background path. + \item The arrow tip, pointing right, is drawn before the background + path. + \end{enumerate} + The anchors of this shape are just the compass anchors, which lie on + a rectangle whose width and height are the above-computed height and + width. + +\begin{codeexample}[] +\begin{tikzpicture} + \pgfsetarrowoptions{direction ee}{6cm} + \node[name=s,shape=direction ee,shape example,minimum height=0.7654*6cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} + +\begin{codeexample}[] +\begin{tikzpicture}[direction ee arrow=angle 45] + \node[name=s,shape=direction ee,shape example,minimum height=1.75cm] {}; + \foreach \anchor/\placement in {north/above, south/below, + output/right, input/left} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} + + +\subsubsection{Implementation: The IEC-Style EE-Symbols Shape Library} + +\begin{pgflibrary}{shapes.gates.ee.IEC} + This library defines shapes for depicting ee symbols according to + the IEC recommendations. These shapes will typically be + used in conjunction with the graphic mechanism detailed earlier, but + you can also used them directly. +\end{pgflibrary} + +\begin{shape}{generic circle IEC} + This shape inherits from |circle ee|, which in turn is just a normal + |circle| with additional |input| and |output| anchors at the left + and right ends. However, additionally, this shapes allows you to + specify a path that should be added before the background path using + the following key: + \begin{key}{/pgf/generic circle IEC/before background=\meta{code}} + When a node of shape |generic circle IEC| is created, the current + setting of this key is used as the ``before background path.'' + This means that after the circle's background has been + drawn/filled/whatever, the \meta{code} is executed. + + When the \meta{code} is executed, the coordinate system will have + been transformed in such a way that the point + $(1\mathrm{pt},0\mathrm{pt})$ lies at the right end of the circle + and $(0\mathrm{pt},1\mathrm{pt})$ lies at the top of the + circle. (More precisely, these points will lie exactly on the + middle of the radial line.) + \end{key} + Here is an examples of how to use this shape: +\begin{codeexample}[] +\tikz \node [generic circle IEC, + /pgf/generic circle IEC/before background={ + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1pt}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{1pt}} + \pgfpathlineto{\pgfpoint{-0.5pt}{-0.5pt}} + \pgfusepathqstroke + }, + draw] {Hello world}; +\end{codeexample} +\end{shape} + + +\begin{shape}{generic diode IEC} + This shape is used to depict diodes. The main shape is taken up by a + ``right pointing'' triangle. The anchors are positioned on border of + a rectangle around the diode, see the below example. The + diode's size is based on the current settings of |minimum width| and + |minimum height|. +\begin{codeexample}[] +\begin{tikzpicture} + \node[name=s,shape=generic diode IEC,shape example,minimum size=6cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} + + This shape, like the |generic circle IEC| shape, is generic in the + sense that there is a special key that is used for the before + background drawings: + \begin{key}{/pgf/generic diode IEC/before background=\meta{code}} + Similarly to the |generic circle IEC| shape, when a node of shape + |generic diode IEC| is created, the current setting of this key is + used as the ``before background path.'' + When the \meta{code} is executed, the coordinate system will have + been transformed in such a way that the origin is at the ``tip'' + of the diode's triangle, the point $(0\mathrm{pt},1\mathrm{pt})$ + is exactly half the diode's height above this origin, and + the point $(1\mathrm{pt},0\mathrm{pt})$ is half the diode's height + to the right of the origin. + + The idea is that you use this key to draw different kinds of diode + endings. +\begin{codeexample}[] +\tikz \node [minimum size=1cm,generic diode IEC, + /pgf/generic diode IEC/before background={ + \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}} + \pgfpathlineto{\pgfqpoint{.5pt}{-1pt}} + \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}} + \pgfpathlineto{\pgfqpoint{0pt}{1pt}} + \pgfpathmoveto{\pgfqpoint{-.5pt}{1pt}} + \pgfpathlineto{\pgfqpoint{.5pt}{1pt}} + \pgfusepathqstroke + }, + draw] {}; +\end{codeexample} + \end{key} +\end{shape} + + + +\begin{shape}{breakdown diode IEC} + This shape is used to depict a bidirectional breakdown diode. The + diode's size is based on the current settings of |minimum width| and + |minimum height|. +\begin{codeexample}[] +\begin{tikzpicture} + \node[name=s,shape=breakdown diode IEC,shape example,minimum width=6cm,minimum height=4cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} + +\begin{shape}{var resistor IEC} + This shape is used to depict a variant version of a resistor. Its + size is computed as for a rectangle (thus, its size depends things + like the |minimum height|). Then, inside this rectangle, a + background path is setup according to the following rule: Starting + from the left end, zigzag segments are added to the path. Each + segment consists of a line at a 45 degree angle going up to the top + of the rectangle, then going down to the bottom, then going up to + mid height of the node. As many segments as possible are put inside + as possible. The last segment is then connected to the output anchor + via a straight line. + + All of this means that, in general, the shape should be much wider + than high. +\begin{codeexample}[] +\begin{tikzpicture} + \node[name=s,shape=var resistor IEC,shape example,minimum width=7cm,minimum height=1cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} + + +\begin{shape}{inductor IEC} + This shape is used to depict an inductor, using a bumpy line. Its + size is computed as follows: Any text and |inner sep| are ignored + (and should normally not be given). The |minimum height| plus + (twice) the |outer ysep| specify the distance between the |north| + and |south| anchors, similarly for the |minimum width| plus the + |outer xsep| for the |east| and |west|. + The bumpy line is drawn starting from the lower left corner to the + lower right corner with bumps being half-circles whose height is + exactly the |minimum height|. The |center| of the shape is just + above the |south| anchor, at a distance of the |outer ysep|. +\begin{codeexample}[] +\begin{tikzpicture} + \node[name=s,shape=inductor IEC,shape example,minimum width=7cm,minimum height=1cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} + Just as for a |var resistor IEC|, as many bumps as possible are + added and the last bump is connected to the output anchor via a + straight line. +\end{shape} + +\begin{shape}{capacitor IEC} + This shape is based on a |rectangle ee|. However, instead of a + rectangle as the background path, only the ``left and right lines'' + that make up the rectangle are drawn. +\begin{codeexample}[] +\begin{tikzpicture} + \node[name=s,shape=capacitor IEC,shape example, + minimum width=2cm,minimum height=3cm,inner sep=0pt] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} + +\begin{shape}{battery IEC} + This shape is similar to a |capacitor IEC|, only the right line is + only half the height of the left line. +\begin{codeexample}[] +\tikz \node[shape=battery IEC,shape example,minimum size=2cm, + inner sep=0pt] {}; +\end{codeexample} +\end{shape} + +\begin{shape}{ground IEC} + This shape is similar to a |batter IEC|, only three lines of + different heights are drawn. +\begin{codeexample}[] +\tikz \node[shape=ground IEC,shape example,minimum size=2cm, + inner sep=0pt] {}; +\end{codeexample} +\end{shape} + +\begin{shape}{make contact IEC} + This shape consists of a line going from the lower left corner to + the upper right corner. The size and anchors of this shape are + computed in the same way as for an |inductor IEC|. +\begin{codeexample}[] +\begin{tikzpicture} + \node[name=s,shape=make contact IEC,shape example,minimum width=3cm,minimum height=1cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} + +\begin{shape}{var make contact IEC} + This shape works like |make contact IEC|, only a little circle is + added to the path at the lower left corner. The radius of this + circle is one twelfth of the width of the node. +\begin{codeexample}[] +\tikz \node[shape=var make contact IEC,shape example, + minimum height=1cm,minimum width=3cm,inner sep=0pt] {}; +\end{codeexample} +\end{shape} + +\begin{shape}{break contact IEC} + This shape depicts a contact that can be broken. It works like + |make contact IEC|. +\begin{codeexample}[] +\tikz \node[shape=break contact IEC,shape example, + minimum height=1cm,minimum width=3cm,inner sep=0pt] {}; +\end{codeexample} +\end{shape} + +\endinput diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex index eeef79c6ee8..bb0e6cadad9 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex @@ -16,11 +16,11 @@ The decoration libraries define a number of (more or less useful) decorations that can be applied to paths. The usage of decorations is -not covered in the present section, please consult +not covered in the present section, please consult Sections~\ref{section-tikz-decorations}, which explains how decorations are used in \tikzname, and \ref{section-base-decorations}, which explains how new -decorations can be defined. +decorations can be defined. The decorations are influenced by a number of parameters that can be set using the |decoration| option. These parameters are @@ -35,32 +35,32 @@ is stored (so that you can access it). Note that some values are stored in \TeX\ dimension registers while others are stored in macros. \begin{key}{/pgf/decoration/amplitude=\meta{dimension} (initially 2.5pt)} - This key determines the ``desired height'' (or amplitude) of + This key determines the ``desired height'' (or amplitude) of decorations for which this makes sense. For instance, the initial value of |2.5pt| means that deforming decorations should deform a path by up to 2.5pt away from the original path. - This key set the \TeX-dimension |\pgfdecorationsegmentamplitude|. + This key set the \TeX-dimension |\pgfdecorationsegmentamplitude|. \end{key} \begin{key}{/pgf/decoration/meta-amplitude=\meta{dimension} (initially 2.5pt)} - This key determines the amplitude for a meta-decoration. + This key determines the amplitude for a meta-decoration. The key set the \TeX-macro (!) |\pgfmetadecorationsegmentamplitude|. \end{key} \begin{key}{/pgf/decoration/segment length=\meta{dimension} (initially 10pt)} Many decorations are made up of small segments. This key determines - the desired length of such segments. + the desired length of such segments. - This key set the \TeX-dimension |\pgfdecorationsegmentlength|. + This key set the \TeX-dimension |\pgfdecorationsegmentlength|. \end{key} \begin{key}{/pgf/decoration/meta-segment length=\meta{dimension} (initially 1cm)} This determined the length of the meta-segments from which a meta-decoration is made up. - This key set the \TeX-macro (!) |\pgfmetadecorationsegmentlength|. + This key set the \TeX-macro (!) |\pgfmetadecorationsegmentlength|. \end{key} \begin{key}{/pgf/decoration/angle=\meta{degree} (initially 45)} @@ -68,7 +68,7 @@ stored in \TeX\ dimension registers while others are stored in macros. instance, a |wave| decoration consists of arcs and the opening angle of these arcs is given by the |angle|. - This key set the \TeX-macro |\pgfdecorationsegmentangle|. + This key set the \TeX-macro |\pgfdecorationsegmentangle|. \end{key} \begin{key}{/pgf/decoration/aspect=\meta{factor} (initially 0.5)} @@ -76,7 +76,7 @@ stored in \TeX\ dimension registers while others are stored in macros. for a |brace| decoration the aspect ratio determines where the brace point will be. - This key set the \TeX-macro |\pgfdecorationsegmentaspect|. + This key set the \TeX-macro |\pgfdecorationsegmentaspect|. \end{key} \begin{key}{/pgf/decoration/start radius=\meta{dimension} (initially 2.5pt)} @@ -100,7 +100,7 @@ stored in \TeX\ dimension registers while others are stored in macros. This is a hint to the decoration code as to whether the path has corners or not. If a path has a sharp corner, setting this option to |true| may result in better rendering of the decoration because the - joins of input segements are approached ``more carefully'' than + joins of input segments are approached ``more carefully'' than when this key is set to false. However, if the path is, say, a smooth circle, setting this key to |true| will usually look worse. Most decorations ignore this key, anyway. Internally, it sets @@ -118,7 +118,7 @@ stored in \TeX\ dimension registers while others are stored in macros. change the number of subpaths. For instance, if the path used to consist of two circles and an open arc, the path will after the decoration process still consist of two closed subpath and one open - subpath. + subpath. \end{pgflibrary} @@ -146,13 +146,13 @@ the paths. \begin{decoration}{straight zigzag} - This (meta-)decoration decorates the path by alternating between + This (meta-)decoration decorates the path by alternating between |curveto| and |zigzag| decorations. It always finishes with the |curveto| decoration. The following parameters influence the decoration: \begin{itemize} \item |amplitude| - determines how much the zig-zag lines raises above and falls below + determines how much the zigzag lines raises above and falls below a straight line to the target point. \item |segment length| determines the length of a complete ``up-down'' cycle. @@ -213,11 +213,11 @@ the paths. \begin{decoration}{zigzag} - This decoration looks like a zig-zag line. The following parameters + This decoration looks like a zigzag line. The following parameters influence the decoration: \begin{itemize} \item |amplitude| - determines how much the zig-zag lines raises above and falls below + determines how much the zigzag lines raises above and falls below a straight line to the target point. \item |segment length| determines the length of a complete ``up-down'' cycle. @@ -238,12 +238,12 @@ the paths. \begin{decoration}{bent} This decoration adds a slightly bent line from the start to the target. The amplitude of the bent is given |amplitude| - (an amplitude of zero gives a straight line). + (an amplitude of zero gives a straight line). \begin{itemize} \item |amplitude| determines the amplitude of the bent. \item |aspect| - determines how tight the bent is. A good value is around |0.3|. + determines how tight the bent is. A good value is around |0.3|. \end{itemize} Note that this decoration makes only little sense for curves. You should apply it only to straight lines. @@ -267,7 +267,7 @@ the paths. \begin{decoration}{bumps} This decoration replaces the path by little half ellipses. The - following parameters influence itL + following parameters influence it. \begin{itemize} \item |amplitude| determines the height of the half ellipse. @@ -290,7 +290,7 @@ the paths. the path toward the target. Then, we ``view'' the spring from a certain angle. If we look ``straight from the side'' we will see a perfect sine curve, if we look ``more from the front'' we will see a - coil. The following parameters influence the decoration: + coil. The following parameters influence the decoration: \begin{itemize} \item |amplitude| determines how much the coil rises above the path and falls below @@ -298,11 +298,11 @@ the paths. \item |segment length| determines the distance between two consecutive ``curls.'' Thus, when the spring is see ``from the side'' this will be the wave - length of the sine curve. + length of the sine curve. \item |aspect| determines the ``viewing direction.'' A value of |0| means ``looking from the side'' and a value of |0.5|, which is the - default, means ``look more from the front.'' + default, means ``look more from the front.'' \end{itemize} \begin{codeexample}[] \begin{tikzpicture}[decoration=coil] @@ -350,7 +350,7 @@ the paths. This decoration replaces the path by a line that looks like a snake seen from above. More precisely, the snake is a sine wave with a ``softened'' start and ending. The following parameters influence - the snake: + the snake: \begin{itemize} \item |amplitude| determines the sine wave's amplitude. @@ -368,7 +368,7 @@ the paths. - + \subsection{Path Replacing Decorations} \begin{pgflibrary}{decorations.pathreplacing} @@ -385,14 +385,14 @@ the paths. This decoration adds straight lines the path that are at a specific angle to the line toward the target. The idea is to add these little lines to indicate the ``border'' or an area. The following - parameters influence the decoration: + parameters influence the decoration: \begin{itemize} \item |segment length| determines the distance between consecutive ticks. \item |amplitude| determines the length of the ticks. \item |angle| - determines the angle between the ticks and the line of the path. + determines the angle between the ticks and the line of the path. \end{itemize} \begin{codeexample}[] \begin{tikzpicture}[decoration=border] @@ -414,7 +414,7 @@ the paths. determines how much the brace rises above the path. \item |aspect| determines the fraction of the total length where the ``middle - part'' of the brace will be. + part'' of the brace will be. \end{itemize} \begin{codeexample}[] \begin{tikzpicture}[decoration=brace] @@ -445,10 +445,20 @@ the paths. \end{decoration} +\begin{decoration}{moveto} + This decoration simply jumps to the end of the path using a move-to + path operation. It is mainly useful as |pre=moveto| or |post=moveto| + decorations. + + This decoration is actually always defined when the decoration + module is loaded, but it is documented here for consistency. +\end{decoration} + + \begin{decoration}{ticks} This decoration replaces the path by straight lines that are orthogonal to the path. The following parameters influence the - decoration: + decoration: \begin{itemize} \item |segment length| determines the distance between consecutive ticks. @@ -467,7 +477,7 @@ the paths. \begin{decoration}{waves} This decoration replaces the path by arcs that have a constant - size. The following parameters influence the decoration: + size. The following parameters influence the decoration: \begin{itemize} \item |segment length| determines the distance between consecutive arcs. @@ -488,13 +498,548 @@ the paths. -\subsection{Decorations with Shapes} +\begin{decoration}{show path construction} + This decoration allows ``something different'' to be done + for each \emph{type} of input segment (i.e., moveto, lineto, + curveto or closepath). Typically, each segment will be replaced + with another path, but this need not necessarily be the case. + +\begin{codeexample}[] +\begin{tikzpicture}[>=stealth, every node/.style={midway, sloped, font=\tiny}, + decoration={show path construction, + moveto code={ + \fill [red] (\tikzinputsegmentfirst) circle (2pt) + node [fill=none, below] {moveto};}, + lineto code={ + \draw [blue,->] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) + node [above] {lineto}; + }, + curveto code={ + \draw [green!75!black,->] (\tikzinputsegmentfirst) .. controls + (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) + ..(\tikzinputsegmentlast) node [above] {curveto}; + }, + closepath code={ + \draw [orange,->] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) + node [above] {closepath};} + }] + \draw [help lines] grid (3,2); + \path [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\end{codeexample} + + + The following keys can be used to specify the code to execute + for each type of input segment. + +\begin{key}{/pgf/decoration/moveto code=\meta{code} (initially \char`\{\char`\})} + Set the code to be executed for every moveto input segment. + It is important to remember that the transformations applied + by the decoration automaton are turned \emph{off} when \meta{code} + is executed. +\end{key} + +\begin{key}{/pgf/decoration/lineto code=\meta{code} (initially \char`\{\char`\})} + Set the code to be executed for every lineto input segment. +\end{key} + +\begin{key}{/pgf/decoration/curveto code=\meta{code} (initially \char`\{\char`\})} + Set the code to be executed for every curveto input segment. +\end{key} + +\begin{key}{/pgf/decoration/closepath code=\meta{code} (initially \char`\{\char`\})} + Set the code to be executed for every closepath input segment. +\end{key} + +Within \meta{code} the first and last +points on the current input segment can be accessed using +|\pgfpointdecoratedinputsegmentfirst| and +|\pgfpointdecoratedinputsegmentlast|. For curves, the +control (support) points can be accessed using +|\pgfpointdecoratedinputsegmentsupporta| and +|\pgfpointdecoratedinputsegmentsupportb|. + +In \tikzname, you can use the following macros +inside a \tikzname{} coordinate. + +\begin{command}{\tikzinputsegmentfirst} + The first point on the current input segment path. +\end{command} + +\begin{command}{\tikzinputsegmentlast} + The last point on the current input segment path. +\end{command} + +\begin{command}{\tikzinputsegmentsupporta} + The first support on the curveto input segment path. +\end{command} + +\begin{command}{\tikzinputsegmentsupportb} + The second support on the curveto input segment path. +\end{command} + +{\tikzexternaldisable +\begin{codeexample}[] +\tikzset{ + show curve controls/.style={ + decoration={ + show path construction, + curveto code={ + \draw [blue, dashed] + (\tikzinputsegmentfirst) -- (\tikzinputsegmentsupporta) + node [at end, cross out, draw, solid, red, inner sep=2pt]{}; + \draw [blue, dashed] + (\tikzinputsegmentsupportb) -- (\tikzinputsegmentlast) + node [at start, cross out, draw, solid, red, inner sep=2pt]{}; + } + },decorate + } +} + +\tikzpicture + \draw [postaction=show curve controls, thick] + (0,2) .. controls (2.5,1.5) and (0.5,0.5) .. (3,0); +\endtikzpicture +\end{codeexample} +}% +\end{decoration} + + + + +\subsection{Marking Decorations} + +\subsubsection{Overview} + +A \emph{marking on a path} is any kind of graphic that is placed on a +specific position on a path. Markings are useful in rather diverse +situations: you can use them to, say, place little ``footsteps'' along +a path as if someone where walking along the path; to place arrow tips +on the middle of a path to indicate the ``direction'' in which +something is flowing; or you can use them to place informative +information at certain positions of a path. + +For historical reasons there are three different libraries for placing +marks on a path. They differ in what kind of markings can be added to +a path. We start with the most general and most useful of these libraries. + + + +\subsection{Arbitrary Markings} + +\begin{pgflibrary}{decorations.markings} + Markings are arbitrary ``marks'' that can be put on a path. Marks + can be arrow tips or nodes or even whole pictures. +\end{pgflibrary} + +\begin{decoration}{markings} + A \emph{marking} can be thought of a ``little picture'' or more + precisely of ``some scope contents'' that is placed ``on'' a path at + a certain position. Suppose the marking should be a simple cross. We + can produce this with the following code: +\begin{codeexample}[code only] +\draw (-2pt,-2pt) -- (2pt,2pt); +\draw (2pt,-2pt) -- (-2pt,2pt); +\end{codeexample} + If we use this code as a marking at position |2cm| on a path, then + the following happens: \pgfname\ determines the position on the path + that is 2cm along the path. Then is translates the coordinate system + to this position and rotates it such that the positive $x$-axis is + tangent to the path. Then a protective scope is created, inside + which the above code is executed -- resulting in a little cross on + the path. + + The |markings| decoration allows you to place one or more such + markings on a path. The decoration destroys the input path (except + in certain cases, detailed later), which means that it uses the path + for determining positions on the path, but after the decoration is + done this path is gone. You typically need to use a |postaction| to + add markings. + + Let us start with the above example in real code: +\begin{codeexample}[] +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=% actually add a mark + at position 2cm + with + { + \draw (-2pt,-2pt) -- (2pt,2pt); + \draw (2pt,-2pt) -- (-2pt,2pt); + } + } + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\end{codeexample} + + We can also add the cross repeatedly: +\begin{codeexample}[] +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=% actually add a mark + between positions 0 and 1 step 5mm + with + { + \draw (-2pt,-2pt) -- (2pt,2pt); + \draw (2pt,-2pt) -- (-2pt,2pt); + } + } + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\end{codeexample} + + The |mark| decoration option is used to specify a marking. It comes + in two version: + \begin{key}{/pgf/decoration/mark=|at position| + \meta{pos}| with |\meta{code}} + The options specifies that when a |marking| decoration is applied, + there should be a marking at position \meta{pos} on the path whose + code is given by \meta{code}. + + The \meta{pos} can have four different forms: + \begin{enumerate} + \item It can be a non-negative dimension like |0pt| or |2cm| or + |5cm/2|. In this case, it refers to the position along the path + that is this far removed from the start. + \item It can be a negative dimension like |-1cm-2pt| or |-1sp|. In + this case, the position is taken from the end of the path. Thus, + |-1cm| is the position that is $-1$cm removed from the end of + the path. + \item It can be a dimensionless non-negative number like |1/2| or + |0.333+2*0.1|. In this case, the \meta{pos} is interpreted as a + factor of the total path length. Thus, a \meta{pos} or |0.5| + refers to the middle of the path, |0.1| is near the start, and + so on. + \item It can be a dimensionless negative number like |-0.1|. Then, + again, the fraction of the path length counts ``from the end.'' + \end{enumerate} + + The \meta{pos} determines a position on the path. When the marking + is applied, the (high level) coordinate system will have been + transformed so that the origin lies at this position and the + positive $x$-axis points along the path. For this coordinate + system, the \meta{code} is executed. It can contains all sorts of + graphic drawing commands, including (even named) nodes. + + If the position lies past the end of the path (for + instance if \meta{pos} is set to |1.2|), the marking will not be + drawn. + + It is possible to give the |mark| option several times, which + causes several markings to be applied. In this case, however, it + is necessary that the positions on the path are in increasing + order. That is, it is not allowed (and will result in chaos) to + have a marking that lies earlier on the path to follow a marking + that is later on the path. + +\begin{codeexample}[] +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=at position 1cm with \node[red]{1cm};, + mark=at position .5 with \node[green]{mid};, + mark=at position -1cm with {\node[blue,transform shape]{1cm from end};}} + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\end{codeexample} + + Here is an example that shows how markings can be used to place text + on plots: +\begin{codeexample}[] +\begin{tikzpicture}[domain=0:4,label/.style={postaction={ + decorate, + decoration={ + markings, + mark=at position .75 with \node #1;}}}] + \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); + + \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; + \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$}; + + \draw[red,label={[above left]{$f(x)=x$}}] plot (\x,\x); + \draw[blue,label={[below left]{$f(x)=\sin x$}}] plot (\x,{sin(\x r)}); + \draw[orange,label={[right]{$f(x)= \frac{1}{20} \mathrm e^x$}}] plot (\x,{0.05*exp(\x)}); +\end{tikzpicture} +\end{codeexample} + + When the \meta{code} is begin executed, two special keys will have + been setup, whose value may be of interest: + \begin{key}{/pgf/decoration/mark info/sequence number} + This key can only be read. Its value (which can be obtained + using the |\pgfkeysvalueof| command) is a ``sequence number'' of + the mark. The first mark that is added to a path has number |1|, + the second number |2|, and so on. This key is mainly useful in + conjunction with repeated markings (see below). + \end{key} + \begin{key}{/pgf/decoration/mark info/distance from start} + This key can only be read. Its value is the distance of the + marking from the start of the path in points. For instance, if + the path length is 100pt and the marking is in the middle of the + path, the value of this key would be |50.0pt|. + \end{key} + \end{key} + + A second way to use the |mark| key is the following: + \begin{key}{/pgf/decoration/mark=|between positions| + \meta{start pos} |and| \meta{end pos} |step| \meta{stepping} + |with| \meta{code}} + This works similarly to the |at position| version of this option, + only multiple marks are placed, starting at \meta{start pos} and + then spaced apart by \meta{stepping}. The \meta{start pos}, the + \meta{end pos}, and also the \meta{stepping} may all be specified + in the same way as for the |at position| version, that is, either + using units or no units and also using positive or negative + values. + + Let us start with a simple example in which we place ten crosses + along a path starting with the beginning of the + path ($\meta{start pos} = 0$) and ending at the end ($\meta{end + pos} = 1$). +\begin{codeexample}[] +\begin{tikzpicture}[decoration={markings, + mark=between positions 0 and 1 step 0.1 + with { \draw (-2pt,-2pt) -- (2pt,2pt); + \draw (2pt,-2pt) -- (-2pt,2pt); }} ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\end{codeexample} + + In the next example we place arrow shapes on the path instead of + crosses. Note the use of the |transform shape| option to ensure + that the nodes are actually rotated. +\begin{codeexample}[] +\begin{tikzpicture}[decoration={markings, + mark=between positions 0 and 1 step 1cm + with { \node [single arrow,fill=red, + single arrow head extend=3pt,transform shape] {};}}] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\end{codeexample} + + Using the key |sequence number| we can also ``number'' the nodes + and even refer to them later on. +\begin{codeexample}[] +\begin{tikzpicture}[decoration={markings, + mark=between positions 0 and 1 step 1cm with { + \node [draw, + name=mark-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}, + transform shape] + {\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}};}}] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); + \draw [red,->] (mark-3) -- (mark-7); +\end{tikzpicture} +\end{codeexample} + + In the following example we use the distance info to place + ``length information'' on a path: +\begin{codeexample}[] +\begin{tikzpicture}[decoration={markings, + % Main marks + mark=between positions 0 and 1 step 40pt with + { \draw [help lines] (0,0) -- (0,0.5) + node[above,font=\tiny]{ + \pgfkeysvalueof{/pgf/decoration/mark info/distance from start}}; }, + mark=at position -0.1pt with + { \draw [help lines] (0,0) -- (0,0.5) + node[above,font=\tiny]{ + \pgfkeysvalueof{/pgf/decoration/mark info/distance from start}}; }}] + \draw [help lines] grid (5,3); + \draw [postaction={decorate}] (0,0) .. controls (8,3) and (0,3) .. (5,0) ; +\end{tikzpicture} +\end{codeexample} + \end{key} + + \begin{key}{/pgf/decoration/reset marks} + Since |mark| options accumulate, there needs to be a way to + ``reset'' things, so that any |mark| options set in an enclosing + scope do not interfere. This option does exactly this. Note that + when the \meta{code} of a marking is executed, the markings are + automatically reset. + \end{key} + + As mentioned earlier, the decoration usually destroys the + path. However, this is no longer the case when the following key is + set: + \begin{key}{/pgf/decoration/mark connection node=\meta{node name} (initially empty)} + When this key is set to a nonempty \meta{node name} while the + decoration is being processed, the following happens: The marking + code should, among possibly other things, define node named + \meta{node name}. Then, the output path of this decoration will + contain a line-to to ``one end'' of this node, followed by a + moveto to the ``other end'' of the node. More precisely, the first + end is given by the position on the border of \meta{node name} + that lies in the direction ``from which the path heads toward the + node'' while the other end lies on the border ``where the path + heads away from the node.'' Furthermore, this option causes the + decoration to end with a line-to to the end instead of a move-to. + + The net effect of all this is that when you decorate a straight + line with one or more markings that contain just a node, the line + will effectively connect these nodes. + + Here are two examples that show how this works: +\begin{codeexample}[] +\begin{tikzpicture}[decoration={markings, + mark connection node=my node, + mark=at position .5 with + {\node [draw,blue,transform shape] (my node) {my node};}}] + \draw [help lines] grid (3,2); + \draw decorate { (0,0) -- (3,2) }; +\end{tikzpicture} +\end{codeexample} + +\begin{codeexample}[] +\begin{tikzpicture}[decoration={markings, + mark connection node=my node, + mark=at position .25 with + {\node [draw,red] (my node) {my node};}}] + \draw [help lines] grid (3,2); + \draw decorate { (0,0) -- (3,2) }; +\end{tikzpicture} +\end{codeexample} + + \end{key} +\end{decoration} + + +\subsubsection{Arrow Tip Markings} + +Frequent markings that are hard to create correctly are arrow +tips. For them, two special commands are available when the \meta{code} of +a |mark| option is execute. (They are only defined in this code): + +\begin{command}{\arrow\opt{\oarg{options}}\marg{arrow end tip}} + This command simply draws the \meta{arrow end tip} at the origin, + pointing right. This is exactly what you need when you want to + draw an arrow tip as a marking. + + The \meta{options} can only be given when \tikzname\ is used. In + this case, they are executed in a scope that contains the arrow + tip. +\begin{codeexample}[] +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=at position 1cm with {\node[red]{1cm};}, + mark=at position .75 with {\arrow[blue,line width=2mm]{>}}, + mark=at position -1cm with {\arrowreversed[black]{stealth};}} + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\end{codeexample} + + Here is a more useful example: +\begin{codeexample}[] +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=between positions 0 and .75 step 4mm with {\arrow{stealth}}, + mark=between positions .75 and 1 step 4mm with {\arrowreversed{stealth}}} + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\end{codeexample} +\end{command} + +\begin{command}{\arrowreversed\opt{\oarg{options}}\marg{arrow end tip}} + As above, only the arrow end tip is flipped and points in the + other direction. +\end{command} + + +\subsubsection{Footprint Markings} + +\begin{pgflibrary}{decorations.footprints} + The decorations of this library can be used to decorate a path with + little footprints, as if someone had ``walked'' along the path. +\end{pgflibrary} + +\begin{decoration}{footprints} + The footprint decoration adds little footprints around the + path. They start with the left foot. +\begin{codeexample}[] +\begin{tikzpicture}[decoration={footprints,foot length=5pt,stride length=10pt}] + \draw [help lines] grid (3,3); + \fill [decorate] (0,0) -- (3,2) arc (0:180:1.5 and 1); +\end{tikzpicture} +\end{codeexample} + You can influence the way this decoration looks using the following + options: + \begin{key}{/pgf/decoration/foot length (initially 10pt)} + The length or size of the footprint itself. A larger value makes + the footprint larger, but does not change the stride length. +\begin{codeexample}[] +\begin{tikzpicture}[decoration={footprints,foot length=20pt}] + \fill [decorate] (0,0) -- (3,0); +\end{tikzpicture} +\end{codeexample} + \end{key} + \begin{key}{/pgf/decoration/stride length (initially 30pt)} + The length of strides. This is the distance between the beginnings + of left footprints along the path. +\begin{codeexample}[] +\begin{tikzpicture}[decoration={footprints,stride length=50pt}] + \fill [decorate] (0,0) -- (3,0); +\end{tikzpicture} +\end{codeexample} + \end{key} + \begin{key}{/pgf/decoration/foot sep (initially 4pt)} + The separation in the middle between the footprints. The + footprints are moved away from the path by half this amount. +\begin{codeexample}[] +\begin{tikzpicture}[decoration={footprints,foot sep=10pt}] + \fill [decorate] (0,0) -- (3,0); +\end{tikzpicture} +\end{codeexample} + \end{key} + \begin{key}{/pgf/decoration/foot angle (initially 10)} + Footprints are rotate by this much. +\begin{codeexample}[] +\begin{tikzpicture}[decoration={footprints,foot angle=60}] + \fill [decorate] (0,0) -- (3,0); +\end{tikzpicture} +\end{codeexample} + \end{key} + \begin{key}{/pgf/decoration/foot of (initially human)} + The species whose footprints are shown. Possible values are: + + \def\render#1{ + \texttt{#1} & + \tikz [baseline,decoration={footprints,foot of=#1}] + \fill [decorate] (0,0) -- (6,0); \\[3em] + } + \begin{tabular}{ll} + \emph{Species} & \emph{Result} \\[1em] + \render{gnome} + \render{human} + \render{bird} + \render{felis silvestris} + \end{tabular} + \end{key} +\end{decoration} + + + + +\subsubsection{Shape Background Markings} + +The third library for adding markings uses the background paths of +certain shapes. This library is included mostly for historical +reasons, using the |markings| library is usually preferable. \begin{pgflibrary}{decorations.shapes} This library defines decorations that use shapes or shape-like drawings to decorate a path. The following options are common options used by the decorations in this library: - + \begin{key}{/pgf/decoration/shape width=\meta{dimension} (initially 2.5pt)} The desired width of the shapes. For decorations that support varying shape sizes, this key sets both the start and end width @@ -517,7 +1062,7 @@ the paths. \begin{decoration}{crosses} This decoration replaces the path by (diagonal) crosses. The - following parameters influence the decoration: + following parameters influence the decoration: \begin{itemize} \item |segment length| determines the distance between (the centers of) consecutive crosses. @@ -536,7 +1081,7 @@ the paths. \begin{decoration}{triangles} This decoration replaces the path by triangles that point along the - path. The following parameters influence the decoration: + path. The following parameters influence the decoration: \begin{itemize} \item |segment length| determines the distance between consecutive triangles. @@ -555,15 +1100,19 @@ the paths. \end{decoration} - \begin{decoration}{shape backgrounds} This is a general decoration that replaces the to-be-decorated path by repeated copies of the background path of an arbitrary shape that has previously defined using the |\pgfdeclareshape| command (that is, - you can use any shape in the shape libraries). Please note that the - background path of the shapes is used, but \emph{no nodes are - created}. You cannot have text inside the shapes of this path, you - cannot name them, or refer to them. + you can use any shape in the shape libraries). + + Please note that the background path of the shapes is used, but + \emph{no nodes are created}. This means that \emph{you cannot have + text inside the shapes of this path, you cannot name them, or + refer to them.} Finally, this decoration \emph{will not work with + shapes that depend strongly of the size of the text box (like the + arrow shapes).} If any of these restrictions pose a problem, use + the |markings| library instead. \begin{codeexample}[] \begin{tikzpicture}[decoration={shape backgrounds,shape=star,shape size=5pt}] @@ -593,7 +1142,7 @@ the paths. A shape background path is added at the start point of the path and, if the distance between the shapes is appropriate, at the end point - of the path. + of the path. \begin{codeexample}[] \begin{tikzpicture}[decoration={ @@ -605,7 +1154,7 @@ the paths. \end{tikzpicture} \end{codeexample} - Keys for cusomizing specific shapes can be specified (e.g., + Keys for customizing specific shapes can be specified (e.g., |star points|, |cloud puffs|, |kite angles|, and so on). The size of the shape is ``enforced'' using transformations. This means that the shape is typeset with an empty text box and some default size @@ -616,7 +1165,7 @@ the paths. entirely accurate. More general options such as |inner sep| and |minimum size| will be ignored, but transformations can be applied to each segment as described below. - + \begin{codeexample}[] \tikzset{ paint/.style={draw=#1!50!black, fill=#1!50}, @@ -631,17 +1180,17 @@ the paths. \end{codeexample} There are various keys to control the drawing of the shape - decoration. - + decoration. + \begin{key}{/pgf/decoration/shape=\meta{shape name} (initially circle)} The shape whose background path is used. \end{key} - - \begin{key}{/pgf/decorations/shape sep=\meta{spacing} (initially {.25cm, between centers})} - Set the spacing between the shapes on the decorationd path. This can be - just a distance on its own, but the additional keywords - |between centers|, and |between borders| (which must be preceded by a - comma), specify that the distance is between the center anchors of + + \begin{key}{/pgf/decoration/shape sep=\meta{spacing} (initially {.25cm, between centers})} + Set the spacing between the shapes on the decorations path. This can be + just a distance on its own, but the additional keywords + |between centers|, and |between borders| (which must be preceded by a + comma), specify that the distance is between the center anchors of the shapes or between the edges of the \emph{boundaries} of the shape borders. @@ -660,19 +1209,19 @@ the paths. \end{tikzpicture} \end{codeexample} \end{key} - + \begin{key}{/pgf/decoration/shape evenly spread=\meta{number}} - This key overides the |shape sep| key and forces the decoration to - fit \meta{number} shapes evenly across the path. - If \meta{number} is less than |1|, then no shapes will be used. - If \meta{number} equals |1|, then one shape is put in the middle - of the path. + This key overrides the |shape sep| key and forces the decoration to + fit \meta{number} shapes evenly across the path. + If \meta{number} is less than |1|, then no shapes will be used. + If \meta{number} equals |1|, then one shape is put in the middle + of the path. The additional keywords |by centers| (the default, if no keyword is - specified) and |by borders| can be used (both preceded by a comma), + specified) and |by borders| can be used (both preceded by a comma), to specify how the distance between shapes is determined. These - keywords will only have a noticable effect if the shapes sizes + keywords will only have a noticeable effect if the shapes sizes differ over time. - + \begin{codeexample}[] \tikzset{ paint/.style={draw=#1!50!black, fill=#1!50}, @@ -684,7 +1233,7 @@ the paths. \fill [paint=green,spreading={5, by borders}, decoration={shape scaled}] (0,2) -- (3,2); \fill [paint=blue,spreading={5, by centers}, - decoration={shape scaled}] (0,1.5) -- (3,1.5); + decoration={shape scaled}] (0,1.5) -- (3,1.5); \fill [paint=red, spreading=5] (0,1) -- (3,1); \fill [paint=orange, spreading=4] (0,.5) -- (3,.5); \fill [paint=gray, spreading=1] (0,0) -- (3,0); @@ -693,8 +1242,8 @@ the paths. \end{key} \begin{key}{/pgf/decoration/shape sloped=\opt{\meta{boolean}} (initially true)} - By default, shapes are rotated to the slope of the decorationd path. If - \meta{boolean} is the value |false|, then this rotation is turned + By default, shapes are rotated to the slope of the decorations path. If + \meta{boolean} is the value |false|, then this rotation is turned off. Internally this sets the \TeX-if |\ifpgfshapedecorationsloped| appropriately. @@ -705,7 +1254,7 @@ the paths. \begin{tikzpicture}[decoration={ shape width=.65cm, shape height=.45cm, shape=isosceles triangle, shape sep=.75cm, - shape backgrounds}] + shape backgrounds}] \draw [help lines] grid (3,2); \draw [paint=red,decorate] (0,0) -- (2,2); \draw [paint=blue,decorate,decoration={shape sloped=false}] @@ -715,7 +1264,7 @@ the paths. \end{key}% It is possible to scale the width and height of the shapes across the - length of the decorationd path. The shapes are scaled between the starting + length of the decorations path. The shapes are scaled between the starting size and the ending size. The following keys customize the way the decoration shapes are scaled: @@ -746,9 +1295,9 @@ the paths. \begin{key}{/pgf/decoration/shape start height=\meta{length} (initially 2.5pt)} The starting height of the shape. \end{key}% - + \begin{stylekey}{/pgf/decoration/shape start size=\meta{length}} - Set both the the start height and start width simultaneously. + Set both the start height and start width simultaneously. \end{stylekey}% \begin{key}{/pgf/decoration/shape end width=\meta{length} (initially 2.5pt)} @@ -757,7 +1306,7 @@ the paths. of the path. -\begin{codeexample}[] +\begin{codeexample}[] \tikzset{ bigger/.style={decoration={shape start size=.25cm, shape end size=1cm}}, smaller/.style={decoration={shape start size=1cm, shape end size=.25cm}}, @@ -767,13 +1316,13 @@ the paths. \begin{tikzpicture} \draw [help lines] grid (3,2); \fill [decorate,bigger, - decoration={shape sep={.25cm, between borders}}, blue!50] + decoration={shape sep={.25cm, between borders}}, blue!50] (0,1.5) -- (3,1.5); \fill [decorate,smaller, - decoration={shape sep={1cm, between centers}}, red!50] + decoration={shape sep={1cm, between centers}}, red!50] (0,.5) -- (3,.5); - \draw [gray, dotted] (0,1.625) -- (3,2) (0,1.375) -- (3,1) - (0,1) -- (3,.625) (0,0) -- (3,.375); + \draw [gray, dotted] (0,1.625) -- (3,2) (0,1.375) -- (3,1) + (0,1) -- (3,.625) (0,0) -- (3,.375); \end{tikzpicture} \end{codeexample} \end{key}% @@ -783,7 +1332,7 @@ the paths. \end{key}% \begin{stylekey}{/pgf/decoration/shape end size=\meta{length}} - Set both the the end height and end width simultaneously. + Set both the end height and end width simultaneously. \end{stylekey} \end{decoration} @@ -795,7 +1344,7 @@ the paths. \begin{pgflibrary}{decorations.text} The decoration in this library decorates the path with some - text. This can be used to draw text that follows a curve. + text. This can be used to draw text that follows a curve. \end{pgflibrary} \begin{decoration}{text along path} @@ -808,7 +1357,7 @@ the paths. \begin{codeexample}[] \catcode`\|12 \begin{tikzpicture}[decoration={text along path, - text={Some long text along a ridiculously long curve that}}] + text={Some long text along a ridiculously long curve that}}] \draw [help lines] grid (3,2); \draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1); \end{tikzpicture} @@ -820,44 +1369,44 @@ the paths. \item Each character in the text is typeset in a separate |\hbox|. This means that if you want fancy things like kerning or ligatures you - will have to manually annotate the characters in the decoration - text within a group, for example, |W{\kern-1ptA}TER|. + will have to manually annotate the characters in the decoration + text within a group, for example, |W{\kern-1ptA}TER|. \item Each character is positioned using the center of its baseline. To - move the text vertcally (relative to the path), the additional + move the text vertically (relative to the path), the additional transform key should be used. \item No attempt is made to ensure characters do not overlap when the angle between segments is considerably less than 180\textdegree{} (this is tricky to do in \TeX{} without a huge processing - overhead). In general this should not be too much of a problem, - but, once again, kerning can be used in most cases to overcome + overhead). In general this should not be too much of a problem, + but, once again, kerning can be used in most cases to overcome any undesirable effects. \item It is only possible to typeset text in math mode under considerable restrictions. Math mode is entered and exited using any character of category code 3 (e.g., in plain \TeX{} this is |$|). %$ - Math subscripts and superscripts need to be contained within braces - (e.g., |{^y_i}|) as do commands like |\times| or |\cdot|. - However, even modestly complex mathematical typesetting is unlikely - to be sucessful along a path (or even desirable). + Math subscripts and superscripts need to be contained within braces + (e.g., |{^y_i}|) as do commands like |\times| or |\cdot|. + However, even modestly complex mathematical typesetting is unlikely + to be successful along a path (or even desirable). \item Some inaccuracies in positioning may be particularly apparent - at input segment boundaries. This can (unfortunately) only be solved - on case by case basis by individually kerning the offending + at input segment boundaries. This can (unfortunately) only be solved + on case by case basis by individually kerning the offending characters within a group. \end{itemize} - + The following keys are used by the |text| decoration: \begin{key}{/pgf/decoration/text=\meta{text} (initially \normalfont empty)} - Set the text to typeset along the curve. - Consecutive spaces are ignored, so |\ | (or |\space| in \LaTeX) + Set the text to typeset along the curve. + Consecutive spaces are ignored, so |\ | (or |\space| in \LaTeX) should be used to insert multiple spaces. It is possible to - format the text using normal formating commands, such as |\it|, |\bf| - and |\color|, within customisable delimiters. Initially these - delimiters are both {\tt\char`\|} (however, care will be needed - regarding the category codes of delimiters --- see below). + format the text using normal formatting commands, such as |\it|, |\bf| + and |\color|, within customizable delimiters. Initially these + delimiters are both {\tt\char`\|} (however, care will be needed + regarding the category codes of delimiters --- see below). {\catcode`\|12 \begin{codeexample}[] @@ -865,13 +1414,13 @@ the paths. \begin{tikzpicture} \draw [help lines] grid (3,2); \path [decorate,decoration={text along path, - text={a big |\color{green}|green|| juicy apple.}}] + text={a big |\color{green}|green|| juicy apple.}}] (0,0) .. controls (0,2) and (3,0) .. (3,2); \end{tikzpicture} \end{codeexample} } By following the first delimiter - with |+|, the formatting commands are added to any exisiting + with |+|, the formatting commands are added to any existing formatting. {\catcode`\|12 @@ -879,16 +1428,16 @@ the paths. \begin{tikzpicture} \draw [help lines] grid (3,2); \path [decorate,decoration={text along path, - text={a |\large|big |+\bf\color{red}|red|| juicy apple.}}] + text={a |\large|big |+\bf\color{red}|red|| juicy apple.}}] (0,0) .. controls (0,2) and (3,0) .. (3,2); \end{tikzpicture} \end{codeexample} } - Internally, the text is stored in the macro |\pgfdecorationtext|. - Any characters that have not been typeset when the end of the + Internally, the text is stored in the macro |\pgfdecorationtext|. + Any characters that have not been typeset when the end of the path has been reached will be stored in |\pgfdecorationrestoftext|. - + \end{key} {\catcode`\|12 @@ -896,21 +1445,21 @@ the paths. \catcode`\|13 - Set the characters that the text decoration will use to parse - formatting commands. + Set the characters that the text decoration will use to parse + formatting commands. If \meta{after} is empty, then \meta{before} will be used for both delimiters. - In general you should stick to characters whose category codes are + In general you should stick to characters whose category codes are |11| or |12|. - As |+| is used to indicate that the specifed format commands - are added to any exisiting ones, you should avoid using |+| as - a delimiter. + As |+| is used to indicate that the specified format commands + are added to any existing ones, you should avoid using |+| as + a delimiter. \begin{codeexample}[] \begin{tikzpicture} \draw [help lines] grid (3,2); - \path [decorate, decoration={text along path,text format delimiters={[}{]}, - text={A big [\color{red}]red[] and [\color{green}]green[] apple.}}] + \path [decorate, decoration={text along path,text format delimiters={[}{]}, + text={A big [\color{red}]red[] and [\color{green}]green[] apple.}}] (0,0) .. controls (0,2) and (3,0) .. (3,2); \end{tikzpicture} \end{codeexample} @@ -920,170 +1469,107 @@ the paths. \begin{key}{/pgf/decoration/text color=\meta{color} (initially black)} The color of the text. \end{key} -\end{decoration} - +\begin{key}{/pgf/decoration/reverse path=\meta{boolean} (initially false)} + This key reverses the path. This is especially useful for typesetting + text along different sides of curves. -\subsection{Mark Decorations: Adding Arrow Tips and Nodes on a Path} +\begin{codeexample}[] +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw [gray, ->] + [postaction={decoration={text along path, + text={a big juicy apple}, text color=red}, decorate}] + [postaction={decoration={text along path, + text={a big juicy apple}, text color=blue, reverse path}, decorate}] + (3,0) .. controls (3,2) and (0,2) .. (0,0); +\end{tikzpicture} +\end{codeexample} -\begin{pgflibrary}{decorations.markings} - Markings are arbitrary ``marks'' that can be put on a path. Marks - can be arrow tips or nodes or even whole pictures. -\end{pgflibrary} +\end{key} -\begin{decoration}{markings} - A \emph{marking} can be thought of a ``little picture'' or a more - precisely of ``some scope contents'' that is placed ``on'' a path at - a certain position. Suppose the marking should be a simple cross. We - can produce this with the following code: -\begin{codeexample}[code only] -\draw (-2pt,-2pt) -- (2pt,2pt); -\draw (2pt,-2pt) -- (-2pt,2pt); -\end{codeexample} - If we use this code as a marking at position |2cm| on a path, then - the following happens: \pgfname\ determines the position on the path - that is 2cm along the path. Then is translates the coordiante system - to this position and rotates it such that the positive $x$-axis is - tangent to the path. Then a protective scope is created, inside - which the above code is executed -- resulting in a little cross on - the path. +\begin{key}{/pgf/decoration/text align={\ttfamily\char`\{}\meta{alignment options}{\ttfamily\char`\}}} + This changes the key path to |/pgf/decoration/text align| and + executes \meta{alignment options}. +\end{key} - The |markings| decoration allows you to place one or more such - markings on a path. The decoration destroys the input path, which - means that it uses the path for determining positions on the path, - but after the decoration is done this path is gone. You typically - need to use a |postaction| to add markings. +\begin{key}{/pgf/decoration/text align/align=\meta{alignment} (initially left)} + Aligns the text according to \meta{alignment}, which should + be one of |left|, |right|, or |center|. - Let us start with the above example in real code: \begin{codeexample}[] -\begin{tikzpicture}[decoration={ - markings,% switch on markings - mark=% actually add a mark - at position 2cm - with - { - \draw (-2pt,-2pt) -- (2pt,2pt); - \draw (2pt,-2pt) -- (-2pt,2pt); - } - } - ] +\begin{tikzpicture} \draw [help lines] grid (3,2); - \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); + \draw [red, dashed] + [postaction={decoration={text along path, text={a big juicy apple}, + text align={align=right}}, decorate}] + (0,0) .. controls (0,2) and (3,2) .. (3,0); \end{tikzpicture} -\end{codeexample} +\end{codeexample} - The |mark| decoration option is used to specify a marking. It has - the following syntax: - \begin{key}{/pgf/decoration/mark=|at position| - \meta{pos}| with |\meta{code}} - The options specifies that when a |marking| decoration is applied, - there should be a marking at position \meta{pos} on the path whose - code is given by \meta{code}. +\end{key} - The \meta{pos} can have four different forms: - \begin{enumerate} - \item It can be a non-negative dimension like |0pt| or |2cm| or - |5cm/2|. In this case, it refers to the position along the path - that is this far removed from the start. - \item It can be a negative dimesion like |-1cm-2pt| or |-1sp|. In - this case, the position is taken from the end of the path. Thus, - |-1cm| is the position that is $-1$cm removed from the end of - the path. - \item It can be a dimensionless non-negative number like |1/2| or - |0.333+2*0.1|. In this case, the \meta{pos} is interpreted as a - factor of the total path lenght. Thus, a \meta{pos} or |0.5| - refers to the middle of the path, |0.1| is near the start, and - so on. - \item It can be a dimensionless negative number like |-0.1|. Then, - again, the fraction of the path length counts ``from the end.'' - \end{enumerate} +\begin{stylekey}{/pgf/decoration/text align/left} + Aligns the text to the left end of the path. - The \meta{pos} determines a position on the path. When the marking - is applied, the (high level) coordinate system will have been - transformed so that the origin lies at this position and the - positive $x$-axis points along the path. For this coordinate - system, the \meta{code} is executed. It can contains all sorts of - graphic drawing commands, including (even named) nodes. +\end{stylekey} - If the position position lies past the end of the path (for - instance if \meta{pos} is set to |1.2|), the marking will not be - drawn. +\begin{stylekey}{/pgf/decoration/text align/right} + Aligns the text to the right end of the path. +\end{stylekey} - It is possible to give the |mark| option several times, which - causes several markings to be applied. In this case, however, it - is necessary that the positions on the path are in increasing - order. That is, it is not allowed (and will result in chaos) to - have a marking that lies earlier on the path to follow a marking - that is later on the path. +\begin{stylekey}{/pgf/decoration/text align/center} + Aligns the text to the center of the path. +\end{stylekey} -\begin{codeexample}[] -\begin{tikzpicture}[decoration={ - markings,% switch on markings - mark=at position 1cm with \node[red]{1cm};, - mark=at position .5 with \node[green]{mid};, - mark=at position -1cm with {\node[blue,transform shape]{1cm from end};}} - ] - \draw [help lines] grid (3,2); - \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); -\end{tikzpicture} -\end{codeexample} +\begin{key}{/pgf/decoration/text align/left indent=\meta{length} (initially 0pt)} + Specify a distance which the automaton should move along + before it starts typesetting the text. +\end{key} + +\begin{key}{/pgf/decoration/text align/right indent=\meta{length} (initially 0pt)} + Specify a distance before the end of the path, where + the automaton should stop typesetting the text. +\end{key} + +\begin{key}{/pgf/decoration/text align/fit to path=\meta{boolean} (initially false)} + This key makes the decoration automaton try to fit the text + to the length of the path. The automaton shifts forward + by a small amount between each character in order to fit the + text to the path. If, however, the length of the text is longer + than the length of the path (i.e., the automaton would have to + shift \emph{backwards} between characters) this key will + have no effect. - Here is an example that shows how markings can be used to place text - on plots: \begin{codeexample}[] -\begin{tikzpicture}[domain=0:4,label/.style={postaction={ - decorate, - decoration={ - markings, - mark=at position .75 with \node #1;}}}] - \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); - - \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; - \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$}; - - \draw[red,label={[above left]{$f(x)=x$}}] plot (\x,\x); - \draw[blue,label={[below left]{$f(x)=\sin x$}}] plot (\x,{sin(\x r)}); - \draw[orange,label={[right]{$f(x)= \frac{1}{20} \mathrm e^x$}}] plot (\x,{0.05*exp(\x)}); +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw [red, dashed] + [postaction={decoration={text along path, text={a big juicy apple}, + text align=fit to path}, decorate}] + (0,0) .. controls (0,2) and (3,2) .. (3,0); \end{tikzpicture} \end{codeexample} - Frequent markings that are hard to create correctly are arrow - tips. For them, inside the \meta{code} two special commands can be - useful, which are only defined in this code: - \begin{command}{\arrow\opt{\oarg{options}}\marg{arrow end tip}} - This command simply draws the \meta{arrow end tip} at the origin, - pointing right. This is exactly what you need when you want to - draw an arrow tip as a marking. - - The \meta{options} can only be given when \tikzname\ is used. In - this case, they are executed in a scope that contains the arrow - tip. +\end{key} + +\begin{key}{/pgf/decoration/text align/fit to path stretching spaces=\meta{boolean} (initially false)} + This key works like the previous key except the automaton + shifts forward only for space characters (including |\space|, but + \emph{excluding} |\ |). + \begin{codeexample}[] -\begin{tikzpicture}[decoration={ - markings,% switch on markings - mark=at position 1cm with {\node[red]{1cm};}, - mark=at position .75 with {\arrow[blue,line width=2mm]{>}}, - mark=at position -1cm with {\arrowreversed[black]{stealth};}} - ] +\begin{tikzpicture} \draw [help lines] grid (3,2); - \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); + \draw [red, dashed] + [postaction={decoration={text along path, text={a big juicy apple}, + text align={fit to path stretching spaces}}, decorate}] + (0,0) .. controls (0,2) and (3,2) .. (3,0); \end{tikzpicture} -\end{codeexample} - \end{command} - \begin{command}{\arrowreversed\opt{\oarg{options}}\marg{arrow end tip}} - As above, only the arrow end tip is flipped and points in the - other direction. - \end{command} - \end{key} +\end{codeexample} +\end{key} - \begin{key}{/pgf/decoration/reset marks} - Since |mark| options accumulate, there needs to be a way to - ``reset'' things, so that any |mark| options set in an enclosing - scope do not interfere. This option does exactly this. Note that - when the \meta{code} of a marking is executed, the markings are - automatically reset. - \end{key} \end{decoration} @@ -1141,7 +1627,7 @@ the paths. \begin{decoration}{Cantor set} This decoration replaces a straight line by a ``line with a whole in the middle.'' The Hausdorff dimension of the Cantor set is $\log - 2/\log 3$. + 2/\log 3$. \begin{codeexample}[] \begin{tikzpicture}[decoration=Cantor set,very thick] \draw decorate{ (0,0) -- (3,0) }; @@ -1155,82 +1641,5 @@ the paths. -\subsection{Footprint Decorations} - - -\begin{pgflibrary}{decorations.footprints} - The decorations of this library can be used to decorate a path with - little footprints, as if someone had ``walked'' along the path. -\end{pgflibrary} - - -\begin{decoration}{footprints} - The footprint decoration adds little footprints around the - path. They start with the left foot. -\begin{codeexample}[] -\begin{tikzpicture}[decoration={footprints,foot length=5pt,stride length=10pt}] - \draw [help lines] grid (3,3); - \fill [decorate] (0,0) -- (3,2) arc (0:180:1.5 and 1); -\end{tikzpicture} -\end{codeexample} - You can influence the way this decoration looks using the following - options: - \begin{key}{/pgf/decoration/foot length (initially 10pt)} - The length or size of the footprint itself. A larger value makes - the footprint larger, but does not change the stride length. -\begin{codeexample}[] -\begin{tikzpicture}[decoration={footprints,foot length=20pt}] - \fill [decorate] (0,0) -- (3,0); -\end{tikzpicture} -\end{codeexample} - \end{key} - \begin{key}{/pgf/decoration/stride length (initially 30pt)} - The length of strides. This is the distance between the beginnings - of left footprints along the path. -\begin{codeexample}[] -\begin{tikzpicture}[decoration={footprints,stride length=50pt}] - \fill [decorate] (0,0) -- (3,0); -\end{tikzpicture} -\end{codeexample} - \end{key} - \begin{key}{/pgf/decoration/foot sep (initially 4pt)} - The separation in the middle between the footprints. The - footprints are moved away from the path by half this amount. -\begin{codeexample}[] -\begin{tikzpicture}[decoration={footprints,foot sep=10pt}] - \fill [decorate] (0,0) -- (3,0); -\end{tikzpicture} -\end{codeexample} - \end{key} - \begin{key}{/pgf/decoration/foot angle (initially 10)} - Footprints are rotate by this much. -\begin{codeexample}[] -\begin{tikzpicture}[decoration={footprints,foot angle=60}] - \fill [decorate] (0,0) -- (3,0); -\end{tikzpicture} -\end{codeexample} - \end{key} - \begin{key}{/pgf/decoration/foot of (initially human)} - The species whose footprints are shown. Possible values are: - - \def\render#1{ - \texttt{#1} & - \tikz [baseline,decoration={footprints,foot of=#1}] - \fill [decorate] (0,0) -- (6,0); \\[3em] - } - \begin{tabular}{ll} - \emph{Species} & \emph{Result} \\[1em] - \render{gnome} - \render{human} - \render{bird} - \render{felis silvestris} - \end{tabular} - \end{key} -\end{decoration} - - \endinput - - - diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex index a0ecfec5c36..5a280cd94a9 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex @@ -35,6 +35,21 @@ from the start coordinate to the target coordinate. \end{key} +\subsection{Move-Tos} + +The following style installs a to path that simply ``jumps'' to the +target coordinate. + +\begin{key}{/tikz/move to} + Causes a move to be added to the path upon a |to| or an + |edge| operation. +\begin{codeexample}[] +\tikz \draw (0,0) to[line to] (1,0) + to[move to] (2,0) to[line to] (3,0); +\end{codeexample} +\end{key} + + \subsection{Curves} The |curve to| style causes the to path to be set to a curve. The @@ -49,7 +64,7 @@ exact way this curve looks can be influenced via a number of options. that is computed in different ways, depending on which options are set. - All of the following options implictly cause the |curve to| style to + All of the following options implicitly cause the |curve to| style to be installed. \begin{key}{/tikz/out=\meta{angle}} @@ -108,8 +123,8 @@ exact way this curve looks can be influenced via a number of options. \begin{key}{/tikz/bend left=\meta{angle} (default \normalfont last value)} This option sets |out=|\meta{angle}|,in=|$180-\meta{angle}$|,relative|. If no \meta{angle} is given, the last given |bend left| or |bend right| - angle is used. - + angle is used. + \begin{codeexample}[] \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid] \node[state,initial] (q_0) {$q_0$}; @@ -183,7 +198,7 @@ exact way this curve looks can be influenced via a number of options. above \meta{distance}, then \meta{distance} is used instead. \end{key} \begin{key}{/tikz/out min distance=\meta{distance}} - The mininimum distance set only for the start coordinate. + The minimum distance set only for the start coordinate. \end{key} \begin{key}{/tikz/out max distance=\meta{distance}} The maximum distance set only for the start coordinate. @@ -224,7 +239,7 @@ exact way this curve looks can be influenced via a number of options. \end{key} \begin{key}{/tikz/controls=\meta{coordinate}| and |\meta{coordinate}} This option causes the \meta{coordinate}s to be used as control - points. + points. \begin{codeexample}[] \tikz \draw (0,0) to [controls=+(90:1) and +(90:1)] (3,0); \end{codeexample} @@ -237,7 +252,7 @@ exact way this curve looks can be influenced via a number of options. \begin{key}{/tikz/loop} This key is similar to the |curve to| key, but differs in the following ways: First, the actual target coordinate is ignored and the - start coordiante is used as the target coordinate. Thus, it is + start coordinate is used as the target coordinate. Thus, it is allowed not to provide any target coordinate, which can be useful with unnamed nodes. Second, the |looseness| is set to |8| and the |min distance| to |5mm|. These settings result in rather nice loops @@ -245,7 +260,7 @@ exact way this curve looks can be influenced via a number of options. 30$^\circ$. \begin{codeexample}[] \begin{tikzpicture} - \node [circle,draw] {a} edge [in=30,out=60,loop] (); + \node [circle,draw] {a} edge [in=30,out=60,loop] (); \end{tikzpicture} \end{codeexample} \end{key} @@ -253,10 +268,10 @@ exact way this curve looks can be influenced via a number of options. \begin{stylekey}{/tikz/loop above} Sets the |loop| style and sets in and out angles such that loop is above the node. Furthermore, the |above| option is set, - which causes a node label to be placed at the correct position. + which causes a node label to be placed at the correct position. \begin{codeexample}[] \begin{tikzpicture} - \node [circle,draw] {a} edge [loop above] node {x} (); + \node [circle,draw] {a} edge [loop above] node {x} (); \end{tikzpicture} \end{codeexample} \end{stylekey} @@ -276,7 +291,7 @@ exact way this curve looks can be influenced via a number of options. -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex index b3503a60108..177a9611d39 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex @@ -12,7 +12,7 @@ \begin{tikzlibrary}{er} This packages provides styles for drawing entity-relationship - diagrams. + diagrams. \end{tikzlibrary} This library is intended to help you in creating E/R-diagrams. It defines @@ -44,7 +44,7 @@ The package defines a simple style for drawing entities: \end{stylekey} \begin{stylekey}{/tikz/every entity} - This stype is envoked by the style |entity|. To change the + This style is evoked by the style |entity|. To change the appearance of entities, you can change this style. \begin{codeexample}[] \begin{tikzpicture} @@ -64,13 +64,13 @@ styles for entities. \begin{stylekey}{/tikz/relationship} This style works like |entity|, only it is to be used for - relationships. Again, |relationship|s are actually relationship types. + relationships. Again, |relationship|s are actually relationship types. \begin{codeexample}[] \begin{tikzpicture} \node[entity] (sheep) at (0,0) {Sheep}; \node[entity] (genome) at (2,0) {Genome}; \node[relationship] at (1,1.5) {has} - edge (sheep) + edge (sheep) edge (genome); \end{tikzpicture} \end{codeexample} @@ -85,7 +85,7 @@ styles for entities. \node[entity] (sheep) at (0,0) {Sheep}; \node[entity] (genome) at (2,0) {Genome}; \node[relationship] at (1,1.5) {has} - edge (sheep) + edge (sheep) edge (genome); \end{tikzpicture} \end{codeexample} @@ -98,7 +98,7 @@ styles for entities. \begin{stylekey}{/tikz/attribute} This style is used to indicate that a node is an attribute. To connect an attribute to its entity, you can use, for example, the - |child| command or the |pin| option. + |child| command or the |pin| option. \begin{codeexample}[] \begin{tikzpicture} \node[entity] (sheep) {Sheep} @@ -107,7 +107,7 @@ styles for entities. \end{tikzpicture} \end{codeexample} \begin{codeexample}[] -\begin{tikzpicture}[every pin edge/.style=draw] +\begin{tikzpicture}[every pin edge/.style=draw] \node[entity,pin={[attribute]60:name},pin={[attribute]120:color}] {Sheep}; \end{tikzpicture} \end{codeexample} @@ -115,7 +115,7 @@ styles for entities. \begin{stylekey}{/tikz/key attribute} This style is intended for key attributes. By default, the will - cause the attribute to be typeset in italics. Typcially, underlining + cause the attribute to be typeset in italics. Typically, underlining is used instead, but that looks ugly and it is difficult to implement in \TeX. \end{stylekey} @@ -134,14 +134,14 @@ styles for entities. child {node [key attribute] {name}}; \node[entity] (genome) at (2,0) {Genome}; \node[relationship] at (1,1.5) {has} - edge (sheep) + edge (sheep) edge (genome); \end{tikzpicture} \end{codeexample} \end{stylekey} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex new file mode 100644 index 00000000000..7399ed6f185 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex @@ -0,0 +1,720 @@ +% Copyright 2008 by Christian Feuersaenger +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\section{Externalization Library} +{ +\pgfkeys{ + /pdflinks/search key prefixes in/.add={/tikz/external/,}{} +} +\label{section-libs-external} +{\noindent {\emph{by Christian Feuers\"anger}}} + +\begin{tikzlibrary}{external} + This library provides a high-level automatic or semi--automatic export feature for \tikzname\ pictures. + Its purpose is to convert each picture to a separate \pdf\ without changing the document as such. + + It also externalizes |\label| information (and other aux file related stuff) using auxiliary files. +\end{tikzlibrary} + +\subsection{Overview} + +There are several reasons why external images for at least some pictures are of interest: +\begin{enumerate} + \item Larger picture require a considerable amount of time, which is necessary for every compilation. However, only few images will change from run to run. It can simply save time to export finished images and include them as final graphics. + \item It may be desirable to have final images for some graphics, for example to include them in third--party programs or to communicate them electronically. + \item It may be necessary to typeset a file in environments where \pgfname\ and \tikzname\ are not available. In this case, external images are the only way to ensure compatibility. +\end{enumerate} +The purpose of this library is to provide a way to export any \tikzname-picture to separate \pdf\ (or \eps) images without changing the main document. It is actually a simple user interface to the |\beginpgfgraphicnamed| $\dotsc$ |\endpgfgraphicnamed| framework of \pgfname\ which is discussed in section~\ref{section-external}. + +\subsection{Requirements} +For most users, the library does not need special attention since requirements are met anyway. It collects all tokens between |\begin{tikzpicture}| and the next following |\end{tikzpicture}| and replaces them by the appropriate graphics or it takes steps to generate such an image.% For Con\TeX t and plain \TeX\ users, the appropriate begin and end picture statements apply. + +It can't expand macros during this step, so the only requirement is that every picture's end is directly reachable from its beginning, without further macro expansion. Furthermore, the library assumes that all \LaTeX\ pictures are ended with |\end{tikzpicture}|.% In Con\TeX t, the end command is assumed to be |\stoptikzpicture| and for plain \TeX\ it is |\endtikzpicture|. + +The library always searches for the \emph{next} picture's end, |\end{tikzpicture}|. As a consequence, you can't use nested pictures directly. You \emph{can} nest pictures, but you have to avoid that the nested picture's |\end| command is found before the outer |\end| command (for example using bracing constructs or by writing the nested picture into a separate macro call). + +Consider using the |\tikzexternaldisable| method in case you'd like to skip selected pictures which do not meet the requirements. + +\subsection{A Word About Con\TeX t And Plain \TeX} +Currently, the basic layer backend |\beginpgfgraphicnamed| $\dotsc$ |\endpgfgraphicnamed| relies on \LaTeX\ only, so externalization is only supported for \LaTeX\ yet. +%The library comes in three different versions, one for \LaTeX, one for Con\TeX t and one for plain \TeX. For reasons of simplicity, examples in this manual only refer to \LaTeX\ (especially |pdflatex|). + +\subsection{Externalizing Graphics} +After loading the library, a call to |\tikzexternalize| is necessary to activate the externalization. +\begin{codeexample}[code only] +\documentclass{article} +% main document, called main.tex +\usepackage{tikz} + +\usetikzlibrary{external} +\tikzexternalize % activate! + +\begin{document} +\begin{tikzpicture} + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} + +A simple image is \tikz \fill (0,0) circle(5pt);. +\end{document} +\end{codeexample} + +The method works as follows: if the document is typeset normally, the library searches for replacement images for every picture. Filenames are generated automatically in the default configuration. In our case, the two file names will be |main-figure0| and |main-figure1|. If they exist, those images are simply included and the pictures as such are not processed. If graphics files do not exist, steps are taken to generate the missing ones. Since (currently) only one output file can be set, each missing image needs to be generated by a separate run of \LaTeX\ in which the |\jobname| is set to the desired image file name. +In the default configuration |mode=convert with system call|, these commands are issued automatically by using the |\write18| method to call system commands. It is also possible to output every required file name or to generate a |makefile|; users will need to issue the required commands manually (or with |make|). The probably most comfortable way is to use the default configuration with +\begin{codeexample}[code only] +pdflatex -shell-escape main +\end{codeexample} +\noindent which authorizes |pdflatex| to call itself recursively to generate the images. When it finishes, all images are generated and the document already includes them. + + +From this point on, successive runs of \LaTeX\ will use the final graphics files, the pictures won't be used anymore. Section~\ref{section-libs-external-nopgf} contains details about how to submit such a file to environments where \pgfname\ is not available. + +\begin{command}{\tikzexternalize\oarg{optional arguments}} + This command activates the externalization. It installs commands to replace every \tikzname-picture. It needs to be called before |\begin{document}| because it may need to install its separate shipout routine. + + + The \meta{optional arguments} can be any of the keys described below. + + Note that the generation/modification of auxiliary files like |.aux|, |.toc| etc.\ is usually suppressed while a single image is externalized (details for |\label| support follow). + + It is also possible to write |\tikzexternalize|\marg{main job name} if the argument is delimited by curly braces. This case is mainly for backwards compatibility and is no longer necessary. Since it might be useful in rare circumstances, it is documented in section~\ref{sec:external:detail}. + + A detailed description about the process of externalization is provided in section~\ref{sec:external:detail}. + + \begin{command}{\tikzexternalrealjob}% + After the library is loaded, this macro will \emph{always} contain the correct main job's name (in the example above, it is |main|). It is to be used instead of |\jobname| when the externalization is in effect. + \end{command} + \begin{command}{\pgfactualjobname} + Once |\tikzexternalize| has been called, |\pgfactualjobname| contains the name of the currently generated output file (which may be |main| or |main-figure0| or |main-figure1| in our example above). + \end{command} + \begin{command}{\jobname} + The value of |\jobname| is one of |\tikzexternalrealjob| or |\pgfactualjobname|, depending on the configuration. In short: if auxiliary file support (|\label| and |\ref|) is activated, |\jobname=\tikzexternalrealjob| (since that's the base file name of auxiliary files). + \end{command} +\end{command} + +\begin{key}{/tikz/external/system call=\marg{template}} +\label{extlib:systemcall:option} + A template string used to generate system calls. Inside of \marg{template}, the macro |\image| can be used as placeholder for the image which is about to be generated while |\texsource| contains the main file name (in truth, it contains |\input|\marg{main file name}, but that doesn't matter). + + The default is +\begin{codeexample}[code only] +\tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error + -interaction=batchmode -jobname "\image" "\texsource"} +\end{codeexample} + \noindent where \declareandlabel{\tikzexternalcheckshellescape} inserts the value of the configuration key |shell escape| + if and only if the current document has been typeset with |-shell-escape|\footnote{Note that this is always true for the default configuration. This security consideration applies mainly for \texttt{mode=list and make} which will also work \emph{without} shell escapes.}. + + For |eps| output, you can (and need to) use +\begin{codeexample}[code only] +\tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error + -interaction=batchmode -jobname "\image" "\texsource"; + dvips -o "\image".ps "\image".dvi}} +\end{codeexample} + + The argument \marg{template} will be expanded using |\edef|, so any control sequences will be expanded. During this evaluation, `|\\|' will result in a normal backslash, `|\|'. Furthermore, double quotes `|"|', single quotes `|'|', semicolons and dashes `|-|' will be made to normal characters if any package uses them as macros. This ensures compatibility with the |german| package, for example. +\end{key} + +\begin{key}{/tikz/external/shell escape=\marg{command-line arg} (initially -shell-escape)} + Contains the command line option for |latex| which enables the |\write18| feature. For \TeX-Live, this is |-shell-escape|. For Mik\TeX, you should use |\tikzexternalize[shell escape=-enable-write18]|. +\end{key} + +\subsubsection{Support for Labels and References In External Files} +The |external| library comes with extra support for |\label| and |\ref| (and other commands which usually store information in the |.aux| file) inside of external files. + +There are, however, some points which need your attention when you try to use +\begin{enumerate} + \item[a)] |\ref| to something in the main document inside of an externalized graphics or + \item[b)] |\label| in the externalized graphics which is referenced in the main document. +\end{enumerate} + +For point a), a |\ref| inside of an externalized graphics works \emph{only} if you issue the required system call \emph{manually} or by |make|. The initial configuration |mode=convert with system call| does \emph{not} support |\ref|. But you can copy--paste the system call generated by |mode=convert with system call| and issue it manually. The reason is that |\ref| information is stored in the main |.aux| file -- but this auxiliary file is not completely written when |mode=convert with system call| is invoked (there is a race condition). Note that |\pageref| is not supported (sorry). Thus: if you have |\ref| inside of external graphics, consider using |mode=list and make| or copy--paste the system call for the image(s) and issue it manually. + +Point b) is realized automatically by the external library. In detail, a |\label| inside of an externalized graphics causes the external library to generate separate auxiliary files for every external image. These files are called \meta{imagename}|.dpth|. The extension |.dpth| indicates that the file also contains the image's depth (the |baseline| key of \tikzname). Furthermore, anything which would have been written to an |.aux| file will be redirected to the |.dpth| file -- but only things which occur inside of the externalized |tikzpicture| environment. When the main document loads the image, it will copy the |.dpth| file into the main |.aux| file. Then, successive compilations of the main document contain the external |\label| information. In other words, a |\label| in an external graphics needs the following work flow: +\begin{enumerate} + \item The external graphics needs to be generated together with its |.dpth| (usually automatically by \tikzname). + \item The main document includes the external graphics and copies the |.dpth| content into its main |.aux| file. + \item The main document needs to be translated one further time to re-read its |.aux| file\footnote{Note that it is not possible to activate the content of an auxiliary file after \texttt{\textbackslash begin\{document\}} in \LaTeX.}. +\end{enumerate} +There is just one special case: if a |\label|/|\ref| combination is realized itsself by a |tikzpicture| which should be externalized, you need to proceed as for case a) since |mode=convert with system call| can't handle that stuff on its own. Thus, |\label| works automatically, just translate the main document often enough. + + + +\subsubsection{Customizing the Generated File Names} +The default filename for externalized graphics is `\meta{real file name}|-figure_|\meta{number}' where \meta{number} ranges from $0$ to whatever is required. However, there are a couple of ways to change the generated filenames: +\begin{itemize} + \item Changing the overall file name using a |prefix|, + \item Changing the file name for a single figure using |\tikzsetnextfilename|, + \item Changing the file name for a restricted set of figures using |figure name|. +\end{itemize} + +\begin{key}{/tikz/external/prefix=\marg{file name prefix} (initially empty)} + A shortcut for |\tikzsetexternalprefix|\marg{file name prefix}, see below. +\end{key} + +\begin{command}{\tikzsetexternalprefix\marg{file name prefix}} + Assigns a common prefix used by all file names. For example, +\begin{codeexample}[code only] +\tikzsetexternalprefix{figures/} +\end{codeexample} + will prepend |figures/| to every external graphics file name. + + Please note that |\tikzsetexternalprefix| is the \emph{only} way to assign a prefix in case you want to prepare your document for environments where \pgfname\ is not installed (see section~\ref{section-libs-external-nopgf}). +\end{command} + +\begin{command}{\tikzsetnextfilename\marg{file name}} + Sets the file name for the \emph{next} \tikzname\ picture or |\tikz| short command. It will \emph{only} be used for the next picture. + + Pictures for which no explicit file name has been set (or the next file name is empty) will get automatically generated file names. + + Please note that |prefix| will still be prepended to \marg{file name}. +\begin{codeexample}[code only] +\documentclass{article} +% main document, called main.tex +\usepackage{tikz} + +\usetikzlibrary{external} +\tikzexternalize[prefix=figures/] % activate + +\begin{document} + +\tikzsetnextfilename{trees} +\begin{tikzpicture} % will be written to 'figures/trees.pdf' + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} + +\tikzsetnextfilename{simple} +A simple image is \tikz \fill (0,0) circle(5pt);. % will be written to 'figures/simple.pdf' + +\begin{tikzpicture} % will be written to 'figures/main-figure0.pdf' + \draw[help lines] (0,0) grid (5,5); +\end{tikzpicture} +\end{document} +\end{codeexample} +\begin{codeexample}[code only] +pdflatex -shell-escape main +\end{codeexample} +\end{command} + +\begin{key}{/tikz/external/figure name=\marg{name}} + Same as |\tikzsetfigurename|\marg{name}. +\end{key} +\begin{command}{\tikzsetfigurename\marg{name}} + Changes the names of \emph{all} following figures. It is possible to change |figure name| during the document either using |\tikzset{external/figure name|=\marg{name}|}| or with this command. A unique counter will be used for each different \marg{name}, and each counter will start at $0$. + + The value of |prefix| will be applied after |figure name| has been evaluated. +\begin{codeexample}[code only] +\documentclass{article} +% main document, called main.tex +\usepackage{tikz} + +\usetikzlibrary{external} +\tikzexternalize % activate + +\begin{document} + +\begin{tikzpicture} % will be written to 'main-figure0.pdf' + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} + +{ + \tikzsetfigurename{subset_} + A simple image is \tikz \fill (0,0) circle(5pt);. % will be written to 'subset_0.pdf' + + \begin{tikzpicture} % will be written to 'subset_1.pdf' + \draw[help lines] (0,0) grid (5,5); + \end{tikzpicture} +}% here, the old file name will be restored: + +\begin{tikzpicture} % will be written to 'main-figure1.pdf' + \draw (0,0) -- (5,5); +\end{tikzpicture} +\end{document} +\end{codeexample} + The scope of |figure name| ends with the next closing brace. + + Remark: Use |\tikzset{external/figure name/.add={prefix_}{_suffix_}}| to add a |prefix_| and a |_suffix_| to the actual value of |figure name|. +\end{command} + +\begin{command}{\tikzappendtofigurename\marg{suffix}} + Appends \meta{suffix} to the actual value of |figure name|. + + It is a shortcut for |\tikzset{external/figure name/.add={}|\marg{suffix}|}| (a shortcut which is also supported if \tikzname\ is not installed, see below). +\end{command} + + +\subsubsection{Remaking Figures or Skipping Figures} +\begin{command}{\tikzpicturedependsonfile\marg{file name}} + Adds a dependency for the \emph{next} picture which is about to be externalized. If the command is invoked within a picture environment, it adds a dependency for the surrounding picture. Dependencies are written into \meta{target file}|.dep| in the format + + \meta{target file}|.\tikzexternalimgextension: |\meta{file name}. + + The effect is that if \meta{file name} changes, the external graphics associated with the picture shall be remade. + + This command uses the contents of \declareandlabel{\tikzexternalimgextension} to check for graphics. If you encounter difficulties with image extensions, consider redefining this macro (after |\tikzexternalize|). + + \paragraph{Limitations:} this command is currently only supported for |mode=list and make| and the generated |makefile|. +\end{command} +\begin{command}{\tikzexternalfiledependsonfile\marg{external graphics}\marg{file name}} + A variant of |\tikzpicturedependsonfile| which adds a dependency for an \meta{external graphics}. The argument \meta{external graphics} must be the path as it would have been generated by the external library, i.e.\ without file extension but including any prefixes. +\end{command} + +\begin{key}{/tikz/external/force remake=\marg{boolean} (default true)} + A boolean which is used to customize the up-to-date checks of all following figures. Every up-to-date check will fail, resulting in automatic regeneration of every following figure. + +\begin{codeexample}[code only] +\tikzset{external/force remake} +\begin{tikzpicture} + \draw (0,0) circle(5pt); +\end{tikzpicture} +\end{codeexample} + You can also use |force remake| inside of a local \TeX\ group to remake only selected pictures. The example +\begin{codeexample}[code only] +\tikz \draw (0,0) -- (1,1); + +{ +\tikzset{external/force remake} +\begin{tikzpicture} + \draw (0,0) circle(5pt); +\end{tikzpicture} +} + +\tikz \draw (0,0) -- (1,1); +\end{codeexample} + will only apply |force remake| to the second figure. + + Up-to-date checks are applied for |mode=convert with system call| and the makefile generated by |mode=list and make|. +\end{key} + +\begin{key}{/tikz/external/remake next=\marg{boolean} (default true)} + A variant of |force remake| which applies only to the next image. +\end{key} + +\begin{key}{/tikz/external/export next=\marg{boolean} (default true)} + A boolean which can be used to disable the export mechanism for single pictures. +\end{key} + +\begin{key}{/tikz/external/export=\marg{boolean} (initially true)} + A boolean which can be used to disable the export mechanism for all pictures inside of the current \TeX-scope. + +\begin{codeexample}[code only] +\begin{document} +\begin{tikzpicture} % will be exported + ... +\end{tikzpicture} + +{ +\tikzset{external/export=false} +\begin{tikzpicture} % won't be exported + ... +\end{tikzpicture} +... +} + +\begin{tikzpicture} % will be exported + ... +\end{tikzpicture} +\end{document} +\end{codeexample} + For \LaTeX, the feature lasts until the next |\end|\marg{$\cdot$} (this holds for every call to |\tikzset|). +\end{key} + +\begin{command}{\tikzexternaldisable} + Allows to disable the complete externalization. While |export next| will still collect the contents of picture environments, this command uninstalls the hooks for the external library completely. Thus, nested picture environments or environments where |\end{tikzpicture}| is not directly reachable won't produce compilation failures -- although it is not possible to externalize them automatically. + + The externalization remains disabled until the end of the next \TeX\ group (or environment) or until the next call to |\tikzexternalenable|. +\end{command} + +\begin{command}{\tikzexternalenable} + Re-enables a previously running externalization after |\tikzexternaldisable|. +\end{command} + + +\subsubsection{Customizing the Externalization} +\begin{key}{/tikz/external/figure list=\marg{boolean} (initially true)} + A boolean which configures whether a figure list shall be generated. A figure list is an output file named \marg{jobname}|.figlist| which is filled with file names of each figure, one per line. + + This file is not used by \TeX\ anymore, its purpose is to issue the required conversion commands |pdflatex -jobname |\marg{picture file name} \marg{main file} manually (or in a script). See section~\ref{sec:external:detail} for the details about the expected system call (or activate |mode=convert with system call| and inspect you log file). + +\begin{codeexample}[code only] +\documentclass{article} +% main document, called main.tex +\usepackage{tikz} + +\usetikzlibrary{external} +\tikzexternalize[ + mode=graphics if exists, + figure list=true, + prefix=figures/] + +\begin{document} + +\tikzsetnextfilename{trees} +\begin{tikzpicture} + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} + +\tikzsetnextfilename{simple} +A simple image is \tikz \fill (0,0) circle(5pt);. + +\begin{tikzpicture} + \draw[help lines] (0,0) grid (5,5); +\end{tikzpicture} +\end{document} +\end{codeexample} + +\begin{codeexample}[code only] +pdflatex main +\end{codeexample} +generates |main.figlist| containing +\begin{codeexample}[code only] +figures/trees +figures/simple +figures/main-figure0 +\end{codeexample} +\end{key} + +\begin{key}{/tikz/external/mode=\marg{choice} (initially convert with system call)} + Configures what to do with \tikzname\ pictures (unless we are currently externalizing one particular image, in that case, these modes are ignored). + + The preconfigured mode |convert with system call| checks whether external graphics files are up-to-date and includes them if that is the case. Any picture which is not up-to-date will be generated automatically using a system call. The system call can be configured using the |system call| template. The up-to-date check is simple: if the file does not exist, it is not up-to-date. Furthermore, if one of the |force remake| or |remake next| keys is true, the figure is not up-to-date. In all other case, the file is considered to be up-to-date. As soon as |convert with system call| is set, the |figure list| will be disabled -- such a file is not required. In case you still need or want it, you can enable it after setting |mode|. + + Please note that system calls may be disabled for security reasons. For pdflatex, they can be enabled using +\begin{codeexample}[code only] +pdflatex -shell-escape +\end{codeexample} + while other \TeX\ variants may need other switches. The feature is sometimes called |\write18|. + + The choice |only graphics| always tries to replace pictures with external graphics. It is an error if the graphics file does not exist. + + The choice |no graphics| (or, equivalently, |only pictures|) typesets \tikzname\ pictures without checking for external graphics. + + A mixture is |graphics if exists|, it checks whether a suitable graphics file exists and includes it if that is the case. If it does not exist, the picture is typeset using \TeX. + + Mode |list only| skips every \tikzname\ picture; it only generates the file \marg{main file}|.figlist| containing file names for every picture, the contents of any picture environment is thrown away and a replacement text is shown. This implies |figure list=true|. See also the |list and make| mode which includes available graphics. + + The mode |list and make| is similar to |list only|: it generates the same file \marg{main file}|.figlist|, but any images which exist already are included as graphics instead of ignoring them. Furthermore, this mode generates an additional file: \marg{main file}.makefile. This allows to use a work flow like +\begin{codeexample}[code only] +% step 1: generate main.makefile: +pdflatex main +% step 2: generate ALL graphics on 2 processors: +make -j 2 main.makefile +% step 3: include the graphics: +pdflatex main +\end{codeexample} + \noindent This last make method is, however unnecessary: |list and make| just assumes that images are generated somehow (not necessarily with the generated makefile). The generated makefile allows parallel externalization of graphics on multi-core systems and it supports any file dependencies configured with |\tikzpicturedependsonfile|. Furthermore, it respects the |force remake| and |remake next| keys. + + +\end{key} + + +\begin{key}{/tikz/external/verbose IO=\marg{boolean} (initially true)} + A boolean which configures whether I/O operations shall be listed in the logfile. +\end{key} +\begin{key}{/tikz/external/verbose optimize=\marg{boolean} (initially true)} + A boolean which configures whether optimization operations shall be listed in the logfile. +\end{key} +\begin{key}{/tikz/external/verbose=\marg{boolean} (initially true)} + Sets all verbosity flags to \meta{boolean}. +\end{key} + +\begin{key}{/tikz/external/optimize=\marg{boolean} (initially true)} + Configures whether the conversion process shall be optimized. This affects only the case when |\jobname| differs from the main file name, i.e. when single pictures are converted. + + In that case, the main file is compiled as usual - but everything except the selected picture is thrown away. If optimization is enabled, all other pictures won't be processed at all. Furthermore, expensive commands which do not contribute to the selected picture will be thrown away as well. + + The default implementation discards |\includegraphics| commands which are \emph{not} inside of the selected picture to reduce conversion time. + + It is possible to add commands which shall be optimized away, see below. +\end{key} + +\begin{key}{/tikz/external/optimize command away=\meta{\textbackslash command}\marg{required argument count}} + Installs commands to optimize \meta{\textbackslash command} away. As is described above, optimization applies to the case when single pictures are converted: one usually doesn't need to process (probably expensive) commands which do not contribute to the selected picture. + + The argument \marg{required argument count} is either empty or a non-negativ integer between $0$ and $9$. It denotes the number of arguments which should be consumed after \meta{\textbackslash command}. In any case, one argument in square brackets after the command will be recognized as well. To be more precise, the following cases for arguments of \meta{\textbackslash command} are supported: + \begin{enumerate} + \item If \marg{required argument count} is empty (the default), \meta{\textbackslash command} may take one optional argument in square brackets and one in curly braces (which is also optional). + \item If \marg{required argument count} is not empty, \marg{\textbackslash command} may take one optional argument in square brackets. Furthermore, it expects exactly \marg{required argument count} following arguments. + \end{enumerate} + + Example: +\begin{codeexample}[code only] +\tikzset{external/optimize command away=\includegraphics} +\end{codeexample} + +\begin{codeexample}[code only] +\newcommand{\myExpensiveMacro}[1]{Very expensive!} + +\tikzset{external/optimize command away=\myExpensiveMacro} +\end{codeexample} + +\begin{codeexample}[code only] +\newcommand{\myExpensiveMacroWithThreeArgs}[3]{Very expensive!} + +\tikzset{external/optimize command away={\myExpensiveMacroWithThreeArgs}{3}} +\end{codeexample} +\begin{codeexample}[code only] +% A command with optional argument: +\newcommand{\aFurtherExample}[3][]{Very expensive!} + +% consume only two arguments: the first optional one will be processed +% anyway: +\tikzset{external/optimize command away={\myExpensiveMacroWithThreeArgs}{2}} +\end{codeexample} + The argument \meta{\textbackslash command} must be the name of a single macro. Any occurrence of this macro, together with its arguments, will be removed. +\begin{codeexample}[code only] +\begin{tikzpicture} + % this picture is currently converted! +\end{tikzpicture} + +This here is outside of the converted picture and contains \myExpensiveMacro. It will be discarded. + +This call: \myExpensiveMacro[argument=value]{Argument} as well. +And this here: \myExpensiveMacro{Argument} also. +\end{codeexample} + + The default is to optimize |\includegraphics| away. + + This key is actually a style which sets the |optimize/install| and |optimize/restore| keys. +\end{key} + +\begin{key}{/tikz/external/optimize/install} + A command key which contains code to install optimizations. You can append code here (or clear the macro) if you need to modify the optimization. +\end{key} +\begin{key}{/tikz/external/optimize/restore} + A command key which contains code to undo optimizations. You can append code here (or clear the macro) if you need to modify the optimization. +\end{key} + +\begin{key}{/tikz/external/only named=\marg{boolean} (initially false)} + If enabled, only pictures for which file names have been set explicitly using |\tikzsetnextfilename| will be considered, no file names will be generated automatically. +\end{key} + +\begin{key}{/pgf/images/include external (initially \textbackslash pgfimage\{\#1\})} +\index{External Graphics!Bounding Box Issues} + This command key constitutes the public interface to exchange the |\includegraphics| command used for the image inclusion. If can be overwritten using |include external/.code=|\marg{\TeX\ code}. + + Its description can be found in the corresponding basic layer documentation on page~\pageref{pgf:includeexternalkey}. + + Just one example here: you can use +\begin{codeexample}[code only] +\pgfkeys{/pgf/images/include external/.code={\includegraphics[viewport=0 0 211.28 175.686]{#1}}} +\end{codeexample} + to manually change the viewport (bounding box) for included graphics. + + Another example (of probably limited use) is +\begin{codeexample}[code only] +\pgfkeys{/pgf/images/include external/.code={\href{file:#1}{\pgfimage{#1}}}} +\end{codeexample} + \noindent which will generate a clickable hyperlink around the image. Clicking on it opens the single exported file\footnote{This requires all external graphics files in the same base directory as the main |.pdf| file.}. + + If you want to limit the effects of this key to just one externalized figure, use +\begin{codeexample}[code only] +{ + \pgfkeys{/pgf/images/include external/.code={\includegraphics[viewport=0 0 211.28 175.686]{#1}}} + \begin{tikzpicture} + ... + \end{tikzpicture} +}% this brace ends the effect of `include external' +\end{codeexample} +\end{key} + +\begin{command}{\tikzifexternalizing\marg{true code}\marg{false code}} + This command can be used to check whether an image is currently written to its separate graphics file (if the ``grab'' procedure is running). If so, the \marg{true code} will be executed. If not, that means if the main document is being typeset normally, the \marg{false code} will be invoked. + + This command must be used \emph{after} |\tikzexternalize|. +\end{command} + +\begin{command}{\tikzifexternalizingnext\marg{true code}\marg{false code}} + Like |\tikzifexternalizing|, but this variant also checks if the next following figure is the one which is about to be written to its separate graphics file. +\end{command} + +\subsubsection{Details About The Process} +\label{sec:external:detail} +The standard run |pdflatex |\meta{main document} causes the |external| library to check every occurrence of |\begin{tikzpicture}| and every |\tikz| shortcommand. If it finds a picture which shall be exported, it queries the respective file name and checks whether the file exists already. If so, it includes the external graphics. If not, it requires an externalization which can be done automatically (the default), semi--automatically (with |mode=list and make|) or manually (by issuing the requires system calls somehow). + +The library can detect whether it runs in ``conversion mode'', i.e.\ if it should only process a single image. To do so, it checks whether the internal macro \declareandlabel{\tikzexternalrealjob} exists. If so, its contents is assumed to be \meta{main document} (without the suffix |.tex|). Usually, this macro is set by the conversion system call, +\begin{codeexample}[code only] +pdflatex -jobname "main-figure0" "\def\tikzexternalrealjob{main}\input{main}" +\end{codeexample} +\noindent where |main-figure0| is the picture we are currently externalizing and |main.tex| is the main document. + +As soon as ``conversion mode'' has been detected, \pgfname\ changes the output routine. The complete file |main.tex| is processed as normal, but only the part of the desired picture will be written to the output file, in our case |main-figure0.pdf|. The rest of the document is silently thrown away. Of course, such a conversion process is quite expensive since we need to do it for every picture. Since everything except the current picture is thrown away, the library skips all other pictures. Furthermore, any |\includegraphics| commands which are outside of the converted \tikzname-picture will be skipped as well. Thus, the conversion process should be much faster than typesetting the complete document, but it still requires its time. +Eventually, the call |\input{main}| returns and the picture is ready. From this point on, the external graphics will be used. + +There is another possibility to communicate \meta{main document} to the subprocess performing the externalization: namely to write `|\tikzexternalize{main}|' into the document. In this case, the conversion system call will be +\begin{codeexample}[code only] +pdflatex -jobname "main-figure0" "main" +\end{codeexample} +\noindent and the contents of |\tikzexternalrealjob| is set automatically. This case is detected by |\tikzexternalize|, and the |system call| is updated automatically (by patching its |\texsource| template argument). It is not necessary to change the |system call| manually. + + +The sequence in which system calls are performed and the decision whether they are issued automatically is governed by the |mode| key, consult its documentation for details. + + +\subsection{Using External Graphics Without \textmd{\pgfname}\ Installed} +\label{section-libs-external-nopgf} +Given that every picture has been exported correctly, one may want to compile a file without \pgfname\ and \tikzname\ installed. \tikzname\ comes with a minimal package which contains just enough commands to replace every |tikzpicture| environment and the |\tikz| short command with the appropriate external graphics. It can be found at +\begin{codeexample}[code only] +latex/pgf/utilities/tikzexternal.sty +\end{codeexample} +\noindent and needs to be used instead of |\usepackage{tikz}|. So, we uncomment |\usepackage{tikz}| and our example from the beginning becomes +\begin{codeexample}[code only] +\documentclass{article} +% main document, called main.tex +%\usepackage{tikz} + +\usepackage{graphicx} +\usepackage{tikzexternal} + +%\usetikzlibrary{external} +\tikzexternalize + +\begin{document} +\begin{tikzpicture} + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} + +A simple image is \tikz \fill (0,0) circle(5pt);. + +Furthermore, we might want to draw \tikz[baseline]\draw (0,-1) rectangle (1,1); +\end{document} +\end{codeexample} +\noindent where the following files are necessary to compile the document: +\begin{codeexample}[code only] +tikzexternal.sty +main.tex +main-figure0.pdf +main-figure1.pdf +main-figure2.pdf +\end{codeexample} +\noindent If there are any `|.dpth|' files, for example |main-figure2.dpth|, these files are also required. They contain information for the \tikzname\ |baseline| option (or |\label|s inside of external graphics). + +Just copy the |.sty| file into the directory of your |main.tex| file and use it as part of your document. + +Please keep in mind, that only |tikzpicture| environments and |\tikz| short images are available within the externalization framework. Additionally, calls to |\tikzset| and |\pgfkeys| won't lead to compilation errors because they are simply ignored. But since |pgfkeys| is not available, any option supplied to |\tikzexternalize| is \emph{ignored}. + +\paragraph{Attention:} Since the simple replacement |\usepackage{tikzexternal}| doesn't support the key--value interface, you \emph{need} to use |\tikzsetexternalprefix| instead of the |prefix| option and |\tikzsetfigurename| instead of the |figure name| option since |\tikzset| is not available in such a context. + +\paragraph{Remark:} Some of the features of this library are mainly useful to improve the speed of successive document compilations. In other words: you can't use all features in this context, Keep it simple. + +\subsection{\eps\ Graphics Export} +It is also possible to use \eps\ graphics instead of \pdf\ files. There are different ways to produce them, for example to use |pdflatex| and call |pdftops -eps |\marg{pdf file} \marg{eps file} afterwards. You could add this command to the |system call| option. + +Alternatively, you can use |latex| and |dvips| for image conversion as is explained for the |system call| option, see page~\pageref{extlib:systemcall:option}. See the documentation for the basic level externalization in section~\ref{section-external} for restrictions of other drivers. + +\subsection{Bitmap Graphics Export} +Occasionally, you may have an extremely large graphics which takes long times to render. It might be interesting to generate a bitmap (raster) image, which displays much faster (for example in a presentation). I have used this feature to speed-up the display of large shadings. + +The |external| library can be customized to export bitmap images -- with the help of external programs. Due to the dependence of external programs, you may need to adjust these commands manually. For example, on my computer, the ImageMagick Suite is installed which comes with the |convert| tool. Together with |pdflatex|, I can define the following style: +\begin{codeexample}[code only] +\tikzset{ + % Defines a custom style which generates BOTH, .pdf and .png export + % but prefers the .png on inclusion. + % + % This style is not pre-defined, you may need to copy-paste and + % adjust it. + png export/.style={ + external/system call/.add= + {} + {; convert -density 300 -transparent white "\image.pdf" "\image.png"}, + % + /pgf/images/external info, + /pgf/images/include external/.code={% + \includegraphics + [width=\pgfexternalwidth,height=\pgfexternalheight] + {##1.png}% + }, + } +} +\end{codeexample} +\noindent The example above defines a new style called `|png export|' which, when it is set with |\tikzset{png export}| somewhere in the document, modifies the configuration for both, file generation and file input. The file generation is modified by appending the ImageMagick command to |system call| (separated by `|;|' as usual on Linux). This is, in principle, enough to generate a |.png| file. The |include external| command is overwritten such that it uses the |.png| file instead of the |.pdf| file (which exists as well in the configuration above). But since a |.png| file can have a much higher resolution than the desired image dimensions, we have to add |width| and |height| explicitly. Usually, the |external| library does not provide size information (it is unnecessary for |.pdf| or |.eps| since these formats have their bounding box information). To enable size information, the style uses the |external info| key which, in turn, provides the |\pgfexternalwidth| and |\pgfexternalheight| commands. + +Now, we can use |\tikzset{png export}| either document--wide or just for one particular image. The configuration remains in effect until the end of the actual environment (or until the next closing curly brace `|}|'). + +\begin{key}{/pgf/images/external info=\mchoice{true,false} (initially false)} + If this key is activated, the size for any externalized image will be stored explicitly into the associated |.dpth| file. + + When the file is included by |\pgfincludeexternalgraphics| (or automatically by the |external| library), the width is available as \declareandlabel{\pgfexternalwidth} and the height as \declareandlabel{\pgfexternalheight}. +\end{key} + +\subsection{Compatibility Issues} +\subsubsection{References In External Pictures} +It is allowed if a picture contains references, for example |\tikz \node {Reference to \ref{a:label}};|. + +There is just one issue: if the main job is currently compiling, its |.aux| file is not in its final state (even worse: it may not be readable at all). The picture externalization, however, needs the main |.aux| file to query any references. + +Thus, you \emph{will} need to invoke |pdflatex -jobname |\meta{image}| |\meta{mainfile} \emph{manually} for any image which contains references. + +This problem arises only for |mode=convert with system call|. In this case, the |external| library creates a special |\jobname.auxlock| file to check whether the main |.aux| file is currently usable. + +\subsubsection{Compatibility With Other Libraries or Packages} +The |external| library has the following compatibility issues: +\begin{enumerate} + \item The |external| library comes with special support for |\usetikzlibrary{fadings}|: the |fadings| library may define local pictures which would be externalized (although they shouldn't). There is special handling to suppress this bug if |\tikzexternalize| is called \emph{after} |\usetikzlibrary{fadings}| or if all fadings are defined \emph{before} |\tikzexternalize|. + + \item Problems have been reported when using |\tikzexternalize| (or the basic layer externalization) together with |\usepackage{glossary}|. This problem disappears if |\tikzexternalize| is called \emph{before} |\usepackage{glossary}|. + + \item Problems with |\usepackage{pdfpages}| and |\usepackage{vmargin}|: The |external| library replaces the current shipout routine of \TeX\ during its externalization. This might raise problems with other packages which also manipulate the shipout routine (like the mentioned ones). + + To fix those problems, use +\begin{codeexample}[code only] + +\usetikzlibrary{external} + +\tikzifexternalizing{% + % don't include package XYZ here +}{% + \usepackage{pdfpages} + \usepackage{vmargin} + ... +}% +\end{codeexample} + This uses the requested packages for the main document, but not for the single, exported graphics. +\end{enumerate} + +In general, the |\tikzifexternalizing| feature might be used to solve package conflicts and the |\tikzexternaldisable| and |\tikzexternalenable| features can be used to solve problems with single pictures. + +\subsubsection{Compatibility With Bounding Box Restrictions} +Bounding box restrictions provide no problem when used with \eps\ graphics. However, they pose problems for |pdflatex|, so you may need to use the |latex| / |dvips| combination if you use bounding box restrictions and externalization. Currently, the only possibility for bounding box restrictions and |pdflatex| is to use a combination of |trim left| / |trim right| / |baseline|: these keys do not \emph{really} truncate the bounding box, they only store horizontal and vertical shifts (also see the |trim lowlevel| key in this context). + +\subsubsection{Interoperability With The Basic Layer Externalization} +This library is fully compatible with |\beginpgfgraphicnamed|$\dotsc$|\endpgfgraphicnamed| environments. However, you will need to use the |export next=false| key to avoid conflicts: +\begin{codeexample}[code only] +\beginpgfgraphicnamed{picture4} +\tikzset{external/export next=false} +\begin{tikzpicture} + \draw (0,0) -- (4,4); +\end{tikzpicture} +\endpgfgraphicnamed +\end{codeexample} +Please keep in mind that file prefixes do not apply to the basic layer. +} +\endinput diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex index 2108e77e333..5e0dab698db 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex @@ -12,11 +12,11 @@ \label{section-library-fit} \begin{tikzlibrary}{fit} - The library defines (currently only one) option for fitting a node + The library defines (currently only two) options for fitting a node so that it contains a set of coordinates. \end{tikzlibrary} -When you load this library, the following option becomes available: +When you load this library, the following options become available: \begin{key}{/tikz/fit=\meta{coordinates or nodes}} This option must be given to a |node| path command. The @@ -49,7 +49,7 @@ When you load this library, the following option becomes available: \node[draw=red, fit=(a) (b) (c) (d) (e)] {box}; \node[draw,circle,fit=(a) (b) (c) (d) (e)] {}; -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} Every time the |fit| option is used, the following style is also @@ -61,14 +61,14 @@ When you load this library, the following option becomes available: The exact effects of the |fit| option are the following: \begin{enumerate} - \item A minimal bounding box containg all coordinates is + \item A minimal bounding box containing all coordinates is computed. Note that if a coordinate like |(a)| is used that contain a node name, this has the same effect as explicitly providing the |(a.north)| and |(a.south)| and |(a.west)| and |(a.east)|. If you wish to refer only to the center of the |a| node, use |(a.center)| instead. \item The |text width| option is set to the width of this bounding box. - \item The |text centered| option is set. + \item The |align=center| option is set. \item The |anchor| is set to |center|. \item The |at| position of the node is set to the center of the computed bounding box. @@ -85,11 +85,11 @@ When you load this library, the following option becomes available: |fit| option that does not contain any text, give it a name, and then use normal nodes to add text at the desired positions. Alternatively, consider using the |label| or |pin| - options. + options. Suppose, for instance, that in the above example we want the word ``box'' to appear inside the box, but at its top. This can be - achieved as follows: + achieved as follows: \begin{codeexample}[] \begin{tikzpicture}[inner sep=0pt,thick, dot/.style={fill=blue,circle,minimum size=3pt}] @@ -102,10 +102,10 @@ When you load this library, the following option becomes available: \node[draw=red,fit=(a) (b) (c) (d) (e)] (fit) {}; \node[below] at (fit.north) {box}; -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} - Here is a real-life example that uses fitting: + Here is a real-life example that uses fitting: \begin{codeexample}[] \begin{tikzpicture} @@ -125,17 +125,36 @@ When you load this library, the following option becomes available: child { node [vertex,leaf=b] {} } } child { node [vertex,leaf=a] {} } } child { node [coordinate] {} - child[missing] + child[missing] child { node [vertex] (f's parent) {} child { node [vertex,leaf=c] {} } child { node [vertex,leaf=f] {} } } } edge from parent node {$\rho$} }; - + \node [fit=(d) (e) (b) (b's parent),label=above left:$F^{(b,R)}$] {}; \node [fit=(c) (f) (f's parent),label=above right:$F^{(c,R)}$] {}; \end{tikzpicture} \end{codeexample} - \end{key} +\begin{key}{/tikz/rotate fit=\meta{angle} (initially 0)} + This key fits \meta{coordinates or nodes} inside a node that is + rotated by \meta{angle}. As a side effect, it also sets the + |/tikz/rotate| key. + +\begin{codeexample}[] +\begin{tikzpicture}[inner sep=0pt,thick, + dot/.style={fill=blue,circle,minimum size=3pt}] + \draw[help lines] (0,0) grid (3,2); + \node[dot] (a) at (1,1) {}; + \node[dot] (b) at (2,2) {}; + \node[dot] (c) at (1,2) {}; + \node[dot] (d) at (1.25,0.25) {}; + \node[dot] (e) at (1.75,1.5) {}; + \node[draw, fit=(a) (b) (c) (d) (e)] {}; + \node[draw=red, rotate fit=30, fit=(a) (b) (c) (d) (e)] {}; +\end{tikzpicture} +\end{codeexample} + +\end{key} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex new file mode 100644 index 00000000000..335bac3ed2d --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex @@ -0,0 +1,151 @@ +% Copyright 2008 by Mark Wibrow +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Fixed Point Arithmetic Library} + +\begin{pgflibrary}{fixedpointarithmetic} + This library provides an interface to the \LaTeX{} package + |fp| for fixed point arithmetic. In addition to loading this + library you must ensure |fp| is loaded otherwise errors + will occur. +\end{pgflibrary} + +\subsection{Overview} + + Whilst the mathematical engine that comes with \pgfname{} is + reasonably fast and flexible when it comes to parsing, the accuracy + tends to be fairly low, particularly for expressions involving many + operations chained together. In addition the range of values that + can be computed is very small: $\pm16383.99999$. + Conversely, the |fp| package has a reasonably high accuracy, and + can perform computations over a wide range of + values (approximately $\pm9.999\times10^{17}$), but is comparatively + slow and not very + flexible, particularly regarding parsing. + + This library enables the combination of the two: the flexible parser + of the \pgfname{} mathematical engine with the evaluation accuracy + of |fp|. There are, however, a number of important points to + bear in mind: + +\begin{itemize} + + \item + + Whilst |fp| supports very large numbers, \pgfname{} and + \tikzname{} do not. It is possible to calculate the result of + |2^20| or |1.2e10+3.4e10|, but it is not possible to use these + results in pictures directly without some ``extra work''. + + \item + + The \pgfname{} mathematical engine will still be used to evaluate + lengths, such as |10pt| or |3em|, so it is not possible for an + length to exceed the range of values supported by + \TeX-dimensions ($\pm16383.99999$pt), even though the resulting + expression is within the range of |fp|. So, for example, one can + calculate |3cm*10000|, but not |3*10000cm|. + + \item + + Not all of the functions listed in Section~\ref{pgfmath-syntax}, + have been mapped onto |fp| equivalents. Of those that have been, + it is not guaranteed that functions will perform in the same way as + they do in \pgfname. Reference should be made to the documentation + for |fp|. + + \item + + In \pgfname, trigonometric functions such as |sin| and |cos| assume + arguments are in degrees, and functions such as |asin| and |acos| + return results in degrees. Although |fp| uses radians for such + functions, \pgfname{} automatically converts arguments from degrees + to radians, and converts results from radians to degrees, to ensure + everything ``works properly''. + + \item + + The overall speed will actually be slower than using + \pgfname{} mathematical engine. The calculating power of |fp| + comes at the cost of an increased processing time. + + +\end{itemize} + +\subsection{Using Fixed Point Arithmetic in PGF and \tikzname} + + The following key is provided to use |fp| in \pgfname{} + and \tikzname: + +\begin{key}{/pgf/fixed point arithmetic=\meta{options}} +\keyalias{tikz} + + This key will set the key path to |/pgf/fixed point|, and + execute \meta{options}. Then it will install the necessary + commands so that the \pgfname{} parser will use |fp| to perform + calculations. + The best way to use this key is as an argument to a scope or + picture. This means that |fp| does not always have to be used, + and \pgfname{} can use its own mathematical engine at other times, + which can lead to a significant reduction in the time for a document + to compile. + +\end{key} + + Currently there are only a few keys key supported for \meta{options}: + +\begin{key}{/pgf/fixed point/scale results=\meta{factor}} + + As noted above, |fp| can process a far greater range of numbers + than \pgfname{} and \tikzname{}. In order to use results from + |fp| in a |{pgfpicture}| or a |{tikzpicture}| they need to be + scaled. When this key is used \pgfname{} will scale results + of any evaluation by \meta{factor}. However, as it is not + desirable for every part of every expression to be scaled, + scaling will only take place if a special prefix |*| is used. + If |*| is used at the beginning of an expression the evaluation + of the expression will evaluated and then multiplied by + \meta{factor}. + +\begin{codeexample}[] +\begin{tikzpicture}[fixed point arithmetic={scale results=10^-6}] +\draw [help lines] grid (3,2); +\draw (0,0) -- (2,2); +\draw [red, line width=4pt] (*1.0e6,0) -- (*3.0e6,*2.0e6); +\end{tikzpicture} +\end{codeexample} + + A special case of scaling involves plots of data containing + large numbers from files. + It is possible to ``pre-process'' a file, typically using the + application that generates the data, to either precede + the relevant column with |*| or to perform the scaling as part + of the calculation process. However, it may be desirable for + the data in a plot to appear in a table as well, so, two files would + be required, one pre-processed for plotting, and one not. This + extra work may be undesirable so the following keys are provided: + +\begin{key}{/pgf/fixed point/scale file plot x=\meta{factor}} + This key will scale the first column of data read from + a file before it is plotted. It is independent of the + |scale results| key. +\end{key} + +\begin{key}{/pgf/fixed point/scale file plot y=\meta{factor}} + This key will scale the second column of data read from + a file before it is plotted. +\end{key} + +\begin{key}{/pgf/fixed point/scale file plot z=\meta{factor}} + This key will scale the third column of data read from + a file before it is plotted. +\end{key} + +\end{key} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex new file mode 100644 index 00000000000..88784f3b9be --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex @@ -0,0 +1,477 @@ +% Copyright 2008 by Christian Feuersaenger +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Floating Point Unit Library} +{\noindent {\emph{by Christian Feuers\"anger}}} +\label{pgfmath-floatunit} +\label{section-library-fpu} + +\begingroup +\pgfqkeys{/pgf/number format}{sci} +\pgfkeys{/pgf/fpu} + +\begin{pgflibrary}{fpu} + The floating point unit (fpu) allows the full data range of scientific computing for use in \pgfname. Its core is the \pgfname\ math routines for mantissa operations, leading to a reasonable trade--of between speed and accuracy. It does not require any third--party packages or external programs. +\end{pgflibrary} + +\subsection{Overview} +The fpu provides a replacement set of math commands which can be installed in isolated placed to achieve large data ranges at reasonable accuracy. It provides at least\footnote{To be more precise, the FPU's exponent is currently a 32 bit integer. That means it supports a significantly larger data range than an IEEE double precision number -- but if a future \TeX\ version may provide lowlevel access to doubles, this may change.} the IEEE double precision data range, $\pgfmathprintnumber{-1e+324}, \dotsc, \pgfmathprintnumber{+1e324}$. The absolute smallest number bigger than zero is $\pgfmathprintnumber{1e-324}$. The FPU's relative precision is at least $\pgfmathprintnumber{1e-4}$ although operations like addition have a relative precision of $\pgfmathprintnumber{1e-6}$. + +Note that the library has not really been tested together with any drawing operations. It should be used to work with arbitrary input data which is then transformed somehow into \pgfname\ precision. This, in turn, can be processed by \pgfname. + +\subsection{Usage} +\begin{key}{/pgf/fpu=\marg{boolean} (default true)} + This key installs or uninstalls the FPU. The installation exchanges any routines of the standard math parser with those of the FPU: |\pgfmathadd| will be replaced with |\pgfmathfloatadd| and so on. Furthermore, any number will be parsed with |\pgfmathfloatparsenumber|. + +\begin{codeexample}[] +\pgfkeys{/pgf/fpu} +\pgfmathparse{1+1}\pgfmathresult +\end{codeexample} +\noindent The FPU uses a lowlevel number representation consisting of flags, mantissa and exponent\footnote{Users should \emph{always} use high level routines to manipulate floating point numbers as the format may change in a future release.}. To avoid unnecessary format conversions, |\pgfmathresult| will usually contain such a cryptic number. Depending on the context, the result may need to be converted into something which is suitable for \pgfname\ processing (like coordinates) or may need to be typeset. The FPU provides such methods as well. + +%-------------------------------------------------- +% \begin{codeexample}[] +% \begin{tikzpicture} +% \fill[red,fpu,/pgf/fpu/scale results=1e-10] (*1.234e10,*1e10) -- (*2e10,*2e10); +% \end{tikzpicture} +% \end{codeexample} +%-------------------------------------------------- + + Use |fpu=false| to deactivate the FPU. This will restore any change. Please note that this is not necessary if the FPU is used inside of a \TeX\ group -- it will be deactivated afterwards anyway. + + It does not hurt to call |fpu=true| or |fpu=false| multiple times. + + Please note that if the |fixed point arithmetics| library of \pgfname\ will be activated after the FPU, the FPU will be deactivated automatically. +\end{key} + +\begin{key}{/pgf/fpu/output format=\mchoice{float,sci,fixed} (initially float)} + This key allows to change the number format in which the FPU assigns |\pgfmathresult|. + + The predefined choice |float| uses the low-level format used by the FPU. This is useful for further processing inside of any library. +\begin{codeexample}[] +\pgfkeys{/pgf/fpu,/pgf/fpu/output format=float} +\pgfmathparse{exp(50)*42}\pgfmathresult +\end{codeexample} + + The choice |sci| returns numbers in the format \meta{mantissa}|e|\meta{exponent}. It provides almost no computational overhead. +\begin{codeexample}[] +\pgfkeys{/pgf/fpu,/pgf/fpu/output format=sci} +\pgfmathparse{4.22e-8^-2}\pgfmathresult +\end{codeexample} + + The choice |fixed| returns normal fixed point numbers and provides the highest compatibility with the \pgfname\ engine. It is activated automatically in case the FPU scales results. +\begin{codeexample}[] +\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed} +\pgfmathparse{sqrt(1e-12)}\pgfmathresult +\end{codeexample} +\end{key} + +\begin{key}{/pgf/fpu/scale results=\marg{scale}} + A feature which allows semi--automatic result scaling. Setting this key has two effects: first, the output format for \emph{any} computation will be set to |fixed| (assuming results will be processed by \pgfname's kernel). Second, any expression which starts with a star, |*|, will be multiplied with \marg{scale}. +\end{key} + +\begin{keylist}{ + /pgf/fpu/scale file plot x=\marg{scale},% + /pgf/fpu/scale file plot y=\marg{scale},% + /pgf/fpu/scale file plot z=\marg{scale}}% + These keys will patch \pgfname's |plot file| command to automatically scale single coordinates by \marg{scale}. + + The initial setting does not scale |plot file|. +\end{keylist} + +\begin{command}{\pgflibraryfpuifactive\marg{true-code}\marg{false-code}} + This command can be used to execute dependent on whether the FPU has been activated or not. +\end{command} + +\subsection{Comparison to the fixed point arithmetics library} +There are other ways to increase the data range and/or the precision of \pgfname's math parser. One of them is the |fp| package, preferable combined with \pgfname's |fixed point arithmetic| library. The differences between the FPU and |fp| are: +\begin{itemize} + \item The FPU supports at least the complete IEEE double precision number range, while |fp| covers only numbers of magnitude $\pm\pgfmathprintnumber{1e17}$. + \item The FPU has a uniform relative precision of about 4--5 correct digits. The fixed point library has an absolute precision which may perform good in many cases -- but will fail at the ends of the data range (as every fixed point routines does). + \item The FPU has potential to be faster than |fp| as it has access to fast mantissa operations using \pgfname's math capabilities (which use \TeX\ registers). +\end{itemize} + +\subsection{Command Reference and Programmer's Manual} + +\subsubsection{Creating and Converting Floats} +\begin{command}{\pgfmathfloatparsenumber\marg{x}} + Reads a number of arbitrary magnitude and precision and stores its result into |\pgfmathresult| as floating point number $m \cdot 10^e$ with mantissa and exponent base~$10$. + + The algorithm and the storage format is purely text-based. The number is stored as a triple of flags, a positive mantissa and an exponent, such as +\begin{codeexample}[] +\pgfmathfloatparsenumber{2} +\pgfmathresult +\end{codeexample} + Please do not rely on the low-level representation here, use |\pgfmathfloattomacro| (and its variants) and |\pgfmathfloatcreate| if you want to work with these components. + + The flags encoded in |\pgfmathresult| are represented as a digit where `$0$' stands for the number $\pm 0\cdot 10^0$, `$1$' stands for a positive sign, `$2$' means a negative sign, `$3$' stands for `not a number', `$4$' means $+\infty$ and `$5$' stands for $-\infty$. + + The mantissa is a normalized real number $m \in \mathbb{R}$, $1 \le m < 10$. It always contains a period and at least one digit after the period. The exponent is an integer. + + Examples: +\begin{codeexample}[] +\pgfmathfloatparsenumber{0} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\end{codeexample} + +\begin{codeexample}[] +\pgfmathfloatparsenumber{0.2} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\end{codeexample} + +\begin{codeexample}[] +\pgfmathfloatparsenumber{42} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\end{codeexample} + +\begin{codeexample}[] +\pgfmathfloatparsenumber{20.5E+2} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\end{codeexample} + +\begin{codeexample}[] +\pgfmathfloatparsenumber{1e6} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\end{codeexample} + +\begin{codeexample}[] +\pgfmathfloatparsenumber{5.21513e-11} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\end{codeexample} + The argument \marg{x} may be given in fixed point format or the scientific `e' (or `E') notation. The scientific notation does not necessarily need to be normalized. The supported exponent range is (currently) only limited by the \TeX-integer range (which uses 31 bit integer numbers). +\end{command} + +\begin{key}{/pgf/fpu/handlers/empty number=\marg{input}\marg{unreadable part}} + This command key is invoked in case an empty string is parsed inside of |\pgfmathfloatparsenumber|. You can overwrite it to assign a replacement |\pgfmathresult| (in float!). + + The initial setting is to invoke |invalid number|, see below. +\end{key} +\begin{key}{/pgf/fpu/handlers/invalid number=\marg{input}\marg{unreadable part}} + This command key is invoked in case an invalid string is parsed inside of |\pgfmathfloatparsenumber|. You can overwrite it to assign a replacement |\pgfmathresult| (in float!). + + The initial setting is to generate an error message. +\end{key} +\begin{key}{/pgf/fpu/handlers/wrong lowlevel format=\marg{input}\marg{unreadable part}} + This command key is invoked whenever |\pgfmathfloattoregisters| or its variants encounter something which is no properly formatted lowlevel floating point number. As for |invalid number|, this key may assign a new |\pgfmathresult| (in floating point) which will be used instead of the offending \marg{input}. + + The initial setting is to generate an error message. +\end{key} + +\begin{command}{\pgfmathfloatqparsenumber\marg{x}} + The same as |\pgfmathfloatparsenumber|, but does not perform sanity checking. +\end{command} + +\begin{command}{\pgfmathfloattofixed{\marg{x}}} + Converts a number in floating point representation to a fixed point number. It is a counterpart to |\pgfmathfloatparsenumber|. The algorithm is purely text based and defines |\pgfmathresult| as a string sequence which represents the floating point number \marg{x} as a fixed point number (of arbitrary precision). + +\begin{codeexample}[] +\pgfmathfloatparsenumber{0.00052} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E +$\to$ +\pgfmathfloattofixed{\pgfmathresult} +\pgfmathresult +\end{codeexample} + +\begin{codeexample}[] +\pgfmathfloatparsenumber{123.456e4} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E +$\to$ +\pgfmathfloattofixed{\pgfmathresult} +\pgfmathresult +\end{codeexample} +\end{command} + +\begin{command}{\pgfmathfloattoint\marg{x}} + Converts a number from low-level floating point representation to an integer (by truncating the fractional part). +\begin{codeexample}[] +\pgfmathfloatparsenumber{123456} +\pgfmathfloattoint{\pgfmathresult} +\pgfmathresult +\end{codeexample} + + See also |\pgfmathfloatint| which returns the result as float. +\end{command} + +\begin{command}{\pgfmathfloattosci\marg{float}} + Converts a number from low-level floating point representation to scientific format, $1.234e4$. The result will be assigned to the macro |\pgfmathresult|. +\end{command} +\begin{command}{\pgfmathfloatvalueof\marg{float}} + Expands a number from low-level floating point representation to scientific format, $1.234e4$. + + Use |\pgfmathfloatvalueof| in contexts where only expandable macros are allowed. +\end{command} + +\begin{command}{\pgfmathfloatcreate{\marg{flags}}{\marg{mantissa}}{\marg{exponent}}} + Defines |\pgfmathresult| as the floating point number encoded by + \marg{flags}, \marg{mantissa} and \marg{exponent}. + + All arguments are characters and will be expanded using |\edef|. +\begin{codeexample}[] +\pgfmathfloatcreate{1}{1.0}{327} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E +\end{codeexample} +\end{command} + +\begin{command}{\pgfmathfloatifflags\marg{floating point number}\marg{flag}\marg{true-code}\marg{false-code}} + Invokes \marg{true-code} if the flag of \marg{floating point number} equals \marg{flag} and \marg{false-code} otherwise. + + The argument \marg{flag} can be one of + \begin{description} + \item[0] to test for zero, + \item[1] to test for positive numbers, + \item[+] to test for positive numbers, + \item[2] to test for negative numbers, + \item[-] to test for negative numbers, + \item[3] for ``not-a-number'', + \item[4] for $+\infty$, + \item[5] for $-\infty$. + \end{description} + +\begin{codeexample}[] +\pgfmathfloatparsenumber{42} +\pgfmathfloatifflags{\pgfmathresult}{0}{It's zero!}{It's not zero!} +\pgfmathfloatifflags{\pgfmathresult}{1}{It's positive!}{It's not positive!} +\pgfmathfloatifflags{\pgfmathresult}{2}{It's negative!}{It's not negative!} + +% or, equivalently +\pgfmathfloatifflags{\pgfmathresult}{+}{It's positive!}{It's not positive!} +\pgfmathfloatifflags{\pgfmathresult}{-}{It's negative!}{It's not negative!} +\end{codeexample} +\end{command} + + +\begin{command}{\pgfmathfloattomacro{\marg{x}}{\marg{flagsmacro}}{\marg{mantissamacro}}{\marg{exponentmacro}}} + Extracts the flags of a floating point number \marg{x} to \marg{flagsmacro}, the mantissa to \marg{mantissamacro} and the exponent to \marg{exponentmacro}. +\end{command} + +\begin{command}{\pgfmathfloattoregisters{\marg{x}}{\marg{flagscount}}{\marg{mantissadimen}}{\marg{exponentcount}}} + Takes a floating point number \marg{x} as input and writes flags to count + register \marg{flagscount}, mantissa to dimen register \marg{mantissadimen} and exponent to count + register \marg{exponentcount}. + + Please note that this method rounds the mantissa to \TeX-precision. +\end{command} + +\begin{command}{\pgfmathfloattoregisterstok{\marg{x}}{\marg{flagscount}}{\marg{mantissatoks}}{\marg{exponentcount}}} + A variant of |\pgfmathfloattoregisters| which writes the mantissa into a token register. It maintains the full input precision. +\end{command} + +\begin{command}{\pgfmathfloatgetflags{\marg{x}}{\marg{flagscount}}} + Extracts the flags of \marg{x} into the count register \marg{flagscount}. +\end{command} + +\begin{command}{\pgfmathfloatgetflagstomacro{\marg{x}}{\marg{\textbackslash macro}}} + Extracts the flags of \marg{x} into the macro \meta{\textbackslash macro}. +\end{command} + +\begin{command}{\pgfmathfloatgetmantissa{\marg{x}}{\marg{mantissadimen}}} + Extracts the mantissa of \marg{x} into the dimen register \marg{mantissadimen}. +\end{command} +\begin{command}{\pgfmathfloatgetmantissatok{\marg{x}}{\marg{mantissatoks}}} + Extracts the mantissa of \marg{x} into the token register \marg{mantissatoks}. +\end{command} +\begin{command}{\pgfmathfloatgetexponent{\marg{x}}{\marg{exponentcount}}} + Extracts the exponent of \marg{x} into the count register \marg{exponentcount}. +\end{command} + +\subsubsection{Symbolic Rounding Operations} +Commands in this section constitute the basic level implementations of the rounding routines. They work symbolically, i.e.\ they operate on text, not on numbers and allow arbitrarily large numbers. + +\begin{command}{\pgfmathroundto{\marg{x}}} + Rounds a fixed point number to prescribed precision and writes the result to |\pgfmathresult|. + + The desired precision can be configured with |/pgf/number format/precision|, see section~\ref{pgfmath-numberprinting}. This section does also contain application examples. + + Any trailing zeros after the period are discarded. The algorithm is purely text based and allows to deal with precisions beyond \TeX's fixed point support. + + As a side effect, the global boolean |\ifpgfmathfloatroundhasperiod| will be set to true if and only if the resulting mantissa has a period. Furthermore, |\ifpgfmathfloatroundmayneedrenormalize| will be set to true if and only if the rounding result's floating point representation would have a larger exponent than \marg{x}. +\begin{codeexample}[] +\pgfmathroundto{1} +\pgfmathresult +\end{codeexample} +\begin{codeexample}[] +\pgfmathroundto{4.685} +\pgfmathresult +\end{codeexample} +\begin{codeexample}[] +\pgfmathroundto{19999.9996} +\pgfmathresult +\end{codeexample} +\end{command} + +\begin{command}{\pgfmathroundtozerofill{\marg{x}}} + A variant of |\pgfmathroundto| which always uses a fixed number of digits behind the period. It fills missing digits with zeros. +\begin{codeexample}[] +\pgfmathroundtozerofill{1} +\pgfmathresult +\end{codeexample} +\begin{codeexample}[] +\pgfmathroundto{4.685} +\pgfmathresult +\end{codeexample} +\begin{codeexample}[] +\pgfmathroundtozerofill{19999.9996} +\pgfmathresult +\end{codeexample} +\end{command} + +\begin{command}{\pgfmathfloatround{\marg{x}}} + Rounds a normalized floating point number to a prescribed precision and writes the result to |\pgfmathresult|. + + The desired precision can be configured with |/pgf/number format/precision|, see section~\ref{pgfmath-numberprinting}. + + This method employs |\pgfmathroundto| to round the mantissa and applies renormalization if necessary. + + As a side effect, the global boolean |\ifpgfmathfloatroundhasperiod| will be set to true if and only if the resulting mantissa has a period. +\begin{codeexample}[] +\pgfmathfloatparsenumber{52.5864} +\pgfmathfloatround{\pgfmathresult} +\pgfmathfloattosci{\pgfmathresult} +\pgfmathresult +\end{codeexample} +\begin{codeexample}[] +\pgfmathfloatparsenumber{9.995} +\pgfmathfloatround{\pgfmathresult} +\pgfmathfloattosci{\pgfmathresult} +\pgfmathresult +\end{codeexample} +\end{command} + +\begin{command}{\pgfmathfloatroundzerofill{\marg{x}}} + A variant of |\pgfmathfloatround| produces always the same number of digits after the period (it includes zeros if necessary). +\begin{codeexample}[] +\pgfmathfloatparsenumber{52.5864} +\pgfmathfloatroundzerofill{\pgfmathresult} +\pgfmathfloattosci{\pgfmathresult} +\pgfmathresult +\end{codeexample} +\begin{codeexample}[] +\pgfmathfloatparsenumber{9.995} +\pgfmathfloatroundzerofill{\pgfmathresult} +\pgfmathfloattosci{\pgfmathresult} +\pgfmathresult +\end{codeexample} +\end{command} + +\subsubsection{Math Operations Commands} +This sections describes some of the replacement commands in more details. + +Please note that these commands can be used even if the |fpu| as such has not been activated -- it is sufficient to load the library. + +\begin{command}{\pgfmathfloat\meta{op}} + Methods of this form constitute the replacement operations where \meta{op} can be any of the well--known math operations. + + Thus, \declareandlabel{\pgfmathfloatadd} is the counterpart for |\pgfmathadd| and so on. The semantics and number of arguments is the same, but all input and output arguments are \emph{expected} to be floating point numbers. +\end{command} + +\begin{command}{\pgfmathfloattoextentedprecision{\marg{x}}} +Renormalizes \marg{x} to extended precision mantissa, meaning +$100 \le m < 1000$ instead of $1 \le m < 10$. + +The `extended precision' means we have higher accuracy when we apply pgfmath operations to mantissas. + +The input argument is expected to be a normalized floating point number; the output argument is a non-normalized floating point number (well, normalized to extended precision). + +The operation is supposed to be very fast. +\end{command} + +\begin{command}{\pgfmathfloatsetextprecision\marg{shift}} + Sets the precision used inside of |\pgfmathfloattoextentedprecision| to \marg{shift}. + + The different choices are + + \begin{tabular}{llrll} + 0 & normalization to & $0$ & $\le m < 1$ & (disable extended precision)\\ + 1 & normalization to & $10$ & $\le m < 100$ \\ + 2 & normalization to & $100$ & $\le m < 1000$ & (default of |\pgfmathfloattoextentedprecision|)\\ + 3 & normalization to & $1000$ & $\le m < 10000$ \\ + \end{tabular} +\end{command} + +\begin{command}{\pgfmathfloatlessthan{\marg{x}}{\marg{y}}} + Defines |\pgfmathresult| as $1.0$ if $\meta{x} < \meta{y}$, but $0.0$ otherwise. It also sets the global \TeX-boolean |\pgfmathfloatcomparison| accordingly. The arguments \marg{x} and \marg{y} are expected to be numbers which have already been processed by |\pgfmathfloatparsenumber|. Arithmetics is carried out using \TeX-registers for exponent- and mantissa comparison. +\end{command} + +\begin{command}{\pgfmathfloatmultiplyfixed\marg{float}\marg{fixed}} + Defines |\pgfmathresult| to be $\meta{float} \cdot \meta{fixed}$ where \meta{float} is a floating point number and \meta{fixed} is a fixed point number. The computation is performed in floating point arithmetics, that means we compute $m \cdot \meta{fixed}$ and renormalizes the result where $m$ is the mantissa of \meta{float}. + + This operation renormalizes \meta{float} with |\pgfmathfloattoextentedprecision| before the operation, that means it is intended for relatively small arguments of \meta{fixed}. The result is a floating point number. +\end{command} + +\begin{command}{\pgfmathfloatifapproxequalrel\marg{a}\marg{b}\marg{true-code}\marg{false-code}} + Computes the relative error between \meta{a} and \meta{b} (assuming \meta{b}$\neq 0$) and + invokes \meta{true-code} if the relative error is below |/pgf/fpu/rel thresh| and + \meta{false-code} if that is not the case. + + The input arguments will be parsed with |\pgfmathfloatparsenumber|. + + \begin{key}{/pgf/fpu/rel thresh=\marg{number} (initially 1e-4)} + A threshold used by |\pgfmathfloatifapproxequalrel| to decide whether numbers are approximately equal. + \end{key} +\end{command} + + +\begin{command}{\pgfmathfloatshift{\marg{x}}{\marg{num}}} + Defines |\pgfmathresult| to be $\meta{x} \cdot 10^{\meta{num}}$. The operation is an arithmetic shift base ten and modifies only the exponent of \marg{x}. The argument \marg{num} is expected to be a (positive or negative) integer. +\end{command} + + +\begin{command}{\pgfmathfloatabserror\marg{x}\marg{y}} + Defines |\pgfmathresult| to be the absolute error between two floating point numbers $x$ and $y$, $\lvert x - y\rvert $ and returns the result as floating point number. +\end{command} + +\begin{command}{\pgfmathfloatrelerror\marg{x}\marg{y}} + Defines |\pgfmathresult| to be the relative error between two floating point numbers $x$ and $y$, $\lvert x - y\rvert / \lvert y \rvert $ and returns the result as floating point number. +\end{command} + + +\begin{command}{\pgfmathfloatint\marg{x}} +Returns the integer part of the floating point number \marg{x}, by truncating any digits after the period. This methods is applied to the absolute value $\rvert x \lvert$, so negative numbers are treated in the same way as positive ones. + +The result is returned as floating point number as well. + +See also |\pgfmathfloattoint| which returns the number in integer format. +\end{command} + +\begin{command}{\pgfmathlog{\marg{x}}} + Defines |\pgfmathresult| to be the natural logarithm of \marg{x}, $\ln(\meta{x})$. This method is logically the same as |\pgfmathln|, but it applies floating point arithmetics to read number \marg{x} and employs the logarithm identity + \[ \ln(m \cdot 10^e) = \ln(m) + e \cdot \ln(10) \] + to get the result. The factor $\ln(10)$ is a constant, so only $\ln(m)$ with $1 \le m < 10$ needs to be computed. This is done using standard pgf math operations. + + Please note that \marg{x} needs to be a number, expression parsing is not possible here. + + If \marg{x} is \emph{not} a bounded positive real number (for example $\meta{x} \le 0$), |\pgfmathresult| will be \emph{empty}, no error message will be generated. +\begin{codeexample}[] +\pgfmathlog{1.452e-7} +\pgfmathresult +\end{codeexample} +\begin{codeexample}[] +\pgfmathlog{6.426e+8} +\pgfmathresult +\end{codeexample} +\end{command} + +\subsubsection{Accessing the Original Math Routines for Programmers} +As soon as the library is loaded, every private math routine will be copied to a new name. +This allows library and package authors to access the \TeX-register based math routines even if the FPU is activated. And, of course, it allows the FPU as such to perform its own mantissa computations. + +The private implementations of \pgfname\ math commands, which are of the form |\pgfmath|\meta{name}|@|, will be available as|\pgfmath@basic@|\meta{name}|@| as soon as the library is loaded. + + +\endgroup diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex new file mode 100644 index 00000000000..0aeb8113b01 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex @@ -0,0 +1,411 @@ +% Copyright 2008 by Mark Wibrow +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Lindenmayer System Drawing Library} +\subsection{Overview} + +Lindenmayer systems (also commonly known as ``L-systems''), were +originally developed by Aristid Lindenmayer as a theory of algae +growth patterns and then subsequently used to model branching +patterns in plants and produce fractal patterns. +Typically, an L-system consists of a set of symbols, each of which +is associated with some graphical action (such as ``turn left'' or +``move forward'') and a set of rules (``production'' or ``rewrite'' +rules). Given a string of symbols, the rewrite rules are applied +several times and the when resulting string is processed the action +associated with each symbol is executed. + +In \pgfname, L-systems can be used to create simple 2-dimensional +fractal patterns\ldots +\begin{codeexample}[pre={\expandafter\let\csname pgf@lsystem@Koch curve\endcsname=\relax}] +\begin{tikzpicture} +\pgfdeclarelindenmayersystem{Koch curve}{ + \rule{F -> F-F++F-F} +} + +\shadedraw [top color=white, bottom color=blue!50, draw=blue!50!black] + [l-system={Koch curve, step=2pt, angle=60, axiom=F++F++F, order=3}] + lindenmayer system -- cycle; +\end{tikzpicture} +\end{codeexample} + +\noindent\ldots and ``plant like'' patterns\ldots + +\begin{codeexample}[] +\begin{tikzpicture} +\draw [green!50!black, rotate=90] + [l-system={rule set={F -> FF-[-F+F]+[+F-F]}, axiom=F, order=4, step=2pt, + randomize step percent=25, angle=30, randomize angle percent=5}] + lindenmayer system; +\end{tikzpicture} +\end{codeexample} + +\noindent +\ldots but it is important to bear in mind that even moderately +complex L-systems can exceed the available memory of \TeX, +and can be very slow. +If possible, you are advised to increase the main memory and save +stack to their maximum possible values for your particular +\TeX{} distribution. +However, even by doing this you may find you still run out of memory +quite quickly. + +For an excellent introduction to L-systems (containing some +``really cool'' pictures -- many of which are sadly not possible in +\pgfname) +see \emph{The Algorithmic Beauty of Plants} by +Przemyslaw Prusinkiewicz and Aristid Lindenmayer (which is freely +available via the internet). + +\begin{pgflibrary}{lindenmayersystems} + This \pgfname-library provides basic commands for defining and using + simple L-systems. The \tikzname-library provides, furthermore, a + front end for using L-systems in \tikzname. +\end{pgflibrary} + + + +\subsubsection{Declaring L-systems} + Before an L-system can be used, it must be declared using the + following command: + +\begin{command}{\pgfdeclarelindenmayersystem\marg{name}\marg{specification}} + +This command declares a Lindenmayer system called \meta{name}. +The \meta{specification} argument contains a description of the +L-system's symbols and rules. Two commands |\symbol| and |\rule| are +only defined when the \meta{specification} argument is executed. + +\begin{command}{\symbol\marg{name}\marg{code}} + This defines a symbol called \meta{name} for a specific L-system, + and associates it with \meta{code}. + + A symbol should consist of a single + alpha-numeric character (i.e., |A|-|Z|, |a|-|z| or |0|-|9|). + The symbols + |F|, |f|, |+|, |-|, |[| and |]| are available by default so do + not need to be defined for each L-system. However, if you are + feeling adventurous, they can be redefined for specific L-systems + if required. The L-system treats the default symbols as follows + (the commands they execute are described below): + + \begin{itemize} + \item + |F| move forward a certain distance, drawing a line. Uses + |\pgflsystemdrawforward|. + + \item + |f| move forward a certain distance, without drawing a line. + Uses |\pgflsystemmoveforward|. + + \item + |+| turn left by some angle. + Uses |\pgflsystemturnleft|. + + \item + |-| turn right by some angle. + Uses |\pgflsystemturnright|. + + \item + |[| save the current state (i.e., the position and direction). + Uses |\pgflsystemsavestate|. + + \item + |]| restore the last saved state. + Uses |\pgflsystemrestorestate|. + + \end{itemize} + + The symbols |[| and |]| act like a stack: |[| pushes the state of the + L-system on to the stack, and |]| pops a state off the stack. + + When \meta{code} is executed the transformation matrix is set up + so that the origin is at the current position and the positive + x-axis ``points forward'', so |\pgfpathlineto{\pgfpoint{1cm}{0cm}}| + draws a line 1cm forward. + +The following keys can alter the production of an L-system. However, +thy do not store values in themselves. + +\begin{key}{/pgf/lindenmayer system/step=\meta{length} (initially 5pt)} + How far the L-system moves forward if required. This key sets the + \TeX{} dimension |\pgflsystemstep|. +\end{key} + +\begin{key}{/pgf/lindenmayer system/randomize step percent=\meta{percentage} (initially 0)} + If the step is to be randomized, this key specifies by how much. + The value is stored in the \TeX{} macro |\pgflsystemrandomizesteppercent|. +\end{key} + +\begin{key}{/pgf/lindenmayer system/left angle=\meta{angle} (initially 90)} + This key sets the angle through which the L-system turns when it + turns left. + The value is stored in the \TeX{} macro |\pgflsystemrleftangle|. +\end{key} + +\begin{key}{/pgf/lindenmayer system/right angle=\meta{angle} (initially 90)} + This key sets the angle through which the L-system turns when it + turns right. + The value is stored in the \TeX{} macro |\pgflsystemrrightangle|. +\end{key} + +\begin{key}{/pgf/lindenmayer system/randomize angle percent=\meta{percentage} (initially 0)} + If the angles are to be randomized, this key specifies by how much. + The value is stored in the \TeX{} macro |\pgflsystemrandomizeanglepercent|. +\end{key} + +For speed and convenience, when the code for a symbol is executed the +following commands are available. + +\begin{command}{\pgflsystemcurrentstep} + The current ``step'' of the L-system (i.e., how far the system + will move forward if required). This is initially set to the + value in the \TeX-dimensions |\pgflsystemstep|, but the actual + value may be changed if |\pgflsystemrandomizestep| is used + (see below). +\end{command} + +\begin{command}{\pgflsystemcurrentleftangle} + The angle the L-system will turn when it turns left. + The value stored in this macro may be changed if + |\pgflsystemrandomizeleftangle| is used. +\end{command} + +\begin{command}{\pgflsystemcurrentrightangle} + The angle the L-system will turn when it turns right. + The value stored in this macro may be changed if + |\pgflsystemrandomizerightangle| is used. +\end{command} + + +The following commands may be useful if you wish to define your own +symbols. + +\begin{command}{\pgflsystemrandomizestep} + Randomizes the value in |\pgflsystemcurrentstep| according to the + value of the |randomize| |step| |percent| key. +\end{command} + +\begin{command}{\pgflsystemrandomizeleftangle} + Randomizes the value in |\pgflsystemcurrentleftangle| according to + the value of the |randomize| |angle| |percent| key. +\end{command} + +\begin{command}{\pgflsystemrandomizerightangle} + Randomizes the value in |\pgflsystemcurrentrightangle| according + to the value of the |randomize| |angle| key. +\end{command} + +\begin{command}{\pgflsystemdrawforward} + Move forward in the current direction, by |\pgflsystemcurrentstep|, + drawing a line in the process. This macro calls + |\pgflsystemrandomizestep|. Internally, \pgfname{} simply + shifts the transformation matrix in the positive direction of + the current (transformed) x-axis by |\pgflsystemstep| + and then executes a line-to to the (newly transformed) origin. +\end{command} + +\begin{command}{\pgflsystemmoveforward} + Move forward in the current direction, by |\pgflsystemcurrentstep|, + without drawing a line. This macro calls + |\pgflsystemrandomizestep|. \pgfname{} executes a transformation + as above, but executes a move-to to the (newly transformed) + origin. +\end{command} + +\begin{command}{\pgflsystemturnleft} + Turn left by |\pgflsystemcurrentleftangle|. Internally, \pgfname{} + simply rotates the transformation matrix. This macro calls + |\pgflsystemrandomizeleftangle|. +\end{command} + +\begin{command}{\pgflsystemturnright} + Turn right by |\pgflsystemcurrentrightangle|. Internally, \pgfname{} + simply rotates the transformation matrix. This macro calls + |\pgflsystemrandomizerightangle|. +\end{command} + +\begin{command}{\pgflsystemsavestate} + Save the current position and orientation. Internally, + \pgfname{} simply starts a new \TeX-group. +\end{command} + +\begin{command}{\pgflsystemrestorestate} + Restore the last saved position and orientation. Internally, + \pgfname{} closes a \TeX-group, restoring the transformation + matrix of the outer scope, and a move-to command is executed to + the (transformed) origin. +\end{command} + + +\end{command} + +\begin{command}{\rule{\ttfamily\char`\{}\meta{head}{\ttfamily->}\meta{body}{\ttfamily\char`\}}} + Declare a rule. \meta{head} should consist of a single symbol, which + need not have been declared using |\symbol| or exist as a default + symbol (in fact, the more interesting L-systems depend on using + symbols with no corresponding code, to control the ``growth'' of the + system). + \meta{body} consists of a string of symbols, which again need not + necessarily have any code associated with them. + +\end{command} + + As an example, the following shows an L-system that uses + some of these commands. This example illustrates the point + that some symbols, in this case |A| and |B|, do not have to + have code associated with them. They simply control the + growth of the system. + +\begin{codeexample}[pre={\nullfont\expandafter\let\csname pgf@lsystem@Hilbert curve\endcsname=\relax}] +\pgfdeclarelindenmayersystem{Hilbert curve}{ + \symbol{X}{\pgflsystemdrawforward} + \symbol{+}{\pgflsystemturnright} % Explicitly define + and - symbols. + \symbol{-}{\pgflsystemturnleft} + \rule{A -> +BX-AXA-XB+} + \rule{B -> -AX+BXB+XA-} +} +\tikz\draw[lindenmayer system={Hilbert curve, axiom=A, order=4, angle=90}] + lindenmayer system; +\end{codeexample} + + +\end{command} + +\subsection{Using Lindenmayer Systems} +\subsubsection{Using L-Systems in PGF} + +The following command is used to run an L-system in \pgfname: +\begin{command}{\pgflindenmayersystem\marg{name}\marg{axiom}\marg{order}} + Runs the L-system called \meta{name} using the input string \meta{axiom} + for \meta{order} iterations. + In general, prior to calling this command the + transformation matrix should be set appropriately for shifting and + rotating, and a move-to to the (transformed) origin should be + executed. This origin will be where the L-system starts. + In addition the relevant keys should be set appropriately. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \pgfset{lindenmayer system/.cd, angle=60, step=2pt} + \foreach \x/\y in {0cm/1cm, 1.5cm/1.5cm, 2.5cm/0.5cm, 1cm/0cm}{ + \pgftransformshift{\pgfqpoint{\x}{\y}} + \pgfpathmoveto{\pgfpointorigin} + \pgflindenmayersystem{Koch curve}{F++F++F}{2} + \pgfusepath{stroke} + } +\end{tikzpicture} +\end{codeexample} + + Note that, it is perfectly feasible for an L-system to define + special symbols which perform the move-to and use-path + operations. + +\end{command} + +\subsubsection{Using L-Systems in Ti\emph{k}Z} + + In \tikzname, an L-system is created using a path operation. + However, \tikzname{} is more flexible regarding the positioning + of the L-system and also provides keys to create L-systems + ``on-line''. + +\begin{pathoperation}{lindenmayer system}{ \opt{|[|\meta{keys}|]|}} + This will run an L-system according to the parameters + specified in \meta{keys} (which can also contain normal \tikz{} keys + such as |draw| or |thin|). The syntax is flexible + regarding the L-system parameters and the following all do + the same thing: + +\begin{codeexample}[code only] +\draw lindenmayer system [lindenmayer system={Hilbert curve, axiom=4, order=3}]; +\end{codeexample} + +\begin{codeexample}[code only] +\draw [lindenmayer system={Hilbert curve, axiom=4, order=3}] lindenmayer system; +\end{codeexample} + +\begin{codeexample}[code only] +\tikzset{lindenmayer system={Hilbert curve, axiom=4, order=3}} +\draw lindenmayer system; +\end{codeexample} + +\end{pathoperation} + +\begin{pathoperation}{l-system}{ \opt{|[|\meta{keys}|]|}} + A more compact version of the |lindenmayer system| path command. +\end{pathoperation} + +This library adds some additional keys for specifying L-systems. +These keys only work in \tikzname{} and all +have the same path, namely, |/pgf/lindenmayer| |system|, but so +you do not have to keep repeating this path the following keys are +provided: + +\begin{stylekey}{/pgf/lindenmayer system=\marg{keys}} +\keyalias{tikz} +This key changes the key path to |/pgf/lindenmayer systems| and +executes \meta{keys}. +\end{stylekey} + +\begin{stylekey}{/pgf/l-system=\marg{keys}} +\keyalias{tikz} +A more compact version of the previous key. +\end{stylekey} + +\begin{key}{/pgf/lindenmayer system/name=\marg{name}} + Set the name for the L-system. +\end{key} + +\begin{key}{/pgf/lindenmayer system/axiom=\marg{string}} + Set the axiom (or input string) for the L-system. +\end{key} + +\begin{key}{/pgf/lindenmayer system/order=\marg{integer}} + Set the number of iterations the L-system will perform. +\end{key} + +\begin{key}{/pgf/lindenmayer system/rule set=\marg{list}} + This key allows an (anonymous) L-system to be declared ``on-line''. + There is, however, a restriction that only the default symbols can be + used for drawing (empty symbols can still be used to control + the growth of the system). The rules in \meta{list} should + be separated by commas. + +\begin{codeexample}[] +\tikz[rotate=65]\draw [green!60!black] l-system + [l-system={rule set={F -> F[+F]F[-F]}, axiom=F, order=4, angle=25,step=3pt}]; +\end{codeexample} +\end{key} + +\begin{key}{/pgf/lindenmayer system/anchor=\meta{anchor}} + Be default, when this key is not used, the L-system will start from + the last specified coordinate. By using this key, the L-system + will be placed inside a special (rectangle) node which can be + positioned using \meta{anchor}. + + +\begin{codeexample}[] +\begin{tikzpicture}[l-system={step=1.75pt, order=5, angle=60}] + \pgfdeclarelindenmayersystem{Sierpinski triangle}{ + \symbol{X}{\pgflsystemdrawforward} + \symbol{Y}{\pgflsystemdrawforward} + \rule{X -> Y-X-Y} + \rule{Y -> X+Y+X} + } + \draw [help lines] grid (3,2); + \draw [red] (0,0) l-system + [l-system={Sierpinski triangle, axiom=+++X, anchor=south west}]; + \draw [blue] (3,2) l-system + [l-system={Sierpinski triangle, axiom=X, anchor=north east}]; +\end{tikzpicture} +\end{codeexample} +\end{key} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex index 57cf67f4abb..a50f1179d7b 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex @@ -30,7 +30,7 @@ cell. The following key simplifies typesetting such matrices. where the name is set to \meta{matrix name}|-|\meta{row number}|-|\meta{column number}. For example, if the matrix has the name |my matrix|, then the node in the upper left cell will get - the name |my matrix-1-1|. + the name |my matrix-1-1|. \begin{codeexample}[] \begin{tikzpicture} \matrix (magic) [matrix of nodes] @@ -61,7 +61,7 @@ cell. The following key simplifies typesetting such matrices. }; \end{tikzpicture} \end{codeexample} - + \item At the beginning of a cell, you can use a special syntax. If a cell starts with a vertical bar, then everything between this bar and the next bar is passed on to the |node| command. @@ -82,7 +82,7 @@ cell. The following key simplifies typesetting such matrices. Note that the |&| character also takes an optional argument, which is an extra column skip. -{\catcode`\|=12 +{\catcode`\|=12 \begin{codeexample}[] \begin{tikzpicture} \matrix [matrix of nodes] @@ -191,7 +191,7 @@ Since \TeX\ is not clairvoyant, the following rules are used: then inside this first group the |\\| command retains the meaning of ``end of line'' character. Note that this special rule works only for the first group in a cell and this group must be at the - beginning. + beginning. \end{enumerate} The net effect of these rules is the following: Normally, |\\| is an @@ -225,7 +225,7 @@ not balanced with respect to the number of braces). \subsection{Delimiters} -Delimiters are parantheses or braces to the left and right of a +Delimiters are parentheses or braces to the left and right of a formula or a matrix. The matrix library offers options for adding such delimiters to a matrix. However, delimiters can actually be added to any node that has the standard anchors |north|, |south|, |north west| @@ -256,7 +256,7 @@ some after node magic. \end{tikzpicture} \end{codeexample} - \begin{stylekey}{/tikz/every delimiter (initially \normalfont empyt)} + \begin{stylekey}{/tikz/every delimiter (initially \normalfont empty)} This style is executed for every delimiter. You can use it to shift or color delimiters or do whatever. \end{stylekey} @@ -316,7 +316,7 @@ some after node magic. -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex index f9396ccf335..4a88719792c 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex @@ -17,7 +17,7 @@ This library is intended to make the creation of mindmaps or concept maps easier. A \emph{mindmap} is a graphical representation of a -concept together +concept together with related concepts and annotations. Mindmaps are, essentially, trees, possibly with a few extra edges added, but they are usually drawn in a special way: The root concept is placed in the middle of @@ -47,14 +47,14 @@ Every mindmap should be put in a scope or a picture where the \begin{stylekey}{/tikz/mindmap} Use this style with all pictures or at least scopes that contain a mindmap. It installs a whole bunch of settings that are useful for - drawing mindmaps. + drawing mindmaps. \begin{codeexample}[] \tikz[mindmap,concept color=red!50] \node [concept] {Root concept} child[grow=right] {node[concept] {Child concept}}; \end{codeexample} The sizes of concepts are predefined in such a way that a - medium-size mindmap will fit on an A4 page (more or less). + medium-size mindmap will fit on an A4 page (more or less). \begin{stylekey}{/tikz/every mindmap} This style is included by the |mindmap| style. Change this style to add special settings to your mindmaps. @@ -64,16 +64,32 @@ Every mindmap should be put in a scope or a picture where the child[grow=right] {node[concept] {Child concept}}; \end{codeexample} \end{stylekey} + + \paragraph{Remark:} Note that |mindmap| re-defines |font| sizes and |sibling angle| depending on the current concept level (i.e. inside of |level 1 concept|, |level 2 concept| etc.). Thus, if you need to redefine these variables, use + + |\tikzset{level 1 concept/.append style={font=\small}}| + + \noindent or + + |\tikzset{level 2 concept/.append style={sibling distance=90}}| + + \noindent \emph{after} the |mindmap| style. \end{stylekey} +\begin{stylekey}{/tikz/small mindmap} + This style includes the |mindmap| style, but additionally changes + the default size of concepts, fonts and distances so that a medium-sized + mindmap will fit on an A5 page (A5 pages are half as large as A4 + pages). Mindmaps with |small mindmap| will also fit onto a standard frame of the |beamer| package. +\end{stylekey} \begin{stylekey}{/tikz/large mindmap} This style includes the |mindmap| style, but additionally changes - the default size of concepts and of distances so that a medium-sized + the default size of concepts, fonts and distances so that a medium-sized mindmap will fit on an A3 page (A3 pages are twice as large as A4 pages). \end{stylekey} \begin{stylekey}{/tikz/huge mindmap} - This style causes conepts to be even bigger and it is best used with + This style causes concepts to be even bigger and it is best used with A2 paper and above. \end{stylekey} @@ -93,7 +109,7 @@ The following styles influence how isolated concepts are rendered: This style should be used with all nodes that are concepts, although some styles like |extra concept| install this style automatically. - Bascially, this style makes the concept node circular and installs a + Basically, this style makes the concept node circular and installs a uniform color called |concept color|, see below. Additionally, the style |every concept| is called. \begin{codeexample}[] @@ -145,7 +161,7 @@ The following styles influence how isolated concepts are rendered: As pointed out earlier, \tikzname\ assumes that your mindmap is build using the |child| facilities of \tikzname. There are numerous options that influence how concepts are rendered at the different levels of a -tree. +tree. \begin{stylekey}{/tikz/root concept} This style is used for the roots of mindmap trees. By adding @@ -165,7 +181,7 @@ tree. \begin{stylekey}{/tikz/level 1 concept} The |mindmap| style adds this style to the |level 1| style. This means that the first level children of a mindmap tree will use this - style. + style. \begin{codeexample}[] \tikz [root concept/.append style={concept color=blue!80}, @@ -185,8 +201,8 @@ tree. \begin{stylekey}{/tikz/level 4 concept} Works like |level 1 concept|. Note that there are not fifth and higher level styles, you need to modify |level 5| directly in such - cases. -\end{stylekey} + cases. +\end{stylekey} \begin{key}{/tikz/concept color=\meta{color}} We saw already that this option is used to change the color of @@ -196,7 +212,7 @@ tree. |child| operation (and not to the |node| operation and also not as an option to all children via the |level 1| style), \tikzname\ will smoothly change the concept color from the parent's color to the - color of the child concept. + color of the child concept. Here is an example: \begin{codeexample}[] @@ -285,7 +301,7 @@ in the mindmap library: first circle at the specified angle relative to the line connecting the centers of the circles. The path then changes into a rectangle whose thickness is given by the amplitude. Finally, the path ends - with the same angles on the second circle. + with the same angles on the second circle. Here is an example that should make this clearer: \begin{codeexample}[] @@ -321,7 +337,7 @@ in the mindmap library: good idea to make the circles slightly larger to cover up such problems. When using nodes of shape |circle|, you can just add the |draw| option with a |line width| or one or two points (for very - large distances you may need line width up to 4pt). + large distances you may need line width up to 4pt). \begin{codeexample}[] \begin{tikzpicture} [blue!50,decoration={start radius=1cm, @@ -361,11 +377,11 @@ necessary computations for you. from the |center| anchor to some anchor on the border) and will set the |start circle| keys accordingly. Next, the |fill| option is set to the |concept color| while |draw=none| is set. The decoration is - set to |circle conncetion bar|. Finally, the following style is + set to |circle connection bar|. Finally, the following style is included: \begin{stylekey}{/tikz/every circle connection bar} - Redefine this sytle to change the appearance of circle connection - bar to-paths. + Redefine this style to change the appearance of circle connection + bar to-paths. \end{stylekey} \begin{codeexample}[] \begin{tikzpicture}[concept color=blue!50,blue!50,outer sep=0pt] @@ -398,7 +414,7 @@ library provides a special option for facilitating this procedure. \node (n2) at (30:2.5) [circle,minimum size=1cm,fill,draw,thick,blue] {}; \path (n1) to[circle connection bar switch color=from (red) to (blue)] (n2); -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{key} @@ -416,7 +432,7 @@ path that uses the to-path |circle connection bar| to connect the parent node and the child node. The |concept color| option (locally) changes this by using |circle connection bar switch color| instead with the from-color set to the old (parent's) concept color and the to-color -set to the new (child's) concept color. This menas that when you +set to the new (child's) concept color. This means that when you provide the |concept color| option to a |child| command, the color will change from the parent's concept color to the specified color. @@ -427,6 +443,8 @@ Here is an example of a tree build in this way: \path[mindmap,concept color=black,text=white] node[concept] {Computer Science} [clockwise from=0] + % note that `sibling angle' can only be defined in + % `level 1 concept/.append style={}' child[concept color=green!50!black] { node[concept] {practical} [clockwise from=90] @@ -434,7 +452,7 @@ Here is an example of a tree build in this way: child { node[concept] {data structures} } child { node[concept] {pro\-gramming languages} } child { node[concept] {software engineer\-ing} } - } + } child[concept color=blue] { node[concept] {applied} [clockwise from=-30] @@ -477,7 +495,7 @@ in an annotation node. -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex index c558acca9ed..befc36b9e0f 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex @@ -11,14 +11,14 @@ \section{Petri-Net Drawing Library} \begin{tikzlibrary}{petri} - This packages provides shapes and styles for drawing Petri nets. + This packages provides shapes and styles for drawing Petri nets. \end{tikzlibrary} \subsection{Places} -The package defines a style for drawing places of Petri nets. +The package defines a style for drawing places of Petri nets. \begin{stylekey}{/tikz/place} This style indicates that a node is a place of a Petri net. Usually, @@ -27,16 +27,16 @@ The package defines a style for drawing places of Petri nets. like its name or its capacity. You should use the |tokens| options, explained in Section~\ref{section-tokens}, to add tokens inside the place. - + \begin{codeexample}[] \begin{tikzpicture} \node[place,label=above:$p_1$,tokens=2] (p1) {}; \node[place,label=below:$p_2\ge1$,right=of p1] (p2) {}; \end{tikzpicture} \end{codeexample} - + \begin{stylekey}{/tikz/every place} - This stype is envoked by the style |place|. To change the + This style is evoked by the style |place|. To change the appearance of places, you can change this style. \begin{codeexample}[] \begin{tikzpicture} @@ -55,7 +55,7 @@ The package defines a style for drawing places of Petri nets. \subsection{Transitions} Transitions are also nodes. They should be drawn using the following -style: +style: \begin{stylekey}{/tikz/transition} This style indicates that a node is a transition. As for places, the @@ -64,7 +64,7 @@ style: To connect a transition to places, you can use the |edge| command as in the following example: - + \begin{codeexample}[] \begin{tikzpicture} \node[place,tokens=2,label=above:$p_1$] (p1) {}; @@ -75,9 +75,9 @@ style: edge[post] node[auto] {2} (p2); \end{tikzpicture} \end{codeexample} - + \begin{stylekey}{/tikz/every transition} - This style is envoked by the style |transition|. + This style is evoked by the style |transition|. \end{stylekey} \begin{stylekey}{/tikz/pre} @@ -116,7 +116,7 @@ simple style for typesetting them. text will be typeset in a tiny font and in white on black (naturally, you can easily change this by setting the style |every token|). - + \begin{codeexample}[] \begin{tikzpicture} \node[place,label=above:$p_1$] (p1) {}; @@ -127,7 +127,7 @@ simple style for typesetting them. \end{tikzpicture} \end{codeexample} \begin{stylekey}{/tikz/every token} - Change this style to chagne the appearance of tokens. + Change this style to change the appearance of tokens. \end{stylekey} \end{stylekey} @@ -271,7 +271,7 @@ affect how these options depict tokens. every place/.style={draw=blue,fill=blue!20,minimum size=6mm}] \foreach \i in {1,...,6} { - \node[place,label=left:$p_\i$] (p\i) at (0,\i) {}; + \node[place,label=left:$p_\i$] (p\i) at (0,\i) {}; \node[place,label=right:$q_\i$] (q\i) at (8,\i) {}; } \foreach \name/\var/\vala/\valb/\height/\x in @@ -311,7 +311,7 @@ affect how these options depict tokens. \node[transition] at (6.5,5.5) {} edge [pre] (q5) edge [pre] (m2t) edge [post] (q6) edge [post] (m2f); \node[transition] at (6.5,6.5) {} edge [pre] (q6) edge [post] (q1.south west); -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} Here is the same net once more, but with these styles changes: @@ -326,7 +326,7 @@ Here is the same net once more, but with these styles changes: every place/.style={draw,thick,minimum size=6mm}] \foreach \i in {1,...,6} { - \node[place,label=left:$p_\i$] (p\i) at (0,\i) {}; + \node[place,label=left:$p_\i$] (p\i) at (0,\i) {}; \node[place,label=right:$q_\i$] (q\i) at (8,\i) {}; } \foreach \name/\var/\vala/\valb/\height/\x in @@ -368,7 +368,7 @@ Here is the same net once more, but with these styles changes: \node[transition] at (6.5,6.5) {} edge [pre] (q6) edge [post] (q1.south west); \end{tikzpicture} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex index efe70ab6975..fd58176b7a2 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex @@ -97,6 +97,76 @@ \end{codeexample} \end{command} +\subsection{Constant Plot Handlers} +There are three plot handlers which produce piecewise constant interpolations between successive points. + +\begin{command}{\pgfplothandlerconstantlineto} + This handler works like the line-to plot handler, only it will + produce a connected, piecewise constant path to connect the points. +\begin{codeexample}[] +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerconstantlineto + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\end{codeexample} +\end{command} + +\begin{command}{\pgfplothandlerconstantlinetomarkright} +A variant of |\pgfplothandlerconstantlineto| which places its mark on +the right line ends. +\begin{codeexample}[] +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerconstantlinetomarkright + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\end{codeexample} +\end{command} + +\begin{command}{\pgfplothandlerjumpmarkleft} + This handler works like the line-to plot handler, only it will + produce a non-connected, piecewise constant path to connect the points. If there are any plot marks, they will be placed on the left open pieces. +\begin{codeexample}[] +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerjumpmarkleft + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\end{codeexample} +\end{command} + +\begin{command}{\pgfplothandlerjumpmarkright} + This handler works like the line-to plot handler, only it will + produce a non-connected, piecewise constant path to connect the points. If there are any plot marks, they will be placed on the right open pieces. +\begin{codeexample}[] +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerjumpmarkright + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\end{codeexample} +\end{command} \subsection{Comb Plot Handlers} @@ -162,6 +232,202 @@ that the plots they produce look like ``combs'' (more or less). \end{codeexample} \end{command} +\pgfname\ bar or comb plots usually draw something from zero to the +current plot's coordinate. The ``zero'' offset can be changed using an +input stream which returns the desired offset successively for each +processed coordinate. + +There are two such streams, which can be configured independently. +The first one returns ``zeros'' for coordinate~$x$, the second one +returns ``zeros'' for coordinate~$y$. They are used as follows. + +\begin{codeexample}[code only] +\pgfplotxzerolevelstreamstart +\pgfplotxzerolevelstreamnext % assigns \pgf@x +\pgfplotxzerolevelstreamnext +\pgfplotxzerolevelstreamnext +\pgfplotxzerolevelstreamend +\end{codeexample} +% +\begin{codeexample}[code only] +\pgfplotyzerolevelstreamstart +\pgfplotyzerolevelstreamnext % assigns \pgf@x +\pgfplotyzerolevelstreamend +\end{codeexample} +Different zero level streams can be implemented by overwriting these macros. + +\begin{command}{\pgfplotxzerolevelstreamconstant\marg{dimension}} + This zero level stream always returns \marg{dimension} instead of + $x=0$pt. + + It is used for |xcomb| and |xbar|. +\end{command} + +\begin{command}{\pgfplotyzerolevelstreamconstant\marg{dimension}} + This zero level stream always returns \marg{dimension} instead of + $y=0$pt. + + It is used for |ycomb| and |ybar|. +\end{command} + +\subsection{Bar Plot Handlers} +\label{section-plotlib-bar-handlers} + +While comb plot handlers produce a line-to operation to generate +combs, bar plot handlers employ rectangular shapes, allowing filled +bars (or pattern bars). + +\begin{command}{\pgfplothandlerybar} + This handler converts each point in the plot stream into a rectangle + from the $x$-axis to the point's coordinate. The rectangle is placed + centered at the $x$-axis. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerybar + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\end{codeexample} +\end{command} + +\begin{command}{\pgfplothandlerxbar} + This handler converts each point in the plot stream into a rectangle + from the $y$-axis to the point's coordinate. The rectangle is placed + centered at the $y$-axis. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerxbar + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\end{codeexample} +\end{command} + +\label{key-bar-width}% +\begin{key}{/pgf/bar width=\marg{dimension} (initially 10pt)} + \keyalias{tikz} + Sets the width of |\pgfplothandlerxbar| and |\pgfplothandlerybar| to + \marg{dimension}. The argument \marg{dimension} will be evaluated + using the math parser. +\end{key} + +\label{key-bar-shift}% +\begin{key}{/pgf/bar shift=\marg{dimension} (initially 0pt)} + \keyalias{tikz} + Sets a shift used by |\pgfplothandlerxbar| and |\pgfplothandlerybar| + to \marg{dimension}. It has the same effect as |xshift|, but it + applies only to those bar plots. The argument \marg{dimension} will + be evaluated using the math parser. +\end{key} + +\begin{command}{\pgfplotbarwidth} + Expands to the value of |/pgf/bar width|. +\end{command} + + +\begin{command}{\pgfplothandlerybarinterval} + This handler is a variant of |\pgfplothandlerybar| which works with + intervals instead of points. + + Bars are drawn between successive input coordinates and the width is + determined relatively to the interval length. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw[gray] (0,2) node {$x_1$} (1,1) node {$x_2$} (2,.5) node {$x_3$} (4,0.7) node {$x_4$}; + \pgfplothandlerybarinterval + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{2cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreampoint{\pgfpoint{4cm}{0.7cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\end{codeexample} + +In more detail, if $(x_i,y_i)$ and $(x_{i+1},y_{i+1})$ denote +successive input coordinates, the bar will be placed above the +interval $[x_i,x_{i+1}]$, centered at \[ x_i + \text{\meta{bar + interval shift}} \cdot (x_{i+1} - x_i) \] with width \[ +\text{\meta{bar interval width}} \cdot (x_{i+1} - x_i). \] Here, +\meta{bar interval shift} and \meta{bar interval width} denote the +current values of the associated options. + +If you have $N+1$ input points, you will get $N$ bars (one for each +interval). The $y$~value of the last point will be ignored. +\end{command} + +\begin{command}{\pgfplothandlerxbarinterval} + As |\pgfplothandlerybarinterval|, this handler provides bar plots + with relative bar sizes and offsets, one bar for each + $y$~coordinate interval. +\end{command} + +\label{key-bar-interval-shift}% +\begin{key}{/pgf/bar interval shift=\marg{shift} (initially 0.5)} + \keyalias{tikz} + Sets the \emph{relative} shift of |\pgfplothandlerxbarinterval| and + |\pgfplothandlerybarinterval| to \marg{shift}. As + |/pgf/bar interval width|, the argument is relative to the interval + length of the input coordinates. + + The argument \marg{scale} will be evaluated using the math parser. +\end{key} + +\label{key-bar-interval-width}% +\begin{key}{/pgf/bar interval width=\marg{scale} (initially 1)} + \keyalias{tikz} + Sets the \emph{relative} width of |\pgfplothandlerxbarinterval| and + |\pgfplothandlerybarinterval| to \marg{scale}. The argument is + relative to $(x_{i+1} - x_i)$ for $y$~bar plots and relative to + $(y_{i+1}-y_i)$ for $x$~bar plots. + + The argument \marg{scale} will be evaluated using the math parser. +\begin{codeexample}[] +\begin{tikzpicture}[bar interval width=0.5] + \draw[gray] + (0,3) -- (0,-0.1) + (1,3) -- (1,-0.1) + (2,3) -- (2,-0.1) + (4,3) -- (4,-0.1); + \pgfplothandlerybarinterval + \begin{scope}[bar interval shift=0.25,fill=blue] + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{2cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreampoint{\pgfpoint{4cm}{0.7cm}} + \pgfplotstreamend + \pgfusepath{fill} + \end{scope} + \begin{scope}[bar interval shift=0.75,fill=red] + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{3cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{0.2cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.7cm}} + \pgfplotstreampoint{\pgfpoint{4cm}{0.2cm}} + \pgfplotstreamend + \pgfusepath{fill} + \end{scope} +\end{tikzpicture} +\end{codeexample} + Please note that bars are always centered, so we have to use shifts + $0.25$ and $0.75$ instead of $0$ and $0.5$. +\end{key} + \subsection{Mark Plot Handler} \label{section-plot-marks} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex index 19db2308f44..b953be6a25e 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex @@ -31,6 +31,7 @@ dark yellow): \plotmarkentry{o} \plotmarkentry{asterisk} \plotmarkentry{star} + \plotmarkentry{10-pointed star} \plotmarkentry{oplus} \plotmarkentry{oplus*} \plotmarkentry{otimes} @@ -41,13 +42,61 @@ dark yellow): \plotmarkentry{triangle*} \plotmarkentry{diamond} \plotmarkentry{diamond*} + \plotmarkentry{halfdiamond*} + \plotmarkentry{halfsquare*} + \plotmarkentry{halfsquare right*} + \plotmarkentry{halfsquare left*} \plotmarkentry{pentagon} \plotmarkentry{pentagon*} + \plotmarkentry{Mercedes star} + \plotmarkentry{Mercedes star flipped} + \plotmarkentry{halfcircle} + \plotmarkentry{halfcircle*} + \plotmarkentry{heart} + \plotmarkentry{text} \end{tabular} } +Note that each of the provided marks can be rotated freely by means of |mark options={rotate=90}| or |every mark/.append style={rotate=90}|. -%%% Local Variables: +\begin{key}{/pgf/mark color=\marg{color} (initially empty)} + Defines the additional fill color for the |halfcircle|, |halfcircle*|, |halfdiamond*| and |halfsquare*| markers. An empty value uses |white| (which is the initial configuration). The special value |none| disables filling of the respective parts. + + Note that |halfsquare| will be filled with |mark color|, and the starred variant |halfsquare*| will be filled half with |mark color| and half with the actual |fill| color. +\end{key} + + + +{ +\def\showit#1{% + \tikz\draw[color=black!25] plot[#1,mark options={fill=examplefill,draw=black}] coordinates{(0,0) (.5,0.2) (1,0) (1.5,0.2)};}% + +\begin{key}{/pgf/text mark=\marg{text} (initially p)} + Changes the text shown by |mark=text|. + + With |/pgf/text mark=m|: \pgfkeys{/pgf/text mark=m}\showit{mark=text} + + With |/pgf/text mark=A|: \pgfkeys{/pgf/text mark=A}\showit{mark=text} + + There is no limitation about the number of characters or whatever. In fact, any \TeX\ material can be inserted as \marg{text}, including images. +\end{key} +\begin{key}{/pgf/text mark style=\marg{options for \texttt{mark=text}}} + Defines a set of options which control the appearance of |mark=text|. + + If |/pgf/text mark as node=false| (the default), \marg{options} is provided as argument to |\pgftext| -- which provides only some basic keys like |left|, |right|, |top|, |bottom|, |base| and |rotate|. + + If |/pgf/text mark as node=true|, \marg{options} is provided as argument to |\node|. This means you can provide a very powerful set of options including |anchor|, |scale|, |fill|, |draw|, |rounded corners| etc. +\end{key} +\begin{key}{/pgf/text mark as node=\mchoice{true,false} (initially false)} + Configures how |mark=text| will be drawn: either as |\node| or as |\pgftext|. + + The first choice is highly flexible and possibly slow, the second is very fast and usually enough. +\end{key} + +} + + +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex new file mode 100644 index 00000000000..74fbea14558 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex @@ -0,0 +1,151 @@ +% Copyright 2010 by Christian Feuersaenger +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\section{Profiler Library} +{\noindent {\emph{by Christian Feuers\"anger}}} + +\begin{pgflibrary}{profiler} + A library to simplify the optimization of runtime speed of \TeX\ programs. + + It relies on the |pdftex| primitive \declareandlabel{\pdfelapsedtime} to count (fractional) seconds and counts total time and self time for macro invocations. +\end{pgflibrary} + +\subsection{Overview} +The intended audience for this library are people writing \TeX\ code which should be optimized. It is certainly \emph{not} useful for the end-user. + +The work flow for the optimization is simple: the preamble contains configuration commands like +\begin{codeexample}[code only] +\usepgflibrary{profiler} +\pgfprofilenewforenvironment{tikzpicture} +\pgfprofilenewforcommand{\pgfkeys}{1} +\end{codeexample} +\noindent and then, the time between |\begin{tikzpicture}| and |\end{tikzpicture}| and the time required to call |\pgfkeys| will be collected. + +At the end, a short usage summary like +\begin{codeexample}[code only] + pgflibraryprofiler(main job) {total time=1.07378sec; (100.0122%) self time=0.034sec; (3.1662%)} + pgflibraryprofiler(<ENV>tikzpicture) {total time=1.03978sec; (96.84601%) self time=1.00415sec; (93.52722%)} + pgflibraryprofiler(<CS>pgfkeys) {total time=0.03563sec; (3.31726%) self time=0.03563sec; (3.31726%)} +\end{codeexample} +\noindent will be provided in the log file, furthermore, the same information is available in a text table called |\jobname.profiler.|\meta{datetime}|.dat| which is of the form: +\begin{codeexample}[code only] +profilerentry totaltime[s] totaltime[percent] selftime[s] selftime[percent] +main job 1.07378 100.0122 0.034 3.1662 +<ENV>tikzpicture 1.03978 96.84601 1.00415 93.52722 +<CS>pgfkeys 0.03563 3.31726 0.03563 3.31726 +\end{codeexample} +Here, the |totaltime| means the time used for all invocations of the respective profiler entry (one row in the table). The |selftime| measures time which is not already counted for in another profiler entry which has been invoked within the current one. The example above is not very exiting: the main job consists only of several (quite complex) pictures and nothing else. Thus, its total time is large. However, the self time is very small because the |tikzpicture|s are counted separately, and they have been invoked within the |main job|. The |\pgfkeys| control sequence has been invoked within the |tikzpicture|, that's why the |selftime| for the |tikzpicture| is a little bit smaller than its |totaltime|. + +\subsection{Requirements} +The library doesn't work without |pdftex|. Furthermore, it requires a more or less recent version which supports the |\pdfelapsedtime| directive. + +\subsection{Defining Profiler Entries} +Unlike profilers for C/C++ or java, this library doesn't extract information about every \TeX\ macro automatically, nor does it collect information for each of them. Instead, every profiler entry needs to be defined explicitly. Only defined profiler entries will be processed. + +\begin{command}{\pgfprofilenew\marg{name}} + Defines a new profiler entry named \meta{name}. + + This updates a set of internal registers used to track the profiler entry. The \meta{name} can be arbitrary, it doesn't need to be related to any \TeX\ macro. + + The actual job of counting seconds is accomplished using |\pgfprofilestart|\marg{name} followed eventually by the command |\pgfprofileend|\marg{name}. + + It doesn't hurt if |\pgfprofilenew| is called multiple times with the same name. +\end{command} + +\begin{command}{\pgfprofilenewforcommand\oarg{profiler entry name}\marg{\textbackslash macro}\marg{arguments}} + Defines a new profiler entry which will measure the time spent in \meta{\textbackslash macro}. This calls |\pgfprofilenew| and replaces the current definition of \meta{\textbackslash macro} with a new one. + + If \oarg{profiler entry name} has been provided, this defines the argument for |\pgfprofilenew|. It is allowed to use the same name for multiple commands; in this case, they are treated as if it where the same command. If the optional argument is not used, the profiler entry will be called `\declareandlabel{\pgfprofilecs}\meta{macro}' (\meta{macro} without backslash) where |\pgfprofilecs| is predefined to be |<CS>|. + + The replacement macro will collect all required arguments, start counting, invoke the original macro definition and stop counting. + + The following macro types are supported within |\pgfprofilenewforcommand|: + \begin{itemize} + \item commands which take one (optional) argument in square brackets + followed by one optional argument which has to be delimited by + curly braces (use an empty argument for \meta{arguments} in this case), + \item commands which take one (optional) argument in square brackets + and \emph{exactly} \meta{arguments} arguments afterwards. + \end{itemize} + + Take a look at |\pgfprofilenewforcommandpattern| in case you have more complicated commands. + + + Note that the library can't detect if a command has been redefined somewhere. +\end{command} + +\begin{command}{\pgfprofilenewforcommandpattern\oarg{profiler entry name}\marg{\textbackslash macro}\marg{argument pattern}\marg{invocation pattern}} + A variant of |\pgfprofilenewforcommand| which can be used with arbitrary \meta{argument patterns}. Example: +\begin{codeexample}[code only] +\def\mymacro#1\to#2\in#3{ ... } +\pgfprofilenewforcommandpattern{\mymacro}{#1\to#2\in#3}{{#1}\to{#2}\in{#3}} +\end{codeexample} + +Note that |\pgfprofilenewforcommand| is a special case of |\pgfprofilenewforcommandpattern|: +\begin{codeexample}[code only] +\def\mymacro#1#2{ ... } +\pgfprofilenewforcommand\macro{2} +\pgfprofilenewforcommandpattern{\mymacro}{#1#2}{{#1}{#2}} +\end{codeexample} + Thus, \meta{argument pattern} is a copy-paste from the definition of your command. The \meta{invocation pattern} is used by the profiler library to invoke the \emph{original} command, so it is closely related to \meta{argument pattern}, but it needs extra curly braces around each argument. + + The behavior of |\pgfprofilenewforcommandpattern| is the same as discussed above: it defines a new profiler entry which will measure the time spent in \meta{\textbackslash macro}. The details about this definition has already been described. Note that up to one optional argument in square brackets is also checked automatically. + + + If you like to profile a command which doesn't match here for whatever reasons, you'll have to redefine it manually and insert |\pgfprofilestart| and |\pgfprofileend| in appropriate places. +\end{command} + +\begin{command}{\pgfprofileshowinvocationsfor\marg{profiler entry name}} + Enables verbose output for \emph{every} invocation of \meta{profiler entry name}. + + This is only available for profiler entries for commands (those created by |\pgfprofilenewforcommand| for example). It will also show any arguments. +\end{command} +\begin{command}{\pgfprofileshowinvocationsexpandedfor\marg{profiler entry name}} + A variant of |\pgfprofileshowinvocationsfor| which will expand all arguments for \meta{profiler entry name} before showing them. The invocation as such is not affected by this expansion. + + This expansion (with |\edef|) might yield unrecoverable errors for some commands. Handle with care. +\end{command} + +\begin{command}{\pgfprofilenewforenvironment\oarg{profiler entry name}\marg{environment name}} + Defines a new profiler entry which measures time spent in the environment \meta{environment name}. + + This calls |\pgfprofilenew| and handles the begin/end of the environment automatically. + + The argument for |\pgfprofilenew| is \meta{profiler entry name}, or, if this optional argument is not used, it is `\declareandlabel{\pgfprofileenv}\meta{environment name}' where |\pgfprofileenv| is predefined as |<ENV>|. Again, it is permitted to use the same \meta{profiler entry name} multiple times to merge different commands into one output section. + +\end{command} + + +\begin{command}{\pgfprofilestart\marg{profiler entry name}} + Starts (or resumes) timing of \meta{profiler entry name}. The argument must have been declared in the preamble using |\pgfprofilenew|. + + Nested calls of |\pgfprofilestart| with the same argument will be ignored. + + The invocation of this command doesn't change the environment: it doesn't introduce any \TeX\ groups nor does it modify the token list. +\end{command} + +\begin{command}{\pgfprofileend\marg{profiler entry name}} + Stops (or interrupts) timing of \meta{profiler entry name}. + + This command finishes a preceding call to |\pgfprofilestart|. +\end{command} + +\begin{command}{\pgfprofilepostprocess} + For \LaTeX, this command is installed automatically in |\end{document}|. It stops all running timings, evaluates them and returns the result into the logfile. Furthermore, it generates a text table called |\jobname.profiler.|\meta{YYYY}|-|\meta{MM}|-|\meta{DD}|_|\meta{HH}|h_|\meta{MM}|m.dat| with the same information. + + Note that the profiler library predefines two profiler entries, namely |main job| which counts time from the beginning of the document until |\pgfprofilepostprocess| and |preamble| which counts time from the beginning of the document until |\begin{document}|. +\end{command} + +\begin{command}{\pgfprofilesetrel\marg{profiler entry name} (initially main job)} + Sets the profiler entry whose total time will be used to compute all other relative times. Thus, \meta{profiler entry name} will use $100\%$ of the total time per definition, all other relative times are relative to this one. +\end{command} + +\begin{command}{\pgfprofileifisrunning\marg{profiler entry name}\marg{true code}\marg{false code}} + Invokes \marg{true code} if \marg{profiler entry name} is currently running and \marg{false code} otherwise. +\end{command} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex new file mode 100644 index 00000000000..cf4a008aebe --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex @@ -0,0 +1,225 @@ +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Shadings Library} +\label{section-library-shadings} + +\begin{pgflibrary}{shadings} + The package defines a number of shadings in addition to the ball and + axis shadings that are available by default. +\end{pgflibrary} + +In the following, the shadings defined in the library are listed in +alphabetical order. The colors of some of these shadings can be +configured using special options (like |left color|). These options +implicitly select the shading. + +The three shadings |axis|, |ball|, and |radial| are always defined, +even when this library is not used. + + +\begin{shading}{axis} + In this always-defined shading the colors change gradually + between three horizontal lines. The top line is at the top + (uppermost) point of the path, the middle is in the middle, the + bottom line is at the bottom of the path. + + \begin{key}{/tikz/top color=\meta{color}} + This option prescribes the color to be used at the top in an |axis| + shading. When this option is given, several things happen: + \begin{enumerate} + \item + The |shade| option is selected. + \item + The |shading=axis| option is selected. + \item + The middle color of the axis shading is set to the average of the + given top color \meta{color} and of whatever color is currently + selected for the bottom. + \item + The rotation angle of the shading is set to 0. + \end{enumerate} + +\begin{codeexample}[] +\tikz \draw[top color=red] (0,0) rectangle (2,1); +\end{codeexample} + \end{key} + + \begin{key}{/tikz/bottom color=\meta{color}} + This option works like |top color|, only for the bottom color. + \end{key} + + \begin{key}{/tikz/middle color=\meta{color}} + This option specifies the color for the middle of an axis + shading. It also sets the |shade| and |shading=axis| options, but it + does not change the rotation angle. + + \emph{Note:} Since both |top color| and |bottom color| change the + middle color, this option should be given \emph{last} if all of + these options need to be given: + +\begin{codeexample}[] +\tikz \draw[top color=white,bottom color=black,middle color=red] + (0,0) rectangle (2,1); +\end{codeexample} + \end{key} + + \begin{key}{/tikz/left color=\meta{color}} + This option does exactly the same as |top color|, except that the + shading angle is set to $90^\circ$. + \end{key} + + \begin{key}{/tikz/right color=\meta{color}} + Works like |left color|. + \end{key} +\end{shading} + + +\begin{shading}{ball} + This always-defined shading fills the path with a shading that ``looks like a + ball.'' The default ``color'' of the ball is blue (for no + particular reason). + + \begin{key}{/tikz/ball color=\meta{color}} + This option sets the color used for the ball shading. It sets the + |shade| and |shading=ball| options. Note that the ball will never + ``completely'' have the color \meta{color}. At its ``highlight'' spot + a certain amount of white is mixed in, at the border a certain + amount of black. Because of this, it also makes sense to say + |ball color=white| or |ball color=black| + +\begin{codeexample}[] +\begin{tikzpicture} + \shade[ball color=white] (0,0) circle (2ex); + \shade[ball color=red] (1,0) circle (2ex); + \shade[ball color=black] (2,0) circle (2ex); +\end{tikzpicture} +\end{codeexample} + \end{key} +\end{shading} + + + +\begin{shading}{bilinear interpolation} + This shading fills a rectangle with colors that a bilinearly + interpolated between the colors in the four corners of the + rectangle. These four colors are called |lower left|, |lower right|, + |upper left|, and |upper right|. By changing these color, you can + change the way the shading looks. The library also defines four + options, called the same way, that can be used to set these colors + and select the shading implicitly. + +\begin{codeexample}[] +\tikz + \shade[upper left=red,upper right=green, + lower left=blue,lower right=yellow] + (0,0) rectangle (3,2); +\end{codeexample} + + \begin{key}{/tikz/lower left=\meta{color} (initially white)} + Sets the color to be used in a |bilinear interpolation| shading + for the lower left corner. Also, this options selects this shading + and sets the |shade| option. + \end{key} + + \begin{key}{/tikz/upper left=\meta{color} (initially white)} + Like |lower left|. + \end{key} + \begin{key}{/tikz/upper right=\meta{color} (initially white)} + Like |lower left|. + \end{key} + \begin{key}{/tikz/lower left=\meta{color} (initially white)} + Like |lower left|. + \end{key} +\end{shading} + + +\begin{shading}{color wheel} + \label{shading-color-wheel} + This shading fills the path with a color wheel. +\begin{codeexample}[] +\tikz \shade[shading=color wheel] (0,0) circle (1.5); +\end{codeexample} + To produce a color ring, cut out a circle from the color wheel: +\begin{codeexample}[] +\tikz \shade[shading=color wheel] [even odd rule] + (0,0) circle (1.5) + (0,0) circle (1); +\end{codeexample} +\end{shading} + + +\begin{shading}{color wheel black center} + This shading looks like a color wheel, but the brightness drops to + zero in the center. +\begin{codeexample}[] +\tikz \shade[shading=color wheel black center] (0,0) circle (1.5); +\end{codeexample} +\end{shading} + + +\begin{shading}{color wheel white center} + This shading looks like a color wheel, but the saturation drops to + zero in the center. +\begin{codeexample}[] +\tikz \shade[shading=color wheel white center] (0,0) circle (1.5); +\end{codeexample} +\end{shading} + + + +\begin{shading}{Mandelbrot set} + This shading is just for fun. It fills the path with a zoomable + Mandelbrot set. Note that this is \emph{not} a bitmap + graphic. Rather, the Mandelbrot set is \emph{computed by the + \textsc{pdf} renderer} and can be zoomed arbitrarily (give it a + try, if you have a fast computer). + +\begin{codeexample}[] +\tikz \shade[shading=Mandelbrot set] (0,0) rectangle (2,2); +\end{codeexample} +\end{shading} + + + +\begin{shading}{radial} + This always-defined shading fills the path with a gradual sweep from + a certain color in the middle to another color at the border. If the path is + a circle, the outer color will be reached exactly at the + border. If the shading is not a circle, the outer color will + continue a bit towards the corners. The default inner color is + gray, the default outer color is white. + + \begin{key}{/tikz/inner color=\meta{color}} + This option sets the color used at the center of a |radial| + shading. When this option is used, the |shade| and |shading=radial| + options are set. + +\begin{codeexample}[] +\tikz \draw[inner color=red] (0,0) rectangle (2,1); +\end{codeexample} + \end{key} + + \begin{key}{/tikz/outer color=\meta{color}} + This option sets the color used at the border and outside of a + |radial| shading. + +\begin{codeexample}[] +\tikz \draw[outer color=red,inner color=white] + (0,0) rectangle (2,1); +\end{codeexample} + \end{key} +\end{shading} + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: "pgfmanual-pdftex-version" +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex index affa75dd8b4..4c99d465083 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex @@ -16,7 +16,7 @@ In addition to the standard shapes |rectangle|, |circle| and |coordinate|, there exist a number of additional shapes defined in -different shape libraries. Most of these shapes have been +different shape libraries. Most of these shapes have been contributed by Mark Wibrow. In the present section, these shapes are described. Note that the library |shapes| is provided for compatibility only. Please include sublibraries like @@ -24,13 +24,13 @@ compatibility only. Please include sublibraries like The appearance of shapes is influenced by numerous parameters like |minimum height| or |inner xsep|. These general parameters are documented in -Section~\ref{section-shape-common-options} +Section~\ref{section-shape-common-options} \subsection{Predefined Shapes} \label{section-predefined-shapes} -The three shapes |rectangle|, |circle|, and |coordiante| are always +The three shapes |rectangle|, |circle|, and |coordinate| are always defined and no library needs to be loaded for them. While the |coordinate| shape defines only the |center| anchor, the other two shapes define a standard set of anchors. @@ -38,17 +38,17 @@ shapes define a standard set of anchors. \begin{shape}{circle} This shape draws a tightly fitting circle around the text. The following figure shows the anchors this shape defines; the anchors - |10| and |130| are example of border anchors. + |10| and |130| are example of border anchors. \begin{codeexample}[] \Huge \begin{tikzpicture} \node[name=s,shape=circle,shape example] {Circle\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, - west/left, center/above, east/right, - mid west/right, mid/above, mid east/left, - base west/left, base/below, base east/right, - south west/below left, south/below, south east/below right, + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, text/left, 10/right, 130/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; @@ -67,11 +67,11 @@ shapes define a standard set of anchors. \begin{tikzpicture} \node[name=s,shape=rectangle,shape example] {Rectangle\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, - west/left, center/above, east/right, - mid west/right, mid/above, mid east/left, - base west/left, base/below, base east/right, - south west/below left, south/below, south east/below right, + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, text/left, 10/right, 130/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; @@ -93,29 +93,29 @@ shapes define a standard set of anchors. This shape is a diamond tightly fitting the text box. The ratio between width and height is 1 by default, but can be changed by setting the shape aspect ratio using the following \pgfname{} - key (to use this key in \tikzname{} simply remove the - \declare{|/pgf/|} path). + key (to use this key in \tikzname{} simply remove the + \declare{|/pgf/|} path). \begin{key}{/pgf/aspect=\meta{value} (initially 1.0)} - The aspect is a recommendation for the quotient of the width and + The aspect is a recommendation for the quotient of the width and the height of a shape. This key calls the macro |\pgfsetshapeaspect|. \end{key} - + The following figure shows the anchors this shape defines; the anchors |10| and |130| are example of border anchors. - + \begin{codeexample}[] \Huge \begin{tikzpicture} \node[name=s,shape=diamond,shape example] {Diamond\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, - west/left, center/above, east/right, - mid/above, - base/below, - south west/below left, south/below, south east/below right, + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid/above, + base/below, + south west/below left, south/below, south east/below right, text/left, 10/right, 130/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; @@ -132,11 +132,11 @@ shapes define a standard set of anchors. \begin{tikzpicture} \node[name=s,shape=ellipse,shape example] {Ellipse\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, - west/left, center/above, east/right, - mid west/right, mid/above, mid east/left, - base west/left, base/below, base east/right, - south west/below left, south/below, south east/below right, + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, text/left, 10/right, 130/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; @@ -151,11 +151,11 @@ shapes define a standard set of anchors. \begin{shape}{trapezium} This shape is a trapezium, that is, a quadrilateral with a single pair of parallel lines (this can sometimes be known as a trapezoid). - The trapezium shape supports the rotation of the shape border, as - described in Section~\ref{section-rotating-shape-borders}. - - The lower internal angles at the lower corners of the trapezium can - be specified independently, and the resulting extensions are in + The trapezium shape supports the rotation of the shape border, as + described in Section~\ref{section-rotating-shape-borders}. + + The lower internal angles at the lower corners of the trapezium can + be specified independently, and the resulting extensions are in addition to the natural dimensions of the node contents (which includes any |inner sep|. @@ -170,45 +170,45 @@ shapes define a standard set of anchors. \end{tikzpicture} \end{codeexample} - - The \pgfname{} keys to set the lower internal angles of the trapezium - are shown below. + + The \pgfname{} keys to set the lower internal angles of the trapezium + are shown below. To use these keys in \tikzname, simply remove the \declare{|/pgf/|} path. \begin{key}{/pgf/trapezium left angle=\meta{angle} (initially 60)} - Set the lower internal angle of the left side. + Set the lower internal angle of the left side. \end{key} - + \begin{key}{/pgf/trapezium right angle=\meta{angle} (initially 60)} - Set the lower internal angle of the right side. + Set the lower internal angle of the right side. \end{key} - + \begin{stylekey}{/pgf/trapezium angle=\meta{angle}} This key stores no value itself, but sets the value of the - previous two keys to \meta{angle}. + previous two keys to \meta{angle}. \end{stylekey} - + Regardless of the rotation of the shape border, the width and height of the trapezium are as follows: \begin{codeexample}[] -\begin{tikzpicture}[>=stealth, every node/.style={text=black}, +\begin{tikzpicture}[>=stealth, every node/.style={text=black}, shape border uses incircle, shape border rotate=60] \node [trapezium, fill=gray!25, minimum width=2cm] (t) {}; - \draw [red, <->] (t.bottom left corner) -- (t.bottom right corner) + \draw [red, <->] (t.bottom left corner) -- (t.bottom right corner) node [midway, below right] {width}; - \draw [red, <->] (t.top side) -- (t.bottom side) + \draw [red, <->] (t.top side) -- (t.bottom side) node [at start, above] {height}; \end{tikzpicture} \end{codeexample} \begin{key}{/pgf/trapezium stretches=\meta{boolean} (default true)} This key controls whether \pgfname{} allows the width and the height - of the trapezium to be enlarged independently, - when considering any minimum size specification. This is initially - |false|, ensuring that the shape ``looks the same but bigger'' when + of the trapezium to be enlarged independently, + when considering any minimum size specification. This is initially + |false|, ensuring that the shape ``looks the same but bigger'' when enlarged. - + \begin{codeexample}[] \tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}} \begin{tikzpicture} @@ -217,11 +217,11 @@ shapes define a standard set of anchors. \node [my node=green, minimum height=1.5cm] at (1, 1.25) {B}; \node [my node=blue, minimum width=1.5cm] at (2, 0) {C}; \end{tikzpicture} -\end{codeexample} +\end{codeexample} By setting \meta{boolean} to |true|, the trapezium can be stretched horizontally or vertically. - + \begin{codeexample}[] \tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}} \begin{tikzpicture} @@ -235,18 +235,18 @@ shapes define a standard set of anchors. \end{key} \begin{key}{/pgf/trapezium stretches body=\meta{boolean} (default true)} - This is similar to the |trapezium stretches| key execept that - when \meta{boolean} is |true|, \pgfname{} enlarges only the body + This is similar to the |trapezium stretches| key except that + when \meta{boolean} is |true|, \pgfname{} enlarges only the body of the trapezium when applying minimum width. - + \begin{codeexample}[] \tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}} \begin{tikzpicture} \draw [help lines] grid (3,2); \node [my node=red] at (1.5,.25) {A}; - \node [my node=green, minimum width=3cm, trapezium stretches] + \node [my node=green, minimum width=3cm, trapezium stretches] at (1.5,1) {B}; - \node [my node=blue, minimum width=3cm, trapezium stretches body] + \node [my node=blue, minimum width=3cm, trapezium stretches body] at (1.5,1.75) {C}; \end{tikzpicture} \end{codeexample} @@ -258,41 +258,41 @@ shapes define a standard set of anchors. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s, shape=trapezium, shape example, inner sep=1cm] + \node[name=s, shape=trapezium, shape example, inner sep=1cm] {Trapezium\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {bottom left corner/below, top right corner/right, + {bottom left corner/below, top right corner/right, top left corner/left, bottom right corner/below, - bottom side/below, left side/left, + bottom side/below, left side/left, right side/right, top side/above, - center/above, text/below, mid/right, base/below, - mid west/right, base west/below, mid east/left, base east/below, + center/above, text/below, mid/right, base/below, + mid west/right, base west/below, mid east/left, base east/below, west/above, east/above, north/below, south/above, - north west/above, north east/above, - south west/below, south east/below, 160/above} + north west/above, north east/above, + south west/below, south east/below, 160/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{shape} \begin{shape}{semicircle} This shape is a semicircle, which tightly fits the node contents. - This shape supports the rotation of the shape border, as described in + This shape supports the rotation of the shape border, as described in Section~\ref{section-rotating-shape-borders}. - The anchors for the |semicircle| shape are shown below. + The anchors for the |semicircle| shape are shown below. Anchor |30| is an example of a border anchor. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s,shape=semicircle,shape border rotate=0,shape example, inner sep=1cm] + \node[name=s,shape=semicircle,shape border rotate=0,shape example, inner sep=1cm] {Semicircle\vrule width 1pt height 2cm}; \foreach \anchor/\placement in {apex/above, arc start/below, arc end/below, chord center/below, center/above, base/below, mid/right, text/left, - base west/below, base east/below, mid west/left, mid east/right, + base west/below, base east/below, mid west/left, mid east/right, north/below, south/above, east/above, west/above, north west/above left, north east/above right, south west/below, south east/below, 30/right} @@ -307,27 +307,27 @@ shapes define a standard set of anchors. \begin{shape}{regular polygon} - This shape is a regular polygon, which, by default, is drawn so that - a side (rather than a corner) is always at the bottom. - This shape supports the rotation as described in - Section~\ref{section-rotating-shape-borders}, but the border of the + This shape is a regular polygon, which, by default, is drawn so that + a side (rather than a corner) is always at the bottom. + This shape supports the rotation as described in + Section~\ref{section-rotating-shape-borders}, but the border of the polygon is \emph{always} constructed using the incircle, whose radius is calculated to tightly fit the node contents (including any |inner sep|). - + \begin{codeexample}[] \begin{tikzpicture} \foreach \a in {3,...,7}{ \draw[red, dashed] (\a*2,0) circle(0.5cm); \node[regular polygon, regular polygon sides=\a, draw, inner sep=0.3535cm] at (\a*2,0) {}; - } + } \end{tikzpicture} \end{codeexample} - If the node is enlarged to any specified minimum size, - this is interpreted as the diameter of the the - circumcircle, that is, the circle that passes through all the + If the node is enlarged to any specified minimum size, + this is interpreted as the diameter of the + circumcircle, that is, the circle that passes through all the corners of the polygon border. \begin{codeexample}[] @@ -335,7 +335,7 @@ shapes define a standard set of anchors. \foreach \a in {3,...,7}{ \draw[blue, dashed] (\a*2,0) circle(0.5cm); \node[regular polygon, regular polygon sides=\a, minimum size=1cm, draw] at (\a*2,0) {}; - } + } \end{tikzpicture} \end{codeexample} @@ -345,18 +345,18 @@ shapes define a standard set of anchors. \begin{key}{/pgf/regular polygon sides=\meta{integer} (initially 5)} \end{key} - - The anchors for a regular polygon shape are shown below. + + The anchors for a regular polygon shape are shown below. The anchor |75| is an example of a border anchor. - + \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s, shape=regular polygon, shape example, inner sep=.5cm] + \node[name=s, shape=regular polygon, shape example, inner sep=.5cm] {Regular Polygon\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {corner 1/above, corner 2/above, corner 3/left, corner 4/right, corner 5/above, - side 1/above, side 2/left, side 3/below, side 4/right, side 5/above, + {corner 1/above, corner 2/above, corner 3/left, corner 4/right, corner 5/above, + side 1/above, side 2/left, side 3/below, side 4/right, side 5/above, center/above, text/left, mid/right, base/below, 75/above, west/above, east/above, north/below, south/above, north east/below, south east/above, north west/below, south west/above} @@ -369,45 +369,45 @@ shapes define a standard set of anchors. \begin{shape}{star} This shape is a star, which by default (minus any transformations) is - drawn with the first point pointing upwards. - This shape supports the rotation as described in - Section~\ref{section-rotating-shape-borders}, but the border of the + drawn with the first point pointing upwards. + This shape supports the rotation as described in + Section~\ref{section-rotating-shape-borders}, but the border of the star is \emph{always} constructed using the incircle. - - A star should be thought of as having an set of ``inner points'' and - and ``outer points''. + + A star should be thought of as having an set of ``inner points'' + and ``outer points''. The inner points of the border are based on the radius of the circle which tightly fits the node contents, and the outer points are based on the circumcircle, the circle that passes through every outer point. - Any specified minimum size, width or height, is interpreted as the + Any specified minimum size, width or height, is interpreted as the diameter of the circumcircle. - + \begin{codeexample}[] \begin{tikzpicture} \draw [help lines] (0,0) grid (2,2); \draw [blue, dashed] (1,1) circle(1cm); \draw [red, dashed] (1,1) circle(.5cm); - \node [star, star point height=.5cm, minimum size=2cm, draw] + \node [star, star point height=.5cm, minimum size=2cm, draw] at (1,1) {S}; \end{tikzpicture} -\end{codeexample} - +\end{codeexample} + The \pgfname{} keys to set the number of star points, and the height of the star points, are shown below. To use these keys in \tikzname, simply remove the \declare{|/pgf/|} path. - + \begin{key}{/pgf/star points=\meta{integer} (initially 5)} Sets the number of points for the star. \end{key} - + \begin{key}{/pgf/star point height=\meta{distance} (initially .5cm)} Sets the height of the star points. This is the distance between the inner point and outer point radii. If the star is enlarged to some specified minimum size, the inner radius is increased to maintain the point height. \end{key} - + \begin{key}{/pgf/star point ratio=\meta{number} (initially 1.5)} Sets the ratio between the inner point and outer point radii. If the star is enlarged to some specified minimum size, the @@ -416,15 +416,15 @@ shapes define a standard set of anchors. The inner and outer points form the principle anchors for the star, as shown below (anchor |75| is an example of a border anchor). - + \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s, shape=star, star points=5, star point ratio=1.65, shape example, inner sep=1.5cm] + \node[name=s, shape=star, star points=5, star point ratio=1.65, shape example, inner sep=1.5cm] {Star\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {inner point 1/above, inner point 2/above, inner point 3/below, inner point 4/right, - inner point 5/above, outer point 1/above, outer point 2/above, outer point 3/left, + {inner point 1/above, inner point 2/above, inner point 3/below, inner point 4/right, + inner point 5/above, outer point 1/above, outer point 2/above, outer point 3/left, outer point 4/right, outer point 5/above, center/above, text/left, mid/right, base/below, 75/above, west/above, east/above, north/below, south/above, @@ -440,12 +440,12 @@ shapes define a standard set of anchors. \begin{shape}{isosceles triangle} - This shape is an isosceles triangle, which supports the rotation of - the shape border, as described in + This shape is an isosceles triangle, which supports the rotation of + the shape border, as described in Section~\ref{section-rotating-shape-borders}. The angle of rotation determines the direction in which the apex of the triangle points (provided no other transformations are applied). However, regardless - of the rotation of the shape border, the width and height are + of the rotation of the shape border, the width and height are always considered as follows: \begin{codeexample}[] @@ -459,24 +459,24 @@ shapes define a standard set of anchors. \end{tikzpicture} \end{codeexample} - There are \pgfname{} keys to customise this shape. - To use these keys in \tikzname, simply remove the \declare{|/pgf/|} + There are \pgfname{} keys to customize this shape. + To use these keys in \tikzname, simply remove the \declare{|/pgf/|} path. - + \begin{key}{/pgf/isosceles triangle apex angle=\meta{angle} (initially 45)} - Sets the angle of the apex of the isosceles triangle. + Sets the angle of the apex of the isosceles triangle. \end{key} \begin{key}{/pgf/isosceles triangle stretches=\meta{boolean} (default true)} - + By default \meta{boolean} is |false|. This means, that when applying - any minimum width or minimum height requirements, increasing the + any minimum width or minimum height requirements, increasing the height will increase the width (and vice versa), in order to keep the apex angle the same. - + \begin{codeexample}[] \begin{tikzpicture}[paint/.style={draw=#1!75, fill=#1!20}] - \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt, + \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt, anchor=left corner, shape border rotate=90}} \draw[help lines] grid(4,2); \foreach \a/\c in {1.5/blue, 1/green, 0.5/red}{ @@ -486,12 +486,12 @@ shapes define a standard set of anchors. \end{tikzpicture} \end{codeexample} - However, by setting \meta{boolean} to |true|, minimum width and + However, by setting \meta{boolean} to |true|, minimum width and height can be applied independently. \begin{codeexample}[] \begin{tikzpicture}[paint/.style={draw=#1!75, fill=#1!20}] - \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt, + \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt, anchor=south, shape border rotate=90, isosceles triangle stretches}} \draw[help lines] grid(4,2); \foreach \a/\c in {1.5/blue, 1/green, 0.5/red}{ @@ -502,10 +502,10 @@ shapes define a standard set of anchors. \end{codeexample} \end{key} - The anchors for the |isosceles triangle| are shown below + The anchors for the |isosceles triangle| are shown below (anchor |150| is an example of a border anchor). Note that, somewhat confusingly, the anchor names such as |left side| and - |right corner| are named as if the triangle is rotated to + |right corner| are named as if the triangle is rotated to 90 degrees. Note also that the |center| anchor does not necessarily correspond to any kind of geometric center. @@ -516,17 +516,17 @@ shapes define a standard set of anchors. {Isosceles Triangle\vrule width 1pt height 2cm}; \foreach \anchor/\placement in {apex/above, left corner/right, right corner/right, - left side/above, right side/below, lower side/right, + left side/above, right side/below, lower side/right, center/above, text/right, 150/above, mid/right, mid west/above, mid east/right, base/below, base west/below, base east/below, west/above, east/below, north/below, south/above, - north west/below, north east/below, - south west/above, south east/above} + north west/below, north east/below, + south west/above, south east/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{shape} @@ -537,11 +537,11 @@ shapes define a standard set of anchors. \par\leavevmode \begin{shape}{kite} - This shape is a kite, which supports the rotation of the shape border, - as described in Section~\ref{section-rotating-shape-borders}. + This shape is a kite, which supports the rotation of the shape border, + as described in Section~\ref{section-rotating-shape-borders}. There are \pgfname{} keys to specify the upper and lower vertex angles - of the kite. - To use these keys in \tikzname, simply remove the \declare{|/pgf/|} + of the kite. + To use these keys in \tikzname, simply remove the \declare{|/pgf/|} path. \begin{key}{/pgf/kite upper vertex angle=\meta{angle} (initially 120)} @@ -557,10 +557,10 @@ shapes define a standard set of anchors. (it stores no value itself). \meta{angle specification} can be pair of angles in the form \meta{upper angle} |and| \meta{lower angle}, or a single angle. - In this latter case, both the upper and lower vertex angles will + In this latter case, both the upper and lower vertex angles will be the same. \end{key}% - + \begin{codeexample}[] \begin{tikzpicture} \tikzstyle{every node}=[kite, draw] @@ -571,23 +571,23 @@ shapes define a standard set of anchors. \end{codeexample} - The anchors for the |kite| are shown below. Anchor |110| is an + The anchors for the |kite| are shown below. Anchor |110| is an example of a border anchor. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s, shape=kite, shape example, inner sep=1.5cm] + \node[name=s, shape=kite, shape example, inner sep=1.5cm] {Kite\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {upper vertex/above, left vertex/above, lower vertex/below, + {upper vertex/above, left vertex/above, lower vertex/below, right vertex/above, upper left side/above, upper right side/above, lower left side/below, lower right side/below, - center/above, text/left, mid/right, base/below, + center/above, text/left, mid/right, base/below, mid west/left, base west/below, mid east/right, base east/below, west/above, east/above, north/below, south/above, - north west/left, north east/right, - south west/above, south east/above, 110/above} + north west/left, north east/right, + south west/above, south east/above, 110/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} @@ -599,20 +599,20 @@ shapes define a standard set of anchors. This shape is a dart (which can also be known as an arrowhead or - concave kite). This shape supports the rotation of the shape border, - as described in Section~\ref{section-rotating-shape-borders}. - The angle of the border rotation determines the direction in which + concave kite). This shape supports the rotation of the shape border, + as described in Section~\ref{section-rotating-shape-borders}. + The angle of the border rotation determines the direction in which the dart points (unless other transformations have been applied). - There are \pgfname{} keys to set the + There are \pgfname{} keys to set the angle for the `tip' of the dart and the angle between the `tails' - of the dart. - To use these keys in \tikzname, simply remove the \declare{|/pgf/|} + of the dart. + To use these keys in \tikzname, simply remove the \declare{|/pgf/|} path. \begin{codeexample}[] \begin{tikzpicture} - \node[dart, draw, gray, shape border uses incircle, shape border rotate=45] + \node[dart, draw, gray, shape border uses incircle, shape border rotate=45] (d) {dart}; \draw [<->] (d.tip)++(202.5:.5cm) arc(202.5:247.5:.5cm); \node [left=.5cm] at (d.tip) {tip angle}; @@ -629,22 +629,22 @@ shapes define a standard set of anchors. Set the angle between the tails of the dart. \end{key} - The anchors for the |dart| shape are shown below (note that the - shape is rotated 90 degrees anti-clockwise). Anchor |110| is an + The anchors for the |dart| shape are shown below (note that the + shape is rotated 90 degrees anti-clockwise). Anchor |110| is an example of a border anchor. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s, shape=dart, shape border rotate=90, shape example, inner sep=1.25cm] + \node[name=s, shape=dart, shape border rotate=90, shape example, inner sep=1.25cm] {Dart\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {tip/above, tail center/below, right tail/below, + {tip/above, tail center/below, right tail/below, left tail/below, right tail/below, left side/left, right side/right, - center/above, text/left, mid/right, base/below, + center/above, text/left, mid/right, base/below, mid west/left, base west/below, mid east/right, base east/below, west/above, east/above, north/below, south/above, north west/left, north east/right, south west/above, south east/above, - 110/above} + 110/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} @@ -658,10 +658,10 @@ shapes define a standard set of anchors. This shape is a circular sector (which can also be known as a wedge). - This shape supports the rotation of the shape border, - as described in Section~\ref{section-rotating-shape-borders}. - The angle of the border rotation determines the direction in which - the `apex' of the sector points (unless other transformations have + This shape supports the rotation of the shape border, + as described in Section~\ref{section-rotating-shape-borders}. + The angle of the border rotation determines the direction in which + the `apex' of the sector points (unless other transformations have been applied). \begin{codeexample}[] @@ -672,13 +672,13 @@ shapes define a standard set of anchors. \end{tikzpicture} \end{codeexample} - There is a \pgfname{} key to set the central angle of the sector, - which is expected to be less than 180 degrees. - To use this key in \tikzname, simply remove the \declare{|/pgf/|} + There is a \pgfname{} key to set the central angle of the sector, + which is expected to be less than 180 degrees. + To use this key in \tikzname, simply remove the \declare{|/pgf/|} path. \begin{key}{/pgf/circular sector angle=\meta{angle} (initially 60)} - Set the central angle of the sector. + Set the central angle of the sector. \end{key} The anchors for the circular sector shape are shown below. @@ -687,7 +687,7 @@ shapes define a standard set of anchors. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s,shape=circular sector, style=shape example, inner sep=1cm] + \node[name=s,shape=circular sector, style=shape example, inner sep=1cm] {Circular Sector\vrule width 1pt height 2cm}; \foreach \anchor/\placement in {sector center/above, arc start/below, arc end/below, arc center/below, @@ -705,7 +705,7 @@ shapes define a standard set of anchors. \begin{shape}{cylinder} - This shape is a 2-dimensional representation of a cylinder, which + This shape is a 2-dimensional representation of a cylinder, which supports the rotation of the shape border as described in Section~\ref{section-rotating-shape-borders}. @@ -717,34 +717,34 @@ shapes define a standard set of anchors. Regardless the rotation of the shape border, the height is always the distance between the curved ends, and the width is always the - distance between the straight sides. + distance between the straight sides. \begin{codeexample}[] \begin{tikzpicture}[>=stealth] - \node [cylinder, gray!50, rotate=30, draw, + \node [cylinder, gray!50, rotate=30, draw, minimum height=2cm, minimum width=1cm] (c) {Cylinder}; - \draw[red, <->] (c.top) -- (c.bottom) + \draw[red, <->] (c.top) -- (c.bottom) node [at end, below, black] {height}; - \draw[red, <->] (c.north) -- (c.south) + \draw[red, <->] (c.north) -- (c.south) node [at start, above, black] {width}; \end{tikzpicture} \end{codeexample} Enlarging the shape to some minimum height will stretch only the body - of the cylinder. By contrast, enlarging the shape to some minimum + of the cylinder. By contrast, enlarging the shape to some minimum width will stretch the curved ends. \begin{codeexample}[] \begin{tikzpicture}[>=stealth, shape aspect=.5] \tikzset{every node/.style={cylinder, shape border rotate=90, draw}} - \node [minimum height=1.5cm] {A}; - \node [minimum width=1.5cm] at (1.5,0) {B}; + \node [minimum height=1.5cm] {A}; + \node [minimum width=1.5cm] at (1.5,0) {B}; \end{tikzpicture} \end{codeexample} There are various keys to customize this shape (to use \pgfname{} keys in \tikzname{}, simply remove the \declare{|/pgf/|} path). - + \begin{key}{/pgf/aspect=\meta{value} (initially 1.0)} The aspect is a recommendation for the quotient of the radii of the cylinder end. This may be ignored if the shape is enlarged @@ -753,27 +753,27 @@ shapes define a standard set of anchors. \begin{codeexample}[] \begin{tikzpicture}[>=stealth] \tikzset{every node/.style={cylinder, shape border rotate=90, draw}} - \node [aspect=1.0] {A}; - \node [aspect=0.5] at (1,0) {B}; - \node [aspect=0.25] at (2,0) {C}; + \node [aspect=1.0] {A}; + \node [aspect=0.5] at (1,0) {B}; + \node [aspect=0.25] at (2,0) {C}; \end{tikzpicture} \end{codeexample} \end{key} \begin{key}{/pgf/cylinder uses custom fill=\meta{boolean} (default true)} - This enables the use of a custom fill for the body and the end of - the cylinder. The background path for the shape should not be - filled (e.g., in \tikzname{}, the |fill| option for the node must + This enables the use of a custom fill for the body and the end of + the cylinder. The background path for the shape should not be + filled (e.g., in \tikzname{}, the |fill| option for the node must be implicity or explicitly set to |none|). - Internally, this key sets the \TeX-if + Internally, this key sets the \TeX-if |\ifpgfcylinderusescustomfill| appropriately. \end{key} \begin{codeexample}[] \begin{tikzpicture}[>=stealth, aspect=0.5] \node [cylinder, cylinder uses custom fill, cylinder end fill=red!50, - cylinder body fill=red!25] {Cylinder}; + cylinder body fill=red!25] {Cylinder}; \end{tikzpicture} \end{codeexample} @@ -786,14 +786,14 @@ shapes define a standard set of anchors. The anchors this shape are shown below (anchor |160| is an - example of a border anchor). Note the the cylinder shape does not - distinguish between |outer xsep| and |outer ysep|. Only the larger - of the two values is used for the shape. Note also the difference + example of a border anchor). Note the cylinder shape does not + distinguish between |outer xsep| and |outer ysep|. Only the larger + of the two values is used for the shape. Note also the difference between the |center| and |shape center| anchors: |center| is the - center of the cylinder body and also the center of rotation. - The |shape center| is the center of the shape which includes the + center of the cylinder body and also the center of rotation. + The |shape center| is the center of the shape which includes the 2-dimensional representation of the cylinder top. - + \begin{codeexample}[] \Huge @@ -803,16 +803,16 @@ shapes define a standard set of anchors. \foreach \anchor/\placement in {before top/above, top/above, after top/below, before bottom/below, bottom/above, after bottom/above, - mid/right, mid west/right, mid east/left, + mid/right, mid west/right, mid east/left, base/below, base west/below, base east/below, - center/above, text/above, shape center/right, + center/above, text/above, shape center/right, west/right, east/left, north/above, south/below, - north west/below, north east/above, - south west/above, south east/below, 160/above} + north west/below, north east/above, + south west/above, south east/below, 160/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{shape} @@ -836,38 +836,44 @@ shapes define a standard set of anchors. lower left to the upper right added. The circle is part of the background, the diagonal line part of the foreground path; thus, the diagonal line is on top of the text. - + \begin{codeexample}[] \begin{tikzpicture} \node [forbidden sign,line width=1ex,draw=red,fill=white] {Smoking}; \end{tikzpicture} \end{codeexample} - The shape inherits all anchors from the |circle| shape, see also the - following figure: + The shape inherits all anchors from the |circle| shape. +\end{shape} + + +\begin{shape}{magnifying glass} + This shape places the node inside a circle with a handle attached to + the node. The angle of the handle and its length can be adjusted + using two keys: + + \begin{key}{/pgf/magnifying glass handle angle fill=\meta{degree} (default -45)} + The angle of the handle. + \end{key} + + \begin{key}{/pgf/magnifying glass handle angle aspect=\meta{factor} (default 1.5)} + The length of the handle as a multiple of the circle radius. + \end{key} + \begin{codeexample}[] -\Huge \begin{tikzpicture} - \node[name=s,shape=forbidden sign,shape example] {Forbidden\vrule width 1pt height 2cm}; - \foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, - west/left, center/above, east/right, - mid west/right, mid/above, mid east/left, - base west/left, base/below, base east/right, - south west/below left, south/below, south east/below right, - text/left, 10/right, 130/above} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; + \node [magnifying glass,line width=1ex,draw] {huge}; \end{tikzpicture} \end{codeexample} + The shape inherits all anchors from the |circle| shape. \end{shape} \begin{shape}{cloud} - This shape is a cloud, drawn to tightly fit the node contents + This shape is a cloud, drawn to tightly fit the node contents (strictly speaking, using an ellipse which tightly fits the node - contents -- including any |inner sep|). + contents -- including any |inner sep|). \begin{codeexample}[] \begin{tikzpicture} @@ -878,7 +884,7 @@ shapes define a standard set of anchors. A cloud should be thought of as having a number of ``puffs'', which are the individual arcs drawn around the border. There are \pgfname{} - keys to specify how the cloud is drawn (to use these keys in + keys to specify how the cloud is drawn (to use these keys in \tikzname{}, simply remove the \declare{|/pgf/|} path). \begin{key}{/pgf/cloud puffs=\meta{integer} (initially 10)} @@ -886,13 +892,13 @@ shapes define a standard set of anchors. \end{key} \begin{key}{/pgf/cloud puff arc=\meta{angle} (initially 135)} - Set the length of the puff arc (in degrees). A shorter arc can + Set the length of the puff arc (in degrees). A shorter arc can produce better looking joins between puffs for larger line widths. \end{key} - Like the diamond shape, the cloud shape also uses the - \declare{|aspect|} key, to determine the ratio of the width and the - height of the cloud. However there may be cirumstances where it may + Like the diamond shape, the cloud shape also uses the + \declare{|aspect|} key, to determine the ratio of the width and the + height of the cloud. However there may be circumstances where it may be undesirable to continually specify the |aspect| for the cloud. Therefore, the following key is implemented: @@ -913,39 +919,39 @@ shapes define a standard set of anchors. Any minimum size requirements are applied to the ``circum-ellipse'', which is the ellipse which passes through all the midpoints of the - puff arcs. These requirements are considered \emph{after} any + puff arcs. These requirements are considered \emph{after} any aspect specification is applied. \begin{codeexample}[] \begin{tikzpicture} \draw [help lines] grid (3,2); \draw [blue, dashed] (1.5, 1) ellipse (1.5cm and 1cm); - \node [cloud, cloud puffs=9, draw, minimum width=3cm, minimum height=2cm] + \node [cloud, cloud puffs=9, draw, minimum width=3cm, minimum height=2cm] at (1.5, 1) {}; \end{tikzpicture} \end{codeexample} The anchors for the cloud shape are shown below for a cloud with - eleven puffs. Anchor 70 is an example of a border anchor. - + eleven puffs. Anchor 70 is an example of a border anchor. + \begin{codeexample}[] \Huge \begin{tikzpicture} \node[name=s, shape=cloud, style=shape example, cloud puffs=11, aspect=1.5, cloud puff arc=120,inner ysep=1cm] {Cloud\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {puff 1/above, puff 2/above, puff 3/above, puff 4/below, + {puff 1/above, puff 2/above, puff 3/above, puff 4/below, puff 5/left, puff 6/below, puff 7/below, puff 8/right, puff 9/below, puff 10/above, puff 11/above, 70/right, - center/above, base/below, mid/right, text/left, + center/above, base/below, mid/right, text/left, north/below, south/below, east/above, west/above, - north west/left, north east/right, + north west/left, north east/right, south west/below, south east/below} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} \end{codeexample} -\end{shape} +\end{shape} @@ -954,9 +960,9 @@ shapes define a standard set of anchors. \begin{shape}{starburst} - This shape is a randomly generated eliptical star, - which supports the rotating of the shape border as described in - Section~\ref{section-rotating-shape-borders}. + This shape is a randomly generated elliptical star, + which supports the rotating of the shape border as described in + Section~\ref{section-rotating-shape-borders}. \begin{codeexample}[] \begin{tikzpicture} \node[starburst, fill=yellow, draw=red, line width=2pt] {\bf BANG!}; @@ -967,52 +973,52 @@ shapes define a standard set of anchors. which tightly fits the node contents (including any |inner sep|). Using a specified `starburst point height' value, the outer points - are generated randomly between this value and one quarter of this - value. For a given starburst shape the angle between each point is + are generated randomly between this value and one quarter of this + value. For a given starburst shape the angle between each point is fixed, and is determined by the number of points specified for the starburst. - It is important to note that, whilst the maximum possible point - height is used to calculate minimum width or height requirements, - the outer points are randomly generated, so there is (unfortunately) - no guarantee that any such requirements will be fully met. + It is important to note that, whilst the maximum possible point + height is used to calculate minimum width or height requirements, + the outer points are randomly generated, so there is (unfortunately) + no guarantee that any such requirements will be fully met. \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] grid(3,2); - \node[starburst, draw, minimum width=3cm, minimum height=2cm] + \node[starburst, draw, minimum width=3cm, minimum height=2cm] at (1.5, 1) {\bf BOOM!}; \end{tikzpicture} \end{codeexample} There are \pgfname{} keys to control the drawing of the starburst - shape. To use these keys in \tikzname, simply remove the + shape. To use these keys in \tikzname, simply remove the \declare{|/pgf/|} path. \begin{key}{/pgf/starburst points=\meta{integer} (initially 17)} Set the number of points for the starburst. \end{key} \begin{key}{/pgf/starburst point height=\meta{length} (initially .5cm)} - Set the \emph{maximum} distance between the inner point radius + Set the \emph{maximum} distance between the inner point radius and the outer point radius. \end{key} \begin{key}{/pgf/random starburst=\meta{integer} (initially 100)} Set the seed for the random number generator for creating the starburst. The maximum value for \meta{integer} is |16383|. - If \meta{integer}|=0|, the random number generator will not be - used, and the maximum point height will be used for all outer + If \meta{integer}|=0|, the random number generator will not be + used, and the maximum point height will be used for all outer points. If \meta{integer} is omitted, a seed will be randomly chosen. \end{key} - The basic anchors for a nine point |starburst| shape are shown below. + The basic anchors for a nine point |starburst| shape are shown below. Anchor |80| is an example of a border anchor. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s, shape=starburst, starburst points=9, starburst point height=3.5cm, - style=shape example,inner sep=1cm] + \node[name=s, shape=starburst, starburst points=9, starburst point height=3.5cm, + style=shape example,inner sep=1cm] {Starburst\vrule width 1pt height 2cm}; \foreach \anchor/\placement in {outer point 1/above, outer point 2/above, outer point 3/right, @@ -1033,13 +1039,14 @@ shapes define a standard set of anchors. \begin{shape}{signal} This shape is a ``signal'' or sign shape, that is, a rectangle, with - optionally pointed sides. A signal can point ``to'' somewhere, with - outward points in that direction. It can also be ``from'' - somewhere, with inward points from that direction. The resulting + optionally pointed sides. A signal can point ``to'' somewhere, with + outward points in that direction. It can also be ``from'' + somewhere, with inward points from that direction. The resulting points extend the node contents (which include the |inner sep|). \begin{codeexample}[] -\begin{tikzpicture}[every node/.style={signal, draw, text=white}] +\begin{tikzpicture} + [every node/.style={signal, draw, text=white, signal to=nowhere}] \node[fill=green!65!black, signal to=east] at (0,1) {To East}; \node[fill=red!65!black, signal from=east] at (0,0) {From East}; \end{tikzpicture} @@ -1048,34 +1055,34 @@ shapes define a standard set of anchors. There are \pgfname{} keys for drawing the signal shape (to use these keys in \tikzname{}, simply remove the \declare{|/pgf/|} path): - \begin{key}{/pgf/signal pointer angle=\meta{angle} (initially 90)} + \begin{key}{/pgf/signal pointer angle=\meta{angle} (initially 90)} Set the angle for the pointed sides of the shape. This angle is maintained when enforcing any minimum size requirements, so any adjustment to the width will affect the height, and vice versa. \end{key} - \begin{key}{/pgf/signal from=\meta{direction}\space\opt{and \meta{opposite direction}} (initially nowhere)} + \begin{key}{/pgf/signal from=\meta{direction}\space\opt{and \meta{opposite direction}} (initially nowhere)} Set which sides take an inward pointer (i.e., that points towards the - center of the shape). The possible values for \meta{direction} and - \meta{opposide direction} are the compass point directions |north|, + center of the shape). The possible values for \meta{direction} and + \meta{opposite direction} are the compass point directions |north|, |south|, |east| and |west| (or |above|, |below|, |right| and |left|). - An additional keyword |nowhere| can be used to reset the sides so - they have no pointers. When used with |signal from| key, this only - resets inward pointers; used with the |signal to| key, it only - resets outward pointers. + An additional keyword |nowhere| can be used to reset the sides so + they have no pointers. When used with |signal from| key, this only + resets inward pointers; used with the |signal to| key, it only + resets outward pointers. \end{key} - \begin{key}{/pgf/signal to=\meta{direction}\space\opt{and \meta{opposite direction}} (initially east)} - Set which sides take an outward pointer (i.e., that points away from - the the shape). + \begin{key}{/pgf/signal to=\meta{direction}\space\opt{and \meta{opposite direction}} (initially east)} + Set which sides take an outward pointer (i.e., that points away from + the the shape). \end{key} Note that \pgfname{} will ignore any instruction to use directions that are not opposites (so using the value |east and north|, will - result in only |north| being assigned a pointer). This is also + result in only |north| being assigned a pointer). This is also the case if non-opposite values are used in the |signal to| and - |signal from| keys at the same time. So, for example, it is not + |signal from| keys at the same time. So, for example, it is not possible for a signal to have an outward point to the left, and also have an inward point from below. @@ -1085,15 +1092,15 @@ shapes define a standard set of anchors. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s, shape=signal, signal from=west, shape example, inner sep=2cm] + \node[name=s, shape=signal, signal from=west, shape example, inner sep=2cm] {Signal\vrule width1pt height2cm}; \foreach \anchor/\placement in {text/left, center/above, 70/above, base/below, base east/below, base west/below, - mid/right, mid east/above left, mid west/above left, - north/above, south/below, - east/above, west/above, - north west/above, north east/above, + mid/right, mid east/above left, mid west/above left, + north/above, south/below, + east/above, west/above, + north west/above, north east/above, south west/below, south east/below} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; @@ -1108,7 +1115,7 @@ shapes define a standard set of anchors. \begin{shape}{tape} This shape is a rectangle with optional, ``bendy'' top and bottom - sides, which tightly fits the node contents (including the + sides, which tightly fits the node contents (including the |inner sep|). \begin{codeexample}[] @@ -1121,38 +1128,38 @@ shapes define a standard set of anchors. There are \pgfname{} keys to specify which sides bend and how high the bends are (to use these keys in \tikzname{}, simply remove the \declare{|/pgf/|} path): - + \begin{key}{/pgf/tape bend top=\meta{bend style} (initially in and out)} Specify how the top side bends. The \meta{bend style} is either - |in and out|, |out and in| or |none| (i.e., a straight line). - The bending sides are drawn in a - clockwise direction, and using the bend style |in and out| will mean - the side will first bend inwards and then bend outwards. - The opposite holds true for |out and in|. + |in and out|, |out and in| or |none| (i.e., a straight line). + The bending sides are drawn in a + clockwise direction, and using the bend style |in and out| will mean + the side will first bend inwards and then bend outwards. + The opposite holds true for |out and in|. \begin{codeexample}[] \begin{tikzpicture}[-stealth] \node[tape, draw, gray, minimum width=2cm](t){Tape}; - \draw [blue]([yshift=5pt] t.north west) -- ([yshift=5pt]t.north east) + \draw [blue]([yshift=5pt] t.north west) -- ([yshift=5pt]t.north east) node[midway, above, black]{in and out}; - \draw [blue]([yshift=-5pt]t.south east) -- ([yshift=-5pt]t.south west) + \draw [blue]([yshift=-5pt]t.south east) -- ([yshift=-5pt]t.south west) node[sloped, allow upside down, midway, above, black]{in and out}; \end{tikzpicture} -\end{codeexample} +\end{codeexample} - This might take a bit of getting used to, but just remember that - when you want the bendy sides to be parallel, the sides take the - same bend style. It is possible for the top and bottom sides to - take opposite bend styles, but the author of this shape cannot + This might take a bit of getting used to, but just remember that + when you want the bendy sides to be parallel, the sides take the + same bend style. It is possible for the top and bottom sides to + take opposite bend styles, but the author of this shape cannot think of a single use for such a combination. - + \begin{codeexample}[] \begin{tikzpicture} \tikzstyle{every node}=[tape, draw] \node [tape bend top=out and in, tape bend bottom=out and in] {Parallel}; \node at (2,0) [tape bend bottom=out and in] {Why?}; \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{key} @@ -1168,28 +1175,28 @@ shapes define a standard set of anchors. \draw [help lines] grid(3,2); \node [tape, fill, minimum size=2cm, red!50, tape bend top=none, tape bend height=1cm] at (1.5,1.5) (t) {}; - \draw [|<->|, blue] (1.5,0) -- (1.5,1) + \draw [|<->|, blue] (1.5,0) -- (1.5,1) node [at end, above, black]{tape bend height}; \end{tikzpicture} -\end{codeexample} - +\end{codeexample} + \end{key} The anchors for the tape shape are shown below. Anchor |60| is an example of a border anchor. Note that border anchors will snap to - the center of convex curves (i.e. when bending in). + the center of convex curves (i.e. when bending in). \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s, shape=tape, tape bend height=1cm, shape example, inner xsep=3cm] + \node[name=s, shape=tape, tape bend height=1cm, shape example, inner xsep=3cm] {Tape\vrule width1pt height2cm}; \foreach \anchor/\placement in - {text/left, center/above, 60/above, + {text/left, center/above, 60/above, base/below, base east/below, base west/below, - mid/right, mid east/left, mid west/right, - north/above, south/below, east/above, west/above, - north west/above, north east/above, + mid/right, mid east/left, mid west/right, + north/above, south/below, east/above, west/above, + north west/above, north east/above, south west/below, south east/below} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; @@ -1210,10 +1217,10 @@ shapes define a standard set of anchors. \end{pgflibrary} \begin{shape}{single arrow} - This shape is an arrow, which tightly fits the note contents - (including any |inner sep|). - This shape supports the rotation of the shape border, as - described in Section~\ref{section-rotating-shape-borders}. + This shape is an arrow, which tightly fits the note contents + (including any |inner sep|). + This shape supports the rotation of the shape border, as + described in Section~\ref{section-rotating-shape-borders}. The angle of rotation determines which direction the arrow points (provided no other rotational transformations are applied). @@ -1226,15 +1233,15 @@ shapes define a standard set of anchors. \end{tikzpicture} \end{codeexample} - Regardless of the rotation of the arrow border, the width is - measured between the back ends of the arrow head, and the - height is measured from the arrow tip to the end of the arrow + Regardless of the rotation of the arrow border, the width is + measured between the back ends of the arrow head, and the + height is measured from the arrow tip to the end of the arrow tail. \begin{codeexample}[] -\begin{tikzpicture}[>=stealth, +\begin{tikzpicture}[>=stealth, rotate border/.style={shape border uses incircle, shape border rotate=#1}] - \node[rotate border=-30, fill=gray!25, minimum height=3cm, single arrow, + \node[rotate border=-30, fill=gray!25, minimum height=3cm, single arrow, single arrow head extend=.5cm, single arrow head indent=.25cm] (arrow) {}; \draw[red, <->] (arrow.before tip) -- (arrow.after tip) node [near end, left, black] {width}; @@ -1249,7 +1256,7 @@ shapes define a standard set of anchors. \begin{key}{/pgf/single arrow tip angle=\meta{angle} (initially 90)} Set the angle for the arrow tip. Enlarging the arrow to some - minimum width may increase the the height of the shape to maintain + minimum width may increase the height of the shape to maintain this angle. \end{key} @@ -1257,12 +1264,12 @@ shapes define a standard set of anchors. This sets the distance between the tail of the arrow and the outer end of the arrow head. This may change if the shape is enlarged to some minimum width. - + \begin{codeexample}[] \begin{tikzpicture} - \node[single arrow, draw, single arrow head extend=.5cm, gray!50, rotate=60] + \node[single arrow, draw, single arrow head extend=.5cm, gray!50, rotate=60] (a) {Arrow}; - \draw[red, |<->|] (a.before tip) -- (a.before head) + \draw[red, |<->|] (a.before tip) -- (a.before head) node [midway, below, sloped, black] {head extend}; \end{tikzpicture} \end{codeexample} @@ -1271,7 +1278,7 @@ shapes define a standard set of anchors. \begin{key}{/pgf/single arrow head indent=\meta{length} (initially 0cm)} This moves the point where the arrow head joins the shaft of the arrow \emph{towards} the arrow tip, by \meta{length}. - + \begin{codeexample}[] \begin{tikzpicture}[every node/.style={single arrow, draw=none, rotate=60}] \node [fill=red!50] {arrow 1}; @@ -1280,22 +1287,22 @@ shapes define a standard set of anchors. \end{codeexample} \end{key} - The anchors for this shape are shown below (anchor |20| is an + The anchors for this shape are shown below (anchor |20| is an example of a border anchor). - + \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s,shape=single arrow, shape example, single arrow head extend=1.5cm] + \node[name=s,shape=single arrow, shape example, single arrow head extend=1.5cm] {Single Arrow\vrule width1pt height2cm}; \foreach \anchor/\placement in {text/above, center/above, 20/above, mid west/left, mid/above, mid east/above left, base west/below, base/below, base east/below, - tip/above, before tip/above, after tip/below, before head/above, - after head/below, after tail/above, before tail/below, tail/right, + tip/above, before tip/above, after tip/below, before head/above, + after head/below, after tail/above, before tail/below, tail/right, north/above, south/below, east/below, west/above, - north west/above, north east/below, south west/below, south east/above} + north west/above, north east/below, south west/below, south east/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} @@ -1308,10 +1315,10 @@ shapes define a standard set of anchors. \begin{shape}{double arrow} - This shape is a double arrow, which tightly fits the note contents + This shape is a double arrow, which tightly fits the note contents (including any |inner sep|), and supports the rotation of the shape - border, as described in Section~\ref{section-rotating-shape-borders}. - + border, as described in Section~\ref{section-rotating-shape-borders}. + \begin{codeexample}[] \begin{tikzpicture}[every node/.style={double arrow, draw}] @@ -1322,12 +1329,12 @@ shapes define a standard set of anchors. The double arrow behaves exactly like the single arrow, so you need to remember that the width is \emph{always} the distance between the back ends of the arrow heads, and the height - is \emph{always} the the tip-to-tip distance. - + is \emph{always} the tip-to-tip distance. + \begin{codeexample}[] -\begin{tikzpicture}[>=stealth, +\begin{tikzpicture}[>=stealth, rotate border/.style={shape border uses incircle, shape border rotate=#1}] - \node[rotate border=210, fill=gray!25, minimum height=3cm, double arrow, + \node[rotate border=210, fill=gray!25, minimum height=3cm, double arrow, double arrow head extend=.5cm, double arrow head indent=.25cm] (arrow) {}; \draw[red, <->] (arrow.before tip 1) -- (arrow.after tip 1) node [near start, right, black] {width}; @@ -1336,14 +1343,14 @@ shapes define a standard set of anchors. \end{tikzpicture} \end{codeexample} - The \pgfname{} keys that can be used to customize the double arrow + The \pgfname{} keys that can be used to customize the double arrow behave similarly to the keys for the single arrow (to use these keys in \tikzname{}, simply remove the \declare{|/pgf/|} path). - + \begin{key}{/pgf/double arrow tip angle=\meta{angle} (initially 90)} Set the angle for the arrow tip. Enlarging the arrow to some - minimum width may increase the the height of the shape to maintain + minimum width may increase the height of the shape to maintain this angle. \end{key} @@ -1365,14 +1372,14 @@ shapes define a standard set of anchors. \end{key} - The anchors for this shape are shown below (anchor |20| is an + The anchors for this shape are shown below (anchor |20| is an example of a border anchor). - - + + \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s,shape=double arrow, double arrow head extend=1.5cm, shape example, inner xsep=2cm] + \node[name=s,shape=double arrow, double arrow head extend=1.5cm, shape example, inner xsep=2cm] {Double Arrow\vrule width1pt height2cm}; \foreach \anchor/\placement in {text/above, center/above, 20/above, @@ -1381,7 +1388,7 @@ shapes define a standard set of anchors. before head 1/above, before tip 1/above, tip 1/above, after tip 1/below, after head 1/below, before head 2/above, before tip 2/below, tip 2/above, after tip 2/above, after head 2/below, north/above, south/below, east/below, west/below, - north west/below, north east/below, south west/above, south east/above} + north west/below, north east/below, south west/above, south east/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} @@ -1398,14 +1405,14 @@ four sides. \begin{codeexample}[] \begin{tikzpicture} \node[arrow box, draw] {A}; - \node[arrow box, draw, arrow box arrows={north:.5cm, west:0.75cm}] + \node[arrow box, draw, arrow box arrows={north:.5cm, west:0.75cm}] at (2,0) {B}; \end{tikzpicture} \end{codeexample} Any minimum size requirements are applied to the main rectangle \emph{only}. This does not pose too many problems if you wish to -accommodate the length of the arrows, as it is possible to specify +accommodate the length of the arrows, as it is possible to specify the length of each arrow independently, from either the border of the rectangle (the default) or the center of the rectangle. @@ -1422,11 +1429,11 @@ There are various \pgfname{} keys for drawing this shape (to use these keys in \tikzname, simply remove the \declare{/pgf/} path). \begin{key}{/pgf/arrow box tip angle=\meta{angle} (initially 90)} - Set the angle at the arrow tip for all four arrows. + Set the angle at the arrow tip for all four arrows. \end{key} \begin{key}{/pgf/arrow box head extend=\meta{length} (initially .125cm)} - Set the the distance the arrow head extends away from the the shaft + Set the distance the arrow head extends away from the shaft of the arrow. This applies to all arrows. \end{key} @@ -1460,30 +1467,30 @@ keys in \tikzname, simply remove the \declare{/pgf/} path). \end{key} \begin{key}{/pgf/arrow box arrows={\ttfamily\char`\{}\meta{list}{\ttfamily\char`\}}} - Set the distance that all arrows extend from the node. The + Set the distance that all arrows extend from the node. The specification in \meta{list} consists of the four compass points |north|, |south|, |east| or |west|, separated by commas (so the list - must be contained within braces). - The distances can be specified after each side separated by a colon - (e.g., |north:1cm|, or |west:5cm from center|). - If an item specifies no distance, the most recently specifed + must be contained within braces). + The distances can be specified after each side separated by a colon + (e.g., |north:1cm|, or |west:5cm from center|). + If an item specifies no distance, the most recently specified distance will be used (at the start of the list this is |0cm|, - so the first item in the list should specify a distance). + so the first item in the list should specify a distance). Any sides not specified will not be drawn with an arrow. \end{key} The anchors for this shape are shown below (unfortunately due to its size, this example must be rotated). Anchor |75| is an example of a border anchor. -If a side is drawn without an arrow, the anchors for that arrow should -be considered unavailable. They are (unavoidably) defined, but default +If a side is drawn without an arrow, the anchors for that arrow should +be considered unavailable. They are (unavoidably) defined, but default to the center of the appropriate side. \begin{codeexample}[] \Huge \begin{tikzpicture} \node[shape=arrow box, shape example, inner xsep=1cm, inner ysep=1.5cm, arrow box shaft width=2cm, - arrow box arrows={north:3.5cm from border, south, east:5cm from border, west}, + arrow box arrows={north:3.5cm from border, south, east:5cm from border, west}, arrow box head extend=0.75cm, rotate=-90](s) {Arrow Box\vrule width1pt height2cm}; \foreach \anchor/\placement in {center/above, text/above, mid/right, base/below, 75/above, @@ -1491,13 +1498,13 @@ to the center of the appropriate side. north/below, south/below, east/below, west/below, north east/above, south east/above, south west/below, north west/below, north arrow tip/above,south arrow tip/above, east arrow tip/above, west arrow tip/above, - before north arrow/above, before north arrow head/below left, before north arrow tip/above left, + before north arrow/above, before north arrow head/below left, before north arrow tip/above left, after north arrow tip/above right, after north arrow head/below right, after north arrow/below, - before south arrow/below, before south arrow head/above right, before south arrow tip/below right, + before south arrow/below, before south arrow head/above right, before south arrow tip/below right, after south arrow tip/below left, after south arrow head/above left, after south arrow/above, - before east arrow/above, before east arrow head/above right, before east arrow tip/above, - after east arrow tip/below, after east arrow head/below right, after east arrow/below, - before west arrow/below, before west arrow head/below left, before west arrow tip/below, + before east arrow/above, before east arrow head/above right, before east arrow tip/above, + after east arrow tip/below, after east arrow head/below right, after east arrow/below, + before west arrow/below, before west arrow head/below left, before west arrow tip/below, after west arrow tip/above, after west arrow head/above left, after west arrow/below} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement, rotate=-90] {\scriptsize\texttt{(s.\anchor)}}; @@ -1512,7 +1519,7 @@ to the center of the appropriate side. \begin{pgflibrary}{shapes.multipart} This library defines general-purpose shapes that are composed of - multiple (text) parts. + multiple (text) parts. \end{pgflibrary} @@ -1520,7 +1527,7 @@ to the center of the appropriate side. This shape is a multi-part shape consisting of a circle with a line in the middle. The upper part is the main part (the |text| part), the lower part is the |lower| part. - + \begin{codeexample}[] \begin{tikzpicture} \node [circle split,draw,double,fill=red!20] @@ -1540,11 +1547,44 @@ to the center of the appropriate side. \begin{tikzpicture} \node[name=s,shape=circle split,shape example] {text\nodepart{lower}lower}; \foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, - west/left, center/below, east/right, - mid west/right, mid/above, mid east/left, - base west/left, base/below, base east/right, - south west/below left, south/below, south east/below right, + {north west/above left, north/above, north east/above right, + west/left, center/below, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, + text/left, lower/left, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} + + +\begin{shape}{circle solidus} + This shape (due to Manuel Lacruz) is similar to the split circle, + but the two text parts are arranged diagonally. + +\begin{codeexample}[] +\begin{tikzpicture} + \node [circle solidus,draw,double,fill=red!20] + { + $q_1$ + \nodepart{lower} + $00$ + }; +\end{tikzpicture} +\end{codeexample} + +\begin{codeexample}[] +\Huge +\begin{tikzpicture} + \node[name=s,shape=circle solidus,shape example,inner xsep=1cm] {text\nodepart{lower}lower}; + \foreach \anchor/\placement in + {north west/above left, north/above, north east/above right, + west/left, center/below, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, text/left, lower/left, 130/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; @@ -1554,9 +1594,9 @@ to the center of the appropriate side. \begin{shape}{ellipse split} - This shape is a multi-part shape consisting of an ellipse with a line + This shape is a multi-part shape consisting of an ellipse with a line in the middle. The upper part is the main part (the |text| part), - the lower part is the |lower| part. + the lower part is the |lower| part. The anchors for this shape are shown below. Anchor |60| is a border anchor. \begin{codeexample}[] \Huge @@ -1576,104 +1616,189 @@ to the center of the appropriate side. \begin{shape}{rectangle split} - This shape is a rectangle which can optionally be split into - two, three or four node parts, or even used with a single node - part. + This shape is a rectangle which can be either split horizontally + or vertically into several parts. + +\begin{codeexample}[] +\begin{tikzpicture}[my shape/.style={ + rectangle split, rectangle split parts=#1, draw, anchor=center}] + \node [my shape=5] at (0,1) + {a\nodepart{two}b\nodepart{three}c\nodepart{four}d\nodepart{five}e}; + \node [my shape=5, rectangle split horizontal] at (2,2) + {1\nodepart{two}2\nodepart{three}3\nodepart{four}4\nodepart{five}5}; + \node [my shape=3] at (3,0.5) + {A\nodepart{two}B\nodepart{three}C}; + \node [my shape=4, rectangle split horizontal] at (1.5,0.5) + {1\nodepart{two}2\nodepart{three}3\nodepart{four}4}; +\end{tikzpicture} +\end{codeexample} + + +The shape can be split into a maximum of twenty parts. However, to +avoid allocating a lot of unnecessary boxes, \pgfname{} only allocates +four boxes by default. +To use the |rectangle| |split| shape with more than four boxes, the +extra boxes must be allocated manually in advance (perhaps using |\newbox| +or |\let|). +The boxes take the form |\pgfnodepart|\meta{number}|box|, where \meta{number} +is from the cardinal numbers |one|, |two|, |three|, \ldots{} and so on. +|\pgfnodepartonebox| is special in that it is synonymous with +|\pgfnodeparttextbox|. For compatibility with earlier versions of +this shape, the boxes |\pgfnodeparttwobox|, |\pgfnodepartthreebox| +and |\pgfnodepartfourbox|, can be referred to using the ordinal +numbers: |\pgfnodepartsecondbox|, |\pgfnodepartthirdbox| +and |\pgfnodepartfourthbox|. In order to facilitate the allocation of +these extra boxes, the following key is provided: + +\begin{key}{/pgf/rectangle split allocate boxes=\meta{number}} + This key checks if \meta{number} boxes have been allocated, and if + not allocates the required boxes using |\newbox| (some ``magic'' is + performed to get around the fact that |\newbox| is declared |\outer| + in plain \TeX). +\end{key} + + When split vertically, the rectangle split will observe any + |minimum width| requirements but any |minimum height| will be ignored. + Conversely when split horizontally, |minimum height| requirements + will be observed, but any |minimum width| will be ignored. + In addition, |inner sep| is applied + to every part that is used, so it cannot be specified + independently for a particular part. + + There are several \pgfname{} keys to specify how the shape is + drawn. To use these keys in \tikzname, simply remove the + \declare{|/pgf/|} path: + +\begin{key}{/pgf/rectangle split parts=\meta{number} (initially 4)} + Split the rectangle into \meta{number} parts, + which should be in the range |1| to |20|. If more than four parts + are need, the boxes should be allocated in advance as + described above. \begin{codeexample}[] -\begin{tikzpicture}[every text node part/.style={text centered}] - \node[rectangle split, rectangle split parts=3, draw, text width=2.75cm] +\begin{tikzpicture}[every text node part/.style={align=center}] + \node[rectangle split, rectangle split parts=3, draw, text width=2.75cm] {Student - \nodepart{second} + \nodepart{two} age:int \\ name:String - \nodepart{third} + \nodepart{three} getAge():int \\ getName():String}; \end{tikzpicture} -\end{codeexample} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/rectangle split horizontal=\opt{\meta{boolean}} (default true)} + This key determines whether the rectangle is split horizontally or vertically + \end{key} - - The contents of node parts which are not used are ignored. - Which node parts are used in each case is shown below: + \begin{key}{/pgf/rectangle split ignore empty parts=\opt{\meta{boolean}} (default true)} + When \meta{boolean} is true, \pgfname{} will ignore any part + that is empty \emph{except the text part}. + This effectively overrides the |rectangle split parts| key in that, if + 3 parts (for example) are specified, but one is empty, only + two will be shown. \begin{codeexample}[] -\begin{tikzpicture} - \foreach \a/\x/\y in {1/0/0, 2/1.5/0, 3/0/-1.5, 4/1.5/-1.5} - \node[rectangle split, rectangle split parts=\a, draw, anchor=north] - at (\x,\y){ - text - \nodepart{second} - second - \nodepart{third} - third - \nodepart{fourth} - fourth}; +\begin{tikzpicture}[every node/.style={draw, anchor=text, rectangle split, + rectangle split parts=3}] + \node {text \nodepart{second} \nodepart{third}third}; + \node [rectangle split ignore empty parts] at (2,0) + {text \nodepart{second} \nodepart{third}third}; \end{tikzpicture} -\end{codeexample} - - There are several \pgfname{} keys to specify how the shape is - drawn. To use these keys in \tikzname, simply remove the - \declare{|/pgf/|} path: - - \begin{key}{/pgf/rectangle split parts=\meta{number} (initially 4)} - Split the rectangle into \meta{number} parts, - which should be in the range |1| to |4|. +\end{codeexample} \end{key} - +% + \begin{key}{/pgf/rectangle split empty part width=\meta{length} (initially 1ex)} + Set the default width for a node part box if it is empty and + empty parts are not ignored. + \end{key} + \begin{key}{/pgf/rectangle split empty part height=\meta{length} (initially 1ex)} - Set the default height for a node part box if it is empty. + Set the default height for a node part box if it is empty and + empty parts are not ignored. \end{key} - + + \begin{key}{/pgf/rectangle split empty part depth=\meta{length} (initially 0ex)} + Set the default depth for a node part box if it is empty and + empty parts are not ignored. + \end{key} + \begin{key}{/pgf/rectangle split part align={\ttfamily\char`\{}\meta{list}{\ttfamily\char`\}} (initially center)} Set the alignment of the boxes inside the node parts. - There should be a maximum of four entries in \meta{list}, - separated by commas (so if there is more than one entry in + Each item in \meta{list} should be + separated by commas (so if there is more than one item in \meta{list} it must be surrounded by braces). - Each entry is one of |left|, - |right|, or |center|. If \meta{list} has less entries than - node parts then the remaining node parts are aligned according to - the last entry in the list. - Note that this only aligns the boxes in each part and \emph{does not} + + When the rectangle is split vertically, the entries in \meta{list} + must be one of |left|, |right|, or |center|. If \meta{list} has less + entries than node parts then the remaining boxes are aligned + according to the last entry in the list. + Note that this only aligns the boxes in each part and \emph{does not} affect the alignment of the contents of the boxes. - + \begin{codeexample}[] -\def\v#1{\vrule width#1ex height2ex} -\def\x{\v2 \nodepart{second} \v5 \nodepart{third} \v2 \nodepart{fourth} \v2} -\begin{tikzpicture}[every node/.style={rectangle split, draw, text=blue!40}] +\def\x{one \nodepart{two} 2 \nodepart{three} three \nodepart{four} 4} +\begin{tikzpicture}[ + every node/.style={rectangle split, rectangle split parts=4, + draw} + ] \node[rectangle split part align={center, left, right}] at (0,0) {\x}; \node[rectangle split part align={center, left}] at (1.25,0) {\x}; \node[rectangle split part align={center}] at (2.5,0) {\x}; \end{tikzpicture} \end{codeexample} + + When the rectangle is split horizontally, the entries in \meta{list} + must be one of |top|, |bottom|, |center| or |base|. Note that using + the value |base| will only makes sense if all the node part boxes are + being aligned in this way. This is because the |base| value aligns + the boxes in relation to each other, whereas the other values align + the boxes in relation to the part of the shape they occupy. + + +\begin{codeexample}[] +\def\x{\Large w\nodepart{two}x\nodepart{three}\Huge y\nodepart{four}\tiny z} +\begin{tikzpicture}[ + every node/.style={rectangle split, rectangle split parts=4, + draw, rectangle split horizontal} + ] + \node[rectangle split part align={center, top, bottom}] at (0,0) {\x}; + \node[rectangle split part align={center, top}] at (0,-1.25) {\x}; + \node[rectangle split part align={center}] at (0,-2.5) {\x}; + \node[rectangle split part align=base] at (0,-3.75) {\x}; +\end{tikzpicture} +\end{codeexample} + \end{key} - - \begin{key}{/pgf/rectangle split draw splits=\meta{boolean} (initially true)} + + \begin{key}{/pgf/rectangle split draw splits=\opt{\meta{boolean}} (default true)} Set whether the line or lines between node parts will be drawn. - Internally, this sets the \TeX-if |\ifpgfrectanglesplitdrawsplits| + Internally, this sets the \TeX-if |\ifpgfrectanglesplitdrawsplits| appropriately. \end{key} - - \begin{key}{/pgf/rectangle split use custom fill=\meta{boolean} (initially false)} + + \begin{key}{/pgf/rectangle split use custom fill=\opt{\meta{boolean}} (default true)} This enables the use of a custom fill for each of the node - parts (including the area covered by the |inner sep|). The + parts (including the area covered by the |inner sep|). The background path for the shape should not be filled (e.g., in \tikzname{}, the |fill| option for the node must be implicity or explicitly set to |none|). - Internally, this key sets the \TeX-if + Internally, this key sets the \TeX-if |\ifpgfrectanglesplitusecustomfill| appropriately. \end{key} - + \begin{key}{/pgf/rectangle split part fill={\ttfamily\char`\{}\meta{list}{\ttfamily\char`\}} (initially white)} - Set the custom fill color for each node part shape. - There should be a maximum of four entries in \meta{list} (one - for each node part), separated by commas (so if there is more than - one entry in \meta{list} it must be surrounded by braces). + Set the custom fill color for each node part shape. + Each item in \meta{list} should be separated by commas (so if + there is more than one item in \meta{list} it must be surrounded + by braces). If \meta{list} has less entries than node parts then the remaining node parts use the color from the last entry in the list. This key will automatically set |/pgf/rectangle split use custom fill|. - + \begin{codeexample}[] \begin{tikzpicture} \tikzset{every node/.style={rectangle split, draw, minimum width=.5cm}} @@ -1684,58 +1809,60 @@ to the center of the appropriate side. \end{tikzpicture} \end{codeexample} - \end{key} +\end{key} - The anchors for the |rectangle split| shape, are - shown below (anchor |70| is an example of a border angle). When a - node part is missing (i.e., when the number of parts is less than - |4|), the anchors prefixed with name of that node part should be - considered unavailable. They are (unavoidably) defined, but default - to other anchor positions. - + The anchors for the |rectangle split| shape split vertically into four, + are shown below (anchor |70| is an example of a border angle). When a + node part is missing, the anchors prefixed with name of that node part + should be considered unavailable. They are (unavoidably) defined, but + default to other anchor positions. + \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s,shape=rectangle split, rectangle split parts=4, shape example] - {\nodepart{text}Text\nodepart{second}Second - \nodepart{third}Third\nodepart{fourth}fourth}; + \node[name=s,shape=rectangle split, rectangle split parts=4, shape example, + inner ysep=0.75cm] + {\nodepart{text}text\nodepart{two}two + \nodepart{three}three\nodepart{four}four}; \foreach \anchor/\placement in - {text/left, text east/above, text west/above, - second/left, second east/above, second west/above, - third/left, third east/below, third west/below, - fourth/left, fourth east/below, fourth west/below, - text split/left, text split east/above, text split west/above, - second split/left, second split east/above, second split west/above, - third split/left, third split east/below, third split west/below, - north/above, south/below, east/below, west/below, - center/above, 70/above, mid/above, base/below, - north west/above, north east/above, south west/below, south east/below} + {text/left, text east/above, text west/above, + two/left, two east/above, two west/above, + three/left, three east/below, three west/below, + four/left, four east/below, four west/below, + text split/left, text split east/above, text split west/above, + two split/left, two split east/above, two split west/above, + three split/left, three split east/below, three split west/below, + north/above, south/below, east/below, west/below, + north west/above, north east/above, south west/below, south east/below, + center/above, 70/above, mid/above, base/below} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} \end{codeexample} + \end{shape} + \subsection{Callout Shapes} -\begin{pgflibrary}{shapes.callout} - Producing basic callouts can be done quite easily in \pgfname{} and +\begin{pgflibrary}{shapes.callouts} + Producing basic callouts can be done quite easily in \pgfname{} and \tikzname{} by creating a node and then subsequently drawing a path from the border of the node to the required point. This library provides more fancy, `balloon'-style callouts. - + \end{pgflibrary} -Callouts consist of a +Callouts consist of a main shape, and a pointer (which is part of the shape) which points to something in (or outside) the picture. The position on the border of the main shape to which the pointer is connected is determined -automatically. However, the pointer is ignored when calculating the +automatically. However, the pointer is ignored when calculating the minimum size of the shape, and also when positioning anchors. \begin{codeexample}[] @@ -1744,16 +1871,16 @@ minimum size of the shape, and also when positioning anchors. \end{tikzpicture} \end{codeexample} -There are two kinds of pointer: the ``relative'' pointer and the +There are two kinds of pointer: the ``relative'' pointer and the ``absolute'' pointer. The relative pointer calculates the angle of a -specified coordinate relative to the center of the main shape, locates -the point on the border to which this angle corresponds, and then adds -the coordinate to this point. This seemingly over-complex approach -means than you do not have to guess the size of the main shape: the -relative pointer will always be outside. -The absolute pointer, on the +specified coordinate relative to the center of the main shape, locates +the point on the border to which this angle corresponds, and then adds +the coordinate to this point. This seemingly over-complex approach +means than you do not have to guess the size of the main shape: the +relative pointer will always be outside. +The absolute pointer, on the other hand, is much simpler: it points to the specified coordinate -absolutely (and can even point to named coordinates in different +absolutely (and can even point to named coordinates in different pictures). @@ -1762,7 +1889,7 @@ pictures). \draw [help lines] grid(3,2); \node [note=red!50, callout relative pointer={(0,1)}] at (3,1) {Relative}; \node [note=blue!50, callout absolute pointer={(0,1)}] at (1,0) {Absolute}; - \node [note=green!50, opacity=.5, overlay, + \node [note=green!50, opacity=.5, overlay, callout absolute pointer={(hallo.south)}] at (1,2) {Outside}; \end{tikzpicture} \end{codeexample} @@ -1770,21 +1897,21 @@ pictures). The following keys are common to all callouts. Please remember that the |callout| |relative| |pointer|, and |callout| |absolute| -|pointer| keys take a different format for their value depending +|pointer| keys take a different format for their value depending on whether they are being used in \pgfname{} or \tikzname{}. - - + + \begin{key}{/pgf/callout relative pointer=\meta{coordinate} (initially {\ttfamily\char`\\pgfpointpolar\char`\{315\char`\}\char`\{.5cm\char`\}})} - - Set the vector of the callout pointer `relative' to the callout - shape. - + + Set the vector of the callout pointer `relative' to the callout + shape. + \end{key} \begin{key}{/pgf/callout absolute pointer=\meta{coordinate}} - + Set the vector of the callout pointer absolutely within the picture. - + \end{key} @@ -1801,12 +1928,12 @@ on whether they are being used in \pgfname{} or \tikzname{}. coordinates. \end{key} - It is also possible to shorten the pointer by some distance, using + It is also possible to shorten the pointer by some distance, using the following key: \begin{key}{/pgf/callout pointer shorten=\meta{distance} (initially 0cm)} - Move the callout pointer towards the center of the callouts main - shape by \meta{distance}. + Move the callout pointer towards the center of the callouts main + shape by \meta{distance}. \begin{codeexample}[] \begin{tikzpicture} @@ -1814,44 +1941,44 @@ on whether they are being used in \pgfname{} or \tikzname{}. callout absolute pointer={#1}}} \draw (0,0) grid (3,2); \node[callout={(3,1.5)}, fill=red!50] at (0,1.5) {A}; - \node[callout={(3,.5)}, fill=green!50, callout pointer shorten=1cm] + \node[callout={(3,.5)}, fill=green!50, callout pointer shorten=1cm] at (0,.5) {B}; -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{key} - + \begin{shape}{rectangle callout}% - This shape is a callout whose main shape is a rectangle, which + This shape is a callout whose main shape is a rectangle, which tightly fits the node contents (including any |inner sep|). - It supports the keys described above and also the following + It supports the keys described above and also the following key: - - -\begin{key}{/pgf/callout pointer width=\meta{length} (initially .25cm)} + + +\begin{key}{/pgf/callout pointer width=\meta{length} (initially .25cm)} Set the width of the pointer at the border of the rectangle. \end{key} The anchors for this shape are shown below (anchor |60| is an - example of a border anchor). The pointer direction is ignored when - placing anchors. - Additionally, when using an absolute pointer, the |pointer| - anchor should not be used to used to position the shape as it is + example of a border anchor). The pointer direction is ignored when + placing anchors. + Additionally, when using an absolute pointer, the |pointer| + anchor should not be used to used to position the shape as it is calculated whilst the shape is being drawn. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s,shape=rectangle callout, callout relative pointer={(1.25cm,-1cm)}, - callout pointer width=2cm, shape example, inner xsep=2cm, inner ysep=1cm] + \node[name=s,shape=rectangle callout, callout relative pointer={(1.25cm,-1cm)}, + callout pointer width=2cm, shape example, inner xsep=2cm, inner ysep=1cm] {Rectangle Callout\vrule width 1pt height 2cm}; \foreach \anchor/\placement in {center/above, text/below, 60/above, - mid/right, mid west/left, mid east/right, - base/below, base west/below, base east/below, + mid/right, mid west/left, mid east/right, + base/below, base west/below, base east/below, north/above, south/below, east/above, west/above, - north west/above, north east/above, + north west/above, north east/above, south west/below, south east/below, pointer/below} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} @@ -1864,37 +1991,37 @@ on whether they are being used in \pgfname{} or \tikzname{}. \begin{shape}{ellipse callout}% - This shape is a callout whose main shape is a ellipse, which + This shape is a callout whose main shape is a ellipse, which tightly fits the node contents (including any |inner sep|). - It uses the |absolute callout pointer|, + It uses the |absolute callout pointer|, |relative callout pointer| and |callout pointer shorten| keys, and also the following key: - - -\begin{key}{/pgf/callout pointer arc=\meta{angle} (initially 15)} + + +\begin{key}{/pgf/callout pointer arc=\meta{angle} (initially 15)} Set the width of pointer at the border of the ellipse according to an arc of length \meta{angle}. \end{key} The anchors for this shape are shown below (anchor |60| is an - example of a border anchor). The pointer direction is ignored + example of a border anchor). The pointer direction is ignored when placing anchors and the |pointer| anchor can only be - used to position the shape when the relative anchor is + used to position the shape when the relative anchor is specified. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s,shape=ellipse callout, callout relative pointer={(1.25cm,-1cm)}, - callout pointer width=2cm, shape example, inner xsep=1cm, inner ysep=.5cm] + \node[name=s,shape=ellipse callout, callout relative pointer={(1.25cm,-1cm)}, + callout pointer width=2cm, shape example, inner xsep=1cm, inner ysep=.5cm] {Ellipse Callout\vrule width 1pt height 2cm}; \foreach \anchor/\placement in {center/above, text/below, 60/above, - mid/above, mid west/right, mid east/left, - base/below, base west/below, base east/below, + mid/above, mid west/right, mid east/left, + base/below, base west/below, base east/below, north/above, south/below, east/above, west/above, - north west/above left, north east/above right, + north west/above left, north east/above right, south west/below left, south east/below right, pointer/below} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} @@ -1906,23 +2033,23 @@ on whether they are being used in \pgfname{} or \tikzname{}. \begin{shape}{cloud callout} -This shape is a callout whose main shape is a cloud which fits the -node contents. The pointer is segmented, consisting of a series of -shrinking ellipses. This callout requires the symbol shape library -(for the cloud shape). If this library is not loaded an error will +This shape is a callout whose main shape is a cloud which fits the +node contents. The pointer is segmented, consisting of a series of +shrinking ellipses. This callout requires the symbol shape library +(for the cloud shape). If this library is not loaded an error will result. \begin{codeexample}[] \begin{tikzpicture} - \node[cloud callout, cloud puffs=15, aspect=2.5, cloud puff arc=120, + \node[cloud callout, cloud puffs=15, aspect=2.5, cloud puff arc=120, shading=ball,text=white] {\bf Imagine...}; \end{tikzpicture} \end{codeexample} The |cloud callout| supports the |absolute callout pointer|, -|relative callout pointer| and |callout pointer shorten| keys, as +|relative callout pointer| and |callout pointer shorten| keys, as described above. -The main shape can be modified using the same keys as the |cloud| +The main shape can be modified using the same keys as the |cloud| shape. The following keys are also supported: \begin{key}{/pgf/callout pointer start size=\meta{value} (initially .2 of callout)} @@ -1931,14 +2058,14 @@ shape. The following keys are also supported: \meta{value}: \begin{itemize} \item - A single dimension (e.g., |5pt|), in which case the first ellipse + A single dimension (e.g., |5pt|), in which case the first ellipse will have equal diameters of 5pt. \item - Two dimensions (e.g., |10pt and 2.5pt|), which sets the $x$ and + Two dimensions (e.g., |10pt and 2.5pt|), which sets the $x$ and $y$ diameters of the first ellipse. \item A decimal fraction (e.g., |.2 of callout|), in which case - the $x$ and $y$ diameters of the first ellipse will be set as + the $x$ and $y$ diameters of the first ellipse will be set as fractions of the width and height of the main shape. The keyword |of callout| cannot be omitted. \end{itemize} @@ -1949,12 +2076,12 @@ shape. The following keys are also supported: \end{key} \begin{key}{/pgf/callout pointer segments=\meta{number} (initially 2)} - Set the number of segments in the pointer. Note that \pgfname{} will - happily overlap segments if too many are specified. + Set the number of segments in the pointer. Note that \pgfname{} will + happily overlap segments if too many are specified. \end{key} -The anchors for this shape are shown below (anchor |70| is an example -of a border anchor). The pointer direction is ignored when placing +The anchors for this shape are shown below (anchor |70| is an example +of a border anchor). The pointer direction is ignored when placing anchors and the pointer anchor can only be used to position the shape when the relative anchor is specified. Note that the center of the last segment is drawn at the |pointer| anchor. @@ -1983,747 +2110,6 @@ of the last segment is drawn at the |pointer| anchor. -\subsection{Logic Gate Shapes} - -\subsubsection{Overview} - \pgfname{} provides two libraries of logic gates, one providing - ``American'' style gates and the other, providing ``rectangular'' - logic gates. - Each library suffixes the gate names with an identifer: - |US| for the American style gates, and |IEC| for the rectangular - gates (additionally, two shapes in the |US| library use the - suffix |CDH|). Keys which are specific - to a particular library also contain this identifier (e.g., - |/pgf/and gate IEC symbol|). - However, as described below, a \tikzname{} key is provided which - sets up several styles allowing the identifier to be omitted, - for example, |and gate| can become a synonym for |shape=and gate US|. - - Multiple inputs can be specified for a logic gate (provided they - support multiple inputs: a not gate --- also known as an inverter --- - does not). However, there is an upper limit for the number of inputs - which has been set at 1024, which should be \emph{way} - more than would ever be needed. - - There are some \pgfname{} keys which are common to both - libraries, which have no library identifier contained in them: - - - \begin{key}{/pgf/logic gate inputs=\meta{input list} (initially \char`\{normal,normal\char`\})} - Specify the inputs for for the logic gate. The keyword |inverted| - indicates an inverted input which will mean \pgfname{} will draw a - circle attached to the main shape of the logic gate. Any keyword - that is not |inverted| will be treated as a ``normal'' or - ``non-inverted'' input (however, for readability, you may wish to - use |normal| or |non-inverted|), and \pgfname{} will not draw the - circle. - In both cases the anchors for the inputs will be set - up appropriately, numbered from top to bottom |input 1|, |input 2|, - \ldots and so on. If the gate only supports one input the anchor - is simply called |input| with no numerical index. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum height=0.75cm] - \node[and gate IEC, draw, logic gate inputs={inverted, normal, inverted}] - (A) {}; - \foreach \a in {1,...,3} - \draw (A.input \a -| -1,0) -- (A.input \a); - \draw (A.output) -- ([xshift=0.5cm]A.output); -\end{tikzpicture} -\end{codeexample} - - For multiple inputs it may be somewhat unweildy to specify a long - list, thus, the following ``shorthand'' is permitted (this is an - extension of ideas due to Juergen Werber and Christoph Bartoschek): - Using |i| for inverted and |n| for normal inputs, \meta{input list} - can be specfied \emph{without the commas}. So, for example, - |ini| is equivalent to |inverted, normal, inverted|. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum height=0.75cm] - \node[or gate US, draw,logic gate inputs=inini] (A) {}; - \foreach \a in {1,...,5} - \draw (A.input \a -| -1,0) -- (A.input \a); - \draw (A.output) -- ([xshift=0.5cm]A.output); -\end{tikzpicture} -\end{codeexample} - -\end{key} - - -The height of the gate may be increased to accommodate the number -of inputs. In fact, it depends on three variables: -$n$, the number of inputs, $r$, the radius of the circle used -to indicate an inverted input and $s$, the distance between -the centers of the inputs. -The default height is then calculated according to the expression -$(n+1)\times\max(2r,s)$. This then may -be increased to accommodate the node contents or any -minimum size specifications. - -The radius of the inverted input circle and the distance between the -centers of the inputs can be customised using the following keys: - -\begin{key}{/pgf/logic gate inverted radius=\meta{length} (initially 2pt)} - Set the radius of the circle that is used to indicate inverted - inputs. This is also the radius of the circle used for the inverted - output of the |nand|, |nor|, |xnor| and |not| gates. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum height=0.75cm] - \tikzset{every node/.style={shape=nand gate CDH, draw, logic gate inputs=ii}} - \node[logic gate inverted radius=2pt] {A}; - \node[logic gate inverted radius=4pt] at (0,-1) {B}; -\end{tikzpicture} -\end{codeexample} -\end{key} - -\begin{key}{/pgf/logic gate input sep=\meta{length} (initially .125cm)} - Set the distance between the \emph{centers} of the inputs to the - logic gate. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum size=0.75cm] - \draw [help lines] grid (3,2); - \tikzset{every node/.style={shape=and gate IEC, draw, logic gate inputs=ini}} - \node[logic gate input sep=0.33333cm] at (1,1)(A) {A}; - \node[logic gate input sep=0.5cm] at (3,1) (B) {B}; - \foreach \a in {1,...,3} - \draw (A.input \a -| 0,0) -- (A.input \a) - (B.input \a -| 2,0) -- (B.input \a); -\end{tikzpicture} -\end{codeexample} -\end{key} - - -\subsubsection{US Logic Gates} - -\begin{pgflibrary}{shapes.gates.logic.US} - This library provides ``American'' logic gate shapes whose names are - suffixed with the identifier |US|. Additionally, - alternative |and| and |nand| gates are provided which are based on the - logic symbols used in A. Croft, R. Davidson, and M. Hargreaves (1992), - \emph{Engineering Mathematics}, Addison-Wesley, 82--95. These two - shapes are suffixed with |CDH|. -\end{pgflibrary} - - To use the shapes in \tikzname{} without their suffixes, the - following keys are provided: - -\begin{key}{/tikz/use US style logic gates} - This allows the the shapes suffixed with |US| to be used without - the suffix. So, for example, |and gate| becomes a synonym for - |shape=and gate US|. -\begin{codeexample}[] -\tikz\node[draw, and gate US, red]{and}; -\space -\tikz[use US style logic gates,blue]\node[draw, and gate]{and}; -\end{codeexample} -\end{key} - -\begin{key}{/tikz/use CDH style logic gates} - This key again allows the the shapes suffixed with |US| to be used - without the |US| suffix. However, |and gate| becomes a synonym for - |shape=and gate CDH| and |nand gate| becomes a synonym for - |shape=nand gate CDH|, providing alternative symbols for these - gates. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum height=1cm] - \node[draw, and gate US, red] at (0,1.5) {and}; - \node[draw, nand gate US, red] at (2,1.5) {nand}; - \tikzset{use CDH style logic gates} - \node[draw, and gate, blue] at (0,0) {and}; - \node[draw, nand gate, blue] at (2,0) {nand}; -\end{tikzpicture} -\end{codeexample} -\end{key} - - - -As described above, \pgfname{} will increase the size of the -logic gate to accommodate the number of inputs, and the size -of the inverted radius and the separation between the inputs. -However with all shapes in this library, any increase in size -(including any minimum size requirements) will be applied so that -the default aspect ratio is unaltered. This means that changing -the height will change the width and vice versa. - -The ``compass point'' anchors apply to the main part of the shape -and do not include any inverted inputs or outputs. This library -provides an additonal feature to facilitate the relative positioning -of logic gates: - -\begin{key}{/pgf/logic gate anchors use bounding box=\meta{boolean} (initially false)} -When set to |true| this key will ensure that the -compass point anchors use the bounding rectangle of the -main shape, which, ignore any inverted inputs or outputs, but -includes any |outer sep|. -This \emph{only} affects the compass point anchors -and is not set on a shape by shape basis: whether the bounding -box is used is determined by value of this key when the anchor -is accessed. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum height=1.5cm] - \node[xnor gate US, draw, gray!50,line width=2pt] (A) {}; - \foreach \x/\y/\z in {false/blue/1pt, true/red/2pt} - \foreach \a in {north, south, east, west, north east, - south east, north west, south west} - \draw[logic gate anchors use bounding box=\x, color=\y] - (A.\a) circle(\z); -\end{tikzpicture} -\end{codeexample} - - - -\end{key} - - - - -\begin{shape}{and gate US} - This shape is an and gate which supports two or more inputs. If - less than two inputs are specified an error will result. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=and gate US,shape example, inner sep=0cm, - logic gate inverted radius=.5cm] {And Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/right, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/right, input 1/above, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} - -\begin{shape}{nand gate US} - This shape is a nand gate, which supports two or more inputs. If - less than two inputs are specified an error will result. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=nand gate US,shape example, inner sep=0cm, - logic gate inverted radius=.5cm] {Nand Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/right, input 1/above, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} - -\end{shape} - -\begin{shape}{or gate US} - - This shape is an or gate, which supports two or more inputs. If - less than two inputs are specified an error will result. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=or gate US,shape example, inner sep=0cm, - logic gate inverted radius=.5cm] {Or Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/right, input 1/left, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} - -\begin{shape}{nor gate US} - This shape is a nor gate, which supports two or more inputs. If - less than two inputs are specified an error will result. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=nor gate US,shape example, inner sep=0cm, - logic gate inverted radius=.5cm] {Nor Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/right, input 1/left, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} - -\end{shape} - -\begin{shape}{xor gate US} - This shape is an xor gate, which supports only two inputs. If - less than two inputs are specified an error will result. If more - than two inputs are specified, the extra inputs are ignored. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=xor gate US,shape example, inner sep=0cm, - logic gate inverted radius=.5cm] {Xor Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/right, input 1/above, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} - -\end{shape} - -\begin{shape}{xnor gate US} - - This shape is an xnor gate, which supports only two inputs. If - less than two inputs are specified an error will result. If more - than two inputs are specified, the extra inputs are ignored. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=xnor gate US,shape example, inner sep=0cm, - logic gate inverted radius=.5cm] {Xnor Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/above, input 1/above, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} - - -\end{shape} - -\begin{shape}{not gate US} - This shape is a not gate, which supports only one input. If - no inputs are specified an error will result. If more - than one input is specified, the extra inputs are ignored. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=not gate US,shape example, inner sep=1.5cm, - logic gate inverted radius=.5cm] - {Not Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/below, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/above} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} - -\end{shape} - -\begin{shape}{buffer gate US} - This shape is a not gate, which supports only one input. If - no inputs are specified an error will result. If more - than one input is specified, the extra inputs are ignored. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=buffer gate US,shape example, inner sep=1.5cm, - logic gate inverted radius=.5cm] - {Buffer Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/below, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} - -\end{shape} - - - - - -\begin{shape}{and gate CDH} - This shape is the alternative and gate. It supports two or more inputs. - If less than two inputs are specified an error will result. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=and gate CDH,shape example, inner sep=0cm, - logic gate inverted radius=.5cm] {And Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/right, input 1/above, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} - -\begin{shape}{nand gate CDH} - This shape is the alternative nand gate. It supports two or more inputs. - If less than two inputs are specified an error will result. - The anchors for this gate with two - non-inverted inputs (using the normal compass point anchors) are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=nand gate CDH,shape example, inner xsep=0cm, - logic gate inverted radius=.5cm] {Nand Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/right, input 1/above, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} - -\end{shape} - - - - - -\subsubsection{IEC Logic Gates} - -\begin{pgflibrary}{shapes.gates.logic.IEC} - This library provides rectangular logic gate shapes. These shapes - are suffixed with |IEC| as they are based on gates recommended by - the International Electrotechincal Commission. -\end{pgflibrary} - - In order to use these shapes in \tikzname{} without the |IEC| - suffix, the following key is provided: - -\begin{key}{/tikz/use IEC style logic gates} - This allows the the shapes suffixed with |IEC| to be used without - the suffix. So, for example, |and gate| becomes a synonym for - |shape=and gate IEC|. In addtion the |IEC| specific keys can be - used without |IEC|, so |and gate symbol| can be - used for |and gate IEC symbol|. -\end{key} - - By default each gate is drawn with a symbol, $\char`\&$ for |and| and - |nand| gates, $\geq1$ for |or| and |nor| gates, $1$ for |not| and - |buffer| gates, and $=1$ for |xor| and |xnor| gates. These symbols - are drawn automatically (internally they are drawn using the - ``foreground'' path), and are not strictly speaking part of the node - contents. However, the gate is enlarged to make sure the symbols are - within the border of the node. - It is possible to change - the symbols and their position within the node using the following - keys: - -\begin{key}{/pgf/and gate IEC symbol=\meta{text} (initially \char`\\char\char`\`\char`\\\char`\&)} - Set the symbol for the |and gate|. Note that if the node is filled, - this color will be used for the symbol, making it invisible, so - it will be necessary set \meta{text} to something like - |\color{black}\char`\&|. Alternatively, the - |logic gate IEC symbol color| key can be used to set the color - of all symbols simultaneously. - - In \tikzname, when the |use IEC style logic gates| key has been - used, this key can be replaced by |and gate symbol|. -\end{key} - -\begin{key}{/pgf/nand gate IEC symbol=\meta{text} (initially \char`\\char\char`\`\char`\\\char`\&)} - Set the symbol for the |nand gate|. - In \tikzname, when the |use IEC style logic gates| key has been - used, this key can be replaced by |nand gate symbol|. -\end{key} - -\begin{key}{/pgf/or gate IEC symbol=\meta{text} (initially \char`\$\char`\\geq1\char`\$)} - Set the symbol for the |or gate|. - In \tikzname, when the |use IEC style logic gates| key has been - used, this key can be replaced by |or gate symbol|. -\end{key} - -\begin{key}{/pgf/nor gate IEC symbol=\meta{text} (initially \char`\$\char`\\geq1\char`\$)} - Set the symbol for the |nor gate|. - In \tikzname, when the |use IEC style logic gates| key has been - used, this key can be replaced by |nor gate symbol|. -\end{key} - -\begin{key}{/pgf/xor gate IEC symbol=\meta{text} (initially \char`\{\char`\$=1\char`\$\char`\})} - Set the symbol for the |xor gate|. Note the necessity for braces, - as the symbol contains |=|. - In \tikzname, when the |use IEC style logic gates| key has been - used, this key can be replaced by |or gate symbol|. -\end{key} - -\begin{key}{/pgf/xnor gate IEC symbol=\meta{text} (initially \char`\{\char`\$=1\char`\$\char`\})} - Set the symbol for the |xnor gate|. - In \tikzname, when the |use IEC style logic gates| key has been - used, this key can be replaced by |xnor gate symbol|. -\end{key} - -\begin{key}{/pgf/not gate IEC symbol=\meta{text} (initially 1)} - Set the symbol for the |not gate|. - In \tikzname, when the |use IEC style logic gates| key has been - used, this key can be replaced by |not gate symbol|. -\end{key} - -\begin{key}{/pgf/buffer gate IEC symbol=\meta{text} (initially 1)} - Set the symbol for the |buffer gate|. - In \tikzname, when the |use IEC style logic gates| key has been - used, this key can be replaced by |buffer gate symbol|. -\end{key} - -\begin{key}{/pgf/logic gate IEC symbol align=\meta{align} (initially top)} - Set the alignment of the logic gate symbol (in \tikzname, when the - |use IEC style logic gates| key has been used, |IEC| can be omitted. - The specification in \meta{align} is a comma separated list from - |top|, |bottom|, |left| or |right|. The distance between the border - of the node and the outer edge of the symbol is determined by the values - of the |inner xsep| and |inner ysep|. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum size=1cm, use IEC style logic gates] - \tikzset{every node/.style={nor gate, draw}} - \node (A) at (0,1.5) {}; - \node [logic gate symbol align={bottom, right}] (B) at (0,0) {}; - \foreach \g in {A, B}{ - \foreach \i in {1,2} - \draw ([xshift=-0.5cm]\g.input \i) -- (\g.input \i); - \draw (\g.output) -- ([xshift=0.5cm]\g.output); - } -\end{tikzpicture} -\end{codeexample} - -\end{key} - - -\begin{key}{/pgf/logic gate IEC symbol color=\meta{color}} - This key sets the color for all symbols simultaneously. This color - can be overridden on a case by case basis by specifying a color - when seting the symbol text. -\end{key} - - -\begin{shape}{and gate IEC} - This shape is an and gate. It supports two or more inputs. - If less than two inputs are specified an error will result. - The anchors for this gate with two - non-inverted inputs are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=and gate IEC ,shape example, inner xsep=1cm, inner ysep=1cm, - minimum height=6cm, and gate IEC symbol=\color{black!30}\char`\&] - {And Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/right, input 1/above, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} - - -\begin{shape}{nand gate IEC} - This shape is a nand gate. It supports two or more inputs. - If less than two inputs are specified an error will result. - The anchors for this gate with two - non-inverted inputs are - shown below. Anchor |30| is an example of a border anchor. - -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=nand gate IEC ,shape example, inner xsep=1cm, inner ysep=1cm, - minimum height=6cm, nand gate IEC symbol=\color{black!30}\char`\&, - logic gate inverted radius=0.65cm] - {Nand Gate\vrule width1pt height2cm}; - \foreach \anchor/\placement in - {center/above, text/above, 30/above right, - mid/right, mid east/left, mid west/above, - base/below, base east/below, base west/left, - north/above, south/below, east/above, west/above, - north east/above, south east/below, south west/below, north west/above, - output/right, input 1/above, input 2/below} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} - -\begin{shape}{or gate IEC} - This shape is an or gate. It supports two or more inputs. - If less than two inputs are specified an error will result. - See the |and gate IEC| shape for the anchors. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm] - \node[or gate IEC, draw, logic gate inputs=in] (A) {}; - \draw (A.input 1 -| -1,0) -- (A.input 1) (A.input 2 -| -1,0) -- (A.input 2) - (A.output) -- ([xshift=0.5cm]A.output); -\end{tikzpicture} -\end{codeexample} - -\end{shape} - - -\begin{shape}{nor gate IEC} - This shape is an nor gate. It supports two or more inputs. - If less than two inputs are specified an error will result. - See the |nand gate IEC| shape for the anchors. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm] - \node[nor gate IEC, draw, logic gate inputs=in] (A) {}; - \draw (A.input 1 -| -1,0) -- (A.input 1) (A.input 2 -| -1,0) -- (A.input 2) - (A.output) -- ([xshift=0.5cm]A.output); -\end{tikzpicture} -\end{codeexample} - -\end{shape} - -\begin{shape}{xor gate IEC} - This shape is an xor gate. It supports only two inputs. - If less than two inputs are specified an error will result. - Any extra inputs are ignored. - See the |and gate IEC| shape for the anchors. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm] - \node[xor gate IEC, draw, logic gate inputs=in] (A) {}; - \draw (A.input 1 -| -1,0) -- (A.input 1) (A.input 2 -| -1,0) -- (A.input 2) - (A.output) -- ([xshift=0.5cm]A.output); -\end{tikzpicture} -\end{codeexample} - -\end{shape} - - -\begin{shape}{xnor gate IEC} - This shape is an xnor gate. It supports only two inputs. - If less than two inputs are specified an error will result. - Any extra inputs are ignored. - See the |nand gate IEC| shape for the anchors. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm] - \node[xnor gate IEC, draw, logic gate inputs=in] (A) {}; - \draw (A.input 1 -| -1,0) -- (A.input 1) (A.input 2 -| -1,0) -- (A.input 2) - (A.output) -- ([xshift=0.5cm]A.output); -\end{tikzpicture} -\end{codeexample} - -\end{shape} - -\begin{shape}{buffer gate IEC} - This shape is a buffer gate. It supports only one input. - If less than one input is specified an error will result. - Any extra inputs are ignored. - See the |and gate IEC| shape for the anchors. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm] - \node[buffer gate IEC, draw] (A) {}; - \draw (A.input -| -1,0) -- (A.input) (A.output) -- ([xshift=0.5cm]A.output); -\end{tikzpicture} -\end{codeexample} - -\end{shape} - - -\begin{shape}{not gate IEC} - This shape is a not gate. It supports only one input. - If less than one input is specified an error will result. - Any extra inputs are ignored. - See the |nand gate IEC| shape for the anchors. - -\begin{codeexample}[] -\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm] - \node[not gate IEC, draw] (A) {}; - \draw (A.input -| -1,0) -- (A.input) (A.output) -- ([xshift=0.5cm]A.output); -\end{tikzpicture} -\end{codeexample} - - -\end{shape} - - - @@ -2737,54 +2123,18 @@ is accessed. \begin{shape}{cross out} This shape ``crosses out'' the node. Its foreground path are simply two diagonal lines that between the corners of the node's bounding - box. Here is an example: -\begin{codeexample}[] -\begin{tikzpicture} - \draw [help lines] (0,0) grid (3,2); - \node [cross out,draw=red] at (1.5,1) {cross out}; -\end{tikzpicture} -\end{codeexample} - - A useful application is inside text as in the following example: -\begin{codeexample}[] -Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out! -\end{codeexample} - - This shape inherits all anchors from the |rectangle| shape, see also - the following figure: -\begin{codeexample}[] -\Huge -\begin{tikzpicture} - \node[name=s,shape=cross out,shape example] {cross out\vrule width 1pt height 2cm}; - \foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, - west/left, center/above, east/right, - mid west/right, mid/above, mid east/left, - base west/left, base/below, base east/right, - south west/below left, south/below, south east/below right, - text/left, 10/right, 130/above} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} - - -\begin{shape}{cross out} - This shape ``crosses out'' the node. Its foreground path are simply - two diagonal lines that between the corners of the node's bounding box. Here is an example: \begin{codeexample}[] \begin{tikzpicture} - \draw[help lines] (0,0) grid (3,2); + \draw [help lines] (0,0) grid (3,2); \node [cross out,draw=red] at (1.5,1) {cross out}; \end{tikzpicture} \end{codeexample} A useful application is inside text as in the following example: \begin{codeexample}[] -Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out! +Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out! \end{codeexample} This shape inherits all anchors from the |rectangle| shape, see also @@ -2794,11 +2144,11 @@ Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out! \begin{tikzpicture} \node[name=s,shape=cross out,shape example] {cross out\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, - west/left, center/above, east/right, - mid west/right, mid/above, mid east/left, - base west/left, base/below, base east/right, - south west/below left, south/below, south east/below right, + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, text/left, 10/right, 130/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; @@ -2807,12 +2157,12 @@ Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out! \end{shape} \begin{shape}{strike out} - This shape is idential to the |cross out| shape, only its foreground + This shape is identical to the |cross out| shape, only its foreground path consists of a single line from the lower left to the upper right. - + \begin{codeexample}[] -Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! +Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \end{codeexample} See the |cross out| shape for the anchors. @@ -2836,8 +2186,8 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \begin{key}{/pgf/rounded rectangle arc length=\meta{angle} (initially 180)} - Set the length of the arcs for the rounded ends. Recommended values - for \meta{angle} are between |90| and |180|. + Set the length of the arcs for the rounded ends. Recommended values + for \meta{angle} are between |90| and |180|. \begin{codeexample}[] \begin{tikzpicture} @@ -2845,7 +2195,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \node[rounded rectangle arc length=180] {180}; \\ \node[rounded rectangle arc length=120] {120}; \\ \node[rounded rectangle arc length=90] {90}; \\}; -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{key} @@ -2860,7 +2210,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \node[rounded rectangle west arc=concave] {Concave}; \\ \node[rounded rectangle west arc=convex] {Convex}; \\ \node[rounded rectangle left arc=none] {None}; \\}; -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \end{key} @@ -2877,20 +2227,20 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \end{stylekey} The anchors for this shape are shown below (anchor |10| is an example - of a border angle). Note that if only one side is rounded, the + of a border angle). Note that if only one side is rounded, the |center| anchor will not be the precise center of the shape. \begin{codeexample}[] \Huge \begin{tikzpicture} - \node[name=s,shape=rounded rectangle, shape example, inner xsep=1.5cm, inner ysep=1cm] + \node[name=s,shape=rounded rectangle, shape example, inner xsep=1.5cm, inner ysep=1cm] {Rounded Rectangle\vrule width 1pt height 2cm}; \foreach \anchor/\placement in {center/above, text/below, 10/above, - mid/above, mid west/right, mid east/left, - base/below, base west/below, base east/below, - north/above, south/below, east/above, west/above, - north west/above left, north east/above right, + mid/above, mid west/right, mid east/left, + base/below, base west/below, base east/below, + north/above, south/below, east/above, west/above, + north west/above left, north east/above right, south west/below left, south east/below right} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; @@ -2927,10 +2277,10 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \end{key} \begin{key}{/pgf/chamfered rectangle xsep=\meta{length} (initially .666ex)} - Set the distance that the chamfer extends horizontally beyond the node - contents (which includes the |inner sep|). + Set the distance that the chamfer extends horizontally beyond the node + contents (which includes the |inner sep|). If \meta{length} is large, such - that the top and bottom chamfered edges would cross, then + that the top and bottom chamfered edges would cross, then \meta{length} is ignored and the chamfered edges are drawn so that they meet in the middle. @@ -2945,10 +2295,10 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \end{key} \begin{key}{/pgf/chamfered rectangle ysep=\meta{length} (initially .666ex)} - Set the distance that the chamfer extends vertically beyond the node - contents. - If \meta{length} is large, such that the left and right chamfered - edges would cross, then \meta{length} is ignored and the chamfered + Set the distance that the chamfer extends vertically beyond the node + contents. + If \meta{length} is large, such that the left and right chamfered + edges would cross, then \meta{length} is ignored and the chamfered edges are drawn so that they meet in the middle. \end{key} @@ -2957,11 +2307,11 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \end{key} \begin{key}{/pgf/chamfered rectangle corners=\meta{list} (initially chamfer all)} - Specify which corners are chamfered. The corners are identified by + Specify which corners are chamfered. The corners are identified by their ``compass point'' directions (i.e. |north east|, |north west|, |south west|, and |south east|), and must be separated by commas (so if there is more than one corner in the list, it must be surrounded - by braces). Any corners not mentioned in + by braces). Any corners not mentioned in \meta{list} are automatically not chamfered. Two additional values |chamfer all| and |chamfer none|, are also permitted. @@ -2982,17 +2332,17 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \Huge \begin{tikzpicture} \node[name=s,shape=chamfered rectangle, chamfered rectangle sep=1cm, - shape example, inner ysep=1cm, inner xsep=.75cm] + shape example, inner ysep=1cm, inner xsep=.75cm] {Chamfered Rectangle\vrule width1pt height2cm}; \foreach \anchor/\placement in - {text/right, center/above, 70/above, + {text/right, center/above, 70/above, base/below, base east/left, base west/right, - mid/right, mid east/above, mid west/above, + mid/right, mid east/above, mid west/above, north/above, south/below, east/above, west/above, before north east/above, north east/above, after north east/above, before north west/above, north west/above, after north west/above, before south west/below, south west/below, after south west/below, - before south east/below, south east/below, after south east/below} + before south east/below, south east/below, after south east/below} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; \end{tikzpicture} @@ -3002,7 +2352,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex new file mode 100644 index 00000000000..dc6f163929f --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex @@ -0,0 +1,451 @@ +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Spy Library: Magnifying Parts of Pictures} +\label{section-library-spy} + +\begin{tikzlibrary}{spy} + The package defines options for creating pictures in which some part + of the picture is repeated in another area in a magnified way (as if + you were looking through a spyglass, hence the name). +\end{tikzlibrary} + + +\subsection{Magnifying a Part of a Picture} + +The idea behind the |spy| library is to make is easy to create high-density +pictures in which some important parts are repeated somewhere, but +magnified as if you were looking through a spyglass: + +\begin{codeexample}[] +\begin{tikzpicture} + [spy using outlines={circle, magnification=4, size=2cm, connect spies}] + + \draw [help lines] (0,0) grid (3,2); + + \draw [decoration=Koch curve type 1] + decorate { decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}}; + + \spy [red] on (1.6,0.3) + in node [left] at (3.5,-1.25); + + \spy [blue, size=1cm] on (1,1) + in node [right] at (0,-1.25); +\end{tikzpicture} +\end{codeexample} + +\begin{codeexample}[] +\begin{tikzpicture}[spy using overlays={size=12mm}] + \draw [decoration=Koch snowflake] + decorate { decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}}; + + \spy [green,magnification=3] on (0.6,0.1) in node at (-0.3,-1); + \spy [blue,magnification=5] on (1,0.5) in node at (1,-1); + \spy [red,magnification=10] on (1.6,0.1) in node at (2.3,-1); +\end{tikzpicture} +\end{codeexample} + + +Note that this magnification uses what is called a \emph{canvas + transformation} in this manual: Everything is magnified, including +line width and text. + +In order for ``spying'' to work, the picture obviously has to be drawn +several times: Once at its normal size and then again for each +``magnifying glass.'' Several keys and commands work in concert to +make this possible: +\begin{itemize} +\item You need to make \tikzname\ aware of the fact that a picture (or + just a scope) is to be magnified. This is done by adding the special + key |spy scope| to a |{scope}| or |{tikzpicture}| (which is also + just a scope). Some special keys like |spy using outlines| + implicitly set the |spy scope|. + +\item Inside this scope you may then use the command |\spy|, which is + only available inside such scopes (so there is no danger of your + inadvertently using this command outside such a scope). This command + has a special syntax and will (at some point) create two nodes: One + node that shows the magnified picture (called the \emph{spy-in + node}) and another node showing which part of the original picture + is magnified (called the \emph{spy-on} node). The spy-in node is, + indeed, a normal node, so it can have any shape or border that you + like and you can apply all of \tikzname's advanced features to + it. The only difference compared to a normal node is that instead of + some ``text'' it contains a magnified version of the picture, + clipped to the size of the node. + + The |\spy| command does not create the nodes immediately. Rather, + the creation of these nodes is postponed till the end of the + |spy scope| in which the |\spy| command is used. This is necessary + since in order to repeat the whole scope inside the node containing + the magnified version, the whole picture needs to be available when + this node is created. +\end{itemize} + +A basic question any library for ``magnifying things'' has to address +is how you specify which part of the picture is to be +magnified (the spy-on node) and where this magnified part is to be +shown (the spy-in node). There are two possible ways: +\begin{enumerate} +\item You specify the size and position of the spy-on node. Then the + size of the spy-in node is determined by the size of the spy-on node + and the magnification factor -- you can still decide where the + spy-in node should be placed, but not its size. +\item Alternatively, you specify the size and position of the spy-in + node. Then, similarly to the first case, the size of the spy-on node + is determined implicitly and you can only decide where the + spy-on node should be placed, but not its size. +\end{enumerate} + +The |spy| library uses the second method: You specify the size and +position of the spy-in nodes, the sizes of the spy-on nodes are then +computed automatically. + + + +\subsection{Spy Scopes} + +\begin{key}{/tikz/spy scope=\meta{options} (default \normalfont empty)} + This option may be used with a |{scope}| or any environment that + creates such a scope internally (like |{tikzpicture}|). It has the + following effects: + \begin{itemize} + \item It resets a number of graphic state parameters, including the + color, line style, and other. This is necessary for technical + reasons. + \item It tells \tikzname\ that the content of the scope should be saved + internally in a special box. + \item It defines the command |\spy| so that it can be used inside + the scope. + \item At the end of the scope, the nodes belonging to the |\spy| + commands used inside the scope are created. + \item The \meta{options} are saved in an internal style. Each time + |\spy| is used, these \meta{options} will be used. + \item Three keys are defined that provide useful shortcuts: + \begin{key}{/tikz/size=\meta{dimension}} + Inside a |spy scope|, |size| this is a shortcut for |minimum size|. + \end{key} + \begin{key}{/tikz/height=\meta{dimension}} + Inside a |spy scope|, |height| this is a shortcut for |minimum height|. + \end{key} + \begin{key}{/tikz/width=\meta{dimension}} + Inside a |spy scope|, |width| this is a shortcut for |minimum width|. + \end{key} + \end{itemize} + It is permissible to nest |spy scopes|. In this case, all |\spy| + commands inside the inner |spy scope| only have an effect on + material inside the scope, whereas |\spy| commands outside the inner + |spy scope| but inside the outer |spy scope| allow you to ``spy on + the spy.'' + +\begin{codeexample}[] +\begin{tikzpicture} + [spy using outlines={rectangle, red, magnification=5, + size=1.5cm, connect spies}] + + \begin{scope} + [spy using outlines={circle, blue, + magnification=3, size=1.5cm, connect spies}] + \draw [help lines] (0,0) grid (3,2); + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy on (1.6,0.3) in node (zoom) [left] at (3.5,-1.25); + \end{scope} + + \spy on (zoom.north west) in node [right] at (0,-1.25); +\end{tikzpicture} +\end{codeexample} + +\end{key} + + + +\subsection{The Spy Command} + +\begin{command}{\spy \opt{\oarg{options}} |on| \meta{coordinate} + |in node| \meta{node options}|;|} + This command can only be used inside a |spy scope|. Let us start with the syntax: + \begin{itemize} + \item The |\spy| command is not a special case of |\path|. Rather, + it has a small parser of its own. + \item Following the optional \meta{options}, you must write |on|, + followed by a coordinate. This coordinate will be the center of + the area that is to be magnified. + \item Following the \meta{coordinate}, you must write |in node| + followed by some \meta{node options}. The syntax for these options is the same + as for a normal |node| path command, such as |[left]| or + |(foo) [red] at (bar)|. \emph{However}, \meta{node options} are + \emph{not} followed by a curly brace. Rather, the \meta{node + options} must directly be followed by a semicolon. + \end{itemize} + The effect of this command is the following: The \meta{options}, + \meta{coordinate}, and \meta{node options} are stored internally + till the end of the current + |spy scope|. This means that, in particular, you can reference any node + inside the |spy scope|, even if it is not yet defined when the + |\spy| command is given. At the end of the current |spy scope|, two + nodes are created, called the \emph{spy-in node} and the + \emph{spy-on node}. + \begin{itemize} + \item The \emph{spy-in node} is the node that contains a magnified + part of the picture (the node \emph{in} which we see on what we + spy). This node is, indeed, a normal \tikzname\ + node, so you can use all standard options to style this node. In + particular, you can specify a shape or a border color or a drop + shadow or whatever. The only thing that is special about this node + is that instead of containing some normal text, its ``text'' is + the magnified picture. + + To be precise, the picture of the |spy scope| is scaled by a + certain factor, specified by the |lens| or |magnification| options + discussed below, and the shifted in such a way that the + \meta{coordinate} lies at the center of the spy-on node. + \item The \emph{spy-on node} is a node that is centered on the + \meta{coordinate} and whose size reflects exactly the area shown + inside the spy-in node (the node containing \emph{on} what we + spy). + \end{itemize} + + Let us now go over what happens in detail when the two nodes are + created: + \begin{enumerate} + \item A scope is started. Two sets of options are used with this + scope: First, the options passed to the enclosing |spy scope| and + then the \meta{options} (which will, thus, overrule the options of + the |spy scope|). + \item Then, the spy-on node is created. However, we will first + discuss the spy-in node. + \item The spy-in node is created after the spy-on node (and, hence, + will cover the spy-on node in case they overlap). When this node is + created, the \meta{node options} are used in addition to the + effect caused by the \meta{options} and the options of the + |{spy scope}|. Additionally, the following style is used: + \begin{stylekey}{/tikz/every spy in node} + This style is used with every spy in node. + \end{stylekey} + The position of the node (the |at| option) is set to the + \meta{coordinate} by default, so that it will cover the + to-be-magnified area. You can change this by providing the |at| + option yourself: +\begin{codeexample}[] +\begin{tikzpicture} + [spy using outlines={circle, magnification=3, size=1cm}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [red] on (1.6,0.3) in node; + \spy [blue] on (1,1) in node at (1,-1); +\end{tikzpicture} +\end{codeexample} + No ``text'' can be specified for the node. Rather, the ``text'' + shown inside this node is the picture of the current |spy scope|, + but canvas-transformed according to the following key: + \begin{key}{/tikz/lens=\meta{options}} + The \meta{options} should contain transformation commands like + |scale| or |rotate|. These transformations are applied to the + picture when it is shown inside the spy-on node. + \end{key} + Since the most common transformation is undoubtedly a simple + scaling, there is a special style for this: + \begin{key}{/tikz/magnification=\meta{number}} + This has the same effect as saying + |lens={scale=|\meta{number}|}|. + \end{key} + Now, usually the size of a node is determined in such a way that + it ``fits'' around the text of the node. For a spy-on node this is + not a good approach since the ``text'' of this node would contain + ``the whole picture.'' Because of this, \tikzname\ acts + as if the ``text'' of the node has zero size. You must then use + keys like |minimum size| to cause the node to have a certain + size. Note that the key |size| is an abbreviation for + |minimum size| inside a spy scope. + + You can name the spy on node in the usual ways. Additionally, the + node is (also) always named |tikzspyinnode|. Following the spy + scope, you can use this node like any other node: +\begin{codeexample}[] +\begin{tikzpicture} + \begin{scope} + [spy using outlines={circle, magnification=3, size=2cm, connect spies}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [red] on (1.6,0.3) in node (a) [left] at (3.5,-1.25); + + \spy [blue, size=1cm] on (1,1) in node (b) [right] at (0,-1.25); + \end{scope} + \draw [ultra thick, green!50!black] (b) -- (a.north west); +\end{tikzpicture} +\end{codeexample} + + \item Once both nodes have been created, the current value of the + following key is used to connect them: + \begin{key}{/tikz/spy connection path=\meta{code} (initially + \normalfont empty)} + The \meta{code} is executed after the spy-on and spy-in nodes + have just been created. Inside this \meta{code}, the two nodes + can be accessed as |tikzspyinnode| and |tikzspyonnode|. + For example, the key |connect spies| sets this command to +\begin{codeexample}[code only] +\draw[thin] (tikzspyonnode) -- (tikzspyinnode); +\end{codeexample} + \end{key} + \end{enumerate} + Returning to the creation of the spy-in node: This node is centered on + \meta{coordinate} (more precisely, its anchor is set to |center| and + the |at| option is set to \meta{coordinate}). Its size and shape are + initially determined in the same way as the size and shape of the + spy-on node (unless, of course, you explicitly provide a different + shape for, say, the spy-on node locally, which is not really a good + idea). Then, additionally, the \emph{inverted} transformation done + by the |lens| option is applied, resulting in a node whose size and + shape exactly corresponds to the area in the picture that is shown + in the spy-on node. +\begin{codeexample}[] +\begin{tikzpicture} + [spy using outlines={lens={scale=3,rotate=20}, size=2cm, connect spies}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [red] on (1.6,0.3) in node at (2.5,-1.25); +\end{tikzpicture} +\end{codeexample} + + Like for the spy-in node, a style can be used to format the spy-on + node: + \begin{stylekey}{/tikz/every spy on node} + This style is used with every spy on node. + \end{stylekey} + The spy-on node is named |tikzspyonnode| (but, as always, this node + is only available after the spy scope). If you have multiple + spy-on nodes and you would like to access all of them, you need to + use the |name| key inside the |every spy on node| style. + + The |inner sep| and |outer sep| of both spy-in and spy-on nodes are + set to |0pt|. +\end{command} + + + +\subsection{Predefined Spy Styles} + +There are some predefined styles that make using the |spy| library +easier. The following two styles can be used instead of |spy scope|, +they pass their \meta{options} directly to |spy scope|. They +additionally setup the graphic styles to be used for the spy-in nodes +and the spy-on nodes in some special way. + +\begin{key}{/tikz/spy using outlines=\meta{options} (default + \normalfont empty)} + This key creates a |spy scope| in which the spy-in node is drawn, + but not filled, using a thick line; and the spy-on node is drawn, + but not filled, using a very thin line. + +\begin{codeexample}[] +\begin{tikzpicture} + [spy using outlines={circle, magnification=3, size=1cm, connect spies}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [red] on (1.6,0.3) in node at (3,1); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/spy using overlays=\meta{options} (default + \normalfont empty)} + This key creates a |spy scope| in which both the spy-in and spy-on + nodes are filled, but with the fill opacity set to 20\%. + +\begin{codeexample}[] +\begin{tikzpicture} + [spy using overlays={circle, magnification=3, size=1cm, connect spies}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [green] on (1.6,0.3) in node at (3,1); +\end{tikzpicture} +\end{codeexample} +\end{key} + +The following style is useful for connecting the spy-in and the spy-on +nodes: + +\begin{key}{/tikz/connect spies} + Causes the spy-in and the spy-on nodes to be connected by a thin + line. + +\begin{codeexample}[] +\begin{tikzpicture} + [spy using overlays={circle, magnification=3, size=1cm}] + + \draw [decoration=Koch curve type 2] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [green] on (1.6,0.1) in node at (3,1); + \spy [red,connect spies] on (0.5,0.4) in node at (1,1.5); +\end{tikzpicture} +\end{codeexample} +\end{key} + + +\subsection{Examples} + +Usually, the spy-in node and the spy-on node should have the same +shape. However, you might also wish to use the |circle| shape for the +spy-on node and the |magnifying glass| shape for the spy-in node: + +\begin{codeexample}[] +\tikzset{spy using mag glass/.style={ + spy scope={ + every spy on node/.style={ + circle, + fill, fill opacity=0.2, text opacity=1}, + every spy in node/.style={ + magnifying glass, circular drop shadow, + fill=white, draw, ultra thick, cap=round}, + #1 + }}} +\begin{tikzpicture}[spy using mag glass={magnification=3, size=1cm}] + \draw [decoration=Koch curve type 2] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [green!50!black] on (1.6,0.1) in node at (2.5,-0.5); +\end{tikzpicture} +\end{codeexample} + +With the magnifying glass, you can also put it ``on top'' of the +picture itself: + +\begin{codeexample}[] +\begin{tikzpicture} + [spy scope={magnification=4, size=1cm}, + every spy in node/.style={ + magnifying glass, circular drop shadow, + fill=white, draw, ultra thick, cap=round}] + + \draw [decoration=Koch curve type 2] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy on (1.6,0.1) in node; +\end{tikzpicture} +\end{codeexample} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: "pgfmanual-pdftex-version" +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex new file mode 100644 index 00000000000..cafe102caad --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex @@ -0,0 +1,58 @@ +% Copyright 2009 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{SVG-Path Library} +\label{section-library-svg-path} + +\begin{pgflibrary}{svg.path} + This library defines a command that allows you to specify a path + using the svg-syntax. +\end{pgflibrary} + +\begin{command}{\pgfpathsvg\marg{path}} + This command extends the current path by a \meta{path} given in the + \textsc{svg}-path-data syntax. This syntax is described in detail in + Section~8.3 of the \textsc{svg}-specification, Version 1.1. + + In principle, the complete syntax is supported and the library just + provides a parser and a mapping to basic layer commands. For + instance, |M 0 10| is mapped to + |\pgfpathmoveto{\pgfpoint{0pt}{10pt}}|. There, however, a few things + to be aware of: + \begin{itemize} + \item The computation underlying the arc commands |A| and |a| + are not numerically stable, which may result in quite imprecise + arcs. B\'ezier curves, both quadratic and cubic, are not affected, + and also not arcs spanning degrees that are multiples of + $90^\circ$. + \item The dimensionless units of \textsc{svg} are always interpreted + at points (|pt|). This is a problem with paths like |M 20000 0|, + which will raise an error message since \TeX\ cannot handle + dimensions larger than about 16000 points. + \item + All coordinate and canvas transformations apply to the path in the + usual fashion. + \item + The |\pgfpathsvg| command can be freely intermixed with other path + commands. + \end{itemize} +\begin{codeexample}[] +\begin{pgfpicture} + \pgfpathsvg{M 0 0 l 20 0 0 20 -20 0 q 10 0 10 10 + t 10 10 10 10 h -50 z} + \pgfusepath{stroke} +\end{pgfpicture} +\end{codeexample} +\end{command} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: "pgfmanual-pdftex-version" +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex index 1ed99fe963c..d95dd5e2106 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex @@ -14,12 +14,12 @@ \begin{tikzlibrary}{trees} - This packages defines styles to be used when drawing trees. + This packages defines styles to be used when drawing trees. \end{tikzlibrary} \subsection{Growth Functions} -The package |pgflibrarytikztrees| defines two new growth +The package |trees| defines two new growth functions. They are installed using the following options: \begin{key}{/tikz/grow via three points=|one child at (|\meta{x}% @@ -49,10 +49,10 @@ functions. They are installed using the following options: \node at (0,-3) {three} child child child; \node at (0,-4.5) {four} child child child child; \end{tikzpicture} -\end{codeexample} +\end{codeexample} The next arrangement places children above, but ``grows only to the - right.'' + right.'' \begin{codeexample}[] \begin{tikzpicture}[grow via three points={% one child at (0,1) and two children at (0,1) and (1,1)}] @@ -61,7 +61,7 @@ functions. They are installed using the following options: \node at (0,-3) {three} child child child; \node at (0,-4.5) {four} child child child child; \end{tikzpicture} -\end{codeexample} +\end{codeexample} In the final arrangement, the children are placed along a line going down and right. @@ -106,13 +106,13 @@ functions. They are installed using the following options: \end{key} \begin{key}{/tikz/clockwise from=\meta{angle}} - This option also cuases children to be arranged on a + This option also causes children to be arranged on a circle. However, the rule for placing children is simpler than with the |grow cyclic| style: The first child is placed at \meta{angle} at a distance of |\tikzleveldistance|. The second child is placed at the same distance from the parent, but at angle \meta{angle}${}-{}$|\tikzsiblingangle|. The third child is displaced - by another |\tikzsiblingangle| in a clockwise fashion, and so on. + by another |\tikzsiblingangle| in a clockwise fashion, and so on. Note that this function will not rotate the coordinate system. \begin{codeexample}[] @@ -140,7 +140,7 @@ are drawn: \begin{stylekey}{/tikz/edge from parent fork down} This style will draw a line from the parent downwards (for half the level distance) and then on to the child using only horizontal and - vertical lines. + vertical lines. \begin{codeexample}[] \begin{tikzpicture} \node {root} @@ -171,15 +171,15 @@ are drawn: \end{stylekey} \begin{stylekey}{/tikz/edge from parent fork left} - Behaves similary to the previous styles. + Behaves similarly to the previous styles. \end{stylekey} \begin{stylekey}{/tikz/edge from parent fork up} - Behaves similary to the previous styles. + Behaves similarly to the previous styles. \end{stylekey} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex new file mode 100644 index 00000000000..ffb35b231d4 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex @@ -0,0 +1,118 @@ +% Copyright 2008 by Mark Wibrow +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\section{Turtle Graphics Library} +\label{section-library-tutrle} + + +\begin{pgflibrary}{turtle} + This little library defines some keys to create simple turtle + graphics in the tradition of the Logo programming language. These + commands are mostly for fun, but they can also be used for more + ``serious'' business. +\begin{codeexample}[] +\tikz[turtle/distance=2mm] + \draw [turtle={home,forward,right,forward,left,forward,left,forward}]; +\end{codeexample} +\end{pgflibrary} + +Even though the |turtle| keys looks like an option, it uses the +|insert path| option internally to produce a path. + +The basic drawing model behind the turtle graphics is very simple: +There is a (virtual) \emph{turtle} that crawls around the page, +thereby extending the path. The turtle always heads in a certain +direction. When you move the turtle forward you extend the path in +that direction; turning the turtle just changes the direction, it does +not cause anything to be drawn. + +The turtle always moves relative to the last current point of the +path and you can mix normal path commands with turtle +commands. However, the direction of the turtle is managed +independently of other path commands. + +\begin{key}{/tikz/turtle=\meta{keys}} + This key executes the \meta{keys} with the current key path set to + |/tikz/turtle|. +\begin{codeexample}[] +\tikz[turtle/distance=2mm] + \draw [turtle={home,fd,rt,fd,lt,fd,lt,fd}]; +\end{codeexample} +\end{key} + +\begin{key}{/tikz/turtle/home} + Places the turtle at the origin and lets it head upward. +\end{key} + +\begin{key}{/tikz/turtle/forward=\meta{distance} (default \normalfont see text)} + Makes the turtle move forward by the given \meta{distance}. If no + \meta{distance} is specified, the current value of the following key + is used: + \begin{key}{/tikz/turtle/distance=\meta{distance} (initially 1cm)} + The default distance by which the turtle advances. + \end{key} + ``Moving forward the turtle'' actually means that, relative to the + current last point on the path, a point at the given \meta{distance} + in the direction the turtle is currently heading is computed. Then, + the operation |to[turtle/how]| is used to extend the path to this + point. + \begin{stylekey}{/tikz/turtle/how (initially \normalfont empty)} + This style can setup the |to path| used by turtles. By setting + this style you can change the to-path: +\begin{codeexample}[] +\tikz \draw [turtle={how/.style={bend left},home,forward,right,forward}]; +\end{codeexample} + \end{stylekey} +\end{key} + +\begin{key}{/tikz/turtle/fd} + An abbreviation for the |forward| key. +\end{key} + +\begin{key}{/tikz/turtle/back=\meta{distance} (default \normalfont see text)} + This has the same effect as a |turtle/forward| for the negated + \meta{distance} value. +\end{key} + +\begin{key}{/tikz/turtle/bk} + An abbreviation for the |back| key. +\end{key} + +\begin{key}{/tikz/turtle/left=\meta{angle} (default 90)} + Turns the turtle left by the given angle. +\end{key} + +\begin{key}{/tikz/turtle/lt} + An abbreviation for the |left| key. +\end{key} + +\begin{key}{/tikz/turtle/right=\meta{angle} (default 90)} + Turns the turtle right by the given angle. +\end{key} + +\begin{key}{/tikz/turtle/rt} + An abbreviation for the |right| key. +\end{key} + +Turtle graphics are especially nice in conjunction with the |\foreach| +statement: + +\begin{codeexample}[] +\tikz \filldraw [thick,blue,fill=blue!20] + [turtle=home] + \foreach \i in {1,...,5} + { + [turtle={forward,right=144}] + }; +\end{codeexample} + +\endinput + + + diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex index 61c2ea6e288..14a3179e8e5 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex @@ -40,16 +40,16 @@ All files in other directories are part of the ``code of the package.'' A detailed listing can be found in the file |doc/generic/pgf/licenses/manifest-code.txt|. -In the resest of this section, the licenses are presented. The +In the rest of this section, the licenses are presented. The following text is copyrighted, see the plain text versions of these -licenses in the directory |doc/generic/pgf/licenses| for details. +licenses in the directory |doc/generic/pgf/licenses| for details. The example picture used in this manual, the Brave \textsc{gnu} World logo, is taken from the Brave \textsc{gnu} World homepage, where it is copyrighted as follows: ``Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Georg C.~F.\ Greve. Permission is granted to make and distribute verbatim copies of this transcript as long as the copyright and this -permission notice appear.'' +permission notice appear.'' \subsection{The GNU Public License, Version 2} @@ -109,7 +109,7 @@ modification follow. \addtocounter{enumi}{-1} -\item +\item This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The ``Program'', below, refers to @@ -145,7 +145,7 @@ above, provided that you also meet all of these conditions: \begin{enumerate} -\item +\item You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. @@ -371,7 +371,7 @@ possibility of such damages. % The file lppl.tex, some minor typographic changes: % -% $Id: pgfmanual-en-license.tex,v 1.4 2006/10/11 15:00:28 tantau Exp $ +% $Id: pgfmanual-en-license.tex,v 1.5 2010/10/12 14:32:38 ludewich Exp $ % % Copyright 1999 2002-2006 LaTeX3 Project % Everyone is allowed to distribute verbatim copies of this @@ -399,7 +399,7 @@ possibility of such damages. % \providecommand{\LPPLsubsubsection}{\subsection*} % \providecommand{\LPPLparagraph}{\subsubsection*} % -% +% % To allow cross-referencing the headings \label's have been attached % to them, all starting with ``LPPL:''. As by default headings without % numbers are produced, this will only allow page references. @@ -451,20 +451,20 @@ possibility of such damages. \LPPLsubsection{Preamble} \label{LPPL:Preamble} - + The \LaTeX\ Project Public License (\LPPL) is the primary license - under which the the \LaTeX\ kernel and the base \LaTeX\ packages are + under which the \LaTeX\ kernel and the base \LaTeX\ packages are distributed. You may use this license for any work of which you hold the copyright and which you wish to distribute. This license may be particularly suitable if your work is \TeX-related (such as a - \LaTeX\ package), but it is written in such a way that you can use + \LaTeX\ package), but it is written in such a way that you can use it even if your work is unrelated to \TeX. - The section `\textsc{wheter and how to distribute works under this + The section `\textsc{whether and how to distribute works under this license}', below, gives instructions, examples, and - recommendations + recommendations for authors who are considering distributing their works under this license. @@ -500,7 +500,7 @@ possibility of such damages. \item[Modify] To apply any procedure that produces a Derived Work under any applicable law. - + \item[Distribution] Making copies of the Work available from one person to another, in whole or in part. Distribution includes (but is not limited to) making any electronic components of the @@ -522,7 +522,7 @@ possibility of such damages. \item[Base Interpreter] A program or process that is normally needed for running or interpreting a part or the whole of the Work. - + A Base Interpreter may depend on external components but these are not considered part of the Base Interpreter provided that each external component clearly identifies itself whenever it is used @@ -583,13 +583,13 @@ possibility of such damages. Derived Work clearly and unambiguously identifies itself as a modified version of this component to the user when used interactively with that Base Interpreter. - + \item Every component of the Derived Work contains prominent notices detailing the nature of the changes to that component, or a prominent reference to another file that is distributed as part of the Derived Work and that contains a complete and accurate log of the changes. - + \item No information in the Derived Work implies that any persons, including (but not limited to) the authors of the original version of the Work, provide any support, including (but not @@ -629,7 +629,7 @@ possibility of such damages. is then produced by applying some process to that format, does not relax or nullify any sections of this license as they pertain to the results of applying that process. - + \item \null \begin{enumerate} \item A Derived Work may be distributed under a different license @@ -637,7 +637,7 @@ possibility of such damages. Clause~\ref{LPPL:item:conditions} above, in regard to the Work, though it does not have to honor the rest of the conditions in this license. - + \item If a Derived Work is distributed under a different license, that Derived Work must provide sufficient documentation as part of itself to allow each recipient of that Derived Work to honor @@ -711,7 +711,7 @@ possibility of such damages. \begin{enumerate} \item If it is being maintained, then ask the Current Maintainer to update their communication data within one month. - + \item\label{LPPL:item:intention} If the search is unsuccessful or no action to resume active maintenance is taken by the Current Maintainer, then announce within the pertinent community your @@ -724,7 +724,7 @@ possibility of such damages. \item If the Current Maintainer is reachable and agrees to pass maintenance of the Work to you, then this takes effect immediately upon announcement. - + \item\label{LPPL:item:announce} If the Current Maintainer is not reachable and the Copyright Holder agrees that maintenance of the Work be passed to you, then this takes effect immediately @@ -736,7 +736,7 @@ possibility of such damages. Current Maintainer nor by the Copyright Holder nor by other people, then you may arrange for the Work to be changed so as to name you as the (new) Current Maintainer. - + \item If the previously unreachable Current Maintainer becomes reachable once more within three months of a change completed under the terms of~\ref{LPPL:item:announce} @@ -822,13 +822,13 @@ possibility of such damages. % version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. - % + % % The Current Maintainer of this work is M. Y. Name. % % This work consists of the files pig.dtx and pig.ins % and the derived file pig.sty. \end{verbatim} - + Given such a notice and statement in a file, the conditions given in this license document would apply, with the `Work' referring to the three files `\LPPLfile{pig.dtx}', `\LPPLfile{pig.ins}', and @@ -969,7 +969,7 @@ An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called \textbf{``Opaque''}. Examples of suitable formats for Transparent copies include plain -ASCII without markup, Texinfo input format, LaTeX input format, SGML +ASCII without markup, Texinfo input format, LaTeX input format, SGML % Texinfo --> TeXinfo? or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats @@ -990,7 +990,7 @@ A section \textbf{``Entitled XYZ''} means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as \textbf{``Acknowledgements''}, -\textbf{``Dedications''}, \textbf{``Endorsements''}, or \textbf{``History''}.) +\textbf{``Dedications''}, \textbf{``Endorsements''}, or \textbf{``History''}.) To \textbf{``Preserve the Title''} of such a section when you modify the Document means that it remains a section ``Entitled XYZ'' according to this definition. @@ -1064,43 +1064,43 @@ and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: \begin{itemize} -\item[A.] +\item[A.] Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. - + \item[B.] List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. - + \item[C.] State on the Title page the name of the publisher of the Modified Version, as the publisher. - + \item[D.] Preserve all the copyright notices of the Document. - + \item[E.] Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. - + \item[F.] Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. - + \item[G.] Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. - + \item[H.] Include an unaltered copy of this License. - + \item[I.] Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and @@ -1109,7 +1109,7 @@ of it. In addition, you must do these things in the Modified Version: stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. - + \item[J.] Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise @@ -1118,26 +1118,26 @@ of it. In addition, you must do these things in the Modified Version: You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. - + \item[K.] For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. - + \item[L.] Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. - + \item[M.] Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. - + \item[N.] Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. - + \item[O.] Preserve any Warranty Disclaimers. \end{itemize} @@ -1296,7 +1296,7 @@ license notices just after the title page: Free Documentation License''. \end{quote} \bigskip - + If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the ``with \dots\ Texts.'' line with this: @@ -1304,10 +1304,10 @@ replace the ``with \dots\ Texts.'' line with this: \begin{quote} with the Invariant Sections being \textsc{list their titles}, with the Front-Cover Texts being \textsc{list}, and with the Back-Cover - Texts being \textsc{list}. + Texts being \textsc{list}. \end{quote} \bigskip - + If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. @@ -1319,7 +1319,7 @@ to permit their use in free software. -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "beameruserguide" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex index 0384b1a2d32..9b4ba330dd4 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex @@ -9,52 +9,92 @@ % pgf version is defined in \pgfversion in file -% generic/pgf/utilities/pgfrcs.code.tex +% generic/pgf/utilities/pgfrcs.code.tex \def\xcolorversion{2.00} \usepackage[version=latest]{pgf} -\usepackage{xkeyval,calc,listings,tikz} +\usepackage{xkeyval,calc,listings,tikz,fp} + +\usepackage{hyperref} +\hypersetup{% + colorlinks=true, % use true to enable colors below: + linkcolor=blue,%red, + filecolor=blue,%magenta, + pagecolor=blue,%red, + urlcolor=blue,%cyan, + citecolor=blue, + pdfborder=0 0 0, +} % We need lots of libraries... -\usetikzlibrary{% - arrows,% - calc,% - fit,% - patterns,% - plotmarks,% - shapes.geometric,% - shapes.misc,% - shapes.symbols,% - shapes.arrows,% - shapes.callouts,% - shapes.multipart,% - shapes.gates.logic.US,% - shapes.gates.logic.IEC,% - er,% - automata,% - backgrounds,% - chains,% - topaths,% - trees,% - petri,% - mindmap,% - matrix,% - calendar,% - folding,% - fadings,% - through,% - positioning,% - scopes,% - decorations.fractals,% - decorations.shapes,% - decorations.text,% - decorations.pathmorphing,% - decorations.pathreplacing,% - decorations.footprints,% - decorations.markings,% - shadows} +\usetikzlibrary{ + arrows, + calc, + fit, + patterns, + plotmarks, + shapes.geometric, + shapes.misc, + shapes.symbols, + shapes.arrows, + shapes.callouts, + shapes.multipart, + shapes.gates.logic.US, + shapes.gates.logic.IEC, + circuits.logic.US, + circuits.logic.IEC, + circuits.logic.CDH, + circuits.ee.IEC, + datavisualization, + datavisualization.formats.functions, + er, + automata, + backgrounds, + chains, + topaths, + trees, + petri, + mindmap, + matrix, + calendar, + folding, + fadings, + shadings, + spy, + through, + turtle, + positioning, + scopes, + decorations.fractals, + decorations.shapes, + decorations.text, + decorations.pathmorphing, + decorations.pathreplacing, + decorations.footprints, + decorations.markings, + shadows, + lindenmayersystems, + intersections, + fixedpointarithmetic, + fpu, + svg.path, + external, +} + +\iffalse +%\iftrue + \tikzexternalize[ + mode=list only,export=true,% simply skips EVERY picture -> good for debugging the text. + ] + {pgfmanual} + + \tikzifexternalizing{% + \pgfkeys{/pdflinks/codeexample links=false}% + }{}% +\fi + \usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry} \usepackage{amsmath,amssymb} @@ -64,7 +104,8 @@ \usepackage[latin1]{inputenc} \usepackage{amsmath} -\input{../../macros/pgfmanual-en-macros} +\graphicspath{{../../images/}} % TODOsp: under windows this would go up 2 directories, but the file is only one directory up +\input{../../macros/pgfmanual-en-macros} % TODOsp: same here \makeindex @@ -73,7 +114,7 @@ \renewcommand*\l@subsubsection{\@dottedtocline{3}{4.3em}{3.2em}} \makeatother -%\includeonly{} +%\includeonly{pgfmanual-en-library-profiler} % Global styles: \tikzset{ @@ -94,21 +135,29 @@ \index{File|see{Packages and files}} \index{Layout|see{Page layout}} \index{Node|see{Predefined node}} +\index{Data formats|see{Formats}} \begin{document} -%\include{pgfmanual-en-base-decorations} -%\end{document} +%\include{pgfmanual-en-dv-introduction} +%\include{pgfmanual-en-dv-main} +%\include{pgfmanual-en-dv-axes} +%\include{pgfmanual-en-dv-visualizers} +%\include{pgfmanual-en-dv-examples} +%\include{pgfmanual-en-dv-formats} +%\include{pgfmanual-en-dv-backend} +%\end{document} % The titlepage +\newbox\mybox { \parindent0pt \null \colorlet{mintgreen}{green!50!black!50} - + \thispagestyle{empty} \vskip3cm \vfill @@ -120,7 +169,7 @@ \coordinate (sky) at (0,.57\paperheight); \coordinate (left) at (-.51\paperwidth,0); \coordinate (right) at (.51\paperwidth,0); - + \shade [bottom color=blue!30!black!10,top color=blue!30!black!50] ([yshift=-5mm]horizon -| left) rectangle (sky -| right); \shade [bottom color=black!70!green!25,top color=black!70!green!10] @@ -131,20 +180,28 @@ ([yshift=-5mm-1pt]front -| left) rectangle ([yshift=1pt]front -| right); \fill [black!25] (bottom -| left) rectangle ([yshift=-5mm]front -| right); - \def\nodeshadowed[#1]#2;{\node[scale=2,above,#1]{#2};\node[scale=2,above,#1,yscale=-1,scope fading=south,opacity=0.4]{#2};} + \def\nodeshadowed[#1]#2;{\node[scale=2,above,#1]{\global\setbox\mybox=\hbox{#2}\copy\mybox}; + \node[scale=2,above,#1,yscale=-1,scope fading=south,opacity=0.4]{\box\mybox};} \nodeshadowed [at={(-5,5 )},yslant=0.05] {\Huge Ti\textcolor{orange}{\emph{k}}Z}; \nodeshadowed [at={( 0,5.3)}] {\huge \textcolor{mintgreen}{\&}}; \nodeshadowed [at={( 5,5 )},yslant=-0.05] {\Huge \textsc{PGF}}; \nodeshadowed [at={( 0,2 )}] {Manual for Version \pgftypesetversion}; + \foreach \where in {-9cm,9cm} + {\nodeshadowed [at={(\where,5cm)}] { + \tikz \draw [green!20!black, rotate=90] + [l-system={rule set={F -> FF-[-F+F]+[+F-F]}, axiom=F, order=4, + step=2pt, randomize step percent=50, angle=30, randomize angle percent=5}] + lindenmayer system;};} + \foreach \i in {0.5,0.6,...,2} \fill [white,decoration=Koch snowflake,opacity=.9] [shift=(horizon),shift={(rand*11,rnd*7)},scale=\i] [double copy shadow={opacity=0.2,shadow xshift=0pt,shadow yshift=3*\i pt,fill=white,draw=none}] - decorate { - decorate { + decorate { + decorate { decorate { (0,0) -- ++(60:1) -- ++(-60:1) -- cycle } @@ -169,19 +226,19 @@ \coordinate (sky) at (0,.57\paperheight); \coordinate (left) at (-.51\paperwidth,0); \coordinate (right) at (.51\paperwidth,0); - + \shade [bottom color=white, top color=blue!30!black!50] ([yshift=-5mm]horizon -| left) rectangle (sky -| right); - + \shade [bottom color=black!70!green!25, top color=black!70!green!10] (front -| left) -- (horizon -| left) decorate [decoration=random steps] { -- (horizon -| right) } -- (front -| right) -- cycle; - + \shade [top color=black!70!green!25, bottom color=black!25] ([yshift=-5mm-1pt]front -| left) @@ -190,11 +247,13 @@ \fill [black!25] (bottom -| left) rectangle ([yshift=-5mm]front -| right); - + \def\nodeshadowed[#1]#2;{ - \node[scale=2,above,#1]{#2}; + \node[scale=2,above,#1]{ + \global\setbox\mybox=\hbox{#2} + \copy\mybox}; \node[scale=2,above,#1,yscale=-1, - scope fading=south,opacity=0.4]{#2}; + scope fading=south,opacity=0.4]{\box\mybox}; } \end{lstlisting} }; @@ -219,6 +278,14 @@ \nodeshadowed [at={( 0,5 )}] {Manual for Version \pgftypesetversion}; + \foreach \where in {-9cm,9cm} { + \nodeshadowed [at={(\where,5cm)}] { \tikz + \draw [green!20!black, rotate=90, + l-system={rule set={F -> FF-[-F+F]+[+F-F]}, + axiom=F, order=4,step=2pt, + randomize step percent=50, angle=30, + randomize angle percent=5}] l-system; }} + \foreach \i in {0.5,0.6,...,2} \fill [white,opacity=\i/2, @@ -226,38 +293,27 @@ shift=(horizon),shift={(rand*11,rnd*7)}, scale=\i,double copy shadow={ opacity=0.2,shadow xshift=0pt, - shadow yshift=3*\i pt, - fill=white,draw=none}] + shadow yshift=3*\i pt,fill=white,draw=none}] decorate { - decorate { - decorate { + decorate { + decorate { (0,0)- ++(60:1) -- ++(-60:1) -- cycle } } }; \node (left text) ... \node (right text) ... - \fill [decorate, - decoration={footprints,foot of=gnome}, - opacity=.5,brown] (left text.south) - to [out=-45,in=135] (right text.north); - \fill [decorate, - decoration={footprints,foot of=felis silvestris, - foot length=5pt,stride length=15pt,foot angle=0}, - opacity=.5,green!50!black] (left text.south) - to [out=20,in=180] (right text.north west); + \fill [decorate,decoration={footprints,foot of=gnome}, + opacity=.5,brown] (rand*8,-rnd*10) + to [out=rand*180,in=rand*180] (rand*8,-rnd*10); \end{tikzpicture} \end{lstlisting} }; \fill [decorate,decoration=footprints, decoration={footprints,foot of=gnome}, - opacity=.5,brown] (left text.south) - to [out=-45,in=135] (right text.north); - \fill [decorate,decoration={footprints,foot length=5pt,foot of=felis - silvestris,stride length=15pt,foot angle=0}, - opacity=.5,green!50!black] (left text.south) - to [out=20,in=180] (right text.north west); + opacity=.5,brown] (rand*8,-rnd*10) + to [out=rand*180,in=rand*180] (rand*8,-rnd*10); \end{tikzpicture} \vfill \vbox{} @@ -276,7 +332,7 @@ \parindent=0pt Copyright 2007 by Till Tantau - \medskip + \medskip Permission is granted to copy, distribute and/or modify \emph{the documentation} under the terms of the \textsc{gnu} Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; @@ -284,19 +340,19 @@ A copy of the license is included in the section entitled \textsc{gnu} Free Documentation License. - \medskip + \medskip Permission is granted to copy, distribute and/or modify \emph{the code of the package} under the terms of the \textsc{gnu} Public License, Version 2 or any later version published by the Free Software Foundation. A copy of the license is included in the section entitled \textsc{gnu} Public License. - \medskip + \medskip Permission is also granted to distribute and/or modify \emph{both the documentation and the code} under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. A copy of the license is included in - the section entitled \LaTeX\ Project Public License. + the section entitled \LaTeX\ Project Public License. \vbox{} \clearpage @@ -333,7 +389,7 @@ and configuration section, this manual starts with tutorials. They explain all the basic and some of the more advanced features of the system, without going into all the details. This part also contains some guidelines on how you should proceed when creating graphics using -\tikzname. +\tikzname. \vskip3cm @@ -346,6 +402,7 @@ some guidelines on how you should proceed when creating graphics using \include{pgfmanual-en-tutorial-nodes} \include{pgfmanual-en-tutorial-Euclid} \include{pgfmanual-en-tutorial-chains} +\include{pgfmanual-en-tutorial-map} \include{pgfmanual-en-guidelines} @@ -360,7 +417,7 @@ some guidelines on how you should proceed when creating graphics using This part explains how the system is installed. Typically, someone has already done so for your system, so this part can be skipped; but if this is not the case and you are the poor fellow who has to do the -installation, read the present part. +installation, read the present part. \vskip1cm @@ -377,10 +434,10 @@ installation, read the present part. \path (A) edge node {0,1,L} (B) edge node {1,1,R} (C) - (B) edge [loop above] node {1,1,L} (B) + (B) edge [loop above] node {1,1,L} (B) edge node {0,1,L} (C) (C) edge node {0,1,L} (D) - edge [bend left] node {1,0,R} (E) + edge [bend left] node {1,0,R} (E) (D) edge [loop below] node {1,1,R} (D) edge node {0,1,R} (A) (E) edge [bend left] node {1,0,R} (A); @@ -430,7 +487,7 @@ installation, read the present part. \draw (60:-1cm) node[fill=white] {$E$} -- (60:3cm) node[fill=white] {$F$}; \draw[red] (-2,0) node[left] {$A$} -- (3,0) node[right]{$B$}; \draw[blue,shift={(60:2cm)}] (-3,0) node[left] {$C$} -- (2,0) node[right]{$D$}; - + \draw[shift={(60:1cm)},xshift=4cm] node [right,text width=6cm,rounded corners,fill=red!20,inner sep=1ex] { @@ -471,13 +528,13 @@ In this part the library packages are documented. They provide additional predefined graphic objects like new arrow heads or new plot marks, but also sometimes extensions of the basic \pgfname\ or \tikzname\ system. The libraries are not loaded by default since -many users will not need them. +many users will not need them. \medskip \noindent \begin{codeexample}[graphic=white] \tikzset{ - ld/.style={level distance=#1},lw/.style={line width=#1}, + ld/.style={level distance=#1},lw/.style={line width=#1}, level 1/.style={ld=4.5mm, trunk, lw=1ex ,sibling angle=60}, level 2/.style={ld=3.5mm, trunk!80!leaf a,lw=.8ex,sibling angle=56}, level 3/.style={ld=2.75mm,trunk!60!leaf a,lw=.6ex,sibling angle=52}, @@ -490,7 +547,7 @@ many users will not need them. { \pgfpathmoveto{\pgfpoint{-2pt}{0pt}} \pgfpatharc{150}{30}{1.8pt} - \pgfpatharc{-30}{-150}{1.8pt} + \pgfpatharc{-30}{-150}{1.8pt} \pgfusepathqfill } @@ -519,7 +576,7 @@ many users will not need them. } edge from parent [shorten >=-1pt,serif cm-,line cap=butt] }; - \node [text centered,text width=2cm,below] at (0pt,-.5ex) + \node [align=center,below] at (0pt,-.5ex) { \textcolor{border}{T}heoretical \\ \textcolor{border}{C}omputer \\ \textcolor{border}{S}cience }; \end{tikzpicture} @@ -535,12 +592,18 @@ many users will not need them. \include{pgfmanual-en-library-arrows} \include{pgfmanual-en-library-automata} \include{pgfmanual-en-library-backgrounds} +\include{pgfmanual-en-library-calc} \include{pgfmanual-en-library-calendar} \include{pgfmanual-en-library-chains} +\include{pgfmanual-en-library-circuits} \include{pgfmanual-en-library-decorations} \include{pgfmanual-en-library-er} +\include{pgfmanual-en-library-external} \include{pgfmanual-en-library-fadings} \include{pgfmanual-en-library-fit} +\include{pgfmanual-en-library-fixedpoint} +\include{pgfmanual-en-library-fpu} +\include{pgfmanual-en-library-lsystems} \include{pgfmanual-en-library-matrices} \include{pgfmanual-en-library-mindmaps} \include{pgfmanual-en-library-folding} @@ -548,15 +611,40 @@ many users will not need them. \include{pgfmanual-en-library-petri} \include{pgfmanual-en-library-plot-handlers} \include{pgfmanual-en-library-plot-marks} +\include{pgfmanual-en-library-profiler} +\include{pgfmanual-en-library-shadings} \include{pgfmanual-en-library-shadows} \include{pgfmanual-en-library-shapes} -%\include{pgfmanual-en-library-3d} +\include{pgfmanual-en-library-spy} +\include{pgfmanual-en-library-svg-path} \include{pgfmanual-en-library-edges} \include{pgfmanual-en-library-through} \include{pgfmanual-en-library-trees} +\include{pgfmanual-en-library-turtle} +\iffalse +\part{Data Visualization} +\label{part-dv} + +{\Large \emph{by Till Tantau}} + +\bigskip +\noindent +The documentation of the data visualization is still missing. This +stuff is still ``heavily under construction.'' + +\include{pgfmanual-en-dv-introduction} +\include{pgfmanual-en-dv-main} +\include{pgfmanual-en-dv-axes} +\include{pgfmanual-en-dv-visualizers} +\include{pgfmanual-en-dv-examples} +\include{pgfmanual-en-dv-formats} +\include{pgfmanual-en-dv-backend} + +\fi + \part{Utilities} \label{part-utilities} @@ -578,7 +666,7 @@ depend on \pgfname\ or they are designed to work well together with \begin{tikzpicture}[scale=2] \shade[top color=blue,bottom color=gray!50] (0,0) parabola (1.5,2.25) |- (0,0); \draw (1.05cm,2pt) node[above] {$\displaystyle\int_0^{3/2} \!\!x^2\mathrm{d}x$}; - + \draw[help lines] (0,0) grid (3.9,3.9) [step=0.25cm] (1,2) grid +(1,1); @@ -590,7 +678,7 @@ depend on \pgfname\ or they are designed to work well together with \foreach \y/\ytext in {1/1, 2/2, 2.25/2\frac{1}{4}, 3/3} \draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt) node[left] {$\ytext$}; - + \draw (-.5,.25) parabola bend (0,0) (2,4) node[below right] {$x^2$}; \end{tikzpicture} \end{codeexample} @@ -600,25 +688,34 @@ depend on \pgfname\ or they are designed to work well together with \include{pgfmanual-en-pgfcalendar} \include{pgfmanual-en-pages} \include{pgfmanual-en-xxcolor} +\include{pgfmanual-en-module-parser} -\part{Mathematical Engine} +\part{Mathematical and Object-Oriented Engines} {\Large \emph{by Mark Wibrow and Till Tantau}} \bigskip \noindent -\pgfname\ comes with its own mathematical engine. The job of this +\pgfname\ comes with two useful engines: One for doing mathematics, +one for doing object-oriented programming. Both engines can be used +independently of the main \pgfname. + +The job of the mathematical engine is to support mathematical operations like addition, -subtraction, multiplication and division, using both integers and +subtraction, multiplication and division, using both integers and non-integers, but also functions such as square-roots, sine, cosine, and generate pseudo-random numbers. - Mostly, you will use the mathematical facilities of \pgfname\ indirectly, namely when you write a coordinate like |(5cm*3,6cm/4)|, but the mathematical engine can also be used independently of -\pgfname\ and \tikzname. +\pgfname\ and \tikzname. + +The job of the object-oriented engine is to support simple +object-oriented programming in \TeX. It allows the definition of +\emph{classes} (without inheritance), \emph{methods}, +\emph{attributes} and \emph{objects}. \vskip1cm \begin{codeexample}[graphic=white] @@ -629,7 +726,7 @@ but the mathematical engine can also be used independently of \coordinate (current point) at (0,0); \coordinate (old velocity) at (0,0); \coordinate (new velocity) at (rand,rand); - + \foreach \i in {0,1,...,100} { \draw[\col!\i] (current point) @@ -647,6 +744,8 @@ but the mathematical engine can also be used independently of \include{pgfmanual-en-math-parsing} \include{pgfmanual-en-math-commands} \include{pgfmanual-en-math-algorithms} +\include{pgfmanual-en-math-numberprinting} +\include{pgfmanual-en-oo} \part{The Basic Layer} @@ -662,7 +761,7 @@ but the mathematical engine can also be used independently of \draw[gray,very thin] (-1.9,-1.9) grid (2.9,3.9) [step=0.25cm] (-1,-1) grid (1,1); \draw[blue] (1,-2.1) -- (1,4.1); % asymptote - + \draw[->] (-2,0) -- (3,0) node[right] {$x(t)$}; \draw[->] (0,-2) -- (0,4) node[above] {$y(t)$}; @@ -696,12 +795,13 @@ but the mathematical engine can also be used independently of \include{pgfmanual-en-base-matrices} \include{pgfmanual-en-base-transformations} \include{pgfmanual-en-base-patterns} -%\include{pgfmanual-en-base-images} +\include{pgfmanual-en-base-images} \include{pgfmanual-en-base-external} \include{pgfmanual-en-base-plots} \include{pgfmanual-en-base-layers} \include{pgfmanual-en-base-shadings} \include{pgfmanual-en-base-transparency} +\include{pgfmanual-en-base-internalregisters} \include{pgfmanual-en-base-quick} @@ -717,7 +817,7 @@ but the mathematical engine can also be used independently of \noindent This part describes the low-level interface of \pgfname, called the \emph{system layer}. This interface provides a complete abstraction of -the internals of the underlying drivers. +the internals of the underlying drivers. Unless you intend to port \pgfname\ to another driver or unless you intend to write your own optimized frontend, you need not read this part. @@ -731,18 +831,18 @@ workings of the |graphics| package and that you know what \begin{tikzpicture} [shorten >=1pt,->, vertex/.style={circle,fill=black!25,minimum size=17pt,inner sep=0pt}] - + \foreach \name/\x in {s/1, 2/2, 3/3, 4/4, 15/11, 16/12, 17/13, 18/14, 19/15, t/16} \node[vertex] (G-\name) at (\x,0) {$\name$}; \foreach \name/\angle/\text in {P-1/234/5, P-2/162/6, P-3/90/7, P-4/18/8, P-5/-54/9} \node[vertex,xshift=6cm,yshift=.5cm] (\name) at (\angle:1cm) {$\text$}; - + \foreach \name/\angle/\text in {Q-1/234/10, Q-2/162/11, Q-3/90/12, Q-4/18/13, Q-5/-54/14} \node[vertex,xshift=9cm,yshift=.5cm] (\name) at (\angle:1cm) {$\text$}; \foreach \from/\to in {s/2,2/3,3/4,3/4,15/16,16/17,17/18,18/19,19/t} - \draw (G-\from) -- (G-\to); + \draw (G-\from) -- (G-\to); \foreach \from/\to in {1/2,2/3,3/4,4/5,5/1,1/3,2/4,3/5,4/1,5/2} { \draw (P-\from) -- (P-\to); \draw (Q-\from) -- (Q-\to); } @@ -785,11 +885,12 @@ workings of the |graphics| package and that you know what \printindex +%\typeout{Examples: \the\codeexamplecount}% \end{document} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "~/texmf/tex/generic/pgf/doc/pgf/version-for-pdftex/en/pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex index c4cf989f55e..8f6f1639b0c 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex @@ -8,74 +8,198 @@ % See the file doc/generic/pgf/licenses/LICENSE for more details. -\section[Reimplementing the Computations of the Mathematical Engine] - {Reimplementing the Computations of the\\ Mathematical Engine} +\section{Customizing the Mathematical Engine} \label{pgfmath-reimplement} -Perhaps you are not satisfied with the Maclaurin series for -$e^x$. Perhaps you have a fantastically more accurate -and efficient way of calculating the sine or cosine of angles. Perhaps - you would like the library to interface with a package such as |fp| - for fixed-point arithmetic (but you may find that exclusively - using |fp| can cause a significant increase in compile time for - documents involving many hundreds of calculations). -In these cases you will want to replace the current implementations of -the computations done by the mathematical engine by your own code. - -The mathematical engine was designed with such a replacement in -mind. For this reason, the operations and functions like |\pgfmathadd| -are implemented in the following manner: - -\begin{itemize} -\item |\pgfmath|\meta{function name} - - This macro is the ``public'' interface for the function - \meta{function name}. All arguments passed to this macro are - evaluated using |\pgfmathparse| and then passed on to the following - function: - -\item |\pgfmath|\meta{function name}|@| - - This macro is the ``non-public'' implementation of the functions - algorithm (but note that, for speed, the parser calls this macro - rather than the ``public'' one). Arguments passed to this macro - are expected to be numbers \emph{without units}. This is the macro - which should be rewritten with your prize-winning new algorithm. - - Note, furthermore, that if the function takes more than one - argument, the second argument should not involve the dimensions - |\pgfmath@x| nor |\pgfmath@xa| nor |\pgf@x| nor |\pgf@xa| since - these may be set to the value of the first argument when the - second argument is parsed. -\end{itemize} - -The effect of |\pgfmath|\meta{function name}|@| should be to set the -macro |\pgfmathresult| to the correct value (namely to the result of -the computation without units). Furthermore, the function should have -no other side effects, that is, it should not change any global -values. One way to achieve this is to use the following code: - -\begin{codeexample}[code only] -\def\pgfmath...@#1#2...{% - \begingroup% - ... code for algorithm ... - \pgfmath@returnone\pgfmath@x% - \endgroup% + +Perhaps you have a desire for some function that \pgfname\ does not +provide. Perhaps you are not happy with the accuracy or efficiency of +some of the algorithms that are implemented in \pgfname. In these +cases you will want to add a function to the parser or replace the +current implementations of the algorithms with your own code. + +The mathematical engine was designed with such customization in mind. +It is possible to add new functions, or modify the code for +existing functions. Note, however, that whilst adding new operators +is possible, it can be a rather tricky business and is only +recommended for adventurous users. + +To add a new function to the math engine the following command can be +used: + +\begin{command}{\pgfmathdeclarefunction\marg{function name}\marg{number of arguments}\marg{code}} + + This will set up the parser to recognize a function called + \meta{name}. The name of the function can consist of, uppercase or + lower case letters, numbers or the underscore |_|. In line with + many programming languages, a function name cannot begin with a + number or contain any spaces. + + The \meta{number of arguments} can be any positive integer, zero, + or the value |...|, which indicates a variable number of + arguments. \pgfname{} treats constants, such as |pi| and |e|, as + functions with zero arguments. Functions with more than nine + arguments or with variable arguments are a ``bit special'' and + are discussed below. + + The effect of \meta{code} should be to set the macro + |\pgfmathresult| to the correct value (namely to the result of the + computation without units). Furthermore, the function should have + no other side effects, that is, it should not change any global + values. As an example, consider the creation of a new function + |double|, which takes one argument, and returns the value of that + argument times two. + +\begin{codeexample}[] +\makeatletter +\pgfmathdeclarefunction{double}{1}{ + \begingroup + \pgf@x=#1pt\relax + \multiply\pgf@x by2\relax + \pgfmathreturn\pgf@x + \endgroup } +\makeatother +\pgfmathparse{double(44.3)}\pgfmathresult \end{codeexample} + The macro |\pgfmathreturn|\meta{tokens} must be + directly followed by an |\endgroup| and will save the result of the + computation, by defining |\pgfmathresult| as the expansion of + \meta{tokens} (without units) outside the group, so \meta{tokens} + must be something that can be assigned to a dimension register. + + Alternatively, the |\pgfmathsmuggle|\meta{macro} can be used. This + must also be directly followed by an |\endgroup| and will simply + ``smuggle'' the definition of \meta{macro} outside the \TeX-group. + + By performing computations within a \TeX-group, \pgfname{} + registers such as |\pgf@x|, |\pgf@y| and |\c@pgf@counta|, + |\c@pgfcountb|, and so forth, can be used at will. + + Beyond setting up the parser, this command also defines two macros + which provide access to the function independently of the parser: + + \begin{itemize} + \item + |\pgfmath|\meta{function name} + + This macro will provide ``public'' interface for the function + \meta{function name} allowing the function to be called + independently of the parser. All arguments passed to this macro are + evaluated using |\pgfmathparse| and then passed on to the following + macro: + + \item + |\pgfmath|\meta{function name}|@| + + This macro is the ``private'' implementation of the functions + algorithm (but note that, for speed, the parser calls this macro + rather than the ``public'' one). Arguments passed to this macro + are expected to be numbers without units. It is defined using + \meta{code}, but need not be self contained. + + \end{itemize} + + For functions that are declared with less than ten arguments, + the public macro is defined in the same way as normal \TeX{} + macros using, for example, |\def\pgfmathNoArgs{|\meta{code}|}| + for a function with no arguments, or + |\def\pgfmathThreeArgs#1#2#3{|\meta{code}|}| for a function with + three arguments. + The private macro is defined in the same way, and each argument + can therefore be accessed in \meta{code} + using |#1|, |#2| and so on. -The macro |\pgfmath@returnone|\meta{code} must be directly followed by an -|\endgroup| and will save result of the algorithm, by defining -|\pgfmathresult| as the expansion of \meta{code} \emph{without units} -outside the group. The \meta{code} should expand to a dimension -register or to a dimension. By performing the algorithm within a -\TeX{} group, \pgfname{} registers such as |\pgf@x|, |\pgf@y| and -|\c@pgf@counta|, |\c@pgfcountb|, and so forth, can be used at will. + For functions with more than nine arguments, or functions with + a variable number of arguments, these macros are only + defined as taking \emph{one} argument. The public macro + expects its arguments to be comma separated, for example, + |\pgfmathVariableArgs{1.1,3.5,-1.5,2.6}|. Each + argument is parsed and + passed on to the private macro as follows: + |\pgfmathVariableArgs@{{1.1}{3.5}{-1.5}{2.6}}|. + This means that some ``extra work'' will be required to access + each argument (although it is a fairly simple task). + + Note, that there are, two exceptions to this arrangement: + the public versions of the |min| and |max| functions still + take two arguments for compatibility with older versions, but + each of these arguments can take several comma separated values. + + + + +\end{command} + + To redefine a function use the following command: + +\begin{command}{\pgfmathredeclarefunction\marg{function name}\marg{algorithm code}} + + This command redefines the |\pgfmath|\meta{function name}|@| macro + with the new \meta{algorithm code}. See the description of the + |\pgfmathdeclarefunction| for details. You cannot change the number + of arguments for an existing function. + +\end{command} + + \pgfname{} uses the last known definition of a function within the + prevailing scope, so it is possible for a function to be redefined + locally. You should also remember that any |.sty| or |.tex| file + containing any re-implementations should be loaded after pgf-Math. + + In addition to the above commands, the following key is provided to + quickly create simple ad hoc functions which can greatly improve + the readability of code, and is particularly useful in \tikzname{}: + +\begin{key}{/pgf/declare function=\meta{function definitions}} + This key allows simple functions to be created locally. Its use + is perhaps best illustrated by an example: + +\begin{codeexample}[] +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + \draw [blue, thick, x=0.0085cm, y=1cm, + declare function={ + sines(\t,\a,\b)=1 + 0.5*(sin(\t)+sin(\t*\a)+sin(\t*\b)); + }] + plot [domain=0:360, samples=144, smooth] (\x,{sines(\x,3,5)}); +\end{tikzpicture} +\end{codeexample} + + Each definition in \meta{function definitions} takes the form + \meta{name}|(|\meta{arguments}|)=|\meta{definition}|;| (note the + semicolon at the end, this is very important). If multiple + functions are being defined the semicolon is used to separate + them (\emph{not} a comma). + The function \meta{name} can be any name that is not already a + function name in the current scope. The list of \meta{arguments} + are commands such as |\x|, or |\y| (it is not possible to declare + functions that take variable numbers of arguments using this key). + If the function takes no arguments then the parentheses need not + be used. + The \meta{definition} should be an expression that can be + parsed by the mathematical engine and should use the commands + specified in \meta{arguments}. + + When specifying multiple functions, functions that appear later + on in \meta{function definitions} can refer to earlier functions: + +\begin{codeexample}[] +\begin{tikzpicture}[ + declare function={ + excitation(\t,\w) = sin(\t*\w); + noise = rnd - 0.5; + source(\t) = excitation(\t,20) + noise; + filter(\t) = 1 - abs(sin(mod(\t, 90))); + speech(\t) = 1 + source(\t)*filter(\t); + } +] + \draw [help lines] (0,0) grid (3,2); + \draw [blue, thick, x=0.0085cm, y=1cm] (0,1) -- + plot [domain=0:360, samples=144, smooth] (\x,{speech(\x)}); +\end{tikzpicture} +\end{codeexample} -\pgfname{} uses the last known definition of a function within the -prevailing scope, so it is possible for a function to be redefined -or |\let| to an alternative definition locally. -You should also remember that any |.sty| or |.tex| file contatining any -re-implementions should be loaded \emph{after} \pgfname-Math.
\ No newline at end of file +\end{key} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex index 8a75eaa89ae..b1be68267d7 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex @@ -7,187 +7,47 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\section{Evaluating Mathematical Operations} +\section{Additional Mathematical Commands} \label{pgfmath-commands} Instead of parsing and evaluating complex expressions, you can also use the mathematical engine to evaluate a single mathematical -operation. The macros used for these computations are described in the -following. +operation. The macros used for many of these computations are listed +above in Section~\ref{pgfmath-functions}. \pgfname{} also provides +some additional commands which are shown below: +\subsection{Basic arithmetic functions} -\subsection{Basic Operations and Functions} +\label{pgfmath-commands-basic} -\label{pgfmath-operations} - -\begin{command}{\pgfmathadd\marg{x}\marg{y}} - Defines |\pgfmathresult| as $\meta{x}+\meta{y}$. -\end{command} - -\begin{command}{\pgfmathsubtract\marg{x}\marg{y}} - Defines |\pgfmathresult| as $\meta{x}-\meta{y}$. -\end{command} - -\begin{command}{\pgfmathmultiply\marg{x}\marg{y}} - Defines |\pgfmathresult| as $\meta{x}\times\meta{y}$. -\end{command} - -\begin{command}{\pgfmathdivide\marg{x}\marg{y}} - Defines |\pgfmathresult| as $\meta{x}\div\meta{y}$. An error will - result if \meta{y} is |0|, or if the result of the division is - too big for the mathematical engine. - Please remember when using this command that accurate (and reasonably - quick) division of non-integers is particularly tricky in \TeX{}. - There are three different forms of division used in this command: - \begin{itemize} - \item - If \meta{y} is an integer then the native |\divide| operation of - \TeX{} is used. - \item - If \vrule\meta{y}\vrule$<1$, then |\pgfmathreciprocal| is employed. - \item - For all other values of \meta{y} an optimised long division - algorithm is used. In theory this should be accurate - to any finite precision, but in practice it is constrained by the - limits of \TeX{}'s native mathematics. - \end{itemize} - -\end{command} +In addition to the commands described in +Section~\ref{pgfmath-functions-basic}, the following command is +provided: \begin{command}{\pgfmathreciprocal\marg{x}} - Defines |\pgfmathresult| as $1\div\meta{x}$. -\end{command} - -\begin{command}{\pgfmathgreaterthan\marg{x}\marg{y}} - Defines |\pgfmathresult| as 1.0 if \meta{x} $>$ \meta{y}, but 0.0 otherwise. -\end{command} - -\begin{command}{\pgfmathlessthan\marg{x}\marg{y}} - Defines |\pgfmathresult| as 1.0 if \meta{x} $<$ \meta{y}, but 0.0 otherwise. -\end{command} - -\begin{command}{\pgfmathequalto\marg{x}\marg{y}} - Defines |\pgfmathresult| 1.0 if \meta{x} $=$ \meta{y}, but 0.0 otherwise. -\end{command} - -\begin{command}{\pgfmathround\marg{x}} - Defines |\pgfmathresult| as $\left\lfloor\textrm{\meta{x}}\right\rceil$. - This uses asymmetric half-up rounding. -\end{command} - -\begin{command}{\pgfmathfloor\marg{x}} - Defines |\pgfmathresult| as $\left\lfloor\textrm{\meta{x}}\right\rfloor$. -\end{command} - -\begin{command}{\pgfmathceil\marg{x}} - Defines |\pgfmathresult| as $\left\lceil\textrm{\meta{x}}\right\rceil$. -\end{command} - -\begin{command}{\pgfmathpow\marg{x}\marg{y}} - Defines |\pgfmathresult| as $\meta{x}^{\meta{y}}$. For greatest - accuracy \mvar{y} should be an integer. If \mvar{y} is not an integer - the actual calculation will be an approximation of $e^{y\ln(x)}$. -\end{command} - -\begin{command}{\pgfmathmod\marg{x}\marg{y}} - Defines |\pgfmathresult| as \meta{x} modulo \meta{y}. -\end{command} - -\begin{command}{\pgfmathmax\marg{x}\marg{y}} - Defines |\pgfmathresult| as the maximum of \meta{x} or \meta{y}. -\end{command} - -\begin{command}{\pgfmathmin\marg{x}\marg{y}} - Defines |\pgfmathresult| as the minimum \meta{x} or \meta{y}. -\end{command} - -\begin{command}{\pgfmathabs\marg{x}} - Defines |\pgfmathresult| as absolute value of \meta{x}. -\end{command} - -\begin{command}{\pgfmathexp\marg{x}} - Defines |\pgfmathresult| as $e^{\meta{x}}$. Here, \meta{x} can be a - non-integer. The algorithm uses a Maclaurin series. -\end{command} - -\begin{command}{\pgfmathln\marg{x}} - Defines |\pgfmathresult| as $\ln{\meta{x}}$. This uses an algorithm - due to Rouben Rostamian, and coefficients suggested by - Alain Matthes. -\end{command} - -\begin{command}{\pgfmathsqrt\marg{x}} - Defines |\pgfmathresult| as $\sqrt{\meta{x}}$. -\end{command} - -\begin{command}{\pgfmathveclen\marg{x}\marg{y}} - Defines |\pgfmathresult| as $\sqrt{\meta{x}^2+\meta{y}^2}$. This uses - a polynomial approximation, based on ideas due to Rouben Rostamian. -\end{command} - -\subsection{Trignometric Functions} - -\label{pgfmath-trigonmetry} - -\begin{command}{\pgfmathpi} - Defines |\pgfmathresult| as $3.14159$. -\end{command} - -\begin{command}{\pgfmathdeg{\marg{x}}} - Defines |\pgfmathresult| as \meta{x} (given in radians) converted to - degrees. -\end{command} - -\begin{command}{\pgfmathrad{\marg{x}}} - Defines |\pgfmathresult| as \meta{x} (given in degrees) converted to - radians. -\end{command} - -\begin{command}{\pgfmathsin{\marg{x}}} - Defines |\pgfmathresult| as the sine of \meta{x}. -\end{command} - -\begin{command}{\pgfmathcos{\marg{x}}} - Defines |\pgfmathresult| as the cosine of \meta{x}. -\end{command} - -\begin{command}{\pgfmathtan{\marg{x}}} - Defines |\pgfmathresult| as the tangant of \meta{x}. + Defines |\pgfmathresult| as $1\div\meta{x}$. This is provides + greatest accuracy when \mvar{x} is small. \end{command} -\begin{command}{\pgfmathsec{\marg{x}}} - Defines |\pgfmathresult| as the secant of \meta{x}. -\end{command} +\subsection{Comparison and logical functions} -\begin{command}{\pgfmathcosec{\marg{x}}} - Defines |\pgfmathresult| as the cosecant of \meta{x}. -\end{command} +In addition to the commands described in +Section~\ref{pgfmath-functions-comparison}, +the following command was provided by Christian Feuers\"anger: -\begin{command}{\pgfmathcot{\marg{x}}} - Defines |\pgfmathresult| as the cotangant of \meta{x}. +\begin{command}{\pgfmathapproxequalto\marg{x}\marg{y}} + Defines |\pgfmathresult| 1.0 if $ \rvert \meta{x} - \meta{y} \lvert < 0.0001$, but 0.0 otherwise. + As a side-effect, the global boolean |\ifpgfmathcomparison| will be set accordingly. \end{command} -\begin{command}{\pgfmathasin{\marg{x}}} - Defines |\pgfmathresult| as the arcsine of \meta{x}. - The result will be in the range $\pm90^\circ$. -\end{command} - -\begin{command}{\pgfmathacos{\marg{x}}} - Defines |\pgfmathresult| as the arccosine of \meta{x}. - The result will be in the range $\pm90^\circ$. -\end{command} - -\begin{command}{\pgfmathatan{\marg{x}}} - Defines |\pgfmathresult| as the arctangent of \meta{x}. -\end{command} - - - \subsection{Pseudo-Random Numbers} \label{pgfmath-random} +In addition to the commands described in +Section~\ref{pgfmath-functions-random}, +the following commands are provided: \begin{command}{\pgfmathgeneratepseudorandomnumber} Defines |\pgfmathresult| as a pseudo-random integer between 1 and @@ -195,14 +55,6 @@ following. due to Erich Janka. \end{command} -\begin{command}{\pgfmathrnd} - Defines |\pgfmathresult| as a pseudo-random number between |0| and |1|. -\end{command} - -\begin{command}{\pgfmathrand} - Defines |\pgfmathresult| as a pseudo-random number between |-1| and |1|. -\end{command} - \begin{command}{\pgfmathrandominteger\marg{macro}\marg{maximum}\marg{minimum}} This defines \meta{macro} as a pseudo-randomly generated integer from the range \meta{maximum} to \meta{minimum} (inclusive). @@ -253,7 +105,7 @@ following. -\subsection{Conversion Between Bases} +\subsection{Base Conversion} \label{pgfmath-bases} @@ -263,6 +115,10 @@ positive integers in the range $0$ to $2^{31}-1$, and the bases in the range $2$ to $36$. All digits representing numbers greater than 9 (in base ten), are alphabetic, but may be upper or lower case. +In addition to the commands described in +Section~\ref{pgfmath-functions-base}, +the following commands are provided: + \begin{command}{\pgfmathbasetodec\marg{macro}\marg{number}\marg{base}} Defines \meta{macro} as the result of converting \meta{number} from base \meta{base} to base 10. Alphabetic digits can be upper or lower @@ -340,4 +196,5 @@ base ten), are alphabetic, but may be upper or lower case. \pgfmathdectobase\mynumber{15}{2} \mynumber \end{codeexample} -\end{command}
\ No newline at end of file +\end{command} + diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex index e29fb81d9b7..e12380bd8ae 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex @@ -46,8 +46,8 @@ The mathematical engine of \pgfname\ is loaded automatically by not need \pgfname\ itself, you can load the following package: \begin{package}{pgfmath} - This command will load the mathematical engine of \pgfname, but not - \pgfname\ itself. It defines commands like |\pgfmathparse|. + This command will load the mathematical engine of \pgfname, but not + \pgfname itself. It defines commands like |\pgfmathparse|. \end{package} @@ -57,7 +57,8 @@ Like \pgfname\ itself, the mathematical engine is also structured into different layers: \begin{enumerate} -\item The top layer, which you will typically use directly, provides +\item + The top layer, which you will typically use directly, provides the command |\pgfmathparse|. This command parses a mathematical expression and evaluates it. @@ -65,11 +66,15 @@ different layers: similar to the macros of the |calc| package for setting dimensions and counters. These macros are just wrappers around the |\pgfmathparse| macro. -\item The calculation layer provides macros for performing one + +\item + The calculation layer provides macros for performing one specific computation like computing a reciprocal or a multiplication. The parser uses these macros for the actual computation. -\item The implementation layer provides the actual implementations of + +\item + The implementation layer provides the actual implementations of the computations. These can be changed (and possibly be made more efficient) without affecting the higher layers. \end{enumerate} @@ -80,7 +85,7 @@ different layers: Currently, the mathematical algorithms are all implemented in \TeX. This poses some intriguing programming challenges as \TeX{} is a -language for typesetting, rather than general mathematics, +language for typesetting, rather than for general mathematics, and as with any programming language, there is a trade-off between accuracy and efficiency. If you find the level of accuracy insufficient for you diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex new file mode 100644 index 00000000000..9deedd2e504 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex @@ -0,0 +1,528 @@ +\section{Number Printing} + +\label{pgfmath-numberprinting}% + +{\emph{An extension by Christian Feuers\"anger}} + +\medskip +\noindent +\pgfname\ supports number printing in different styles and rounds to arbitrary precision. + +\begin{command}{\pgfmathprintnumber\marg{x}} +Generates pretty-printed output for the (real) number \marg{x}. The input number \marg{x} is parsed using |\pgfmathfloatparsenumber| which allows arbitrary precision. + +Numbers are typeset in math mode using the current set of number printing options, see below. Optional arguments can also be provided using |\pgfmathprintnumber[|\meta{options}|]|\marg{x}. +\end{command} + +\begin{command}{\pgfmathprintnumberto\marg{x}\marg{\textbackslash macro}} + Returns the resulting number into \marg{\textbackslash macro} instead of typesetting it directly. +\end{command} + +\begin{key}{/pgf/number format/fixed} +Configures |\pgfmathprintnumber| to round the number to a fixed number of digits after the period, discarding any trailing zeros. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,fixed,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\end{codeexample} + +See section~\ref{sec:number:styles} for how to change the appearance. +\end{key} + +\begin{key}{/pgf/number format/fixed zerofill=\marg{boolean} (default true)} +Enables or disables zero filling for any number drawn in fixed point format. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,fixed,fixed zerofill,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\end{codeexample} +This key affects numbers drawn with |fixed| or |std| styles (the latter only if no scientific format is chosen). +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,std,fixed zerofill,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-05}\hspace{1em} +\pgfmathprintnumber{1}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\end{codeexample} + +See section~\ref{sec:number:styles} for how to change the appearance. +\end{key} + +\begin{key}{/pgf/number format/sci} +Configures |\pgfmathprintnumber| to display numbers in scientific format, that means sign, mantissa and exponent (basis~$10$). The mantissa is rounded to the desired |precision| (or |sci precision|, see below). + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,sci,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\end{codeexample} + +See section~\ref{sec:number:styles} for how to change the exponential display style. +\end{key} + +\begin{key}{/pgf/number format/sci zerofill=\marg{boolean} (default true)} +Enables or disables zero filling for any number drawn in scientific format. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,sci,sci zerofill,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\end{codeexample} +As with |fixed zerofill|, this option does only affect numbers drawn in |sci| format (or |std| if the scientific format is chosen). + +See section~\ref{sec:number:styles} for how to change the exponential display style. +\end{key} + +\begin{stylekey}{/pgf/number format/zerofill=\marg{boolean} (default true)} + Sets both, |fixed zerofill| and |sci zerofill| at once. +\end{stylekey} + +\begin{keylist}{/pgf/number format/std,% + /pgf/number format/std=\meta{lower e}, + /pgf/number format/std=\meta{lower e}:\meta{upper e}} +Configures |\pgfmathprintnumber| to a standard algorithm. It chooses either |fixed| or |sci|, depending on the order of magnitude. Let $n=s \cdot m \cdot 10^e$ be the input number and $p$ the current precision. If $-p/2 \le e \le 4$, the number is displayed using |fixed| format. Otherwise, it is displayed using |sci| format. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,std,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\end{codeexample} +The parameters can be customized using the optional integer argument(s): if $\text{\meta{lower e}} \le e \le \text{\meta{upper e}}$, the number is displayed in |fixed| format, otherwise in |sci| format. Note that \meta{lower e} should be negative for useful results. The precision used for scientific format can be adjusted with |sci precision| if necessary. + +\end{keylist} + +\begin{key}{/pgf/number format/int detect} +Configures |\pgfmathprintnumber| to detect integers automatically. If the input number is an integer, no period is displayed at all. If not, the scientific format is chosen. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,int detect,precision=2} +\pgfmathprintnumber{15}\hspace{1em} +\pgfmathprintnumber{20}\hspace{1em} +\pgfmathprintnumber{20.4}\hspace{1em} +\pgfmathprintnumber{0.01}\hspace{1em} +\pgfmathprintnumber{0} +\end{codeexample} +\end{key} + +\begin{command}{\pgfmathifisint\marg{number constant}\marg{true code}\marg{false code}} + A command which does the same check as |int detect|, but it invokes \meta{true code} if the \meta{number constant} actually is an integer and the \meta{false code} if not. + + As a side--effect, |\pgfretval| will contain the parsed number, either in integer format or as parsed floating point number. + + + The argument \meta{number constant} will be parsed with |\pgfmathfloatparsenumber|. +\begin{codeexample}[] +15 \pgfmathifisint{15}{is an int: \pgfretval.}{is no int}\hspace{1em} +15.5 \pgfmathifisint{15.5}{is an int: \pgfretval.}{is no int} +\end{codeexample} +\end{command} + +\begin{key}{/pgf/number format/int trunc} +Truncates every number to integers (discards any digit after the period). + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,int trunc} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/number format/frac} +Displays numbers as fractionals. + +\begin{codeexample}[width=3cm] +\pgfkeys{/pgf/number format/frac} +\pgfmathprintnumber{0.333333333333333}\hspace{1em} +\pgfmathprintnumber{0.5}\hspace{1em} +\pgfmathprintnumber{2.133333333333325e-01}\hspace{1em} +\pgfmathprintnumber{0.12}\hspace{1em} +\pgfmathprintnumber{2.666666666666646e-02}\hspace{1em} +\pgfmathprintnumber{-1.333333333333334e-02}\hspace{1em} +\pgfmathprintnumber{7.200000000000000e-01}\hspace{1em} +\pgfmathprintnumber{6.666666666666667e-02}\hspace{1em} +\pgfmathprintnumber{1.333333333333333e-01}\hspace{1em} +\pgfmathprintnumber{-1.333333333333333e-02}\hspace{1em} +\pgfmathprintnumber{3.3333333}\hspace{1em} +\pgfmathprintnumber{1.2345}\hspace{1em} +\pgfmathprintnumber{1}\hspace{1em} +\pgfmathprintnumber{-6} +\end{codeexample} + +\begin{key}{/pgf/number format/frac TeX=\marg{\textbackslash macro} (initially \texttt{\textbackslash frac})} + Allows to use a different implementation for |\frac| inside of the |frac| display type. +\end{key} +\begin{key}{/pgf/number format/frac denom=\meta{int} (initially empty)} + Allows to provide a custom denominator for |frac|. +\begin{codeexample}[width=3cm] +\pgfkeys{/pgf/number format/.cd,frac, frac denom=10} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{0.5}\hspace{1em} +\pgfmathprintnumber{1.2}\hspace{1em} +\pgfmathprintnumber{-0.6}\hspace{1em} +\pgfmathprintnumber{-1.4}\hspace{1em} +\end{codeexample} +\end{key} +\begin{key}{/pgf/number format/frac whole=\mchoice{true,false} (initially true)} + Configures whether complete integer parts shall be placed in front of the fractional part. In this case, the fractional part will be less then $1$. Use |frac whole=false| to avoid whole number parts. +\begin{codeexample}[width=3cm] +\pgfkeys{/pgf/number format/.cd,frac, frac whole=false} +\pgfmathprintnumber{20.1}\hspace{1em} +\pgfmathprintnumber{5.5}\hspace{1em} +\pgfmathprintnumber{1.2}\hspace{1em} +\pgfmathprintnumber{-5.6}\hspace{1em} +\pgfmathprintnumber{-1.4}\hspace{1em} +\end{codeexample} +\end{key} +\begin{key}{/pgf/number format/frac shift=\marg{integer} (initially 4)} + In case you experience problems because of stability problems, try experimenting with a different |frac shift|. + Higher shift values $k$ yield higher sensitivity to inaccurate data or inaccurate arithmetics. + + Technically, the following happens. If $r < 1$ is the fractional part of the mantissa, then a scale $i = 1/r \cdot 10^k$ is computed where $k$ is the shift; fractional parts of $i$ are neglected. The value $1/r$ is computed internally, its error is amplified. + + If you still experience stability problems, use |\usepackage{fp}| in your preamble. The |frac| style will then automatically employ the higher absolute precision of |fp| for the computation of $1/r$. +\end{key} +\end{key} + +\begin{key}{/pgf/number format/precision=\marg{number}} +Sets the desired rounding precision for any display operation. For scientific format, this affects the mantissa. +\end{key} + +\begin{key}{/pgf/number format/sci precision=\meta{number or empty} (initially empty)} + Sets the desired rounding precision only for |sci| styles. + + Use |sci precision={}| to restore the initial configuration (which uses the argument provided to |precision| for all number styles). +\end{key} + +\subsection{Changing display styles}% +\label{sec:number:styles}% +You can change the way how numbers are displayed. For example, if you use the `\texttt{fixed}' style, the input number is rounded to the desired precision and the current fixed point display style is used to typeset the number. The same is applied to any other format: first, rounding routines are used to get the correct digits, afterwards a display style generates proper \TeX-code. + +\begin{key}{/pgf/number format/set decimal separator=\marg{text}} +Assigns \marg{text} as decimal separator for any fixed point numbers (including the mantissa in sci format). + +Use |\pgfkeysgetvalue{/pgf/number format/set decimal separator}\value| to get the current separator into |\value|. +\end{key} + +\begin{stylekey}{/pgf/number format/dec sep=\marg{text}} + Just another name for |set decimal separator|. +\end{stylekey} + +\begin{key}{/pgf/number format/set thousands separator=\marg{text}} +Assigns \marg{text} as thousands separator for any fixed point numbers (including the mantissa in sci format). + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={}} +\pgfmathprintnumber{1234.56} +\end{codeexample} +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={}} +\pgfmathprintnumber{1234567890} +\end{codeexample} + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={.}} +\pgfmathprintnumber{1234567890} +\end{codeexample} +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={,}} +\pgfmathprintnumber{1234567890} +\end{codeexample} +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={{{,}}}} +\pgfmathprintnumber{1234567890} +\end{codeexample} +The last example employs commas and disables the default comma-spacing. + +Use |\pgfkeysgetvalue{/pgf/number format/set thousands separator}\value| to get the current separator into |\value|. +\end{key} + +\begin{stylekey}{/pgf/number format/1000 sep=\marg{text}} + Just another name for |set thousands separator|. +\end{stylekey} + +\begin{key}{/pgf/number format/min exponent for 1000 sep=\marg{number} (initially 0)} + Defines the smallest exponent in scientific notation which is required to draw thousand separators. The exponent is the number of digits minus one, so $\meta{number}=4$ will use thousand separators starting with $1e4 = 10000$. +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + int detect, + 1000 sep={\,}, + min exponent for 1000 sep=0} +\pgfmathprintnumber{5000}; \pgfmathprintnumber{1000000} +\end{codeexample} + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + int detect, + 1000 sep={\,}, + min exponent for 1000 sep=4} +\pgfmathprintnumber{1000}; \pgfmathprintnumber{5000} +\end{codeexample} +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + int detect, + 1000 sep={\,}, + min exponent for 1000 sep=4} +\pgfmathprintnumber{10000}; \pgfmathprintnumber{1000000} +\end{codeexample} +\noindent A value of |0| disables this feature (negative values are ignored). +\end{key} + +\begin{key}{/pgf/number format/use period} +A predefined style which installs periods `\texttt{.}' as decimal separators and commas `\texttt{,}' as thousands separators. This style is the default. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use period} +\pgfmathprintnumber{12.3456} +\end{codeexample} +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use period} +\pgfmathprintnumber{1234.56} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/number format/use comma} +A predefined style which installs commas `\texttt{,}' as decimal separators and periods `\texttt{.}' as thousands separators. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use comma} +\pgfmathprintnumber{12.3456} +\end{codeexample} +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use comma} +\pgfmathprintnumber{1234.56} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/number format/skip 0.=\marg{boolean} (initially false)} + Configures whether numbers like $0.1$ shall be typeset as $.1$ or not. +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill,precision=2, + skip 0.} +\pgfmathprintnumber{0.56} +\end{codeexample} +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill,precision=2, + skip 0.=false} +\pgfmathprintnumber{0.56} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/number format/showpos=\marg{boolean} (initially false)} + Enables or disables display of plus signs for non-negative numbers. +\begin{codeexample}[] +\pgfkeys{/pgf/number format/showpos} +\pgfmathprintnumber{12.345} +\end{codeexample} + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/showpos=false} +\pgfmathprintnumber{12.345} +\end{codeexample} + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,showpos,sci} +\pgfmathprintnumber{12.345} +\end{codeexample} +\end{key} + +\begin{stylekey}{/pgf/number format/print sign=\marg{boolean}} + A style which is simply an alias for |showpos=|\marg{boolean}. +\end{stylekey} + +\begin{key}{/pgf/number format/sci 10e} +Uses $m \cdot 10^e$ for any number displayed in scientific format. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,sci,sci 10e} +\pgfmathprintnumber{12.345} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/number format/sci 10\textasciicircum e} +The same as `|sci 10e|'. +\end{key} + +\begin{key}{/pgf/number format/sci e} +Uses the `$1e{+}0$' format which is generated by common scientific tools for any number displayed in scientific format. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,sci,sci e} +\pgfmathprintnumber{12.345} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/number format/sci E} +The same with an uppercase `\texttt{E}'. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,sci,sci E} +\pgfmathprintnumber{12.345} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/number format/sci subscript} +Typesets the exponent as subscript for any number displayed in scientific format. This style requires very few space. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,sci,sci subscript} +\pgfmathprintnumber{12.345} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/number format/sci superscript} +Typesets the exponent as superscript for any number displayed in scientific format. This style requires very few space. + +\begin{codeexample}[] +\pgfkeys{/pgf/number format/.cd,sci,sci superscript} +\pgfmathprintnumber{12.345} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/number format/sci generic=\marg{keys}} +Allows to define an own number style for the scientific format. Here, \meta{keys} can be one of the following choices (omit the long key prefix): + +\begin{key}{/pgf/number format/sci generic/mantissa sep=\marg{text} (initially empty)} + Provides the separator between a mantissa and the exponent. It might be |\cdot|, for example, +\end{key} +\begin{key}{/pgf/number format/sci generic/exponent=\marg{text} (initially empty)} + Provides text to format the exponent. The actual exponent is available as argument |#1| (see below). +\end{key} + +\begin{codeexample}[] +\pgfkeys{ + /pgf/number format/.cd, + sci, + sci generic={mantissa sep=\times,exponent={10^{#1}}}} +\pgfmathprintnumber{12.345}; +\pgfmathprintnumber{0.00012345} +\end{codeexample} + The \meta{keys} can depend on three parameters, namely on |#1| which is the exponent, |#2| containing the flags entity of the floating point number and |#3| is the (unprocessed and unformatted) mantissa. + + Note that |sci generic| is \emph{not} suitable to modify the appearance of fixed point numbers, nor can it be used to format the mantissa (which is typeset like fixed point numbers). Use |dec sep|, |1000 sep| and |print sign| to customize the mantissa. +\end{key} + + +\begin{key}{/pgf/number format/@dec sep mark=\marg{text}} + Will be placed right before the place where a decimal separator belongs to. However, \marg{text} will be inserted even if there is no decimal separator. It is intended as place-holder for auxiliary routines to find alignment positions. + + This key should never be used to change the decimal separator! Use |dec sep| instead. +\end{key} + +\begin{key}{/pgf/number format/@sci exponent mark=\marg{text}} + Will be placed right before exponents in scientific notation. It is intended as place-holder for auxiliary routines to find alignment positions. + + This key should never be used to change the exponent! +\end{key} + +\begin{key}{/pgf/number format/assume math mode=\marg{boolean} (default true)} + Set this to |true| if you don't want any checks for math mode. The initial setting checks whether math mode is active using |\pgfutilensuremath| for each final number. + + Use |assume math mode=true| if you know that math mode is active. In that case, the final number is typeset as-is, no further checking is performed. +\end{key} + + +\begin{stylekey}{/pgf/number format/verbatim} + A style which configures the number printer to produce verbatim text output, i.e.\ it doesn't contain \TeX\ macros. +\begin{codeexample}[] +\pgfkeys{ + /pgf/fpu, + /pgf/number format/.cd, + sci, + verbatim} +\pgfmathprintnumber{12.345}; +\pgfmathprintnumber{0.00012345}; +\pgfmathparse{exp(15)} +\pgfmathprintnumber{\pgfmathresult} +\end{codeexample} + The style resets |1000 sep|, |dec sep|, |print sign|, |skip 0.| and sets |assume math mode|. Furthermore, it installs a |sci generic| format for verbatim output of scientific numbers. + + However, it will still respect |precision|, |fixed zerofill|, |sci zerofill| and the overall styles |fixed|, |sci|, |int detect| (and their variants). It might be useful if you intent to write output files. +\end{stylekey} +%-------------------------------------------------- +% \subsubsection{Defining own display styles} +% You can define own display styles, although this may require some insight into \TeX-programming. Here are two examples: +% \begin{enumerate} +% \item A new fixed point display style: The following code defines a new style named `\texttt{my own fixed point style}' which uses $1{\cdot}00$ instead of $1.00$. +% \begin{lstlisting} +% \def\myfixedpointstyleimpl#1.#2\relax{% +% #1{\cdot}#2% +% }% +% \def\myfixedpointstyle#1{% +% \pgfutilensuremath{% +% \ifpgfmathfloatroundhasperiod +% \expandafter\myfixedpointstyleimpl#1\relax +% \else +% #1% +% \fi +% }% +% } +% \pgfkeys{/my own fixed point style/.code={% +% \let\pgfmathprintnumber@fixed@style=\myfixedpointstyle} +% }% +% \end{lstlisting} +% You only need to overwrite the macro \lstinline!\pgfmathprintnumber@fixed@style!. This macro takes one argument (the result of any numerical computations). The \TeX-boolean \lstinline!\ifpgfmathfloatroundhasperiod! is true if and only if the input number contains a period. +% +% \item An example for a new scientific display style: +% \begin{lstlisting} +% % #1: +% % 0 == '0' (the number is +- 0.0), +% % 1 == '+', +% % 2 == '-', +% % 3 == 'not a number' +% % 4 == '+ infinity' +% % 5 == '- infinity' +% % #2: the mantissa +% % #3: the exponent +% \def\myscistyle#1#2e#3\relax{% +% ... +% } +% \pgfkeys{/my own sci style/.code={% +% \let\pgfmathfloatrounddisplaystyle=\myscistyle}, +% }% +% \end{lstlisting} +% \end{enumerate} +%-------------------------------------------------- diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex index 7ec64df937c..1d28cfa4fea 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex @@ -11,22 +11,20 @@ \section{Evaluating Mathematical Expressions} The easiest way of using \pgfname's mathematical engine is to provide -a mathematical expression given in the usual infix notation (such as -|1cm+4*2cm/5.5| or |2*3+3*sin(30)|). This expression can be parsed by -the mathematical engine and the result be placed in a dimension -register, a counter, or a macro. Supported are infix mathematical -operations involving integers and non-integers, with or without -units. - -It should be noted that all -calculations must not exceed $\pm16383.99999$ at \emph{any} point, -because the underlying algorithms rely on \TeX{} dimensions. This -means that many of the underlying algorithms are necessarily -approximate. It also means that some of the algorithms are not very -fast. \TeX{} is, after all, a typesetting language and not ideally -suited to relatively advanced mathematical operations. However, it is -possible to change the algorithms as described in -Section~\ref{pgfmath-reimplement}. +a mathematical expression given in familiar infix notation, for +example, |1cm+4*2cm/5.5| or |2*3+3*sin(30)|. This expression can be +parsed by the mathematical engine and the result be placed in a +dimension register, a counter, or a macro. + +It should be noted that all +calculations must not exceed $\pm16383.99999$ at \emph{any} point, +because the underlying computations rely on \TeX{} dimensions. This +means that many of the underlying computations are necessarily +approximate and that in addition, are not very fast. \TeX{} is, +after all, a typesetting language and not ideally +suited to relatively advanced mathematical operations. However, it +is possible to change the computations as described in +Section~\ref{pgfmath-reimplement}. In the present section, the high-level macros for parsing an expression are explained first, then the syntax for expression is @@ -55,136 +53,104 @@ engine is the following: \begin{itemize} \item - The result stored in the macro |\pgfmathresult| is a decimal - \emph{without units}. This is true regardless of whether the - \meta{expression} contains any unit specification. But, any units - specified will be converted to points first. -\begin{codeexample}[] -\pgfmathparse{2pt+3.4pt} \pgfmathresult -\end{codeexample} - -\begin{codeexample}[] -\pgfmathparse{2cm+3.4cm} \pgfmathresult -\end{codeexample} - - \item If no units are specified \emph{at any point} in the - expression, the result will be multiplied by the value in - |\pgfmathresultunitscale|, which can be a number or a dimension - (which will be converted to points). By default it is set to 1, - but can be changed with |\pgfmathsetresultunitscale|. Note that - the result will still be a number \emph{without} units. + The result stored in the macro |\pgfmathresult| is a decimal + \emph{without units}. This is true regardless of whether the + \meta{expression} contains any unit specification. All numbers + with units are converted to points first. -\begin{codeexample}[] -\pgfmathparse{2pt+3.4pt} \pgfmathresult -\end{codeexample} - -\begin{codeexample}[] -\pgfmathsetresultunitscale{1cm} -\pgfmathparse{2+3.4} \pgfmathresult -\end{codeexample} + \item + You can check whether an expression contained a unit using + the \TeX-if |\||ifpgfmathunitsdeclared|. After a call + of |\pgfmathparse| this if will be true exactly if some unit was + encountered in the expression. - \pgfmathsetresultunitscale{1pt} - - \item You can check whether an expression contained a unit using - the \TeX-if |\||ifpgfmathunitsdeclared|. After a call - of |\pgfmathparse| this if will be true exactly if some unit was - encountered in the expression. - - \item The parser handles numbers with or without units regardless - of the operation. + \item + The parser can recognize \TeX{} registers and box dimensions, + so |\mydimen|, |0.5\mydimen|, |\wd\mybox|, |0.5\dp\mybox|, + |\mycount\mydimen| and so on can be parsed. -\begin{codeexample}[] -\pgfmathparse{54pt/3cm*2.1} \pgfmathresult -\end{codeexample} + \item + Parenthesis can be used to change the order of the evaluation. - \item the parser can cope with \TeX{} registers, including those - preceded by |\the|. + \item + Various functions are recognized, so it is possible to parse + |sin(.5*pi r)*60|, which means ``the sine of $0.5$ times $\pi$ + radians, multiplied by 60''. The argument of functions can + be any expression. - \makeatletter + \item + Scientific notation in the form |1.234e+4| is recognized (but + the restriction on the range of values still applies). The exponent + symbol can be upper or lower case (i.e., |E| or |e|). -\begin{codeexample}[] -\pgf@x=12.34pt -\c@pgf@counta=5 -\pgfmathparse{\pgf@x+\c@pgf@counta*6} \pgfmathresult -\end{codeexample} + \item + An integer with a zero-prefix (excluding, of course zero itself), + is interpreted as an octal number and is automatically converted + to base 10. -\begin{codeexample}[] -\pgf@x=56.78pt -\pgfmathparse{\pgf@x+\the\pgf@x} \pgfmathresult -\end{codeexample} + \item + An integer with prefix |0x| or |0X| is interpreted as a hexadecimal + number and is automatically converted to base 10. Alphabetic digits + can be in uppercase or lowercase. - \item \TeX{} dimension registers can be multiplied without the |*| - operator by preceding them with a number (\emph{not} a function), - or a count register. - -\begin{codeexample}[] -\c@pgf@counta=-4 -\pgf@x=10pt -\pgfmathparse{.5\pgf@x-\c@pgf@counta\pgf@x} \pgfmathresult -\end{codeexample} + \item + An integer with prefix |0b| or |0B| is interpreted as a binary + number and is automatically converted to base 10. - \item Parenthesis can be used to group operations. + \item + An expression (or part of an expression) surrounded with double + quotes (i.e., the character |"|) will not be evaluated. + Obviously this should be used with great care. -\begin{codeexample}[] -\pgfmathparse{(4pt+0.5)*3} \pgfmathresult -\end{codeexample} +\end{itemize} - \item functions are recognized, so it is possible to parse - |sin(.5*pi r)*60|, which means ``the sine of $0.5$ times $\pi$ - radians, multiplied by 60''. The argument of most functions can - be any expression. +\end{command} -\begin{codeexample}[] -\pgfmathparse{sin(pi/2 r)*60} \pgfmathresult -\end{codeexample} - \item Scientific notation in the form |1.234e+4| is recognised (but - the restriction on the range of values still applies). The exponent - symbol can be upper or lower case (i.e., |E| or |e|). - -\begin{codeexample}[] -\pgfmathparse{1.234567891e-2} \pgfmathresult -\end{codeexample} -\begin{codeexample}[] -\pgfmathparse{1.234567891e4} \pgfmathresult -\end{codeexample} - \end{itemize} -\end{command} \begin{command}{\pgfmathqparse\marg{expression}} - This macro is similar to |\pgfmathparse|: it parses - \meta{expression} and returns the result in the macro - |\pgfmathresult|. It differs in two respects. Firstly, - |\pgfmathqparse| does not parse functions or scientific - notation. + This macro is similar to |\pgfmathparse|: it parses + \meta{expression} and returns the result in the macro + |\pgfmathresult|. It differs in two respects. Firstly, + |\pgfmathqparse| does not parse functions, scientific + notation, the prefixes for binary octal, or hexadecimal numbers, + nor does it accept the special use of |"|, |?| or |:| characters. Secondly, numbers in \meta{expression} \emph{must} - specify a \TeX{} unit (except in such instances as |0.5\pgf@x|), - which greatly simplifies the problem of parsing - of non-integers. As a result of these restrictions |\pgfmathqparse| - is about twice as fast as |\pgfmathparse|. Note that the result - will still be a number \emph{without} units. + specify a \TeX{} unit (except in such instances as |0.5\pgf@x|), + which greatly simplifies the problem of parsing real numbers. + As a result of these restrictions |\pgfmathqparse| + is about twice as fast as |\pgfmathparse|. Note that the result + will still be a number without units. \end{command} -\begin{command}{\pgfmathsetresultunitscale\marg{number or dimension}} - Sets the value in |\pgfmathresultunitscale|, which scales the result - of an expression parsed with |\pgfmathparse|, if that expression - contains no units \emph{at any point}. The argument can be an integer, - non-integer or a dimension, but the result will still be a number - \emph{without} units. Note, that this will affect |\pgfmathsetlength| - and friends, but not if the expression starts with |+| (which - switches parsing off). By default the value in - |\pgfmathresultunitscale| is 1. +\begin{command}{\pgfmathpostparse} + + At the end of the parse this command is executed, allowing some + custom action to be performed on the result of the parse. When this + command is executed the macro |\pgfmathresult| will hold the result + of the parse (as ever, without units). The result of the custom + action should be to redefined |\pgfmathresult| appropriately. + By default, this command is equivalent to |\relax|. This differs + from previous versions, where, if the parsed expression contained + no units, the result of the parse was scaled according to the value + in |\pgfmathresultunitscale| (which by default was |1|). + + This scaling can be turned on again using: + |\let\pgfmathpostparse=\pgfmathscaleresult|. + Note, however that by scaling the result, the base conversion + functions will not work, and the |"| character should not be + used to quote parts of an expression. + \end{command} Instead of the |\pgfmathparse| macro you can also wrapper commands, -whose usage is very similar to their cousins in the \calcname{} +whose usage is very similar to their cousins in the \calcname{} package. The only difference is that the expressions can be any expression that is handled by |\pgfmathparse|. - For all of the following commands, if \meta{expression} starts with |+|, no parsing is done and a simple assignment or increment is done using normal \TeX\ assignments or increments. This will be orders of -magnitude faster than calling the parser. +magnitude faster than calling the parser. \begin{command}{\pgfmathsetlength\marg{dimension register}\marg{expression}} Sets the length of the \TeX{} \meta{dimension register}, to the value @@ -193,45 +159,37 @@ magnitude faster than calling the parser. \end{command} \begin{command}{\pgfmathaddtolength\marg{dimension register}\marg{expression}} - Adds the value (in points) of \meta{expression} to the \TeX{} - \meta{dimension register}. + Adds the value (in points) of \meta{expression} to the \TeX{} + \meta{dimension register}. \end{command} \begin{command}{\pgfmathsetcount\marg{count register}\marg{expression}} - Sets the value of the \TeX{} \meta{count register}, to the - \emph{truncated} value specified by \meta{expression}. + Sets the value of the \TeX{} \meta{count register}, to the + \emph{truncated} value specified by \meta{expression}. \end{command} \begin{command}{\pgfmathaddtocount\marg{count register}\marg{expression}} - Adds the \emph{truncated} value of \meta{expression} to the \TeX{} + Adds the \emph{truncated} value of \meta{expression} to the \TeX{} \meta{count register}. \end{command} \begin{command}{\pgfmathsetcounter\marg{counter}\marg{expression}} - Sets the value of the \LaTeX{} \meta{counter}, to the \emph{truncated} - value specified by \meta{expression}. + Sets the value of the \LaTeX{} \meta{counter}, to the \emph{truncated} + value specified by \meta{expression}. \end{command} \begin{command}{\pgfmathaddtocounter\marg{counter}\marg{expression}} - Adds the \emph{truncated} value of \meta{expression} to + Adds the \emph{truncated} value of \meta{expression} to \meta{counter}. \end{command} -% \begin{command}{\pgfmathnewcounter\marg{counter}} -% This is simply a version of the \LaTeX{} macro |\newcounter|, -% implemented to maintain consistency (consistency is good, -% inconsistency is evil). Considering |\pgfmathnewcounter{foo}|, this -% creates a new count register |\c@foo|, and a macro |\thefoo|, which -% returns the value in |\c@foo|. -% \end{command} - \begin{command}{\pgfmathsetmacro\marg{macro}\marg{expression}} Defines \meta{macro} as the value of \meta{expression}. The result - is a decimal \emph{without} units. + is a decimal without units. \end{command} \begin{command}{\pgfmathsetlengthmacro\marg{macro}\marg{expression}} - Defines \meta{macro} as the value of \meta{expression} + Defines \meta{macro} as the value of \meta{expression} \LaTeX{}\emph{in points}. \end{command} @@ -241,200 +199,351 @@ magnitude faster than calling the parser. -\subsection{Syntax for mathematical expressions} +\section{Syntax for mathematical expressions} \label{pgfmath-syntax} -The syntax for the expressions recognized by |\pgfmathparse| and -friends is straightfoward, and the following operations and -functions are currently recognized: + The syntax for the expressions recognized by |\pgfmathparse| and + friends is straightforward, and the following sections describe the + operators and functions that are recognized by default. -\begin{math-operator}{\mvar{x}\ +\ \mvar{y}} - Adds \mvar{y} to \mvar{x}. - -\begin{codeexample}[] -\pgfmathparse{4+2pt} \pgfmathresult -\end{codeexample} +\subsection{Operators} + +\label{pgfmath-operators} + + The following operators (presented in the context in which they are used) + are recognized: + +\begin{math-operator}{+}{infix}{add} + Adds \mvar{x} to \mvar{y}. \end{math-operator} -\begin{math-operator}{\mvar{x}\ -\ \mvar{y}} - Subtracts \mvar{y} from \mvar{x}. - -\begin{codeexample}[] -\pgfmathparse{155.35-4cm} \pgfmathresult -\end{codeexample} +\begin{math-operator}{-}{infix}{subtract} + Subtracts \mvar{y} from \mvar{x}. \end{math-operator} -\begin{math-operator}{\mvar{x}\ *\ \mvar{y}} - Multiplies \mvar{x} by \mvar{y}. - -\begin{codeexample}[] -\pgfmathparse{3.9pt*4.56} \pgfmathresult -\end{codeexample} +\begin{math-operator}{-}{prefix}{neg} + Reverses the sign of \mvar{x}. \end{math-operator} -\begin{math-operator}{\mvar{x}\ /\ \mvar{y}} - Divides \mvar{x} by \mvar{y}. - -\begin{codeexample}[] -\pgfmathparse{-31.6pt/17} \pgfmathresult -\end{codeexample} +\begin{math-operator}{*}{infix}{multiply} + Multiples \mvar{x} by \mvar{y}. \end{math-operator} -\begin{math-operator}{\mvar{x}\ {\char94}\ \mvar{y}} -Raises \mvar{x} to the power \mvar{y}. For greatest accuracy \mvar{y} -should be an integer. If \mvar{y} is not an integer the actual -calculation will be an approximation of $e^{y\ln(x)}$. +\begin{math-operator}{/}{infix}{divide} + Divides \mvar{x} by \mvar{y}. An error will result if \mvar{y} is 0, + or if the result of the division is too big for the mathematical + engine. Please remember when using this command that accurate (and + reasonably quick) division of real numbers that are not integers + is particularly tricky in \TeX. +\end{math-operator} -{ -\catcode`\^=7 +\begin{math-operator}{\char`\^}{infix}{pow} + Raises \mvar{x} to the power \mvar{y}. +\end{math-operator} -\begin{codeexample}[] -\pgfmathparse{2.3^4} \pgfmathresult -\end{codeexample} +\begin{math-operator}{!}{postfix}{factorial} + Calculates the factorial of \mvar{x}. +\end{math-operator} -\begin{codeexample}[] -\pgfmathparse{2^-4} \pgfmathresult -\end{codeexample} +\begin{math-operator}{r}{postfix}{deg} + Converts \mvar{x} to degrees (\mvar{x} is assumed to be in radians). + This operator has the same precedence as multiplication. +\end{math-operator} + +\begin{math-operators}{?}{:}{conditional}{ifthenelse} + + |?| and |:| are special operators which can be used as a shorthand + for |if| \mvar{x} |then| \mvar{y} |else| \mvar{z} inside the parser. + The expression \mvar{x} is taken to be true if it evaluates to any + non-zero value. + +\end{math-operators} + +\begin{math-operator}{==}{infix}{equal} + Returns |1| if \mvar{x}$=$\mvar{y}, |0| otherwise. +\end{math-operator} + +\begin{math-operator}{>}{infix}{greater} + Returns |1| if \mvar{x}$>$\mvar{y}, |0| otherwise. +\end{math-operator} + +\begin{math-operator}{<}{infix}{less} + Returns |1| if \mvar{x}$<$\mvar{y}, |0| otherwise. +\end{math-operator} + +\begin{math-operator}{!=}{infix}{notequal} + Returns |1| if \mvar{x}$\neq$\mvar{y}, |0| otherwise. +\end{math-operator} + +\begin{math-operator}{>=}{infix}{notless} + Returns |1| if \mvar{x}$\geq$\mvar{y}, |0| otherwise. +\end{math-operator} + +\begin{math-operator}{<=}{infix}{notgreater} + Returns |1| if \mvar{x}$\leq$\mvar{y}, |0| otherwise. +\end{math-operator} + +\begin{math-operator}{{\char`\&}{\char`\&}}{infix}{and} + Returns |1| if both \mvar{x} and \mvar{y} evaluate to some + non-zero value. Both arguments are evaluated. +\end{math-operator} + + + +{ + \catcode`\|=12 +\begin{math-operator}[no index]{||}{infix}{or} + \index{*pgfmanualvbarvbarr@\protect\texttt{\protect\pgfmanualvbarvbar} math operator}% + \index{Math operators!*pgfmanualvbarvbar@\protect\texttt{\protect\pgfmanualvbarvbar}}% + Returns {\tt 1} if either \mvar{x} or \mvar{y} evaluate to some + non-zero value. +\end{math-operator} } + +\begin{math-operator}{!}{prefix}{not} + Returns |1| if \mvar{x} evaluates to zero, |0| otherwise. \end{math-operator} -\begin{math-operator}{\mvar{x}\ ==\ \mvar{y}} - This evaluates to |1| if \mvar{x} equals \mvar{y}, or |0| if \mvar{x} - does not equal \mvar{y}. - Note that equalities (and inequalities) are evaluated left to right, - and are only evaluated when another equality (or inequality) operator - is scanned, or the end of the current group or parse is reached. So - |5+4==3+2==9| results in |0| because |5+4| does not equal |3+2|, - resulting in zero, and the second equality is therefore evaluating - |0==9|. +\begin{math-operators}{(}{)}{group}{} + +These operators act in the usual way, that is, to control the order +in which operators are executed, for example, |(1+2)*3|. This +includes the grouping of arguments for functions, for example, +|sin(30*10)| or |mod(72,3)| (the comma character is also treated +as an operator). + +Parentheses for functions with one argument are not always +necessary, |sin 30| (note the space) is the same as |sin(30)|. +However, functions have the highest precedence so, |sin 30*10| +is the same as |sin(30)*10|. + +\end{math-operators} + + +\begin{math-operators}{\char`\{}{\char`\}}{array}{} + +These operators are used to process array-like structures (within an +expression these characters do not act like \TeX{} grouping tokens). +The \meta{array specification} consists of comma separated elements, +for example, |{1, 2, 3, 4, 5}|. Each element in the array will be +evaluated as it is parsed, so expressions can be used. +In addition, an element of an array can be an array itself, +allowing multiple dimension arrays to be simulated: +|{1, {2,3}, {4,5}, 6}|. +When storing an array in a macro, do not forget the surrounding +braces: |\def\myarray{{1,2,3}}| not |\def\myarray{1,2,3}|. \begin{codeexample}[] -\pgfmathparse{3*5==15} \pgfmathresult +\def\myarray{{1,"two",2+1,"IV","cinq","sechs",sin(\i*5)*14}} +\foreach \i in {0,...,6}{\pgfmathparse{\myarray[\i]}\pgfmathresult, } \end{codeexample} -\end{math-operator} +\end{math-operators} +\begin{math-operators}{\char`\[}{\char`\]}{array access}{array} -\begin{math-operator}{\mvar{x}\ >\ \mvar{y}} +|[| and |]| are two operators used in one particular circumstance: to +access an array (specified using the |{| and |}| operators) +using the index \mvar{x}. Indexing starts from zero, +so, if the index is greater than, or equal to, the number of values in +the array, an error will occur, and zero will be returned. - This evaluates to |1| if \mvar{x} is greater than \mvar{y}, or |0| if - \mvar{x} is smaller or equal to \mvar{y}. - \begin{codeexample}[] -\pgfmathparse{17>4.2*1.97+4} \pgfmathresult +\def\myarray{{7,-3,4,-9,11}} +\pgfmathparse{\myarray[3]} \pgfmathresult \end{codeexample} -\end{math-operator} +If the array is defined to have multiple dimensions then the array +access operators can be immediately repeated. -\begin{math-operator}{\mvar{x}\ <\ \mvar{y}} - - This evaluates to |1| if \mvar{x} is smaller than \mvar{y}, or |0| if - \mvar{x} is greater or equal to \mvar{y}. - \begin{codeexample}[] -\pgfmathparse{2<-5.2/-3.6-2} \pgfmathresult +\def\print#1{\pgfmathparse{#1}\pgfmathresult} +\def\identitymatrix{{{1,0,0},{0,1,0},{0,0,1}}} +\tikz[x=0.5cm,y=0.5cm]\foreach \i in {0,1,2} \foreach \j in {0,1,2} + \node at (\j,-\i) [anchor=base] {\print{\identitymatrix[\i][\j]}}; \end{codeexample} -\end{math-operator} +\end{math-operators} -\begin{math-function}{mod(\mvar{x},\mvar{y})} - This evaluates \mvar{x} modulo \mvar{y} (using truncated division). - This function cannot be nested inside itself or the functions |max|, - |min| or |pow|. + +\begin{math-operators}{"}{"}{group}{} + +These operators are used to quote \mvar{x}. However, as every +expression is expanded with |\edef| before it is parsed, macros +(e.g., font commands like |\tt| or |\Huge|) may need to be +``protected'' from this expansion (e.g., |\noexpand\Huge|). Ideally, +you should avoid such macros anyway. +Obviously, these operators should be used with great care as further +calculations are unlikely to be possible with the result. \begin{codeexample}[] -\pgfmathparse{mod(20,6)} \pgfmathresult +\def\x{5} +\foreach \y in {0,10}{ + \pgfmathparse{\x > \y ? "\noexpand\Large Bigger" : "\noexpand\tiny smaller"} + \x\ is \pgfmathresult\ than \y. +} \end{codeexample} -\end{math-function} +\end{math-operators} + + + + +\subsection{Functions} + +\label{pgfmath-functions} + +The following functions are recognized: + +\medskip +\def\mathlink#1{\hyperlink{math:#1}{\tt#1}} +\begin{tikzpicture} +\foreach \f [count=\i from 0] in +{abs,acos,add,and,array,asin,atan,atan2,bin,ceil,cos, + cosec,cosh,cot,deg,depth,div,divide,e,equal,factorial, false, + floor,frac,greater,height,hex,Hex,int,ifthenelse, + less,ln,log10,log2,max,min,mod,Mod,multiply, + neg,not,notequal,notgreater,notless, + oct,or,pi,pow,rad,rand,random,real,rnd,round, + sec,sin,sinh,sqrt,subtract,tan,tanh,true, veclen,width} +\node [anchor=base west] at ({int(\i/11)*2.5cm},{-mod(\i,11)*1.1*\baselineskip}) {\mathlink{\f}}; +\end{tikzpicture} +\bigskip + -\begin{math-function}{max(\mvar{x},\mvar{y})} - This evaluates to the maximum of \mvar{x} or \mvar{y}. This function - cannot be nested inside itself or the functions |min|, |mod| or - |pow|. +Each function has a \pgfname{} command associated with it (which is +also shown with the function below). In general the command +is simply the name of the function prefixed with |\pgfmath|, for +example, |\pgfmathadd|, but there are some notable exceptions. + +\subsubsection{Basic arithmetic functions} + +\label{pgfmath-functions-basic} + +\begin{math-function}{add(\mvar{x},\mvar{y})} +\mathcommand + + Adds $x$ and $y$. \begin{codeexample}[] -\pgfmathparse{max(17,23)} \pgfmathresult +\pgfmathparse{add(75,6)} \pgfmathresult \end{codeexample} - \end{math-function} -\begin{math-function}{min(\mvar{x},\mvar{y})} - This evaluates to the minimum of \mvar{x} or \mvar{y}. This function - cannot be nested inside itself or the functions |max|, |mod| or - |pow|. +\begin{math-function}{subtract(\mvar{x},\mvar{y})} +\mathcommand + + Subtract $x$ from $y$. \begin{codeexample}[] -\pgfmathparse{min(17,23)} \pgfmathresult +\pgfmathparse{subtract(75,6)} \pgfmathresult \end{codeexample} - \end{math-function} -\begin{math-function}{abs(\mvar{x})} +\begin{math-function}{neg(\mvar{x})} +\mathcommand - Evaluates the absolute value of $x$. + This returns $-\mvar{x}$. \begin{codeexample}[] -\pgfmathparse{abs(-5)} \pgfmathresult +\pgfmathparse{neg(50)} \pgfmathresult \end{codeexample} +\end{math-function} + +\begin{math-function}{multiply(\mvar{x},\mvar{y})} +\mathcommand + + Multiply $x$ by $y$. + \begin{codeexample}[] -\pgfmathparse{-abs(4*-3)} \pgfmathresult +\pgfmathparse{multiply(75,6)} \pgfmathresult \end{codeexample} +\end{math-function} +\begin{math-function}{divide(\mvar{x},\mvar{y})} +\mathcommand + + Divide $x$ by $y$. + +\begin{codeexample}[] +\pgfmathparse{divide(75,6)} \pgfmathresult +\end{codeexample} \end{math-function} -\begin{math-function}{round(\mvar{x})} +\begin{math-function}{div(\mvar{x},\mvar{y})} +\mathcommand - Rounds \mvar{x} to the nearest integer. It uses ``asymmetric half-up'' - rounding. So |1.5| is rounded to |2|, but |-1.5| is rounded to |-2| - (\emph{not} |0|). + Divide $x$ by $y$ and round to the nearest integer \begin{codeexample}[] -\pgfmathparse{round(32.5/17)} \pgfmathresult +\pgfmathparse{div(75,9)} \pgfmathresult \end{codeexample} +\end{math-function} + +\begin{math-function}{factorial(\mvar{x})} +\mathcommand + + Return \mvar{x}!. \begin{codeexample}[] -\pgfmathparse{round(398/12)} \pgfmathresult +\pgfmathparse{factorial(5)} \pgfmathresult \end{codeexample} \end{math-function} -\begin{math-function}{floor(\mvar{x})} +\begin{math-function}{sqrt(\mvar{x})} +\mathcommand + + Calculates $\sqrt{\textrm{\mvar{x}}}$. - Rounds \mvar{x} down to the nearest integer. - \begin{codeexample}[] -\pgfmathparse{floor(32.5/17)} \pgfmathresult +\pgfmathparse{sqrt(10)} \pgfmathresult \end{codeexample} \begin{codeexample}[] -\pgfmathparse{floor(398/12)} \pgfmathresult +\pgfmathparse{sqrt(8765.432)} \pgfmathresult \end{codeexample} \end{math-function} -\begin{math-function}{ceil(\mvar{x})} +\begin{math-function}{pow(\mvar{x},\mvar{y})} +\mathcommand - Rounds \mvar{x} up to the nearest integer. + Raises \mvar{x} to the power \mvar{y}. For greatest accuracy + \mvar{y} should be an integer. If \mvar{y} is not an integer + the actual calculation will be an approximation of $e^{yln(x)}$. \begin{codeexample}[] -\pgfmathparse{ceil(32.5/17)} \pgfmathresult +\pgfmathparse{pow(2,7)} \pgfmathresult \end{codeexample} +\end{math-function} + + +\begin{math-function}{e} +\mathcommand + + Returns the value 2.718281828. +{ +\catcode`\^=7 + \begin{codeexample}[] -\pgfmathparse{ceil(398/12)} \pgfmathresult +\pgfmathparse{(e^2-e^-2)/2} \pgfmathresult \end{codeexample} +} \end{math-function} \begin{math-function}{exp(\mvar{x})} +\mathcommand + { \catcode`\^=7 - Maclaurin series for $e^x$. + Maclaurin series for $e^x$. } \begin{codeexample}[] \pgfmathparse{exp(1)} \pgfmathresult @@ -448,10 +557,14 @@ calculation will be an approximation of $e^{y\ln(x)}$. \begin{math-function}{ln(\mvar{x})} +\mathcommand + { \catcode`\^=7 - An approximation for for $\ln(\textrm{\mvar{x}})$. + An approximation for $\ln(\textrm{\mvar{x}})$. + This uses an algorithm due to Rouben Rostamian, and coefficients + suggested by Alain Matthes. } \begin{codeexample}[] \pgfmathparse{ln(10)} \pgfmathresult @@ -463,77 +576,183 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} -\begin{math-function}{pow(\mvar{x},\mvar{y})} +\begin{math-function}{log10(\mvar{x})} +\mathcommand[logten(\mvar{x})] - Raises \mvar{x} to the power \mvar{y}. + An approximation for $\log_{10}(\textrm{\mvar{x}})$. \begin{codeexample}[] -\pgfmathparse{pow(2,7)} \pgfmathresult +\pgfmathparse{log10(100)} \pgfmathresult \end{codeexample} \end{math-function} -\begin{math-function}{sqrt(\mvar{x})} +\begin{math-function}{log2(\mvar{x})} +\mathcommand[logtwo(\mvar{x})] - Calculates $\sqrt{\textrm{\mvar{x}}}$. + An approximation for $\log_2(\textrm{\mvar{x}})$. \begin{codeexample}[] -\pgfmathparse{sqrt(10)} \pgfmathresult +\pgfmathparse{log2(128)} \pgfmathresult \end{codeexample} +\end{math-function} + +\begin{math-function}{abs(\mvar{x})} +\mathcommand + + Evaluates the absolute value of $x$. + \begin{codeexample}[] -\pgfmathparse{sqrt(8765.432)} \pgfmathresult +\pgfmathparse{abs(-5)} \pgfmathresult \end{codeexample} +\begin{codeexample}[] +\pgfmathparse{-abs(4*-3)} \pgfmathresult +\end{codeexample} \end{math-function} -\begin{math-function}{veclen(\mvar{x},\mvar{y})} +\begin{math-function}{mod(\mvar{x},\mvar{y})} +\mathcommand - Calculates $\sqrt{\left(\textrm{\mvar{x}}^2+\textrm{\mvar{y}}^2\right)}$. + This evaluates \mvar{x} modulo \mvar{y}, using truncated division. + The sign of the result is the same as the sign of + $\frac{\textrm{\mvar{x}}}{\textrm{\mvar{y}}}$. \begin{codeexample}[] -\pgfmathparse{veclen(12,5)} \pgfmathresult +\pgfmathparse{mod(20,6)} \pgfmathresult +\end{codeexample} + +\begin{codeexample}[] +\pgfmathparse{mod(-100,30)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{Mod(\mvar{x},\mvar{y})} +\mathcommand + + This evaluates \mvar{x} modulo \mvar{y}, using floored division. + The sign of the result is never negative. + +\begin{codeexample}[] +\pgfmathparse{Mod(-100,30)} \pgfmathresult +\end{codeexample} + +\end{math-function} + + + + + +\subsubsection{Rounding functions} + +\label{pgfmath-functions-rounding} + +\begin{math-function}{round(\mvar{x})} +\mathcommand + + Rounds \mvar{x} to the nearest integer. It uses ``asymmetric half-up'' + rounding. So |1.5| is rounded to |2|, but |-1.5| is rounded to |-2| + (\emph{not} |1|). + +\begin{codeexample}[] +\pgfmathparse{round(32.5/17)} \pgfmathresult +\end{codeexample} + +\begin{codeexample}[] +\pgfmathparse{round(398/12)} \pgfmathresult \end{codeexample} \end{math-function} -\begin{math-constant}{pi} +\begin{math-function}{floor(\mvar{x})} +\mathcommand - The constant $\pi=3.14159$. + Rounds \mvar{x} down to the nearest integer. \begin{codeexample}[] -\pgfmathparse{pi} \pgfmathresult +\pgfmathparse{floor(32.5/17)} \pgfmathresult \end{codeexample} \begin{codeexample}[] -\pgfmathparse{pi r} \pgfmathresult +\pgfmathparse{floor(398/12)} \pgfmathresult \end{codeexample} -\end{math-constant} +\end{math-function} -\begin{math-operator}{\mvar{x}\ r} +\begin{math-function}{ceil(\mvar{x})} +\mathcommand - This converts \mvar{x} from radians to degrees. Note that |r| will - evaluate any preceding series of multiplication or division - \emph{before} conversion, but not other operations. So |3*4/6r| - converts 2 radians to degrees, but |3-4+6r|, converts 6 radians to - degrees and adds the result to |-1|. + Rounds \mvar{x} up to the nearest integer. \begin{codeexample}[] -\pgfmathparse{2*pi r-pi r} \pgfmathresult +\pgfmathparse{ceil(32.5/17)} \pgfmathresult \end{codeexample} \begin{codeexample}[] -\pgfmathparse{2*pi/8 r} \pgfmathresult +\pgfmathparse{ceil(398/12)} \pgfmathresult \end{codeexample} +\end{math-function} + +\begin{math-function}{int(\mvar{x})} +\mathcommand + + Returns the integer part of \mvar{x}. + \begin{codeexample}[] -\pgfmathparse{sin(3*pi/2r)*60} \pgfmathresult +\pgfmathparse{int(32.5/17)} \pgfmathresult \end{codeexample} -\end{math-operator} +\end{math-function} + +\begin{math-function}{frac(\mvar{x})} +\mathcommand + + Returns the fractional part of \mvar{x}. + +\begin{codeexample}[] +\pgfmathparse{frac(32.5/17)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{real(\mvar{x})} +\mathcommand + + Ensures \mvar{x} contains a decimal point. + +\begin{codeexample}[] +\pgfmathparse{real(4)} \pgfmathresult +\end{codeexample} + +\end{math-function} + + + + +\subsubsection{Trigonometric functions} + +\label{pgfmath-functions-trigonometric} + +\begin{math-function}{pi} +\mathcommand + + Returns the value $\pi=3.141592654$. + +\begin{codeexample}[] +\pgfmathparse{pi} \pgfmathresult +\end{codeexample} + +\begin{codeexample}[] +\pgfmathparse{pi r} \pgfmathresult +\end{codeexample} + +\end{math-function} \begin{math-function}{rad(\mvar{x})} +\mathcommand Convert \mvar{x} to radians. \mvar{x} is assumed to be in degrees. @@ -544,6 +763,7 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} \begin{math-function}{deg(\mvar{x})} +\mathcommand Convert \mvar{x} to degrees. \mvar{x} is assumed to be in radians. @@ -554,8 +774,9 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} \begin{math-function}{sin(\mvar{x})} +\mathcommand - Sine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in + Sine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in radians. \begin{codeexample}[] @@ -563,14 +784,15 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{codeexample} \begin{codeexample}[] -\pgfmathparse{sin(pi/3 r)} +\pgfmathparse{sin(pi/3 r)} \pgfmathresult \end{codeexample} \end{math-function} \begin{math-function}{cos(\mvar{x})} +\mathcommand - Cosine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in + Cosine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in radians. \begin{codeexample}[] @@ -584,8 +806,9 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} \begin{math-function}{tan(\mvar{x})} +\mathcommand - Tangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in + Tangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in radians. \begin{codeexample}[] @@ -600,8 +823,9 @@ calculation will be an approximation of $e^{y\ln(x)}$. \begin{math-function}{sec(\mvar{x})} +\mathcommand - Secant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in + Secant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in radians. \begin{codeexample}[] @@ -611,8 +835,9 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} \begin{math-function}{cosec(\mvar{x})} +\mathcommand - Cosecant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in + Cosecant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in radians. \begin{codeexample}[] @@ -622,8 +847,9 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} \begin{math-function}{cot(\mvar{x})} +\mathcommand - Cotangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in + Cotangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in radians. \begin{codeexample}[] @@ -633,6 +859,7 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} \begin{math-function}{asin(\mvar{x})} +\mathcommand Arcsine of \mvar{x}. The result is in degrees and in the range $\pm90^\circ$. @@ -643,9 +870,9 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} \begin{math-function}{acos(\mvar{x})} +\mathcommand - Arccosine of \mvar{x} in degrees. The result is in the range $\pm90^\circ$. - + Arccosine of \mvar{x} in degrees. The result is in the range $[0^\circ,180^\circ]$. \begin{codeexample}[] \pgfmathparse{acos(0.5)} \pgfmathresult @@ -654,8 +881,9 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} \begin{math-function}{atan(\mvar{x})} +\mathcommand - Arctangent of $x$ in degrees. + Arctangent of $x$ in degrees. \begin{codeexample}[] \pgfmathparse{atan(1)} \pgfmathresult @@ -663,34 +891,392 @@ calculation will be an approximation of $e^{y\ln(x)}$. \end{math-function} -\begin{math-function}{rnd} +\begin{math-function}{atan2(\mvar{x},\mvar{y})} +\mathcommand[atantwo(\mvar{x},\mvar{y})] - Generates a pseudo-random number between 0 and 1. + Arctangent of $y\div x$ in degrees. This also takes into account the + quadrants. + +\begin{codeexample}[] +\pgfmathparse{atan2(-4,3)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\subsubsection{Comparison and logical functions} + +\label{pgfmath-functions-comparison} + +\begin{math-function}{equal(\mvar{x},\mvar{y})} +\mathcommand + + This returns |1| if $\mvar{x}=\mvar{y}$ and |0| otherwise. + +\begin{codeexample}[] +\pgfmathparse{equal(20,20)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{greater(\mvar{x},\mvar{y})} +\mathcommand + + This returns |1| if $\mvar{x}>\mvar{y}$ and |0| otherwise. + +\begin{codeexample}[] +\pgfmathparse{greater(20,25)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{less(\mvar{x},\mvar{y})} +\mathcommand + + This returns |1| if $\mvar{x}<\mvar{y}$ and |0| otherwise. + +\begin{codeexample}[] +\pgfmathparse{greater(20,25)} \pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{notequal(\mvar{x},\mvar{y})} +\mathcommand + + This returns |0| if $\mvar{x}=\mvar{y}$ and |1| otherwise. + +\begin{codeexample}[] +\pgfmathparse{notequal(20,25)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{notgreater(\mvar{x},\mvar{y})} +\mathcommand + + This returns |1| if $\mvar{x}\leq\mvar{y}$ and |0| otherwise. + +\begin{codeexample}[] +\pgfmathparse{notgreater(20,25)} \pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{notless(\mvar{x},\mvar{y})} +\mathcommand + + This returns |1| if $\mvar{x}\geq\mvar{y}$ and |0| otherwise. + +\begin{codeexample}[] +\pgfmathparse{notless(20,25)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{and(\mvar{x},\mvar{y})} +\mathcommand + This returns |1| if \mvar{x} and \mvar{y} both evaluate to + non-zero values. Otherwise |0| is returned. + \begin{codeexample}[] -\pgfmathparse{rnd} \pgfmathresult +\pgfmathparse{and(5>4,6>7)} \pgfmathresult \end{codeexample} +\end{math-function} + +\begin{math-function}{or(\mvar{x},\mvar{y})} +\mathcommand + + This returns |1| if either \mvar{x} or \mvar{y} evaluate to + non-zero values. Otherwise |0| is returned. + \begin{codeexample}[] -\pgfmathparse{2*rnd} \pgfmathresult +\pgfmathparse{and(5>4,6>7)} \pgfmathresult \end{codeexample} +\end{math-function} + +\begin{math-function}{not(\mvar{x})} +\mathcommand + + This returns |1| if $\mvar{x}=0$, otherwise |0|. + \begin{codeexample}[] -\pgfmathparse{-rnd+5} \pgfmathresult +\pgfmathparse{not(true)} \pgfmathresult +\end{codeexample} + +\end{math-function} + + +\begin{math-function}{ifthenelse(\mvar{x},\mvar{y},\mvar{z})} +\mathcommand + + This returns \mvar{y} if \mvar{x} evaluates to some non-zero value, + otherwise \mvar{z} is returned. + +\begin{codeexample}[] +\pgfmathparse{ifthenelse(5==4,"yes","no")} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{true} +\mathcommand + + This evaluates to |1|. + +\begin{codeexample}[] +\pgfmathparse{true ? "yes" : "no"} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{false} +\mathcommand + + This evaluates to |0|. + +\begin{codeexample}[] +\pgfmathparse{false ? "yes" : "no"} \pgfmathresult +\end{codeexample} + +\end{math-function} + + + +\subsubsection{Pseudo-random functions} + +\label{pgfmath-functions-random} + +\begin{math-function}{rnd} +\mathcommand + + Generates a pseudo-random number between 0 and 1. + +\begin{codeexample}[] +\foreach \x in {1,...,10}{\pgfmathparse{rnd}\pgfmathresult, } \end{codeexample} \end{math-function} \begin{math-function}{rand} +\mathcommand Generates a pseudo-random number between -1 and 1. \begin{codeexample}[] -\pgfmathparse{rand} \pgfmathresult +\foreach \x in {1,...,10}{\pgfmathparse{rand}\pgfmathresult, } +\end{codeexample} + +\end{math-function} + +\begin{math-function}{random(\opt{\mvar{x},\mvar{y}})} +\mathcommand + This function takes zero, one or two arguments. If there are zero + arguments, a random number between 0 and 1 is generated. If there is + one argument \mvar{x}, a random integer between 1 and \mvar{x} is + generated. Finally, if there are two arguments, a random integer + between \mvar{x} and \mvar{y} is generated. If there are no + arguments the \pgfname{} command should be called as follows: + |\pgfmathrandom{}|. + +\begin{codeexample}[] +\foreach \x in {1,...,10}{\pgfmathparse{random()}\pgfmathresult, } +\end{codeexample} + +\begin{codeexample}[] +\foreach \x in {1,...,10}{\pgfmathparse{random(100)}\pgfmathresult, } +\end{codeexample} + +\begin{codeexample}[] +\foreach \x in {1,...,10}{\pgfmathparse{random(232,762)}\pgfmathresult, } \end{codeexample} +\end{math-function} + +\subsubsection{Base conversion functions} + +\label{pgfmath-functions-base} +\begin{math-function}{hex(\mvar{x})} +\mathcommand + + Convert \mvar{x}{} (assumed to be an integer in base 10) to a + hexadecimal representation, using lower case alphabetic digits. + No further calculation will be possible with the result. + \begin{codeexample}[] -\pgfmathparse{rand*15} \pgfmathresult -\end{codeexample} +\pgfmathparse{hex(65535)} \pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{Hex(\mvar{x})} +\mathcommand + + Convert \mvar{x}{} (assumed to be an integer in base 10) to a + hexadecimal representation, using upper case alphabetic digits. + No further calculation will be possible with the result. + +\begin{codeexample}[] +\pgfmathparse{Hex(65535)} \pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{oct(\mvar{x})} +\mathcommand + Convert \mvar{x}{} (assumed to be an integer in base 10) to a + octal representation. + No further calculation should be attempted with the result, as + the parser can only process numbers converted to base 10. +\begin{codeexample}[] +\pgfmathparse{oct(63)} \pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{bin(\mvar{x})} +\mathcommand + + Convert \mvar{x}{} (assumed to be an integer in base 10) to a + binary representation. + No further calculation should be attempted with the result, as + the parser can only process numbers converted to base 10. + +\begin{codeexample}[] +\pgfmathparse{bin(185)} \pgfmathresult +\end{codeexample} +\end{math-function} + +\subsubsection{Miscellaneous functions} + +\label{pgfmath-functions-misc} + +\begin{math-function}{min(\mvar{x$_1$},\mvar{x$_2$},\ldots,\mvar{x$_n$})} +\mathcommand[min({\mvar{x$_1$},\mvar{x$_2$},\ldots},{\ldots,\mvar{x$_{n-1}$},\mvar{x$_n$}})] + + Return the minimum value from \mvar{x$_1$}\ldots\mvar{x$_n$}. + For historical reasons, the command |\pgfmathmin| takes two + arguments, but each of these can contain an arbitrary number + of comma separated values. + +\begin{codeexample}[] +\pgfmathparse{min(3,4,-2,250,-8,100)} \pgfmathresult +\end{codeexample} + +\end{math-function} + + +\begin{math-function}{max(\mvar{x$_1$},\mvar{x$_2$},\ldots,\mvar{x$_n$})} +\mathcommand[max({\mvar{x$_1$},\mvar{x$_2$},\ldots},{\ldots,\mvar{x$_{n-1}$},\mvar{x$_n$}})] + + Return the maximum value from \mvar{x$_1$}\ldots\mvar{x$_n$}. + Again, for historical reasons, the command |\pgfmathmax| takes two + arguments, but each of these can contain an arbitrary number + of comma separated values. + +\begin{codeexample}[] +\pgfmathparse{max(3,4,-2,250,-8,100)} \pgfmathresult +\end{codeexample} + +\end{math-function} + + +\begin{math-function}{veclen(\mvar{x},\mvar{y})} +\mathcommand + + Calculates $\sqrt{\left(\textrm{\mvar{x}}^2+\textrm{\mvar{y}}^2\right)}$. + This uses a polynomial approximation, based on ideas due + to Rouben Rostamian +\begin{codeexample}[] +\pgfmathparse{veclen(12,5)} \pgfmathresult +\end{codeexample} + +\end{math-function} + + + + + +\begin{math-function}{array(\mvar{x},\mvar{y})} +\mathcommand + + This accesses the array \mvar{x} at the index \mvar{y}. The + array must begin and end with braces (e.g., |{1,2,3,4}|) and + array indexing starts at |0|. + +\begin{codeexample}[] +\pgfmathparse{array({9,13,17,21},2)} \pgfmathresult +\end{codeexample} + +\end{math-function} + + +The following hyperbolic functions were adapted from code +suggested by Martin Heller: + +\begin{math-function}{sinh(\mvar{x})} +\mathcommand + + The hyperbolic sine of \mvar{x}% + +\begin{codeexample}[] +\pgfmathparse{sinh(0.5)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{cosh(\mvar{x})} +\mathcommand + + The hyperbolic cosine of \mvar{x}% + +\begin{codeexample}[] +\pgfmathparse{cosh(0.5)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{tanh(\mvar{x})} +\mathcommand + + The hyperbolic tangent of \mvar{x}% + +\begin{codeexample}[] +\pgfmathparse{tanh(0.5)} \pgfmathresult +\end{codeexample} + +\end{math-function} + +\begin{math-function}{width("\mvar{x}")} +\mathcommand + + Return the width of a \TeX{} (horizontal) box containing \mvar{x}. + The quote characters are necessary to prevent \mvar{x}{} being + parsed. + It is important to remember that any expression is expanded with + |\edef| before being parsed, so any macros (e.g., font commands + like |\tt| or |\Huge|) will need to be ``protected'' (e.g., + |\noexpand\Huge| is usually sufficient). + +\begin{codeexample}[] +\pgfmathparse{width("Some Lovely Text")} \pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{height("\mvar{x}")} +\mathcommand + + Return the height of a box containing \mvar{x}. + +\begin{codeexample}[] +\pgfmathparse{height("Some Lovely Text")} \pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{depth("\mvar{x}")} +\mathcommand + + Returns the depth of a box containing \mvar{x}. + +\begin{codeexample}[] +\pgfmathparse{depth("Some Lovely Text")} \pgfmathresult +\end{codeexample} \end{math-function} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex new file mode 100644 index 00000000000..8668d69ad24 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex @@ -0,0 +1,96 @@ +% Copyright 2008 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + + +\section{Parser Module} + +\label{section-module-parser} + +\begin{pgfmodule}{parser} + This module defines some commands for creating a simple + letter-by-letter parser. +\end{pgfmodule} + +This module provides commands for defining a parser that scans some +given text letter-by-letter. For each letter, some code is executed +and, possible, a state-switch occurs. The parsing process ends when a +final state has been reached. + +\begin{command}{\pgfparserparse\marg{parser name}\meta{text}} + This command is used to parse the \meta{text} using the (previously + defined) parser named \meta{parser name}. + + The \meta{text} is not contained in curly braces, rather it is all + the text that follows. The end of the text is determined implicitly, + namely when the final state of the parser has been reached. + + The parser works as follows: At any moment, it is in a certain + \emph{state}, initially this state is called |initial|. Then, the + first letter of the \meta{text} is examined (using the |\futurlet| + command). For each possible state and each possible letter, some + action code is stored in the parser in a table. This code is then + executed. This code may, but need not, trigger a \emph{state + switch}, causing a new state to be set. The parser then moves on + to the next character of the text and repeats the whole + procedure, unless it is in the state |final|, which causes the + parsing process to stop immediately. + + In the following example, the parser counts the number of |a|'s + in the \text{text}, ignoring any |b|'s. The \meta{text} ends with + the first~|c|. +\begin{codeexample}[] +\newcount\mycount +\pgfparserdef{myparser}{initial}{the letter a} +{\advance\mycount by 1\relax} +\pgfparserdef{myparser}{initial}{the letter b} +{} % do nothing +\pgfparserdef{myparser}{initial}{the letter c} +{\pgfparserswitch{final}}% done! + +\pgfparserparse{myparser}aabaabababbbbbabaabcccc +There are \the\mycount\ a's. +\end{codeexample} +\end{command} + +\begin{command}{\pgfparserdef\marg{parser name}\marg{state}\marg{symbol meaning}\marg{action}} + This command should be used repeatedly to define a parser named + \meta{parser name}. With a call to this command you specify that the + \meta{parser name} should do the following: When it is in state + \meta{state} and reads the letter \meta{symbol meaning}, perform the + code stored in \meta{action}. + + The \meta{symbol meaning} must be the text that results from + applying the \TeX\ command |\meaning| to the given character. For + instance, |\meaning a| yields |the letter a|, while |\meaning 1| + yields |the character 1|. A space yields |blank space|. + + Inside the \meta{action} you can perform almost any kind of + code. This code will not be surrounded by a scope, so its effect + persist after the parsing is done. However, each time after the + \meta{action} is executed, control goes back to the parser. You + should not launch a parser inside the \meta{action} code, unless you + put it in a scope. + + When you set the \meta{state} to |all|, the state \meta{action} is + performed in all states as a fallback, whenever \meta{symbol + meaning} is encountered. This means that when you do not specify + anything explicitly for a state and a letter, but you do specify + something for |all| and this letter, then the specified + \meta{action} will be used. + + When the parser encounters a letter for which nothing is specified + in the current state (neither directly nor indirectly via |all|), an + error occurs. +\end{command} + +\begin{command}{\pgfparserswitch\marg{state}} + This command can be called inside the action code of a parser to + cause a state switch to \meta{state}. +\end{command} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-oo.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-oo.tex new file mode 100644 index 00000000000..5044c0bd183 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-oo.tex @@ -0,0 +1,653 @@ +% Copyright 2008 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + + +\section{Object-Oriented Programming} + +\label{section-oop} + +This section describes the |oo| module. + +\begin{pgfmodule}{oo} + This module defines a relatively small set of \TeX\ commands for + defining classes, methods, attributes and objects in the sense of + object-oriented programming. +\end{pgfmodule} + +In this chapter it is assumed that you are familiar with the basics +of a typical object-oriented programming language like Java, C++ or +Eiffel. + + + +\subsection{Overview} + +\TeX\ does not support object-oriented programming, presumably because +it was written at a time when this style of programming was not yet +``en vogue.'' When one is used to the object-oriented style of +thinking, some programming constructs in \TeX\ often seem overly +complicated. The object-oriented programming module of \pgfname\ may +help here. It is written completely using simple \TeX\ macros and is, +thus, perfectly portable. This also means, however, that it is not +particularly fast (but not too slow either), so you should use it only +for non-time-critical things. + +Basically, the oo-system supports \emph{classes} (in the +object-oriented sense, this has nothing to do with \LaTeX-classes), +\emph{methods}, \emph{constructors}, \emph{attributes}, +\emph{objects}, and \emph{object identities}. It (currently) does not +support either inheritance, overloading, destructors, or class nesting. + +The first step is to define a class, using the macro |\pgfooclass| +(all normal macros in \pgfname's object-oriented system start with +|\pgfoo|). This macro gets the name of a class and in its body a +number of \emph{methods} are defined. These are defined using the +|\method| macro (which is defined only inside such a class definition) +and they look a bit like method definitions in, say, Java. Object +attributes are declared using the |\attribute| command, which is also +defined only inside a class definition. + +Once a class has been defined, you can create objects of this +class. Objects are created using |\pgfoonew|. Such an object has many +characteristics of objects in a normal object-oriented programming +language: Each object has a \emph{unique identity}, so when you create +another object this object is completely distinct from all other +objects. Each object also has a set of private attributes, which may +change over time. Suppose, for instance, that we have a |point| +class. Then creating a new object (called an instance) of this class +would typically have an |x|-attribute and a |y|-attribute. These can +be changed over time. Creating another instance of the +|point| class creates another object with its own |x|- and +|y|-attributes. + +Given an object, you can call a method for this object. Inside the +method the attributes of the object for which the method is being +called can be accessed. + +The life of an object always ends with the end of the \TeX\ scope in +which it was created. However, changes to attribute values are not +local to scopes, so when you change an attribute anywhere, this change +persists till the end of the life of the object or until the attribute +is changed again. + +\subsection{A Running Example: The Stamp Class} + +As a running example we will develop a |stamp| class and |stamp| +objects. The idea is that a stamp object is able to ``stamp +something'' on a picture. This means that a stamp object has an +attribute storing the ``stamp text'' and there is a method that asks +the object to place this text somewhere on a +canvas. The method can be called repeatedly and there can be several +different stamp objects, each producing a different text. Stamp +objects can either be created dynamically when needed or a library +might define many such objects in an outer scope. + +Such stamps are similar to many things present in \pgfname\ such as +arrow tips, patterns, or shadings and, indeed, these could all have +been implemented in this object-oriented fashion (which might have +been better, but the object-oriented subsystem is a fairly new +addition to \pgfname). + + +\subsection{Classes} + +We start with the definition of the |stamp| class. This is done using +the |\pgfooclass| macro: + +\begin{command}{\pgfooclass\marg{class name}\marg{body}} + This command defines a class named \meta{class name}. The name of + the class can contain spaces and most other characters, but no + periods. So, valid class names are |MyClass| or |my class| or + |Class_C++_emulation??1|. + + The \meta{body} is actually just executed, so any + normal \TeX-code is permissible here. However, while the \meta{body} is + being executed, the macros |\method| and |\attribute| are setup so + that they can be used to define methods and attributes for this + class (the original meanings are restored afterward). + + The definition of a class is local to the scope where the class has + been defined. +\begin{codeexample}[code only] +\pgfooclass{stamp}{ + % This is the class stamp + + \attribute text; + \attribute rotation angle=20; + + \method stamp(#1) { % The constructor + ... + } + + \method apply(#1,#2) { % Causes the stamp to be shown at coordinate (#1,#2) + ... + } +} + +% We can now create objects of type "stamp" +\end{codeexample} +\end{command} + +The \meta{body} of a class usually just consists of calls to the macros +|\attribute| and |\method|, which will be discussed in more detail in +later sections. + + + +\subsection{Objects} + +Once a class has been declared, we can start creating objects for this +class. For this the |\pgfoonew| command can be used, which has a +peculiar syntax: + +\begin{command}{\pgfoonew\opt{\meta{object handle or attribute}|=|}|new |\meta{class + name}|(|\meta{constructor arguments}|)|} + Causes a new object to be created. The class of the object will be + \meta{class name}, which must previously have been declared using + |\pgfooclass|. Once the object has been created, the constructor + method of the object will be called with the parameter list set to + \meta{constructor arguments}. + + The resulting object is stored internally and its lifetime will + end exactly at the end of the current scope. + + Here is an example in which three stamp objects are created. +\begin{codeexample}[code only] +\pgfoonew \firststamp = new stamp() +\pgfoonew \secondstamp = new stamp() +{ + \pgfoonew \thirdstamp = new stamp() + ... +} +% \thirdstamp no longer exists, but \firststamp and \secondstamp do +% even if you try to store \thirdstamp in a global variable, trying +% to access it will result in an error. +\end{codeexample} + + The optional \meta{object handle or attribute} can either be an + \meta{object handle} or an \meta{attribute}. When an \meta{object + handle} is give, it must be a normal \TeX\ macro name that will + ``point'' to the object (handles are discussed in more detail in + Section~\ref{section-identities}). You can use this macro to call + methods of the object as discussed in the following section. When an + \meta{attribute} is given, it must be given in curly braces (the + curly braces are used to detect the presence of an attribute). In + this case, a handle to the newly created object is stored in this + attribute. +\begin{codeexample}[code only] +\pgfooclass{foo} +{ + \attribute stamp obj; + \attribute another object; + + \method \foo() { + \pgfoonew{stamp obj}=new stamp() + \pgfoonew{another object}=new bar() + } + ... +} +\end{codeexample} +\end{command} + +\begin{command}{\pgfoogc} + This command causes the ``garbage collector'' to be invoked. The job + of this garbage collector is to free the global \TeX-macros that are + used by ``dead'' objects (objects whose life-time has ended). This + macro is called automatically after every scope in which an object + has been created, so you normally do not need to call this macro + yourself. +\end{command} + + +\subsection{Methods} + +Methods are defined inside the body of classes using the following +command: + +\begin{command}{\method \meta{method name}|(|\meta{parameter list}|)|\marg{method body}} + This macro, which is only defined inside a class definition, defines + a new method named \meta{method name}. Just like class names, method + names can contain spaces and other characters, so \meta{method names} like + |put_stamp_here| or |put stamp here| are both legal. + + Three method names are special: First, a method having the same name + as the class is called the \emph{constructor} of the class. The must be + such a method, even if its body is empty. There are (currently) no + destructors; objects simply become ``undefined'' at the + end of the scope in which they have been created. The other two + methods are called |get id| and |get handle|, which are always automatically + defined and which you cannot redefine. They are discussed in + Section~\ref{section-identities}. + + Overloading of methods is not possible, that is, it is illegal to + have two methods inside a single class with the same name (despite + possibly different parameter lists). However, two different classes + may contain a method with the same name, that is, classes form + namespaces for methods. + + The \meta{method name} must be followed by a \meta{parameter list} + in parentheses, which must be present even when the \meta{parameter + list} is empty. The \meta{parameter list} is actually a normal + \TeX\ parameter list that will be matched against the parameters + inside the parentheses upon method invocation and, thus, could be + something like |#1#2 foo #3 bar.|, but a list like |#1,#2,#3| is + more customary. By setting the parameter list to just |#1| and then + calling, say, |\pgfkeys{#1}| at the beginning of a method, you can + implement Objective-C-like named parameters. + + When a method is called, the \meta{body} of + the method will be executed. The main difference to a normal macro + is that while the \meta{body} is executed a special macro called + |\pgfoothis| is setup in such a way that it references that object + for which the method is executed. +\end{command} + +In order to call a method for an object, you first need to create the +object and you need a handle for this object. In order to invoke a +method for this object, a special syntax is used that is similar to +Java or C++ syntax: + +\begin{pgfmanualentry} + \pgfmanualentryheadline{\meta{object handle}|.|\meta{method name}|(|\meta{parameters}|)|}% + \pgfmanualbody + This causes the method \meta{method name} to be called for the + object referenced by the \meta{object handle}. Naturally, the method + is the one defined in the class of the object. The \meta{parameters} + are matched against the parameters of the method and, then, the + method body is executed. The execution of the method body is + \emph{not} done inside a scope, so the effects of a method body + persist. + +\begin{codeexample}[code only] +\pgfooclass{stamp}{ + % This is the class stamp + + \method stamp() { % The constructor + } + + \method apply(#1,#2) { % Causes the stamp to be shown at coordinate (#1,#2) + % Draw the stamp: + \node [rotate=20,font=\huge] at (#1,#2) {Passed}; + } +} + +\pgfoonew \mystamp=new stamp() + +\begin{tikzpicture} + \mystamp.apply(1,2) + \mystamp.apply(3,4) +\end{tikzpicture} +\end{codeexample} + + Inside a method, you can call other methods. If you have a handle + for another object, you can simply call it in the manner described + above. In order to call a method of the current object, you can use + the special object handle |\pgfoothis|. + + \begin{command}{\pgfoothis} + This object handle is defined only when a method is being + executed. There, it is then set to point to the object for which + the method is being called, which allows you to call another + method for the same object. + +\begin{codeexample}[code only] +\pgfooclass{stamp}{ + % This is the class stamp + + \method stamp() {} + + \method apply(#1,#2) { + \pgfoothis.shift origin(#1,#2) + + % Draw the stamp: + \node [rotate=20,font=\huge] {Passed}; + } + + % Private method: + \method shift origin(#1,#2) { + \tikzset{xshift=#1,yshift=#2} + } +} +\end{codeexample} + \end{command} +\end{pgfmanualentry} + + + +\subsection{Attributes} + +Every object has a set of attributes, which may change over +time. Attributes are declared using the |\attribute| command, which, +like the |\method| command, is defined only inside the scope of +|\pgfooclass|. Attributes can be modified (only) by methods. To take +the |stamp| example, an attribute of a |stamp| object might be the +text that should be stamped when the |apply| method is called. + +When an attribute is changed, this change is \emph{not} local to the +current \TeX\ group. Changes will persist till the end +of the object's life or until the attribute is changed once more. + +To declare an attribute you should use the |\attribute| command: +\begin{command}{\attribute \meta{attribute name}\opt{|=|\meta{initial + value}}|;|} + This command can only be given inside the body of an |\pgfooclass| + command. It declares the attribute named \meta{attribute name}. This + name, like method or class names, can be quite arbitrary, but should + not contain periods. Valid names are |an_attribute?| or + |my attribute|. + + You can optionally specify an \meta{initial value} for the + attribute; if none is given, the empty string is used + automatically. The initial value is the value that the attribute + will have just after the object has been created and before the + constructor is called. + +\begin{codeexample}[code only] +\pgfooclass{stamp}{ + % This is the class stamp + + \attribute text; + \attribute rotation angle = 20; + + \method stamp(#1) { + \pgfooset{text}{#1} % Set the text + } + + \method apply(#1,#2) { + \pgfoothis.shift origin(#1,#2) + + % Draw the stamp: + \node [rotate=\pgfoovalueof{rotation angle},font=\huge] + {\pgfoovalueof{text}}; + } + + \method shift origin(#1,#2) { ... } + + \method set rotation (#1) { + \pgfooset{rotation angle}{#1} + } +} +\end{codeexample} +\end{command} + +Attributes can be set and read only inside methods, it is not possible +to do so using an object handle. Spoken in terms of traditional +object-oriented programming, attributes are always private. You need +to define getter and setter methods if you wish to read or modify +attributes. + +Reading and writing attributes is not done using the ``dot-notation'' +that is used for method calls. This is mostly due to efficiency +reasons. Instead, a set of special macros is used, all of which can +\emph{only be used inside methods}. + +\begin{command}{\pgfooset\marg{attribute}\marg{value}} + Sets the \meta{attribute} of the current object to + \meta{value}. +\begin{codeexample}[code only] +\method set rotation (#1) { + \pgfooset{rotation angle}{#1} +} +\end{codeexample} +\end{command} + +\begin{command}{\pgfoolet\marg{attribute}\marg{macro}} + Sets the \meta{attribute} of the current value to the current value + of \meta{macro} using \TeX's |\let| command. +\begin{codeexample}[code only] +\method foo () { + \pgfoolet{my func}\myfunc + % Changing \myfunc now has no effect on the value of attribute my func +} +\end{codeexample} +\end{command} + +\begin{command}{\pgfoovalueof\marg{attribute}} + Expands (eventually) to the current value of \meta{attribute} of + the current object. +\begin{codeexample}[code only] +\method apply(#1,#2) { + \pgfoothis.shift origin(#1,#2) + + \node [rotate=\pgfoovalueof{rotation angle},font=\huge] + {\pgfoovalueof{text}}; +} +\end{codeexample} +\end{command} + +\begin{command}{\pgfooget\marg{attribute}\marg{macro}} + Reads the current value of \meta{attribute} and stores the result in + \meta{macro}. +\begin{codeexample}[code only] +... + \method get rotation (#1) { + \pgfooget{rotation angle}{#1} + } +... + +\mystamp.get rotation(\therotation) +``\therotation'' is now ``20'' (or whatever). +\end{codeexample} +\end{command} + + +\subsection{Identities} +\label{section-identities} + +Every object has a unique identity, which is simply an integer. It is +possible to retrieve the object id using the |get id| method (discussed +below), but normally you will not need to do so because the id itself +cannot be used to access an object. Rather, you access objects via +their methods and these, in turn, can only be called via object +handles. + +Object handles can be created in four ways: +\begin{enumerate} +\item Calling |\pgfoonew|\meta{object handle}|=...| will cause + \meta{object handle} to be a handle to the newly created object. +\item Using |\let| to create an alias of an existing object handle: If + |\mystamp| is a handle, saying |\let\myotherstamp=\mystamp| creates + a second handle to the same object. +\item |\pgfooobj|\marg{id} can be used as an object handle to the + object with the given \meta{id}. +\item Using the |get handle| method to create a handle to a given object. +\end{enumerate} + +Let us have a look at the last two methods. + +\begin{command}{\pgfooobj\marg{id}} + Provided that \meta{id} is the id of an existing object (an object + whose life-time has not expired), calling this command yields a + handle to this object. The handle can then be used to call methods: +\begin{codeexample}[code only] +% Create a new object: +\pgfoonew \mystamp=new stamp() + +% Get the object's id and store it in \myid: +\mystamp.get id(\myid) + +% The following two calls have the same effect: +\mystamp.apply(1,1) +\pgfooobj{\myid}.apply(1,1) +\end{codeexample} +\end{command} + +The |get id| method can be used to retrieve the id of an object. This +method is predefined for every class and you should not try to define +a method of this name yourself. + +\begin{predefinedmethod}{get id(\meta{macro})} + Calling \meta{obj}|.get id(|\meta{macro}|)| stores the id \meta{obj} in + \meta{macro}. This is mainly useful when you wish to store an + object for a longer time and you cannot guarantee that any handle + that you happen to have for this object will be available later on. + + The only way to use the retrieved id later on is to call + |\pgfooobj|. + + Different object that are alive (that are still within the scope in + which they were created) will always have different ids, so you can + use the id to test for equality of objects. However, after an object + has been destroyed because its scope has ended the same id may be + used again for newly created objects. + + Here is a typical application where you need to call this method: + You wish to collect a list of objects for which you wish to call a + specific method from time to time. For the collection process you + wish to offer a macro called |\addtoobjectlist|, which takes an + object handle as parameter. It is quite easy to store this handle + somewhere, but a handle is, well, just a handle. Typically, shortly + after the call to |\addtoobjectlist| the handle will no longer be + valid or even exist, even though the object still exists. In this + case, you wish to store the object id somewhere instead of the + handle. Thus, for the object passed to |\addtoobjectlist| you call + the |get id| method and store the resulting id, rather than the handle. +\end{predefinedmethod} + +There is a second predefined methods, called |get handle|, which is also +used to create object handles. + +\begin{predefinedmethod}{get handle(\marg{macro name})} + Calling this method for an object will cause \meta{macro name} to + become a handle to the given object. For any object handle |\obj| -- + other than |\pgfoothis| -- the following two have the same effect: + \begin{enumerate} + \item |\let|\meta{macro name}|=\obj| + \item |\obj.get handle(|\meta{macro name}|)| + \end{enumerate} + + The first method is simpler and faster. However, for |\pgfoothis| + there is a difference: The call |\pgfoothis.get handle(|\meta{macro name}|)| will + cause \meta{macro name} to be an object handle to the current + object and will persist to be so even after the method is done. By + comparison, |\let|\meta{macro name}|=\pgfoothis| causes |\obj| to be + the same as the very special macro |\pgfoothis|, so |\obj| will + always refer to the current object, which may change over time. +\end{predefinedmethod} + + + + +\subsection{The Signal Class} + +\label{section-signals} + +The object-oriented module predefines, in addition to the basic mechanism +for defining and using classes and object, one class: |signal|. This +class implements a so-called signal--slot mechanism. + +\begin{ooclass}{signal} + This class is used to implement a simple signal--slot + mechanism. The idea is the following: Form time to time special + things happen about which a number of objects need to be + informed. Different things can happen and different object will be + interested in these things. A |signal| object can be used to signal + that such special things of a certain kind have happened. For + example, on signal object might be used to signal the event that ``a + page has been shipped out.'' Another signal might be used to signal + that ``a figure is about to be typeset,'' and so on. + + Objects can ``tune in'' to signals. They do so by \emph{connecting} + one of their methods (then called a \emph{slot}) to the + signal. Then, whenever the signal is \emph{emitted}, the method of + the connected object(s) get called. Different objects can connect + different slots to the same signal as long as the argument lists + will fit. For example, the object that is used to signal the ``end + of page has been reached'' might emit signals that have, say, the + box number in which the finished page can be found as a parameter + (actually, the finished page is always in box 255). Then one object + could connect a method |handle page(#1)| to this signal, another + might connect the method |emergency action(#1)| to this signal, and + so on. + + Currently, it is not possible to ``unregister'' or ``detach'' a slot + from a signal, that is, once an object has been connect to a signal, + it will continue to receive emissions of this signal till the end + of the life-time of the signal. This is even true when the object no + longer exists (but the signal does), so care must be taken that + signal objects are always created before the objects that are + listening to them. + + \begin{method}{signal()} + The constructor does nothing. + \end{method} + + \begin{method}{connect(\meta{object handle},\meta{method name})} + This method gets an \meta{object handle} as parameter and a + \meta{method name} of this object. It will queue the object-method + pair in an internal list and each time the signal emits something, + this object's method is called. + + Be careful not to pass |\pgfoothis| as \meta{object handle}. This + would cause the signal object to connect to itself. Rather, if you + wish to connect a signal to a method of the current object you + first need to create an alias using the |get handle| method: +\begin{codeexample}[code only] +\pgfooclass{some class}{ + \method some class() { + \pgfoothis.get handle(\me) + \somesignal.connect(\me,foo) + \anothersignal.connect(\me,bar) + } + \method foo () {} + \method bar (#1,#2) {} +} +\pgfoonew \objA=new some class() +\pgfoonew \objB=new some class() +\end{codeexample} + \end{method} + + \begin{method}{emit(\meta{arguments})} + This method emits a signal to all connected slots. This means that + for all objects that have previously been connected via a call of + |connect|, the method (slot) that was specified during the call of + |connect| is invoked with given \meta{arguments}. +\begin{codeexample}[code only] +\anothersignal.emit(1,2) +% will call \objA.bar(1,2) and \objB.bar(1,2) +\end{codeexample} + \end{method} +\end{ooclass} + + +\subsection{Implementation Notes} + +For the curious, here are some notes on how the oo-system is +implemented: + +\begin{itemize} +\item There is an object id counter that gets incremented each time an + object is created. However, this counter is local to the current + scope, which means that it is reset at the end of each scope, + corresponding to the fact that at the end of a scope all objects + created in this scope become invalid. Newly created objects will + then have the same id as ``deleted'' objects. +\item Attributes are stored globally. For each attribute of each + object there is a macro whose name is composed of the object's id + and the attribute name. Changes to object attributes are always + global. +\item A call to the garbage collector causes a loop to be executed + that tries to find objects whose object number is larger than the + current maximum alive objects. The global attributes of these + objects are then freed (set to |\relax|) by calling a special + internal method of these (dead) objects. + + The garbage collector is automatically called after each group in + which an object was created using |\aftergroup|. +\item When a method is called, before the method call some code is + executed that sets a global counter storing the current object id to + the object id of the object being called. After the method call some + code is inserted that restores the global counter to its original + value. This is done without scopes, so some tricky |\expandafter| + magic is needed. Note that, because of this process, you cannot use + commands like |\pgfutil@ifnextchar| at the end of a method. +\item An object handle contains just the code to setup and restore the + current object number to the number of the object being called. +\end{itemize} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex index f6097340d54..57bf5b7cd98 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex @@ -188,10 +188,10 @@ select a layout using the following command: \begin{itemize} \item \declare{|physical paper height=|\meta{size}} sets the - height of the physical pape size to \meta{size}. + height of the physical page size to \meta{size}. \item \declare{|physical paper width=|\meta{size}} sets the - width of the physical pape size to \meta{size}. + width of the physical Pappe size to \meta{size}. \item \declare{|a0paper|} sets the physical page size to DIN A0 paper. \item @@ -266,7 +266,7 @@ select a layout using the following command: drawn in each corner. Next, a clipping region is set up that contains all of the logical page except for little rounded corners. Finally, the logical page is draw, clipped against the - clipping region. + clipping region. Note that every logical page should fill its background for this to work. @@ -306,7 +306,7 @@ select a layout using the following command: \item \declare{|second bottom|} puts the second page below the main page. This make the physical pages twice as high as the logical ones. - \item \declare{|second top|} works like |second bottom|. + \item \declare{|second top|} works like |second bottom|. \end{itemize} \end{pgflayout} @@ -320,7 +320,7 @@ select a layout using the following command: current page should be put there, once it is finished. The same options as for |two screens with lagging second| may be - given. + given. \end{pgflayout} @@ -440,13 +440,13 @@ following two commands are used to define the layout: \item \declare{|logical pages=|\meta{logical pages}} specified how many logical pages there are, in total. These are numbered 1 to \meta{logical pages}. - \item \declare{|first logical shipout=|\meta{first}}. See the the + \item \declare{|first logical shipout=|\meta{first}}. See the next option. By default, \meta{first} is 1. \item \declare{|last logical shipout=|\meta{last}}. Together with the previous option, these two options define an interval of pages inside the range 1 to \meta{logical pages}. Only this range is used to store the pages that are shipped out by \TeX. This - means that after a physical shipout has just occured (or at the + means that after a physical shipout has just occurred (or at the beginning), the first time \TeX\ wishes to perform a shipout, the page to be shipped out is stored in logical page \meta{first}. The next time \TeX\ performs a shipout, the page is stored in logical @@ -543,7 +543,7 @@ following two commands are used to define the layout: |2| will double the size. ``At least'' means that if options like |resize height| are given and if the scaling required to meet that option is less than \meta{factor}, that other scaling is used - instead. + instead. \item \declare{|xscale=|\meta{factor}} scales the logical page along the $x$-axis by the given @@ -560,7 +560,7 @@ following two commands are used to define the layout: rotation need not be a multiple of |90|. \item \declare{|copy from=|\meta{logical page number}}. - Normally, after a physical shipout has occured, all logical pages + Normally, after a physical shipout has occurred, all logical pages are voided in a loop. However, if this option is given, the current logical page is filled with the contents of the old logical page number \meta{logical page number}. @@ -605,7 +605,7 @@ following two commands are used to define the layout: \declare{|corner width|=\meta{size}} adds black ``rounded corners'' to the page. See the description of the predefined layout |rounded corners| on - page~\pageref{layout-rounded-corners}. + page~\pageref{layout-rounded-corners}. \end{itemize} \end{command} @@ -644,14 +644,14 @@ following command: \end{command} The final way of setting a logical page is using the following -command: +command: \begin{command}{\pgfpagescurrentpagewillbelogicalpage\marg{number}} When the current \TeX\ page has been typeset, it will be become the given logical page \meta{number}. This command ``interrupts'' the normal order of logical pages, that is, it behaves like the previous command and does not update the \meta{current logical page} - counter. + counter. \begin{codeexample}[code only] \pgfpagesuselayout{two screens with optional second} @@ -667,7 +667,7 @@ Text for main page. \end{codeexample} \end{command} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex index 6526f40394f..318c01cf384 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex @@ -17,7 +17,7 @@ This section describes the package |pgfcalendar|. This package can be used independently of \pgfname. It has two purposes: \begin{enumerate} - \item It provides functions for working with dates. Most noticably, + \item It provides functions for working with dates. Most noticeably, it can convert a date in ISO-standard format (like 1975-12-26) to a so-called Julian day number, which is defined in Wikipedia as follows: ``The Julian day or Julian day number is the @@ -35,7 +35,7 @@ This section describes the package |pgfcalendar|. is highly configurable and flexible (for example, it can produce both plain text calendars and also complicated \tikzname-based calendars), but most users will not use the macro directly. It is - the job of a frontend to provide useful configruations for + the job of a frontend to provide useful configurations for typesetting calendars based on this command. \end{enumerate} \end{package} @@ -73,20 +73,20 @@ This section describes the package |pgfcalendar|. \item |2006-01-01| refers to the first day of 2006. \item |2006-02-last| refers to February 28, 2006. \item |\year-\month-\day| refers to today. - \item |2006-01-01+2| refser to January 3, 2006. + \item |2006-01-01+2| refers to January 3, 2006. \item |\year-\month-\day+1| refers to tomorrow. \item |\year-\month-\day+-1| refers to yesterday. \end{itemize} - + The conversion method is taken from the English Wikipedia entry on - Julian days. + Julian days. \newcount\mycount \example |\pgfcalendardatetojulian{2007-01-14}{\mycount}| sets |\mycount| to \pgfcalendardatetojulian{2007-01-14}{\mycount}\the\mycount. - + \end{command} \begin{command}{\pgfcalendarjuliantodate\marg{Julian day}\marg{year @@ -130,7 +130,7 @@ This section describes the package |pgfcalendar|. \example |\pgfcalendarjuliantoweekday{2454115}{\mycount}| sets |\mycount| to - \pgfcalendarjuliantoweekday{2454115}{\mycount}\the\mycount. + \pgfcalendarjuliantoweekday{2454115}{\mycount}\the\mycount. \end{command} @@ -164,7 +164,7 @@ This section describes the package |pgfcalendar|. \itemcalendaroption{Sunday} as above. \itemcalendaroption{workday} Passed by Mondays, Tuesdays, Wednesdays, Thursdays, and Fridays. - \itemcalendaroption{weekend} Passed Saturdays and Sundays. + \itemcalendaroption{weekend} Passed Saturdays and Sundays. \itemcalendaroption{equals}|=|\meta{reference} The \meta{reference} can be in one of two forms: Either, it is a full ISO format date like |2007-01-01| or the year may be missing as in |12-31|. In the @@ -184,7 +184,7 @@ This section describes the package |pgfcalendar|. year. \itemcalendaroption{at most}|=|\meta{reference} as above. \itemcalendaroption{between}|=|\meta{start reference}| and |\meta{end - refernce} This test checks whether the current date lies between + reference} This test checks whether the current date lies between the two given reference dates. Both full and short version may be given. @@ -258,16 +258,16 @@ This section describes the package |pgfcalendar|. more details on translations. \example |\pgfcalendarweekdayname{2}| yields - \texttt{\pgfcalendarweekdayname{2}}. + \texttt{\pgfcalendarweekdayname{2}}. \end{command} \begin{command}{\pgfcalendarweekdayshortname\marg{week day number}} - This command works similiarly to the previous command, only an + This command works similarly to the previous command, only an abbreviated version of the week day is produced. \example |\pgfcalendarweekdayshortname{2}| yields - \texttt{\pgfcalendarweekdayshortname{2}}. + \texttt{\pgfcalendarweekdayshortname{2}}. \end{command} @@ -276,7 +276,7 @@ This section describes the package |pgfcalendar|. is given by the \meta{month number}. \example |\pgfcalendarmonthname{12}| yields - \texttt{\pgfcalendarmonthname{12}}. + \texttt{\pgfcalendarmonthname{12}}. \end{command} @@ -284,7 +284,7 @@ This section describes the package |pgfcalendar|. As above, only an abbreviated version is produced. \example |\pgfcalendarmonthshortname{12}| yields - \texttt{\pgfcalendarmonthshortname{12}}. + \texttt{\pgfcalendarmonthshortname{12}}. \end{command} @@ -319,14 +319,14 @@ documentation of this package for more details. \medskip \textbf{Basic typesetting process.} A calendar is typeset as follows: The \meta{start date} and - \meta{end date} specify a range of dates. For each date in this + \meta{end date} specify a range of dates. For each date in this range the \meta{rendering code} is executed with certain macros setup to yield information about the \emph{current date} (the current date in the enumeration of dates of the range). Typically, the \meta{rendering code} places nodes inside a picture, but it can do other things as well. Note that it is also the job of the \meta{rendering code} to position the calendar - correctly. + correctly. The different calls of the \meta{rending code} are not surrounded by \TeX\ groups (though you can do so yourself, of @@ -339,7 +339,7 @@ documentation of this package for more details. \begin{itemize} \item |\pgfcalendarprefix| - The \meta{prefix} parameter. This prefix is recomended for nodes + The \meta{prefix} parameter. This prefix is recommended for nodes inside the calendar, but you have to use it yourself explicitly. \item |\pgfcalendarbeginiso| The \meta{start date} of range being typeset in ISO format (like 2006-01-10). @@ -349,7 +349,7 @@ documentation of this package for more details. The \meta{end date} of range being typeset in ISO format. \item |\pgfcalendarendjulian| Julian day number of \meta{end date}. - \item |\pgfcalendarcurrentjulian| This \TeX\ count holds the + \item |\pgfcalendarcurrentjulian| This \TeX\ count holds the Julian day number of day currently begin rendered. \item |\pgfcalendarcurrentweekday| The weekday (a number with zero representing Monday) of the current date. @@ -357,7 +357,7 @@ documentation of this package for more details. \item |\pgfcalendarcurrentmonth| The month of the current date (always two digits with a leading zero, if necessary). \item |\pgfcalendarcurrentday| The day of month of the current date - (alwyas two digits). + (always two digits). \end{itemize} \medskip @@ -375,7 +375,7 @@ documentation of this package for more details. In a first example, let us create a very simple calendar: It just lists the dates in a certain range. \begin{codeexample}[vbox,ignorespaces] -\pgfcalendar{cal}{2007-01-20}{2007-02-10}{\pgfcalendarcurrentday\ } +\pgfcalendar{cal}{2007-01-20}{2007-02-10}{\pgfcalendarcurrentday\ } \end{codeexample} Let us now make this a little more interesting: Let us add a line break after each Sunday. @@ -384,7 +384,7 @@ documentation of this package for more details. { \pgfcalendarcurrentday\ \ifdate{Sunday}{\par}{} -} +} \end{codeexample} We now want to have all Mondays to be aligned on a column. For this, different approaches work. Here is one based positioning each day @@ -395,7 +395,7 @@ documentation of this package for more details. \leavevmode% \hbox to0pt{\hskip\pgfcalendarcurrentweekday cm\pgfcalendarcurrentday\hss}% \ifdate{Sunday}{\par}{}% -} +} \end{codeexample} Let us now typeset two complete months. \begin{codeexample}[vbox,ignorespaces] @@ -412,11 +412,11 @@ documentation of this package for more details. }% }% \ifdate{Sunday}{\par}{}% -} +} \end{codeexample} - For our final example, we use a |{tikzpicture}|. + For our final example, we use a |{tikzpicture}|. \begin{codeexample}[vbox,ignorespaces] -\begin{tikzpicture} +\begin{tikzpicture} \pgfcalendar{cal}{2007-01-20}{2007-02-10}{% \ifdate{workday} {\tikzset{filling/.style={fill=blue!20}}} @@ -452,12 +452,12 @@ documentation of this package for more details. \end{itemize} Normally, you should say |\let\%=\pgfcalendarshorthand| locally, so that you can write |\%wt| instead of the much more cumbersome - |\pgfcalendarshorthand{w}{t}|. + |\pgfcalendarshorthand{w}{t}|. \begin{codeexample}[leave comments] \let\%=\pgfcalendarshorthand \pgfcalendar{cal}{2007-01-20}{2007-01-20} -{ ISO form: \%y0-\%m0-\%d0, long form: \%wt, \%mt \%d-, \%y0} +{ ISO form: \%y0-\%m0-\%d0, long form: \%wt, \%mt \%d-, \%y0} \end{codeexample} \end{command} @@ -469,7 +469,5 @@ documentation of this package for more details. calendar, followed by a hyphen, followed by the ISO format version of the date. Thus, when the date |2007-01-01| is typeset in a calendar for the prefix |mycal|, the macro expands to - |mycal-2007-01-01|. + |mycal-2007-01-01|. \end{command} - - diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex index fb89643018c..9c3ef4832a8 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex @@ -20,8 +20,8 @@ automatically by \tikzname, but not by \pgfname: two new commands: |\foreach| and |\breakforeach|. \end{package} -\begin{command}{\foreach| |\meta{variables}| in |\meta{list} - \meta{commands}} +\begin{command}{\foreach| |\meta{variables}| |\opt{{\ttfamily[}\meta{options}{\ttfamily]}}% + | in |\meta{list} \meta{commands}} The syntax of this command is a bit complicated, so let us go through it step-by-step. @@ -30,7 +30,10 @@ automatically by \tikzname, but not by \pgfname: active characters. If you do not know what active characters are, you are blessed.) - Still in the easiest case, \meta{list} is either a comma-separated + Still in the easiest case, \meta{options} will be omitted. The keys + for customizing this command will be discussed below. + + Again, in the easiest case, \meta{list} is either a comma-separated list of values surrounded by curly braces or it is the name of a macro that contain such a list of values. Anything can be used as a value, but numbers are most likely. @@ -112,7 +115,7 @@ automatically by \tikzname, but not by \pgfname: \dots, $x+md$,'' where the last dots are semantic dots, not syntactic dots. The value $m$ is the largest number such that $x + md \le z$ if $d$ is positive or such that $x+md \ge z$ if $d$ is - negative. + negative. Perhaps it is best to explain this by some examples: The following \meta{list} have the same effects: @@ -133,8 +136,8 @@ automatically by \tikzname, but not by \pgfname: $2^{-n}$ for some small $n$, rounding errors can occur pretty easily. Thus, in the second last case, |0.5| should probably be replaced by |0.501| for robustness. - - There is yet another special case for the |...| statement: If the + + There is another special case for the |...| statement: If the |...| is used right after the first item in the list, that is, if there is an $x$, but no $y$, the difference $d$ obviously cannot be computed and is set to $1$ if the number $z$ following the dots is @@ -144,7 +147,26 @@ automatically by \tikzname, but not by \pgfname: |\foreach \x in {9,...,3.5} {\x, }| yields \foreach \x in {9,...,3.5} {\x, } - \medskip + + There is a yet a further special case for the |...| statement, in that + it can indicate an alphabetic character sequence: + + |\foreach \x in {a,...,m} {\x, }| yields \foreach \x in {a,...,m} {\x, } + + |\foreach \x in {Z,X,...,M} {\x, }| yields \foreach \x in {Z,X,...,M} {\x, } + + A final special case for the |...| statement is contextual replacement. + If the |...| is used in some context, for example, |sin(...)|, this + context will be interpreted correctly, provided that the list items + prior to the |...| statement have \emph{exactly} the same pattern, + except that, instead of dots, they have a number or a character: + + |\foreach \x in {2^1,2^...,2^7} {$\x$, }| yields \foreach \x in {2^1,2^...,2^7} {$\x$, } + + |\foreach \x in {0\pi,0.5\pi,...\pi,3\pi} {$\x$, }| yields \foreach \x in {0\pi,0.5\pi,...\pi,3\pi} {$\x$, } + + |\foreach \x in {A_1,..._1,H_1} {$\x$, }| yields \foreach \x in {A_1,..._1,H_1} {$\x$, } + \textbf{Special handling of pairs.} Different list items are separated by commas. However, this causes a problem when the list items contain commas themselves as pairs like @@ -160,7 +182,7 @@ automatically by \tikzname, but not by \pgfname: \foreach \position in {(0,0), (1,1), (2,0), (3,1)} \draw \position rectangle +(.25,.5); \end{codeexample} - + \medskip \textbf{Using the foreach-statement inside paths.} \tikzname\ allows you to use a |\foreach| statement inside a path @@ -178,7 +200,7 @@ automatically by \tikzname, but not by \pgfname: \begin{codeexample}[] \tikz \draw \foreach \p in {1,...,3} {(\p,1)--(\p,3) (1,\p)--(3,\p)}; \end{codeexample} - + \medskip \textbf{Multiple variables.} You will often wish to iterate over two variables at the same @@ -211,7 +233,7 @@ automatically by \tikzname, but not by \pgfname: \draw (\x,0) node{$\xtext$}; \end{tikzpicture} \end{codeexample} - + Here are more useful examples: \begin{codeexample}[] \begin{tikzpicture} @@ -224,7 +246,7 @@ automatically by \tikzname, but not by \pgfname: % Draw some connections: \foreach \source/\target in {a/b, b/c, c/a, c/d} - \draw (\source) .. controls +(.75cm,0pt) and +(-.75cm,0pt)..(\target); + \draw (\source) .. controls +(.75cm,0pt) and +(-.75cm,0pt)..(\target); \end{tikzpicture} \end{codeexample} @@ -233,7 +255,7 @@ automatically by \tikzname, but not by \pgfname: % Let's draw circles at interesting points: \foreach \x / \y / \diameter in {0 / 0 / 2mm, 1 / 1 / 3mm, 2 / 0 / 1mm} \draw (\x,\y) circle (\diameter); - + % Same effect \foreach \center/\diameter in {{(0,0)/2mm}, {(1,1)/3mm}, {(2,0)/1mm}} \draw[yshift=2.5cm] \center circle (\diameter); @@ -251,7 +273,7 @@ automatically by \tikzname, but not by \pgfname: \draw[line width=1pt] (\angle:1.8cm) -- (\angle:2cm); \draw (\angle:1.4cm) node{\textsf{\label}}; } - + \foreach \angle in {0,90,180,270} \draw[line width=2pt] (\angle:1.6cm) -- (\angle:2cm); @@ -266,6 +288,80 @@ automatically by \tikzname, but not by \pgfname: \foreach \y / \colb in {0/red,1/green,2/blue,3/yellow} \shade[ball color=\cola!50!\colb] (\x,\y) circle (0.4cm); \end{codeexample} + + \medskip + \textbf{Options to customize the foreach-statement.} + + The keys described below can be used in the \meta{options} argument + to the |\foreach| command. They all have the path |/pgf/foreach/|, + however, the path is set automatically when \meta{options} are + parsed, so it does not have to explicitly stated. + +\begin{key}{/pgf/foreach/var=\meta{variable}} + This key provides an alternative way to specify variables: + |\foreach [var=\x,var=\y]| is the same as |\foreach \x/\y|. + If used, this key should be used before the other keys. +\end{key} + +\begin{key}{/pgf/foreach/evaluate=\meta{variable}| |\opt{|as |\meta{macro}| using |\meta{formula}}} + By default list items are not evaluated: |1+2|, yields |1+2|, + not |3|. This key allows a variable to be evaluated using the + mathematical engine. The variable must have been specified either + using the |var| key or in the \meta{variables} argument of the + |foreach| command. + By default, the result of the evaluation will be stored in + \meta{variable}. However, the optional |as |\meta{macro} statement + can be used to store the result in \meta{macro}. + +\begin{codeexample}[] +\foreach \x [evaluate=\x] in {2^0,2^...,2^8}{$\x$, } +\end{codeexample} + +\begin{codeexample}[] +\foreach \x [evaluate=\x as \xeval] in {2^0,2^...,2^8}{$\x=\xeval$, } +\end{codeexample} + + The optional |using |\meta{formula} statement means an evaluation + does not have to be explicitly stated for each item in \meta{list}. + The \meta{formula} should contain at least one reference to + \meta{variable}. + +\begin{codeexample}[] +\tikz\foreach \x [evaluate=\x as \shade using \x*10] in {0,1,...,10} + \node [fill=red!\shade!yellow, minimum size=0.65cm] at (\x,0) {\x}; +\end{codeexample} + +\end{key} + +\begin{key}{/pgf/foreach/remember=\meta{variable}| as |\meta{macro}| |\opt{|(initially |\meta{value}|)|}} + This key allows the item value stored in \meta{variable} to be + remembered during the next iteration, stored in \meta{macro}. + If a variable is evaluated, the result of this evaluation is + remembered. + By default the value of \meta{variable} is zero for the first + iteration, however, the optional |(initially |\meta{value}|)| + statement, allows the \meta{macro} to be initially defined + as \meta{value}. + +\begin{codeexample}[] +\foreach \x [remember=\x as \lastx (initially A)] in {B,...,H}{$\overrightarrow{\lastx\x}$, } +\end{codeexample} +\end{key} + +\begin{key}{/pgf/foreach/count=\meta{macro}| |\opt{|from |\meta{value}}} + This key allows \meta{macro} to hold the position in the list of + the current item. The optional |from |\meta{value} statement allows + the counting to begin from \meta{value}. + +\begin{codeexample}[] +\tikz[x=0.75cm,y=0.75cm] + \foreach \x [count=\xi] in {a,...,e} + \foreach \y [count=\yi] in {\x,...,e} + \node [draw, top color=white, bottom color=blue!50, minimum size=0.666cm] + at (\xi,-\yi) {$\mathstrut\x\y$}; +\end{codeexample} +\end{key} + \end{command} @@ -274,7 +370,7 @@ automatically by \tikzname, but not by \pgfname: executions of the \meta{commands} will occur. However, the current execution of the \meta{commands} is continued normally, so it is probably best to use this command only at the end of a |\foreach| - command. + command. \begin{codeexample}[] \begin{tikzpicture} @@ -286,10 +382,8 @@ automatically by \tikzname, but not by \pgfname: \ifnum \x<\y \breakforeach \fi - } + } \end{tikzpicture} \end{codeexample} - -\end{command} - +\end{command} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex index 121e8b6b768..4ce292d380d 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex @@ -18,7 +18,7 @@ automatically by both \pgfname\ and \tikzname. This package can be used independently of \pgfname. Note that no other package of \pgfname\ needs to be loaded (so neither the emulation layer nor the system layer is needed). The Con\TeX t - abbreviation is |pgfkey| if |pgfmod| is not loaded. + abbreviation is |pgfkey| if |pgfmod| is not loaded. % pgfkey --> pgfkeys? \end{package} @@ -40,10 +40,6 @@ following: \item |pgfkeys| organizes keys in a tree, while |keyval| and |xkeyval| use families. In |pgfkeys| the families correspond to the root entries of the key tree. -\item For efficiency reasons, |pgfkeys| does not directly support - setting keys drawn from multiple families as |xkeyval| does. This - can be emulated if necessary, but it will be slower than |xkeyval|'s - native support. \item |pgfkeys| has no save-stack impact (you will have to read the \TeX Book very carefully to appreciate this). \item |pgfkeys| is slightly slower than |keyval|, but not much. @@ -89,7 +85,7 @@ a new command. Rather, the |\pgfkeys| command can also be used to set the code of a key. This is done using so-called \emph{handlers}. They look like keys whose names look like ``hidden files in Unix'' since they start with a dot. The handler for setting the code of a key is -appropriately called |.code| and it is used as follows: +appropriately called |/.code| and it is used as follows: \begin{codeexample}[] \pgfkeys{/my key/.code=The value is '#1'.} \pgfkeys{/my key=hi!} @@ -100,7 +96,7 @@ set to |hi!|. There are numerous handlers for defining a key. For instance, we can also define a key whose value actually consists of more than one -parameter. +parameter. \begin{codeexample}[] \pgfkeys{/my key/.code 2 args=The values are '#1' and '#2'.} \pgfkeys{/my key={a1}{a2}} @@ -108,7 +104,7 @@ parameter. We often want to have keys where the code is called with some default value if the user does not provide a value. Not surprisingly, this is -also done using a handler, this time called |.default|. +also done using a handler, this time called |/.default|. \begin{codeexample}[] \pgfkeys{/my key/.code=(#1)} \pgfkeys{/my key/.default=hello} @@ -117,15 +113,15 @@ also done using a handler, this time called |.default|. The other way round, it is also possible to specify that a value \emph{must} be specified, using a handler called -|.value required|. Finally, you can also require that no value -\emph{may} be specified using |.value forbidden|. +|/.value required|. Finally, you can also require that no value +\emph{may} be specified using |/.value forbidden|. All keys for a package like, say, \tikzname\ start with the path |/tikz|. We obviously do not like to write this path down every time we use a key (so we do not have to write things like |\draw[/tikz/line width=1cm]|). What we need is to somehow ``change the default path to a specific location.'' This is done using the -handler |.cd| (for ``change directory''). Once this handler has been +handler |/.cd| (for ``change directory''). Once this handler has been used on a key, all subsequent keys {\itshape in the current call of |\pgfkeys| only} are automatically prefixed with this path, if necessary. @@ -180,12 +176,12 @@ different parts separated by slashes. A typical key might be Let us fix some further terminology: Given a key like |/a/b/c|, we call the part leading up the last slash (|/a/b|) the \emph{path} of the key. We call everything after the last slash (|c|) the \emph{name} -of the key (in a file system this would be the file name). +of the key (in a file system this would be the file name). We do not always wish to specify keys completely. Instead, we usually specify only part of a key (typically only the name) and the \emph{default path} is then added to the key at the front. So, when -the default path is |/tikz| and you +the default path is |/tikz| and you refer to the (partial) key |line width|, the actual key that is used is |/tikz/line width|. There is a simple rule for deciding whether a key is a partial key or a full key: If it starts with a slash, then it @@ -219,7 +215,7 @@ continue with the next subsection. like |#| or unbalanced \TeX-ifs. \begin{codeexample}[] \pgfkeyssetvalue{/my family/my key}{Hello, world!} -\pgfkeysvalueof{/my family/my key} +\pgfkeysvalueof{/my family/my key} \end{codeexample} The setting of a key is always local to the current \TeX\ group. @@ -231,7 +227,7 @@ continue with the next subsection. \begin{codeexample}[] \def\helloworld{Hello, world!} \pgfkeyslet{/my family/my key}{\helloworld} -\pgfkeysvalueof{/my family/my key} +\pgfkeysvalueof{/my family/my key} \end{codeexample} You should never let a key be equal to |\relax|. Such a key may or may not be indistinguishable from an undefined key. @@ -240,7 +236,7 @@ continue with the next subsection. \begin{command}{\pgfkeysgetvalue\marg{full key}\marg{macro}} Retrieves the tokens stored in the \meta{full key} and lets \meta{macro} be equal to these tokens. If the key has - not been set, the \meta{macro} will be equal to |\relax|. + not been set, the \meta{macro} will be equal to |\relax|. \begin{codeexample}[] \pgfkeyssetvalue{/my family/my key}{Hello, world!} \pgfkeysgetvalue{/my family/my key}{\helloworld} @@ -267,7 +263,7 @@ continue with the next subsection. This command will use e\TeX's |\ifcsname| command, if available, for efficiency. This means, however, that it may behave differently for \TeX\ and for e\TeX\ when you set keys to |\relax|. For this reason - you should not do so. + you should not do so. \begin{codeexample}[] \pgfkeyssetvalue{/my family/my key}{Hello, world!} \pgfkeysifdefined{/my family/my key}{yes}{no} @@ -290,7 +286,7 @@ taken. This action can be one of the following: \item If the key's name (the part after the last slahs) is a known \emph{handler}, then this handler will take care of the key. \item If the key is totally unknown, one of several possible - \emph{unknown key handlers} is called. + \emph{unknown key handlers} is called. \end{enumerate} Addtionally, if the \meta{value} is missing, a default value may or @@ -316,8 +312,8 @@ let us have a quick look at the command itself. then used. The default path is just the root path |/| when the first key is handled, but it may change later on. At the end of the command, the default path is reset to the value it had before this - command was executed. - + command was executed. + Calls of this command may be nested. Thus, it is permissible to call |\pgfkeys| inside the code that is executed for a key. Since the default path is restored after a call of |\pgfkeys|, the default @@ -329,7 +325,7 @@ let us have a quick look at the command itself. This command has the same effect as |\pgfkeys{|\meta{default path}|/.cd,|\meta{key list}|}|, it is only marginally quicker. This command should not be used in user code, but rather in - commands like |\tikzset| or |\pgfset| that get called very often. + commands like |\tikzset| or |\pgfset| that get called very often. \end{command} \begin{command}{\pgfkeysalso\marg{key list}} @@ -358,8 +354,8 @@ value is defined, it will be used as if you had written \meta{key}|=|\meta{default value}. In the following, the details of how default values are determined is -described; however, you should normally use the handlers |.default| -and |.value required| as described in +described; however, you should normally use the handlers |/.default| +and |/.value required| as described in Section~\ref{section-default-handlers} and you can may wish to skip the following details. @@ -370,7 +366,7 @@ following happens: particular, the commands |\pgfkeys{my key}| and |\pgfkeys{my key=\pgfkeysnovalue}| have exactly the same effect and you can ``simulate'' a missing value by providing the value - |\pgfkeysnovalue|, which is sometimes useful. + |\pgfkeysnovalue|, which is sometimes useful. \item If the \meta{value} is |\pgfkeysnovalue|, then it is checked whether the subkey \meta{key}|/.@def| exists. For instance, if you write |\pgfkeys{/my key}|, then it is checked whether the key @@ -451,10 +447,27 @@ handlers described in Section~\ref{section-code-handlers}. command. \end{command} -\begin{command}{\pgfkeysdeargs\marg{key}\marg{argument pattern}\marg{code}} +\begin{command}{\pgfkeysdefnargs\marg{key}\marg{argument count}\marg{code}} This command works like |\pgfkeysdef|, but it allows you to provide - an arbitrary \meta{argument pattern} rather than just the simple - single argument of |\pgfkeysdef|. + an arbitrary \meta{argument count} between $0$ and $9$ (inclusive). + +\begin{codeexample}[] +\pgfkeysdefnargs{/my key}{2}{\def\a{#1}\def\b{#2}} +\pgfkeys{/my key= + {hello} + {world}} + +|\a| is `\a', |\b| is `\b'. +\end{codeexample} + The resulting key will expect exactly \marg{argument count} arguments. +\end{command} +\begin{command}{\pgfkeysedefnargs\marg{key}\marg{argument count}\marg{code}} + The |\edef| version of |\pgfkeysdefnargs|. +\end{command} + +\begin{command}{\pgfkeysdefargs\marg{key}\marg{argument pattern}\marg{code}} + This command works like |\pgfkeysdefnargs|, but it allows you to provide + an arbitrary \meta{argument pattern} rather than just a number of arguments. \begin{codeexample}[] \pgfkeysdefargs{/my key}{#1+#2}{\def\a{#1}\def\b{#2}} @@ -462,6 +475,7 @@ handlers described in Section~\ref{section-code-handlers}. |\a| is \a, |\b| is \b. \end{codeexample} + Note that |\pgfkeysdefnargs| is \emph{better} when it comes to simple argument \emph{counts}\footnote{When the resulting keys are used, the \texttt{defnargs} variant allows spaces between arguments whereas the \texttt{defargs} variant does not; it considers the spaces as part of the argument.}. \end{command} \begin{command}{\pgfkeysedefargs\marg{key}\marg{argument pattern}\marg{code}} @@ -477,7 +491,7 @@ it is checked whether the \meta{key} itself exists (has been previously assigned a value using, for instance, |\pgfkeyssetvalue|). In this case, the tokens stored in \meta{key} are replaced by \meta{value} and |\pgfkeys| proceeds with the next key in -the \meta{key list}. +the \meta{key list}. \subsubsection{Keys That Are Handled} @@ -500,7 +514,7 @@ key). It decomposed into two parts: It is recommended (but not necessary) that the name of a handler starts with a dot (but not with |.@|), so that they are easy to - detect for the reader. + detect for the reader. \end{enumerate} (For efficiency reasons, these two macros are only setup at this point; @@ -518,7 +532,7 @@ It is the job of the handlers to so something useful with the For an example, let us write a handler that will output the value stored in a key to the log file. We call this handler -|.print to log|. The idea is that when someone tries to use the key +|/.print to log|. The idea is that when someone tries to use the key |/my key/.print to log|, then this key will not be defined and the handler gets executed. The handler will then have access to the path-part of the key, which is |/my key|, via the macro @@ -549,8 +563,100 @@ name) and assign the parameter value to it. \pgfkeys{/my key=hallo} \end{codeexample} +There are some parameters for handled keys which prove to be useful in some (possibly rare) special cases: +\begin{key}{/handler config=\mchoice{all,only existing,full or existing} (initially all)} + Changes the initial configuration how key handlers will be used. + + This configuration is for advanced users and rarely necessary. + + \begin{description} + \item[\texttt{all}] + The preconfigured setting |all| works as described above and + imposes no restriction on the key setting process. + + \item[\texttt{only existing}] + The value |only existing| modifies the algorithm for handled keys + as follows: a handler \meta{key name}|/.|\meta{handler} will be + executed only if \meta{key name} is either a key which stores its + value directly or a command key for which |/.@cmd| exists. If + \meta{key name} does \emph{not} exist already, the complete string + \meta{key name}|/.|\meta{handler} is considered to be an unknown + key and the procedure described in the next section applies (for + the path of \meta{key name}). +\begin{codeexample}[] +% Define a test key and error handlers: +\pgfkeys{/the/key/.code={Initial definition. }} +\pgfkeys{/handlers/.unknown/.code={Unknown key `\pgfkeyscurrentkey'. }} + +% calling the test key yields 'Initial definition. ': +\pgfkeys{/the/key} + +% Change configuration: +\pgfkeys{/handler config=only existing} + +% allowed: key *re*-definition: +\pgfkeys{/the/key/.code={Re-Definition. }} +% calling the key yields 'Re-Definition. ': +\pgfkeys{/the/key} + +% not allowed: definition of new keys: +% this checks for '/the/other key/.unknown' +% and '/handlers/.unknown' +% and yields finally +% 'Unknown key `/the/other key/.code`' +\pgfkeys{/the/other key/.code={New definition. }} +\end{codeexample} + It is necessary to exclude some key handlers from this + procedure. Altogether, the detailed procedure is as follows: + \begin{enumerate} + \item If a handled key like |/a path/a key/.a handler=value| is + encountered, it is checked whether the handler should be + invoked. This is the case if + \begin{itemize} + \item An exception from |only existing| for this key exists (see below), + \item The key |/a path/a key| exists already -- either directly as + storage key or with the |.@cmd| suffix. + \end{itemize} + \item If the check passes, everything works as before. + \item If the check fails, the complete key will be considered to be + unknown. In that case, the handling of unknown keys as described + in the next section applies. There, the current key path will be + set to |/a path| and the current key's name to |key/.a handler|. + \end{enumerate} + + A consequence of this configuration is to provide more meaningful + processing of handled keys if a search path for keys is in effect, + see section~\ref{sec:pgf:unknown:keys} for an example. + + \item[\texttt{full or existing}] Finally, the choice + |full or existing| is a variant of |only existing|: it works in + the same way + for keys which do not have a full key path. For example, the style + + |\pgfkeys{/my path/.cd,key/.style={|$\dotsc$|}}| + + can only be redefined: it doesn't have a full path, so the + |only existing| mechanism applies. But the style + + |\pgfkeys{/my path/key/.style={|$\dotsc$|}}| + + will still work. This allows users to override the |only existing| + feature if they know what they're doing (and provide full key + paths). + \end{description} +\end{key} + +\begin{key}{/handler config/only existing/add exception=\marg{key + handler name}} + Allows to add exceptions to the |/handler config=only existing| + feature. Initially exceptions for the key handlers + |/.cd|, |/.try|, |/.retry|, |/.lastretry| and |/.unknown| are + defined. The value \marg{key handler name} should be the name of a + key handler. +\end{key} \subsubsection{Keys That Are Unknown} +\label{sec:pgf:unknown:keys} For some keys, neither the key is defined nor its |.@cmd| subkey nor is a handler defined for this key. In this case, it is checked whether @@ -567,7 +673,7 @@ the code of the key \meta{my path prefix}|/.unknown|. This also allows you to setup ``search paths.'' The idea is that you would like keys to be searched not only in a single default path, but in several. Suppose, for instance, that you would like keys to be -searched +searched for in |/a|, |/b|, and |/b/c|. We setup a key |/my search path| for this: \begin{codeexample}[code only] @@ -584,12 +690,67 @@ this: \pgfkeys{/my search path/.cd,foo,bar} \end{codeexample} In the above code, |foo| and |bar| will be searched for in the three -directories |/a|, |/b|, and |/b/c|. +directories |/a|, |/b|, and |/b/c|. Before you start implementing +search paths using this pattern, consider the |/.search also| handler +discussed below. If the key \meta{current path}|/.unknown/.@cmd| does not exist, the handler |/handlers/.unknown| is invoked instead, which is always defined and which prints an error message by default. +\subsubsection{Search Paths And Handled Keys} + +There is one special case which occurs in the search path example +above. What happens if we want to change a style? For example, +\begin{codeexample}[code only] +\pgfkeys{/my search path/.cd,custom/.style={variables}} +\end{codeexample} +\noindent could mean a style in |/my search path/|, |/a/|, |/b/| or +even |/b/c/|! + +Due to the rules for handled keys, the answer is +|/my search path/custom/.style={variables}|. +It may be useful to modify this default behavior. One useful thing +would be to search for \emph{existing} styles named |custom| and +redefine them. For example, if a style |/b/custom| exists, the +assignment |custom/.style={variables}| should probably redefine +|/b/custom| instead of |/my search path/custom|. This can be done +using |handler config|: +\begin{codeexample}[] +\pgfkeys{/my search path/.unknown/.code= + {% + \let\searchname=\pgfkeyscurrentname% + \pgfkeysalso{% + /a/\searchname/.try=#1, + /b/\searchname/.retry=#1, + /b/c/\searchname/.retry=#1% + }% + }% +} + +% Let's define /b/custom here: +\pgfkeys{/b/custom/.code={This is `\pgfkeyscurrentkey'. }} + +% Reconfigure treatment of key handlers: +\pgfkeys{/handler config=only existing} + +% The search path procedure will find /b/custom +% -> leads to This is `/b/custom' +\pgfkeys{/my search path/.cd,custom} + +% Due to the reconfiguration, this will find /b/custom instead of +% defining /my search path/custom: +\pgfkeys{/my search path/.cd,custom/.append code={Modified. }} + +% So using the search path, we again find /b/custom which +% leads to This is `/b/custom' Modified +\pgfkeys{/my search path/.cd,custom} +\end{codeexample} + +A slightly different approach to search paths can be realized using +the |/.search also| key handler, see below. + + \subsection{Key Handlers} We now describe which key handlers are defined by default. You can @@ -607,17 +768,138 @@ also define new ones as described in Section~\ref{section-key-handlers}. \end{handler} \begin{handler}{{.is family}} +\label{section-is family-handler} This handler sets up things such that when \meta{key} is executed, then the current path is set to \meta{key}. A typical use is the following: \begin{codeexample}[code only] \pgfkeys{/tikz/.is family} -\pgfkeys{tikz,line width=1cm} +\pgfkeys{tikz,line width=1cm} \end{codeexample} The effect of this handler is the same as if you had written \meta{key}|/.style=|\meta{key}|/.cd|, only the code produced by the - |.is family| handler is quicker. + |/.is family| handler is quicker. \end{handler} +\begin{handler}{{.search also}=\marg{path list}} + A style which installs a |/.unknown| handler into \meta{key}. This + |/.unknown| handler will then search for unknown keys in every path + provided in \marg{path list}. + +\begin{codeexample}[] +% define a key: +\pgfkeys{/secondary path/option/.code={Invoking /secondary path/option with `#1'}} + +% set up a search path: +\pgfkeys{/main path/.search also={/secondary path}} + +% try searching for `option=value' in '/main path': +% -> this finds `/secondary path/option'! +\pgfkeys{/main path/.cd,option=value} +\end{codeexample} + + The |/.search also| handler follows the strategy + \begin{enumerate} + \item If a user provides a fully qualified key which could not be + found, for example the full string |/main path/option|, it assume + that the user new what he is doing -- and does \emph{not} continue + searching for |an option| in \marg{path list}. + \item If a user provides only the key's name, for example |option| + and |option| can't be found in the current default path (which is + |/main path| in our example above), the current default path is + set to the next element in \marg{path list} (which is + |/secondary path| here) and |\pgfkeys| will be restarted. + + This will be iterated until either a match has been found or all + elements in \marg{path list} have been tested. + + \item If all elements in \marg{path list} have been checked and the + key is still unknown, the fall-back handler |/handlers/.unknown| + will be invoked. + \end{enumerate} +\begin{codeexample}[] +% define a key: +\pgfkeys{/secondary path/option/.code={Invoking /secondary path/option with `#1'}} + +% set up a search path: +\pgfkeys{/main path/.search also={/secondary path}} + +% try searching for `option=value' in '/main path': +% -> this finds `/secondary path/option'! +\pgfkeys{/main path/.cd,option=value} + +% negative example: +% try searching for fully qualified key /main path/option. +% This won't be handled by .search also. +\pgfkeys{/handlers/.unknown/.code={Found unknown option \pgfkeyscurrentkeyRAW={#1}!}}% +\pgfkeys{/main path/.cd,/main path/option=value} +\end{codeexample} + + Please note that the strategy of |/.search also| is different from + the first example provided in section~\ref{sec:pgf:unknown:keys} + ``Unknown Keys'' because |/.search also| only applies only for keys + which are not fully qualified. + + + For those who are familiar with |\pgfkeys|, the actual + implementation of |/.search also| might be interesting: + \begin{enumerate} + \item |\pgfkeys{/path/.search also={/tikz}}| is equivalent to +\begin{codeexample}[code only] +\pgfkeys{/path/.unknown/.code={% + \ifpgfkeysaddeddefaultpath + % only process keys for which no full path has been + % provided: + \pgfkeyssuccessfalse + \let\pgfkeys@searchalso@name =\pgfkeyscurrentkeyRAW + \ifpgfkeyssuccess + \else + % search with /tikz as default path: + \pgfqkeys{/tikz}{\pgfkeys@searchalso@name={#1}}% + \fi + \else + \def\pgfutilnext{\pgfkeysvalueof {/handlers/.unknown/.@cmd}#1\pgfeov}% + \pgfutilnext + \fi + } +} +\end{codeexample} + \item |\pgfkeys{/path/.search also={/tikz,/pgf}}| is equivalent to +\begin{codeexample}[code only] +\pgfkeys{/path/.unknown/.code={% + \ifpgfkeysaddeddefaultpath + \pgfkeyssuccessfalse + \let\pgfkeys@searchalso@name=\pgfkeyscurrentkeyRAW + \ifpgfkeyssuccess + \else + % step 1: search in /tikz with .try: + \pgfqkeys{/tikz}{\pgfkeys@searchalso@name/.try={#1}}% + \fi + \ifpgfkeyssuccess + \else + % step 2: search in /pgf (without .try!): + \pgfqkeys{/pgf}{\pgfkeys@searchalso@name={#1}}% + \fi + \else + \def\pgfutilnext{\pgfkeysvalueof {/handlers/.unknown/.@cmd}#1\pgfeov}% + \pgfutilnext + \fi + } +} +\end{codeexample} + \end{enumerate} + + To also enable searching for styles (or other handled keys), + consider changing the configuration for handled keys to + |/hander config=full or existing| when you use |/.search also|, + that is, use +\begin{codeexample}[code only] +\pgfkeys{ + /main path/.search also={/secondary path}, + /handler config=full or existing} +\end{codeexample} +\end{handler} + + \subsubsection{Setting Defaults} \label{section-default-handlers} @@ -643,7 +925,7 @@ also define new ones as described in Section~\ref{section-key-handlers}. This handler works be adding code to the code of the key. This means that you have to define the key first before you can use this - handler. + handler. \begin{codeexample}[code only] \pgfkeys{/my key/.code=I do not want an argument!} \pgfkeys{/my key/.value forbidden} @@ -681,13 +963,13 @@ A number of handlers exist for defining the code of keys. \end{handler} \begin{handler}{{.ecode}|=|\meta{code}} - This handler works like |.code|, only the command |\pgfkeysedef| is - used. + This handler works like |/.code|, only the command |\pgfkeysedef| is + used. \end{handler} \begin{handler}{{.code 2 args}|=|\meta{code}} - This handler works like |.code|, only two arguments rather than one + This handler works like |/.code|, only two arguments rather than one are expected when the \meta{code} is executed. This means that when \meta{key}|=|\meta{value} is encountered in a key list, the \meta{value} should consist of two arguments. For instance, @@ -695,42 +977,64 @@ A number of handlers exist for defining the code of keys. executed with any occurrence of |#1| replaced |first| and any occurrence of |#2| replaced by |second|. - Because of the special way the \meta{value} is parsed, if you set - \meta{value} to, for instance, |first| (without any braces), then - |#1| will be set to |f| and |#2| will be set to |irst|. - \begin{codeexample}[code only] \pgfkeys{/page size/.code 2 args={\paperheight=#2\paperwidth=#1}} \pgfkeys{/page size={30cm}{20cm}} \end{codeexample} + The second argument is optional: if it is not provided, it will be the empty string. + + Because of the special way the \meta{value} is parsed, if you set + \meta{value} to, for instance, |first| (without any braces), then + |#1| will be set to |f| and |#2| will be set to |irst|. \end{handler} \begin{handler}{{.ecode 2 args}|=|\meta{code}} - This handler works like |.code 2 args|, only an |\edef| is used + This handler works like |/.code 2 args|, only an |\edef| is used rather than a |\def| to define the macro. \end{handler} +\begin{handler}{{.code n args}|=|\marg{argument count}\marg{code}} + This handler also works like |/.code|, but you can now specify a + number of arguments between $0$ and $9$ (inclusive). +\begin{codeexample}[] +\pgfkeys{/a key/.code n args={2}{First=`#1', Second=`#2'}} +\pgfkeys{/a key={A}{B}} +\end{codeexample} + In contrast to |/.code 2 args|, there must be exactly \meta{argument + count} arguments, not more and not less and these arguments should + be properly delimited. +\end{handler} + +\begin{handler}{{.ecode n args}|=|\marg{argument count}\marg{code}} + This handler works like |/.code n args|, only an |\edef| is used + rather than a |\def| to define the macro. +\end{handler} \begin{handler}{{.code args}|=|\marg{argument pattern}\marg{code}} - This handler also works like |.code|, but you can now specify an - arbitrary \meta{argument pattern}. Such a pattern is a usual \TeX\ - macro pattern. For instance, suppose \meta{argument pattern} is - |(#1/#2)| and \meta{key}|=|\meta{value} is encountered in a - key list with \meta{value} being |(first/second)|. Then \meta{code} - is executed with any occurrence of |#1| replaced |first| and any - occurrence of |#2| replaced by |second|. So, the actual \meta{value} - is matched against the \meta{argument pattern} in the standard \TeX\ - way. + This handler is the most flexible way to define a |/.code| key: you + can now specify an arbitrary \meta{argument pattern}. Such a pattern + is a usual \TeX\ macro pattern. For instance, suppose \meta{argument + pattern} is |(#1/#2)| and \meta{key}|=|\meta{value} is encountered + in a key list with \meta{value} being |(first/second)|. Then + \meta{code} is executed with any occurrence of |#1| replaced |first| + and any occurrence of |#2| replaced by |second|. So, the actual + \meta{value} is matched against the \meta{argument pattern} in the + standard \TeX\ way. \begin{codeexample}[code only] \pgfkeys{/page size/.code args={#1 and #2}{\paperheight=#2\paperwidth=#1}} \pgfkeys{/page size=30cm and 20cm} \end{codeexample} + + Note that |/.code n args| should be preferred in case you need just a number + of arguments (when the resulting keys are used, |/.code n args| + gobbles spaces between the arguments whereas |/.code args| considers + spaces to be part of the argument). \end{handler} \begin{handler}{{.ecode args}|=|\marg{argument pattern}\marg{code}} - This handler works like |.code args|, only an |\edef| is used + This handler works like |/.code args|, only an |\edef| is used rather than a |\def| to define the macro. \end{handler} @@ -743,11 +1047,11 @@ There are also handlers for modifying existing keys. \meta{append code} is added to this code at the end. Either can be empty. The argument list of \meta{code} cannot be changed using this handler. Note that both \meta{prefix code} and \meta{append code} - may contain parameters like |#2|. - + may contain parameters like |#2|. + \begin{codeexample}[code only] \pgfkeys{/par indent/.code={\parindent=#1}} -\newdimen\myparindent +\newdimen\myparindent \pgfkeys{/par indent/.add code={}{\myparindent=#1}} ... \pgfkeys{/par indent=1cm} % This will set both \parindent and @@ -772,7 +1076,7 @@ There are also handlers for modifying existing keys. The following handlers allow you to define \emph{styles}. A style is a key list that is processed whenever the style is given as a key in a key list. Thus, a style ``stands for'' a certain key value -list. Styles can be parametrized just like normal code. +list. Styles can be parameterized just like normal code. \begin{handler}{{.style}|=|\meta{key list}} This handler set things up so that whenever \meta{key}|=|\meta{value} is @@ -784,7 +1088,7 @@ list. Styles can be parametrized just like normal code. You can achieve the same effect by writing \meta{key}|/.code=\pgfkeysalso{|\meta{key list}|}|. This means, in particular, that the code of a key could also first execute some - normal code and only then process some further keys. + normal code and only then process some further keys. \begin{codeexample}[code only] \pgfkeys{/par indent/.code={\parindent=#1}} @@ -794,7 +1098,7 @@ list. Styles can be parametrized just like normal code. ... \pgfkeys{/normal indent} \end{codeexample} - The following example shows a parametrized style ``in action''. + The following example shows a parameterized style ``in action''. \begin{codeexample}[] \begin{tikzpicture}[outline/.style={draw=#1,fill=#1!20}] \node [outline=red] {red box}; @@ -804,7 +1108,7 @@ list. Styles can be parametrized just like normal code. \end{handler} \begin{handler}{{.estyle}|=|\meta{key list}} - This handler works like |.style|, only the \meta{code} is set using + This handler works like |/.style|, only the \meta{code} is set using |\edef| rather than |\def|. Thus, all macros in the \meta{code} are expanded prior to saving the style. \end{handler} @@ -812,10 +1116,10 @@ list. Styles can be parametrized just like normal code. For styles the corresponding handlers as for normal code exist: \begin{handler}{{.style 2 args}|=|\meta{key list}} - This handler works like |.code 2 args|, only for styles. Thus, the + This handler works like |/.code 2 args|, only for styles. Thus, the \meta{key list} may contain occurrences of both |#1| and |#2| and when the style is used, two parameters must be given as - \meta{value}. + \meta{value}. \begin{codeexample}[code only] \pgfkeys{/paper height/.code={\paperheight=#1},/paper width/.code={\paperwidth=#1}} \pgfkeys{/page size/.style 2 args={/paper height=#1,/paper width=#2}} @@ -824,24 +1128,28 @@ For styles the corresponding handlers as for normal code exist: \end{handler} \begin{handler}{{.estyle 2 args}|=|\meta{key list}} - This handler works like |.style 2 args|, only an |\edef| is used + This handler works like |/.style 2 args|, only an |\edef| is used rather than a |\def| to define the macro. \end{handler} \begin{handler}{{.style args}|=|\marg{argument pattern}\marg{key list}} - This handler works like |.code args|, only for styles. + This handler works like |/.code args|, only for styles. \end{handler} \begin{handler}{{.estyle args}|=|\marg{argument pattern}\marg{code}} - This handler works like |.ecode args|, only for styles. + This handler works like |/.ecode args|, only for styles. +\end{handler} + +\begin{handler}{{.style n args}|=|\marg{argument count}\meta{key list}} + This handler works like |/.code n args|, only for styles. Here, \meta{key list} may depend on all \meta{argument count} parameters. \end{handler} \begin{handler}{{.add style}|=|\marg{prefix key list}\marg{append key list}} - This handler works like |.add code|, only for styles. However, it is + This handler works like |/.add code|, only for styles. However, it is permissible to add styles to keys that have previously been set - using |.code|. (It is also permissible to add normal \meta{code} to - a key that has previously been set using |.style|). When you add a - style to a key that was previously set using |.code|, the following + using |/.code|. (It is also permissible to add normal \meta{code} to + a key that has previously been set using |/.style|). When you add a + style to a key that was previously set using |/.code|, the following happens: When \meta{key} is processed, the \meta{prefix key list} will be processed first, then the \meta{code} that was previously stored in \meta{key}|/.@cmd|, and then the keys in \meta{append key @@ -856,11 +1164,11 @@ For styles the corresponding handlers as for normal code exist: \end{handler} \begin{handler}{{.prefix style}|=|\meta{prefix key list}} - Works like |.add style|, but only for the prefix key list. + Works like |/.add style|, but only for the prefix key list. \end{handler} \begin{handler}{{.append style}|=|\meta{append key list}} - Works like |.add style|, but only for the append key list. + Works like |/.add style|, but only for the append key list. \end{handler} @@ -894,12 +1202,12 @@ that is directly stored in a key. |/my key=\pgfkeysnovalue| and, thus, |\pgfkeysnovalue| will be stored in |/my key|. - To retrieve the value stored in a key, the handler |.get| is used. + To retrieve the value stored in a key, the handler |/.get| is used. \end{handler} \begin{handler}{{.get}|=|\meta{macro}} Executes a |\let| command so that \meta{macro} contains the contents - stored in \meta{key}. + stored in \meta{key}. \begin{codeexample}[] \pgfkeys{/my key/.initial=red} @@ -914,6 +1222,21 @@ that is directly stored in a key. value} at the end of the value stored in \meta{key}. \end{handler} +\begin{handler}{{.prefix}|=|\marg{prefix value}} + Adds the \meta{prefix value} and the beginning of the value stored in \meta{key}. +\end{handler} + +\begin{handler}{{.append}|=|\marg{append value}} + Adds the \meta{append value} at the end of the value stored in \meta{key}. +\end{handler} + +\begin{handler}{{.link}|=|\meta{another key}} + Stores the value |\pgfkeysvalueof{|\meta{another key}|}| in the + \meta{key}. The idea is that when you expand the \meta{key}, the + value of \meta{another key} is expanded instead. This corresponds + loosely to the notion of soft links in Unix, hence the name. +\end{handler} + The next handler is useful for the common situation where \meta{key}|=|\meta{value} should cause the \meta{value} to be stored in some macro. Note that, typically, you could just as well store the @@ -923,10 +1246,10 @@ value in the key itself. This handler has the following effect: When you write \meta{key}|=|\meta{value}, the code |\def|\meta{macro}|{|\meta{value}|}| is executed. Thus, the given - value is ``stored'' in the \meta{macro}. + value is ``stored'' in the \meta{macro}. \begin{codeexample}[] \pgfkeys{/text/.store in=\mytext} -\def\a{world} +\def\a{world} \pgfkeys{/text=Hello \a!} \def\a{Gruffalo} \mytext @@ -934,13 +1257,13 @@ value in the key itself. \end{handler} \begin{handler}{{.estore in}|=|\meta{macro}} - This handler is similar to |.store in|, only the code + This handler is similar to |/.store in|, only the code |\edef|\meta{macro}|{|\meta{value}|}| is used. Thus, the macro-expanded version of \meta{value} is stored in the - \meta{macro}. + \meta{macro}. \begin{codeexample}[] \pgfkeys{/text/.estore in=\mytext} -\def\a{world} +\def\a{world} \pgfkeys{/text=Hello \a!} \def\a{Gruffalo} \mytext @@ -948,18 +1271,18 @@ value in the key itself. \end{handler} In another common situation a key is used to set a \TeX-if to true or -false. +false. \begin{handler}{{.is if}|=|\meta{\TeX-if name}} This handler has the following effect: When you write \meta{key}|=|\meta{value}, it is first checked that \meta{value} is |true| or |false| (the default is |true| if no \meta{value} is given). If this is not the case, the error key - |/errors/boolean expected| is executed. Otherwise, + |/errors/boolean expected| is executed. Otherwise, the code |\|\meta{\TeX-if name}\meta{value} is executed, which sets the \TeX-if accordingly. \begin{codeexample}[] -\newif\iftheworldisflat +\newif\iftheworldisflat \pgfkeys{/flat world/.is if=theworldisflat} \pgfkeys{/flat world=false} \iftheworldisflat @@ -995,7 +1318,7 @@ handler is useful. \end{handler} -\subsubsection{Expanding Values} +\subsubsection{Expanded and Multiple Values} When you write \meta{key}|=|\meta{value}, you usually wish to use the \meta{value} ``as is.'' Indeed, great care is taken to ensure that you @@ -1046,6 +1369,20 @@ Key 4:& \pgfkeys{/key4} before processing \meta{key}|=|\meta{result}. \end{handler} +\begin{handler}{{.list}|=|\meta{comma-separated list of values}} + This handler causes the key to be used repeatedly, namely once for + every element of the list of values. Note that the list of values + should typically be surrounded by braces since, otherwise, \TeX\ + will not be able to tell whether a comma starts a new key or a new + value. + + The \meta{list of values} is processed using the |\foreach| + statement, so you can use the |...| notation. +\begin{codeexample}[] +\pgfkeys{/foo/.code=(#1)} +\pgfkeys{/foo/.list={a,b,0,1,...,5}} +\end{codeexample} +\end{handler} \subsubsection{Handlers for Testing Keys} @@ -1053,13 +1390,13 @@ Key 4:& \pgfkeys{/key4} This handler causes the same things to be done as if \meta{key}|=|\meta{value} had been written instead. However, if neither \meta{key}|/.@cmd| nor the key itself is defined, no - handlers will be called. Instead, + handlers will be called. Instead, the execution of the key just stops. Thus, this handler will ``try'' to use the key, but no further action is taken when the key is not defined. The \TeX-if |\||ifpgfkeyssuccess| will be set according to whether - the \meta{key} was successfully executed or not. + the \meta{key} was successfully executed or not. \begin{codeexample}[] \pgfkeys{/a/.code=(a:#1)} \pgfkeys{/b/.code=(b:#1)} @@ -1068,9 +1405,9 @@ Key 4:& \pgfkeys{/key4} \end{handler} \begin{handler}{{.retry}|=|\meta{value}} - This handler works just like |.try|, only it will not do anything if + This handler works just like |/.try|, only it will not do anything if |\||ifpgfkeyssuccess| is false. Thus, this handler will only retry - to set a key if ``the last attempt failed''. + to set a key if ``the last attempt failed''. \begin{codeexample}[] \pgfkeys{/a/.code=(a:#1)} \pgfkeys{/b/.code=(b:#1)} @@ -1078,6 +1415,10 @@ Key 4:& \pgfkeys{/key4} \end{codeexample} \end{handler} +\begin{handler}{{.lastretry}|=|\meta{value}} + This handler works like |/.retry|, only it will invoke the usual handlers for unknowns keys if |\||ifpgfkeyssuccess| is false. Thus, this handlers will only try to set a key if ``the last attempt failed''. Furthermore, this here is the last such attempt. +\end{handler} + \subsubsection{Handlers for Key Inspection} @@ -1098,7 +1439,7 @@ Key 4:& \pgfkeys{/key4} The following key is not a handler, but it also commonly used for inspecting things: \begin{key}{/utils/exec=\meta{code}} - This key will simply execute the given \meta{code}. + This key will simply execute the given \meta{code}. \example |\pgfkeys{some key=some value,/utils/exec=\show\hallo,obscure key=obscure}| \end{key} @@ -1118,7 +1459,7 @@ language currently set so that users get a localized error message. \begin{key}{/errors/value required=\marg{offending key}\marg{value}} This key is executed whenever an \meta{offending key} is used - without a value when a value is actually required. + without a value when a value is actually required. \end{key} \begin{key}{/errors/value forbidden=\marg{offending key}\marg{value}} @@ -1127,16 +1468,18 @@ language currently set so that users get a localized error message. \end{key} \begin{key}{/errors/boolean expected=\marg{offending key}\marg{value}} - This key is executed whenever a key setup using |.is if| gets called + This key is executed whenever a key setup using |/.is if| gets called with a \meta{value} other than |true| or |false|. \end{key} \begin{key}{/errors/unknown choice value=\marg{offending key}\marg{value}} This key is executed whenever a choice is used as a \meta{value} for - a key setup using the |.is choice| handler that is not defined. + a key setup using the |/.is choice| handler that is not defined. \end{key} \begin{key}{/errors/unknown key=\marg{offending key}\marg{value}} This key is executed whenever a key is unknown and no specific - |.unknown| handler is found. + |/.unknown| handler is found. \end{key} + +\input pgfmanual-en-pgfkeysfiltered.tex diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex new file mode 100644 index 00000000000..b5c7e260432 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex @@ -0,0 +1,405 @@ +\subsection{Key Filtering} +\begingroup + +{\small \emph{An extension by Christian Feuers\"anger}} +\vspace{0.4cm}% + +\noindent +Normally, a call to |\pgfkeys| sets all keys provided in its argument list. This is usually what users expect it to do. However, implementations of different packages or \pgfname-libraries may need more control over the key setting procedure: library~A may want to set its options directly and communicate all remaining ones to library~B. + +This section describes key filtering methods of \pgfname, including options for family groupings. If you merely want to use \pgfname\ (or its libraries), you can skip this section. It is addressed to package (or library) authors. + +\subsubsection{Starting With An Example} +\label{section-key-filter-example} +Users of |xkeyval| are familiar with the concept of key families: keys belong to groups and those keys can be `filtered' out of other options. \pgfname\ supports family groupings and more abstract key selection mechanism with |\pgfkeysfiltered|, a variant of |\pgfkeys|. Suppose we have the example key grouping + +\pgfkeys{ + /my group/A1/.code=(A1:#1), + /my group/A2/.code=(A2:#1), + /my group/A3/.code=(A3:#1), + /my group/B/.code=(B:#1), + /my group/C/.code=(B:#1), + /my group/A/.is family, + /my group/A1/.belongs to family=/my group/A, + /my group/A2/.belongs to family=/my group/A, + /my group/A3/.belongs to family=/my group/A, + /pgf/key filters/active families/.install key filter, + /my group/A/.activate family, +}% +\begin{codeexample}[code only] +\pgfkeys{ + /my group/A1/.code=(A1:#1), + /my group/A2/.code=(A2:#1), + /my group/A3/.code=(A3:#1), + /my group/B/.code=(B:#1), + /my group/C/.code=(B:#1), +} +\end{codeexample} + +\noindent and we want to set options |A1|, |A2| and |A3| only. A call to |\pgfkeys| yields +\begin{codeexample}[] +\pgfkeys{/my group/A1=a1, /my group/A2=a2, /my group/B=b, /my group/C=c} +\end{codeexample} +\noindent because all those command option are processed consecutively. + +Now, let's define a family named |A| which contains |A1|, |A2| and |A3| and set only family members of |A|. We prepare our key settings with +\begin{codeexample}[code only] +\pgfkeys{ + /my group/A/.is family, + /my group/A1/.belongs to family=/my group/A, + /my group/A2/.belongs to family=/my group/A, + /my group/A3/.belongs to family=/my group/A, +} +\end{codeexample} +\noindent and +\begin{codeexample}[code only] +\pgfkeys{/pgf/key filters/active families/.install key filter} +\end{codeexample} +\noindent After this preparation, we can use |\pgfkeysfiltered| with +\begin{codeexample}[] +\pgfkeys{/my group/A/.activate family} +\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2, + /my group/B=b, /my group/C=c} +\end{codeexample} +\noindent or +\begin{codeexample}[] +\pgfkeys{/my group/A/.activate family} +\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2, + /my group/B=b, /my group/C=c, /tikz/color=blue, /my group/A3=a3} +\end{codeexample} +\noindent to set only keys which belong to an `active' family -- in our case, only family~|A| was active, so the remaining options have not been processed. The family processing is quite fast and allows an arbitrary number of active key families. + +Unprocessed options can be collected into a macro (similar to |xkeyval|'s |\xkv@rm|), discarded or handled manually. The details of key selection and family declaration are described in the following sections. + +\subsubsection{Setting Filters} +The command |\pgfkeysfiltered| is the main tool to process only selected options. It works as follows. +\begin{command}{\pgfkeysfiltered\marg{key-value-list}} + Processes all options in exactly the same way as |\pgfkeys|\marg{key-value-list}, but a key filter is considered as soon as key identification is complete. + + The key filter tells |\pgfkeysfiltered| whether it should continue to apply the current option (return value is `true') or whether something different shall be done (filter returns `false'). + + There is exactly one key filter in effect, and it is installed by the |.install key filter| handler or by |\pgfkeysinstallkeyfilter|. + + If the key filter returns `false', a unique key filter handler gets control. This handler is installed by the |.install key filter handler| method and has access to the key's full name, value and (possibly) path. + + Key filtering applies to any (possibly nested) call to |\pgfkeys|, |\pgfkeysalso|, |\pgfqkeys| and |\pgfqkeysalso| during the evaluation of \marg{key-value-list}. It does \emph{not} apply to routines like |\pgfkeyssetvalue| or |\pgfkeysgetvalue|. Furthermore, keys belonging to |/errors| are always processed. Key filtering routines can't be nested: you can't combine different key filters automatically. +\end{command} + +\begin{command}{\pgfqkeysfiltered\marg{default-path}\marg{key-value-list}} + A variant of |\pgfkeysfiltered| which uses the `quick' search path setting. It is the |\pgfqkeys| variant of |\pgfkeysfiltered|, see the documentation for |\pgfqkeys| for more details. +\end{command} + +\begin{command}{\pgfkeysalsofrom\marg{macro}} + A variant of |\pgfkeysalso| which loads its key list from \marg{macro}. + + It is useful in conjunction with the |/pgf/key filter handlers/append filtered to=|\meta{macro} handler. + + The following example uses the same settings as in the intro section~\ref{section-key-filter-example}. +\begin{codeexample}[] +\pgfkeys{/pgf/key filter handlers/append filtered to/.install key filter handler=\remainingoptions} +\def\remainingoptions{} +\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2, + /my group/B=b, /my group/C=c, /tikz/color=blue, /my group/A3=a3} + +Remaining: `\remainingoptions'. +\pgfkeysalsofrom{\remainingoptions} +\end{codeexample} +\end{command} + +\begin{command}{\pgfkeysalsofiltered\marg{key-value-list}} + This command works as |\pgfkeysfiltered|, but it does not change the current default path. See the documentation of |\pgfkeysalso| for more details. +\end{command} + +\begin{command}{\pgfkeysalsofilteredfrom\marg{macro}} + A variant of |\pgfkeysalsofiltered| which loads its key list from \marg{macro}. +\end{command} + +\begin{handler}{{.install key filter}|=|\meta{optional arguments}} + This handler install a key filter. A key filter is a command key which sets the \TeX-boolean |\ifpgfkeysfiltercontinue|, that means a key with existing `|/.@cmd|' suffix. A simple example is a key filter which returns always true: +\begin{codeexample}[code only] +\pgfkeys{/foo/bar/true key filter/.code={\pgfkeysfiltercontinuetrue}} +\pgfkeys{/foo/bar/true key filter/.install key filter} +\end{codeexample} + If key filters require arguments, they are installed by |.install key filter| as well. An example is the |/pgf/key filters/equals| handler: +\begin{codeexample}[] +\pgfkeys{/pgf/key filters/equals/.install key filter={/my group/A1}} +\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2, +/my group/B=b, /my group/C=c, /tikz/color=blue, /my group/A3=a3} +\end{codeexample} + If a key filter requires more than one argument, you need to provide the complete argument listing in braces like |{{first}{second}}|. + + You can also use |\pgfkeysinstallkeyfilter|\meta{full key}\meta{optional arguments}, it has the same effect. + + See section~\ref{section-key-writing-filters} for how to write key filters. +\end{handler} + +\begin{handler}{{.install key filter handler}|=|\meta{optional arguments}} + This handler installs the routine which will be invoked for every \emph{unprocessed} option, that means any option for which the key filter returned `false'. + + The |.install key filter handler| is used in the same way as |.install key filter|. There exists a macro version, |\pgfkeysinstallkeyfilterhandler|\meta{full key}\meta{optional arguments}, which has the same effect. + + See section~\ref{section-key-writing-filters} for how to write key filter handlers. +\end{handler} + +\subsubsection{Handlers For Unprocessed Keys} +Each option for which key filters decided to skip them is handed over to a `key filter handler'. There are several predefined key filter handlers. + +\begin{key}{/pgf/key filter handlers/append filtered to=\marg{macro}} + Install this filter handler to append any unprocessed options to macro \marg{macro}. +\begin{codeexample}[] +\pgfkeys{/pgf/key filter handlers/append filtered to/.install key filter handler=\remainingoptions} +\def\remainingoptions{} +\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2, + /my group/B=b, /my group/C=c, /tikz/color=blue} + +Remaining options: `\remainingoptions'. +\end{codeexample} + This example uses the same keys as defined in the intro section~\ref{section-key-filter-example}. +\end{key} + +\begin{key}{/pgf/key filter handlers/ignore} + Install this filter handler if you simply want to ignore any unprocessed option. This is the default. +\end{key} + +\begin{key}{/pgf/key filter handlers/log} + This key filter handler writes messages for any unprocessed option to your logfile (and terminal). +\end{key} + + +\subsubsection{Family Support} +\pgfname supports a family concept: every option can be associated with (at most) one family. Families form loose key groups which are independent of the key hierarchy. For example, |/my tree/key1| can belong to family |/tikz|. + +It is possible to `activate' or `deactivate' single families. Furthermore, it is possible to set only keys which belong to active families using appropriate key filter handlers. + +The family support is fast: if there are $N$ options in a key-value-list and there are $K$ active families, the runtime for |\pgfkeysfiltered| is $O(N+K)$ (activate every family $O(K)$, check every option $O(N)$, deactivate every family $O(K)$). + +\begin{handler}{{.is family}} + Defines a new family. This option has already been described in section~\ref{section-is family-handler} on page~\pageref{section-is family-handler}. +\end{handler} + +\begin{handler}{{.activate family}} + Activates a family. The family needs to be defined, otherwise |/errors/family unknown| will be raised. + + Activation means a \TeX-boolean will be set to |true|, indicating that a family should be processed. + + You can also use |\pgfkeysactivatefamily|\meta{full path} to get the same effect. Furthermore, you can use |\pgfkeysactivatefamilies|\meta{list of families}\meta{macro name for de-activation} to activate a list of families (see section~\ref{section-key-filter-api}). +\end{handler} + +\begin{handler}{{.deactivate family}} + Deactivates a family. The family needs to be defined, otherwise |/errors/family unknown| will be raised. + + You can also use |\pgfkeysdeactivatefamily|\meta{full path} to get the same effect. +\end{handler} + +\begin{handler}{{.belongs to family}|=|\marg{family name}} + Associates the current option with \marg{family name}, which is expected to be a full path of a family. +\begin{codeexample}[code only] +\pgfkeys{/foo/bar/.is family} +\pgfkeys{ + /foo/a/.belongs to family=/foo/bar, + /foo/b/.belongs to family=/foo/bar +} +\end{codeexample} + Each option can have up to one family, |.belongs to family| overwrites any old setting. +\end{handler} + +\begin{key}{/pgf/key filters/active families} + Install this key filter if |\pgfkeysfiltered| should only process activated families. If a key does not belong to any family, it is not processed. If a key is completely unknown within the default path, the normal `unknown' handlers of |\pgfkeys| are invoked. +\end{key} + +\begin{key}{/pgf/key filters/active families or no family=\marg{key filter 1}\marg{key filter 2}} + This key filter configures |\pgfkeysfiltered| to work as follows. + \begin{enumerate} + \item If the current key belongs to a family, set |\ifpgfkeysfiltercontinue| to true if and only if its family is active. + \item If the current key does \emph{not} belong to a family, assign |\ifpgfkeysfiltercontinue| as result of \marg{key filter 1}. + \item If the current key is unknown within the default path, assign |\ifpgfkeysfiltercontinue| as result of \marg{key filter 2}. + \end{enumerate} + The arguments \marg{key filter 1} and \marg{key filter 2} are other key filters (possibly with options) and allow fine-grained control over the filtering process. + \begin{codeexample}[code only] + \pgfkeysinstallkeyfilter + {/pgf/key filters/active families or no family} + {{/pgf/key filters/is descendant of=/tikz}% for keys without family + {/pgf/key filters/false}% for unknown keys + }% + \end{codeexample} + This key filter will return true for any option with active family. If an option has no family, the return value is true if and only if it belongs to |/tikz|. If the option is unknown, the return value is |false| and unknown handlers won't be called. +\end{key} + +\begin{key}{/pgf/key filters/active families or no family DEBUG=\marg{key filter 1}\marg{key filter 2}} + A variant of |active families or no family| which protocols each action on your terminal (log-file). +\end{key} + +\begin{key}{/pgf/key filters/active families and known} + A fast alias for + + |/pgf/key filters/active families or no family=|\par + \noindent\hskip10pt|{/pgf/keys filters/false}|\par + \noindent\hskip10pt|{/pgf/keys filters/false}|. +\end{key} +\begin{key}{/pgf/key filters/active families or descendants of=\marg{path prefix}} + A fast alias for + + |/pgf/key filters/active families or no family=|\par + \noindent\hskip10pt|{/pgf/keys filters/is descendant of=|\marg{path prefix}|}|\par + \noindent\hskip10pt|{/pgf/keys filters/false}|. +\end{key} + +\begin{command}{\pgfkeysactivatefamiliesandfilteroptions\marg{family list}\marg{key-value-list}}% + A simple shortcut macro which activates any family in the comma separated \marg{family list}, invokes |\pgfkeysfiltered|\meta{key-value-list} and deactivates the families afterwards. + + Please note that you will need to install a family key filter, otherwise family activation has no effect. +\end{command} +\begin{command}{\pgfqkeysactivatefamiliesandfilteroptions\marg{family list}\marg{default path}\marg{key-value-list}}% + The `quick' default path variant of |\pgfkeysactivatefamiliesandfilteroptions|. +\end{command} + +\begin{command}{\pgfkeysactivatesinglefamilyandfilteroptions\marg{family name}\marg{key-value-list}}% + A shortcut macro which activates a single family and invokes |\pgfkeysfiltered|. + + Please note that you will need to install a family key filter, otherwise family activation has no effect. +\end{command} +\begin{command}{\pgfqkeysactivatesinglefamilyandfilteroptions\marg{family name}\marg{default path}\marg{key-value-list}}% + The `quick' default path variant of |\pgfkeysactivatesinglefamilyandfilteroptions|. +\end{command} + +\subsubsection{Other Key Filters} +There are some more key filters which have nothing to do with family handling. +\begin{key}{/pgf/key filters/is descendant of=\marg{path}} + Install this key filter to process only options belonging to the key tree \marg{path}. It returns true for every key which has key path \marg{path}. It also returns true for any unknown key, that means unknown keys are processed using the standard unknown handlers of \pgfname. +\begin{codeexample}[] +\pgfkeys{ +/group 1/A/.code={(A:#1)}, +/group 1/foo/bar/B/.code={(B:#1)}, +/group 2/C/.code={(C:#1)}, +/pgf/key filters/is descendant of/.install key filter=/group 1} +\pgfkeysfiltered{/group 1/A=a,/group 1/foo/bar/B=b,/group 2/C=c} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/key filters/equals=\marg{full key}} + Install this key filter to process only the fully qualified option \marg{full key}. The filter returns true for any unknown key or if the key equals \marg{full key}. +\begin{codeexample}[] +\pgfkeys{ +/group 1/A/.code={(A:#1)}, +/group 1/B/.code={(B:#1)}, +/pgf/key filters/equals/.install key filter=/group 1/A} +\pgfqkeysfiltered{/group 1}{A=a,B=b} +\end{codeexample} +\end{key} + +\begin{key}{/pgf/key filters/not=\marg{key filter}} + This key filter logically inverts the result of \marg{key filter}. +\begin{codeexample}[] +\pgfkeys{ +/group 1/A/.code={(A:#1)}, +/group 1/foo/bar/B/.code={(B:#1)}, +/group 2/C/.code={(C:#1)}, +/pgf/key filters/not/.install key filter= + {/pgf/key filters/is descendant of=/group 1}} +\pgfkeysfiltered{/group 1/A=a,/group 1/foo/bar/B=b,/group 2/C=c} +\end{codeexample} + Please note that unknown keys will be handed to the usual unknown handlers. +\end{key} + +\begin{key}{/pgf/key filters/and=\marg{key filter 1}\marg{key filter 2}} + This key filter returns true if and only if both, \marg{key filter 1} and \marg{key filter 2} return true. + +\end{key} + +\begin{key}{/pgf/key filters/or=\marg{key filter 1}\marg{key filter 2}} + This key filter returns true if one of \marg{key filter 1} and \marg{key filter 2} returns true. + +\end{key} + +\begin{key}{/pgf/key filters/true} + This key filter returns always true. +\end{key} + +\begin{key}{/pgf/key filters/false} + This key filter returns always false (including unknown keys). +\end{key} + +\begin{key}{/pgf/key filters/defined} + This key filter returns false if the current key is unknown, which avoids calling the unknown handlers. +\end{key} + +\subsubsection{Programmer Interface} +\label{section-key-filter-api}% +\begin{plainenvironment}{{pgfkeysinterruptkeyfilter}}% + Temporarily disables key filtering inside of the environment. If key filtering is not active, this has no effect at all. + + Please note that no \TeX-group is introduced. +\end{plainenvironment} + +\begin{command}{\pgfkeyssavekeyfilterstateto\marg{macro}} +Creates \marg{macro} which contains commands to re-activate the current +key filter and key filter handler. It can be used to temporarily +switch the key filter. +\end{command} + +\begin{command}{\pgfkeysinstallkeyfilter\marg{full key}\marg{optional arguments}}% + The command |\pgfkeysinstallkeyfilter{|\meta{full key}|}{|\meta{optional arguments}|}| has the same effect as |\pgfkeys{|\meta{full key}|/.install key filter={|\meta{optional arguments}|}}|. +\end{command} + +\begin{command}{\pgfkeysinstallkeyfilterhandler\marg{full key}\marg{optional arguments}}% + The command |\pgfkeysinstallkeyfilterhandler{|\meta{full key}|}{|\meta{optional arguments}|}| has the same effect as |\pgfkeys{|\meta{full key}|/.install key filter handler={|\meta{optional arguments}|}}|. +\end{command} + + +\begin{command}{\pgfkeysactivatefamily\marg{family name}}% + Equivalent to |\pgfkeys{|\meta{family name}|/.activate family}|. +\end{command} + +\begin{command}{\pgfkeysdeactivatefamily\marg{family name}}% + Equivalent to |\pgfkeys{|\meta{family name}|/.dactivate family}|. +\end{command} + +\begin{command}{\pgfkeysactivatefamilies\marg{family list}\marg{deactivate macro name}}% + Activates each family in \meta{family list} and creates a macro \meta{deactivate macro name} which de-activates each family in \meta{family list}. +\begin{codeexample}[code only] +\pgfkeysactivatefamilies{/family 1,/family 2,/family 3}{\deactivatename} +\pgfkeysfiltered{foo,bar} +\deactivatename +\end{codeexample} +\end{command} + + +\begin{command}{\pgfkeysiffamilydefined\marg{family}\marg{true case}\marg{false case}}% + Checks whether the full key \meta{family} is a family and executes either \meta{true case} or \meta{false case}. +\end{command} + +\begin{command}{\pgfkeysisfamilyactive\marg{family}}% + Sets the \TeX-boolean |\ifpgfkeysfiltercontinue| to whether \meta{family} is active or not. +\end{command} + +\begin{command}{\pgfkeysgetfamily\marg{key}\marg{resultmacro}}% + Returns the family associated to a full key \meta{key} into macro \meta{resultmacro}. +\end{command} + +\begin{command}{\pgfkeyssetfamily\marg{key}\marg{family}}% + The command |\pgfkeyssetfamily|\marg{full key}\marg{family} has the same effect as |\pgfkeys{|\meta{full key}|/.belongs to family=|\marg{family}|}|. +\end{command} + +\subsubsection{Defining Own Filters Or Filter Handlers} +\label{section-key-writing-filters} + During |\pgfkeysfiltered|, the key filter code will be invoked. At this time, the full key path including key name is available as |\pgfkeyscurrentkey|, the key name before default paths have been considered as |\pgfkeyscurrentkeyRAW| and the values as |\pgfkeyscurrentvalue|. + + Furthermore, the macro |\pgfkeyscasenumber| contains the current key's type as an integer: +\begin{itemize} +\item[\meta{1}] The key is a command key (i.e. |.../.@cmd| exists). +\item[\meta{2}] The key contains its value directly. +\item[\meta{3}] The key is handled (for example it is |.code| or |.cd|). + +In this case, the macros |\pgfkeyscurrentname| and |\pgfkeyscurrentpath| are set to the handlers name and path, respectively. +Invoke |\pgfkeyssplitpath{}| to extract these values for non-handled keys. +\item[\meta{0}] The key is unknown. +\end{itemize} + Any key filter or key filter handler can access these variables. Key filters are expected to set the \TeX-boolean |\ifpgfkeysfiltercontinue| to whether the current key shall be processed or not. + +\begin{command}{\pgfkeysevalkeyfilterwith\marg{full key}=\marg{filter arguments}} + Evaluates a fully qualified key filter \meta{full key} with argument(s) \meta{filter arguments}. +\begin{codeexample}[code only] +\pgfkeysevalkeyfilterwith{/pgf/key filters/equals=/tikz} +\end{codeexample} +\end{command} +\endgroup diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex index 9c10da526c8..3739db4d83b 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex @@ -39,7 +39,7 @@ command. \end{command} \begin{command}{\pgfsys@endpicture} - Called at the end of a pgfpicture. + Called at the end of a pgfpicture. Most drivers will need to implement this command. \end{command} @@ -51,7 +51,7 @@ command. box that contains only the |\special|'s that make up the description of the picture. The job of this command is to resize and shift \meta{box} according to the baseline shift and the size of the - box. + box. This command has a default implementation and need not be implemented by a driver file. @@ -61,15 +61,15 @@ command. This version of the |\pgfsys@beginpicture| picture command can be used for pictures that are guaranteed not to contain any escaped boxes (see below). In this case, a driver might provide a more - compact version of the command. - + compact version of the command. + This command has a default implementation and need not be implemented by a driver file. \end{command} \begin{command}{\pgfsys@endpurepicture} Called at the end of a ``pure'' |{pgfpicture}|. - + This command has a default implementation and need not be implemented by a driver file. \end{command} @@ -82,14 +82,14 @@ force. For this escaping, the following command is used: \begin{command}{\pgfsys@hbox\marg{box number}} Called to insert a (horizontal) TeX box inside a |{pgfpicture}|. - + Most drivers will need to (re-)implement this command. \end{command} \begin{command}{\pgfsys@hboxsynced\marg{box number}} Called to insert a (horizontal) TeX box inside a - |{pgfpicture}|, but with the current coordiante transformation - matrix synced with the canvas transformation matrix. + |{pgfpicture}|, but with the current coordinate transformation + matrix synced with the canvas transformation matrix. This command should do the same as if you used |\pgflowlevelsynccm| followed by |\pgfsys@hbox|. However, the default @@ -118,14 +118,14 @@ force. For this escaping, the following command is used: |\pgf@sys@bp| helps with this conversion. \example Draw a line from $(10\mathrm{pt},10\mathrm{pt})$ to the - origin of the picture. + origin of the picture. \begin{codeexample}[code only] \pgfsys@moveto{10pt}{10pt} \pgfsys@lineto{0pt}{0pt} \pgfsys@stroke \end{codeexample} - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -133,7 +133,7 @@ force. For this escaping, the following command is used: Continue the current path to $(x,y)$ with a straight line. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -148,7 +148,7 @@ force. For this escaping, the following command is used: \pgfsys@stroke \end{codeexample} - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -159,9 +159,9 @@ force. For this escaping, the following command is used: This command can be ``mapped back'' to |\pgfsys@moveto| and |\pgfsys@lineto| commands, but it is included since \pdf\ has a - special, quick version of this command. + special, quick version of this command. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -189,13 +189,13 @@ force. For this escaping, the following command is used: \pgfsys@lineto{0bp}{0bp} \pgfsys@stroke \end{codeexample} - + The difference between the above will be that in the second triangle the corner at the origin will be wrong; it will just be the overlay of two lines going in different directions, not a sharp pointed corner. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -207,11 +207,11 @@ force. For this escaping, the following command is used: Perform a concatenation of the canvas transformation matrix with the matrix given by the values \meta{a} to \meta{f}, see the \pdf\ or PostScript manual for details. The values \meta{a} to \meta{d} are - dimensionless factors, \meta{e} and \meta{f} are \TeX\ dimensions + dimensionless factors, \meta{e} and \meta{f} are \TeX\ dimensions \example |\pgfsys@transformcm{1}{0}{0}{1}{1cm}{1cm}|. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -221,7 +221,7 @@ force. For this escaping, the following command is used: This command has a default implementation and need not be implemented by a driver file. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@transformxyscale\marg{x scale}\marg{y scale}} @@ -236,7 +236,7 @@ force. For this escaping, the following command is used: This command has a default implementation and need not be implemented by a driver file. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -257,7 +257,7 @@ force. For this escaping, the following command is used: \item[Stroke color] This special color is used for stroking. If it is not set, the current color is used. - + \item[Cap] The cap describes how the endings of lines are drawn. A round cap adds a little half circle to these endings. A butt cap ends the @@ -266,7 +266,7 @@ force. For this escaping, the following command is used: lines protrude over the endpoint by the line thickness. (See also the \pdf\ manual.) If the path has been closed, no cap is drawn. - + \item[Join] This describes how a bend (a join) in a path is rendered. A round join draws bends using small arcs. A bevel join just draws the two @@ -274,21 +274,21 @@ force. For this escaping, the following command is used: convex. A miter join extends the lines so that they form a single sharp corner, but only up to a certain miter limit. (See the \pdf\ manual once more.) - + \item[Dash] The line may be dashed according to a dashing pattern. - + \item[Clipping area] If a clipping area is established, only those parts of the path that are inside the clipping area will be drawn. \end{description} - + In addition to stroking a path, the path may also be used for clipping after it has been stroked. This will happen if the |\pgfsys@clipnext| is used prior to this command, see there for details. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -299,7 +299,7 @@ force. For this escaping, the following command is used: This command has a default implementation and need not be implemented by a driver file. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -311,19 +311,19 @@ force. For this escaping, the following command is used: used to determine whether a point is inside or outside the path, except if |\ifpgfsys@eorule| holds -- in which case the even-odd rule should be used. (See the \pdf\ or PostScript manual - for details.) - + for details.) + The following graphic state parameters influence the filling: - + \begin{description} \item[Interior rule] If |\ifpgfsys@eorule| is set, the even-odd rule is used, otherwise the non-zero winding number rule. - + \item[Fill color] If the fill color is not especially set, the current color is - used. - + used. + \item[Clipping area] If a clipping area is established, only those parts of the filling area that are inside the clipping area will be drawn. @@ -332,7 +332,7 @@ force. For this escaping, the following command is used: In addition to filling the path, the path will also be used for clipping if |\pgfsys@clipnext| is used prior to this command. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@fillstroke} @@ -345,17 +345,17 @@ force. For this escaping, the following command is used: In addition to stroking and filling the path, the path will also be used for clipping if |\pgfsys@clipnext| is used prior to this command. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@discardpath} Normally, this command should ``throw away'' the current path. However, after |\pgfsys@clipnext| has been called, the current path - should subsequently be used for clipping. See |\pgfsys@clipnext| for - details. + should subsequently be used for clipping. See |\pgfsys@clipnext| for + details. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -381,50 +381,50 @@ force. For this escaping, the following command is used: Sets the width of lines, when stroked, to \meta{width}, which must be a \TeX\ dimension. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@buttcap} Sets the cap to a butt cap. See |\pgfsys@stroke|. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@roundcap} Sets the cap to a round cap. See |\pgfsys@stroke|. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@rectcap} Sets the cap to a rectangular cap. See |\pgfsys@stroke|. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@miterjoin} Sets the join to a miter join. See |\pgfsys@stroke|. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@setmiterlimit\marg{factor}} Sets the miter limit of lines to \meta{factor}. See the \pdf\ or PostScript for details on what the miter limit is. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@roundjoin} Sets the join to a round join. See |\pgfsys@stroke|. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@beveljoin} Sets the join to a bevel join. See |\pgfsys@stroke|. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@setdash\marg{pattern}\marg{phase}} @@ -433,7 +433,7 @@ force. For this escaping, the following command is used: single dimension. \example |\pgfsys@setdash{3pt,3pt}{0pt}| - + The list of values in \meta{pattern} is used to determine the lengths of the ``on'' phases of the dashing and of the ``off'' phases. For example, if \meta{pattern} is |3bp,4bp|, then the dashing @@ -441,15 +441,15 @@ force. For this escaping, the following command is used: followed by 4bp off, and so on.'' A pattern of |.5pt,4pt,3pt,1.5pt| means ``.5pt on, 4pt off, 3pt on, 1.5pt off, .5pt on, \dots'' If the number of entries is odd, the last one is used twice, so |3pt| means - ``3pt on, 3pt off, 3pt on, 3pt off, \dots'' An empty list + ``3pt on, 3pt off, 3pt on, 3pt off, \dots'' An empty list means ``always on.'' - + The second argument determines the ``phase'' of the pattern. For example, for a pattern of |3bp,4bp| and a phase of |1bp|, the pattern would start: ``2bp on, 4bp off, 3bp on, 4bp off, 3bp on, 4bp off, \dots'' - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} {\let\ifpgfsys@eorule=\relax @@ -468,34 +468,34 @@ and |xcolor| package, which perform similar functions. However, the |color| package does not support having two different colors for stroking and filling, which is a useful feature that is supported by \pgfname. For this reason, the \pgfname\ system layer offers commands for -setting these colors separatedly. Also, plain \TeX\ profits from the +setting these colors separately. Also, plain \TeX\ profits from the fact that \pgfname\ can set colors. -For \pdf, implementing these color commands is easy since \pdf\ +For \pdf, implementing these color commands is easy since \pdf\ supports different stroking and filling colors directly. For PostScript, a more complicated approach is needed in which the colors need to be stored in special PostScript variables that are set whenever a stroking or a filling operation is done. \begin{command}{\pgfsys@color@rgb\marg{red}\marg{green}\marg{blue}} - Sets the color used for stroking and filling operations to the given + Sets the color used for stroking and filling operations to the given red/green/blue tuple (numbers between 0 and 1). - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@rgb@stroke\marg{red}\marg{green}\marg{blue}} Sets the color used for stroking operations to the given - red/green/blue tuple (numbers between 0 and 1). + red/green/blue tuple (numbers between 0 and 1). \example Make stroked text dark red: |\pgfsys@color@rgb@stroke{0.5}{0}{0}| The special stroking color is only used if the stroking color has been set since the last |\color| or |\pgfsys@color@xxx| command. Thus, each |\color| command will reset both the stroking - and filling colors by calling |\pgfsys@color@reset|. + and filling colors by calling |\pgfsys@color@reset|. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@rgb@fill\marg{red}\marg{green}\marg{blue}} @@ -503,70 +503,70 @@ whenever a stroking or a filling operation is done. red/green/blue tuple (numbers between 0 and 1). This color may be different from the stroking color. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@cmyk\marg{cyan}\marg{magenta}\marg{yellow}\marg{black}} Sets the color used for stroking and filling operations to the given - cymk tuple (numbers between 0 and 1). + cymk tuple (numbers between 0 and 1). - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@cmyk@stroke\marg{cyan}\marg{magenta}\marg{yellow}\marg{black}} Sets the color used for stroking operations to the given cymk tuple - (numbers between 0 and 1). + (numbers between 0 and 1). - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@cmyk@fill\marg{cyan}\marg{magenta}\marg{yellow}\marg{black}} Sets the color used for filling operations to the given cymk tuple - (numbers between 0 and 1). + (numbers between 0 and 1). - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@cmy\marg{cyan}\marg{magenta}\marg{yellow}} Sets the color used for stroking and filling operations to the given - cym tuple (numbers between 0 and 1). + cymk tuple (numbers between 0 and 1). - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@cmy@stroke\marg{cyan}\marg{magenta}\marg{yellow}} - Sets the color used for stroking operations to the given cym tuple - (numbers between 0 and 1). + Sets the color used for stroking operations to the given cymk tuple + (numbers between 0 and 1). - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@cmy@fill\marg{cyan}\marg{magenta}\marg{yellow}} - Sets the color used for filling operations to the given cym tuple - (numbers between 0 and 1). + Sets the color used for filling operations to the given cymk tuple + (numbers between 0 and 1). - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@gray\marg{black}} Sets the color used for stroking and filling operations to the given black value, where 0 means black and 1 means white. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@gray@stroke\marg{black}} Sets the color used for stroking operations to the given black value, where 0 means black and 1 means white. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@gray@fill\marg{black}} Sets the color used for filling operations to the given black value, where 0 means black and 1 means white. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@color@reset} @@ -587,7 +587,7 @@ whenever a stroking or a filling operation is done. or stroke color might be in force. However, when the box is later on inserted at some point, a special fill color might already have been set. In this case, this command is not guaranteed to reset the color - correctly. + correctly. \end{command} \begin{command}{\pgfsys@color@reset@inordertrue} @@ -596,7 +596,7 @@ whenever a stroking or a filling operation is done. \end{command} \begin{command}{\pgfsys@color@reset@inorderfalse} - Switches off the optimized color resetting. + Switches off the optimized color resetting. \end{command} \begin{command}{\pgfsys@color@unstacked\marg{\LaTeX\ color}} @@ -648,7 +648,7 @@ whenever a stroking or a filling operation is done. \end{command} \begin{command}{\pgfsys@setpatterncolored\marg{name}} - Sets the fill color to the pattern named \meta{name}. This pattern + Sets the fill color to the pattern named \meta{name}. This pattern must have been declared with the |1| flag. \end{command} @@ -662,22 +662,22 @@ local. \begin{command}{\pgfsys@beginscope} Saves the current graphic state on a graphic state stack. All changes to the graphic state parameters mentioned for |\pgfsys@stroke| - and |\pgfsys@fill| will be local to the current graphic state and + and |\pgfsys@fill| will be local to the current graphic state and the old values will be restored after |\pgfsys@endscope| is used. - + \emph{Warning:} \pdf\ and PostScript differ with respect to the question of whether the current path is part of the graphic state or not. For this reason, you should never use this command unless the - path is currently empty. For example, it might be a good idea to use - |\pgfsys@discardpath| prior to calling this command. + path is currently empty. For example, it might be a good idea to use + |\pgfsys@discardpath| prior to calling this command. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} \begin{command}{\pgfsys@endscope} Restores the last saved graphic state. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -699,12 +699,12 @@ The system layer provides some commands for image inclusion. \begin{command}{\pgfsys@defineimage} - Called, when an image should be defined. - + Called, when an image should be defined. + This command does not take any parameters. Instead, certain macros will be preinstalled with appropriate values when this command is invoked. These are: - + \begin{itemize} \item\declare{|\pgf@filename|} File name of the image to be defined. @@ -714,19 +714,19 @@ The system layer provides some commands for image inclusion. \item\declare{|\pgf@imageheight|} Will be set to the desired (scaled) height of the image. - + If this macro and also the height macro are empty, the image should have its ``natural'' size. - + If exactly only of them is specified, the undefined value the image is scaled so that the aspect ratio is kept. - + If both are set, the image is scaled in both directions independently, possibly changing the aspect ratio. \end{itemize} - + The following macros presumable mostly make sense for drivers that - can handle \pdf: + can handle \pdf: \begin{itemize} \item \declare{|\pgf@imagepage|} @@ -734,15 +734,15 @@ The system layer provides some commands for image inclusion. ``image.'' \item\declare{|\pgf@imagemask|} - If set, it will be set to |/SMask x 0 R| where |x| is the \pdf\ + If set, it will be set to |/SMask x 0 R| where |x| is the \pdf\ object number of a soft mask to be applied to the image. \item\declare{|\pgf@imageinterpolate|} If set, it will be set to |/Interpolate true| or |/Interpolate false|, indicating whether the image should be - interpolated in \pdf. + interpolated in \pdf. \end{itemize} - + The command should now setup the macro |\pgf@image| such that calling this macro will result in typesetting the image. Thus, |\pgf@image| is the ``return value'' of the command. @@ -761,18 +761,18 @@ The system layer provides some commands for image inclusion. command should be the definition of a macro called |\@pgfshading|\meta{name}|!| (or |\csname @pdfshading|\meta{name}|!\endcsname|, to be precise). When invoked, this new macro should insert a shading at - the current position. - + the current position. + \meta{name} is the name of the shading, which is also used in the output macro name. \meta{height} is the height of the shading and must be given as a TeX dimension like |2cm| or - |10pt|. \meta{specification} is a shading color + |10pt|. \meta{specification} is a shading color specification as specified in Section~\ref{section-shadings}. The - shading specification implicitly fixes the width of the shading. - + shading specification implicitly fixes the width of the shading. + When |\@pgfshading|\meta{name}|!| is invoked, it should insert a box of height \meta{height} and the width implicit in the shading - declaration. + declaration. \end{command} @@ -793,7 +793,7 @@ The system layer provides some commands for image inclusion. \end{command} -\begin{command}{\pgfsys@radialshading\marg{name}\marg{lower left +\begin{command}{\pgfsys@functionalshading\marg{name}\marg{lower left corner}\meta{upper right corner}\marg{type 4 function}} Declares a shading using a PostScript-like function that provides a color for each point. Like the previous macros, this command @@ -816,7 +816,7 @@ The system layer provides some commands for image inclusion. green, and blue components of the color. A buggy function will result is \emph{totally unpredictable chaos} during - rendering. + rendering. \end{command} @@ -835,7 +835,7 @@ The system layer provides some commands for image inclusion. This takes a TeX box and converts it into a transparency group. This means that any transparency settings apply to the box as a whole. For instance, if a box contains two overlapping black - circles and you draw the box and, thus, the two cirlces normally + circles and you draw the box and, thus, the two circles normally with 50\% transparency, then the overlap will be darker than the rest. By comparison, if the circles are part of a transparency group, the overlap will get the same color as the rest. @@ -854,7 +854,7 @@ The system layer provides some commands for image inclusion. fading. The fading should be centered on the origin and have its original size, except that the parameters \meta{a} to \meta{f} specify a transformation matrix that should be applied additionally - to the fading before it is installed. The transformtion should not + to the fading before it is installed. The transformation should not apply to the following graphics, however. \end{command} @@ -866,8 +866,8 @@ The system layer provides some commands for image inclusion. the command is called. The result should be to set the macro |\pgf@mask| to a pdf object count that can subsequently be used as a transparency mask. The following macros will be set when this command is - invoked: - + invoked: + \begin{itemize} \item \declare{|\pgf@filename|} File name of the mask to be defined. @@ -887,7 +887,7 @@ The system layer provides some commands for image inclusion. \subsection{Reusable Objects System Commands} \begin{command}{\pgfsys@invoke\marg{literals}} - This command gets protocoled literals and should insert them into + This command gets protocolled literals and should insert them into the |.pdf| or |.dvi| file using an appropriate |\special|. \end{command} @@ -897,7 +897,7 @@ The system layer provides some commands for image inclusion. precached in some way and then be rendered more quickly when used several times. For example, an arrow head might be defined and prerendered in this way. - + The parameter \meta{name} is the name for later use. \meta{lower left} and \meta{upper right} are \pgfname\ points specifying a bounding box for the object. \meta{code} is the code for the object. The code @@ -909,7 +909,7 @@ The system layer provides some commands for image inclusion. \begin{command}{\pgfsys@useobject\marg{name}\marg{extra code}} Renders a previously declared object. The first parameter is the - name of the the object. The second parameter is extra code that + name of the object. The second parameter is extra code that should be executed right \emph{before} the object is rendered. Typically, this will be some transformation code. @@ -931,14 +931,14 @@ commands do not open a graphics scope and can be opened and closed output should be suppressed. Nothing should be drawn at all, which includes all paths, images and shadings. However, no groups (neither \TeX\ groups nor graphic state groups) should be opened by this - command. + command. This command has a default implementation and need not be implemented by a driver file. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} - + \begin{command}{\pgfsys@endinvisible} Ends the invisibility section, unless invisibility blocks have been nested. In this case, only the ``last'' one restores visibility. @@ -946,7 +946,7 @@ commands do not open a graphics scope and can be opened and closed This command has a default implementation and need not be implemented by a driver file. - This command is protocoled, see Section~\ref{section-protocols}. + This command is protocolled, see Section~\ref{section-protocols}. \end{command} @@ -1045,9 +1045,9 @@ command may be useful: \end{command} Note that this command is \emph{not} a system command that can/needs -to be overwritten by a driver. +to be overwritten by a driver. -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex index b02713dc849..e46a31e0247 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex @@ -22,14 +22,14 @@ single sweep.'' When protocolling is ``switched on,'' there is a ``current protocol'' to which literal text gets appended. Once all commands that needed to -be protocoled have been issued, the protocol can be obtained and +be protocolled have been issued, the protocol can be obtained and stored using |\pgfsysprotocol@getcurrentprotocol|. At any point, the current protocol can be changed using a corresponding setting command. Finally, |\pgfsysprotocol@invokecurrentprotocol| is used to -insert the protocoled commands into the |.pdf| or |.dvi| file. +insert the protocolled commands into the |.pdf| or |.dvi| file. Only those |\pgfsys@| commands can be protocolled that use the -command |\pgfsysprotocol@literal| interally. For example, the +command |\pgfsysprotocol@literal| internally. For example, the definition of |\pgfsys@moveto| in |pgfsys-common-pdf.def| is \begin{codeexample}[code only] \def\pgfsys@moveto#1#2{\pgfsysprotocol@literal{#1 #2 m}} @@ -52,7 +52,7 @@ require special |\special|'s and cannot be protocolled. \begin{command}{\pgfsysprotocol@bufferedtrue} Turns on protocolling. All subsequent calls of |\pgfsysprotocol@literal| will append their argument to the current - protocol. + protocol. \end{command} \begin{command}{\pgfsysprotocol@bufferedfalse} @@ -84,7 +84,7 @@ require special |\special|'s and cannot be protocolled. \end{command} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex index 50aa70a3af2..c80846dcd85 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex @@ -45,7 +45,7 @@ expands to the first line of the above example. Similarly, |\fill| is an abbreviation for |\path[fill]| and |\filldraw| is an abbreviation for the command |\path[fill,draw]|. Since options accumulate, the following commands -all have the same effect: +all have the same effect: \begin{codeexample}[code only] \path [draw,fill] (0,0) circle (1cm); \path [draw] [fill] (0,0) circle (1cm); @@ -106,7 +106,7 @@ The most unspecific option for setting colors is the following: The \meta{color name} is the name of a previously defined color. For \LaTeX\ users, this is just a normal ``\LaTeX-color'' and the - |xcolor| extensions are allows. Here is an example: + |xcolor| extensions are allowed. Here is an example: \begin{codeexample}[] \tikz \fill[color=red!20] (0,0) circle (1ex); @@ -128,7 +128,7 @@ The most unspecific option for setting colors is the following: to do the following: \begin{itemize} \item Specify a new color using |\definecolor|. Only the two color - models |gray| and |rgb| are supported. + models |gray| and |rgb| are supported\footnote{Con\TeX t users should be aware that \texttt{\textbackslash definecolor} has a different meaning in Con\TeX t. There is a low-level equivalent named \texttt{\textbackslash pgfutil@definecolor} which can be used instead.}.% \example |\definecolor{orange}{rgb}{1,0.5,0}| \item Use |\colorlet| to define a new color based on an old one. Here, the |!| mechanism is supported, though only ``once'' @@ -169,7 +169,7 @@ You can draw a path using the following option: If the special color name |none| is given, this option causes drawing to be ``switched off.'' This is useful if a style has previously switched on drawing and you locally wish to undo this - effect. + effect. Although this option is normally used on paths to indicate that the path should be drawn, it also makes sense to use the option with a @@ -203,7 +203,7 @@ how a path is drawn. All of these options only have an effect if the There are a number of predefined styles that provide more ``natural'' ways of setting the line width. You can also redefine these -styles. +styles. \begin{stylekey}{/tikz/ultra thin} Sets the line width to 0.1pt. @@ -279,8 +279,8 @@ styles. \begin{codeexample}[] \begin{tikzpicture}[line width=10pt] \draw[line join=round] (0,0) -- ++(.5,1) -- ++(.5,-1); - \draw[line join=bevel] (1.25,0) -- ++(.5,1) -- ++(.5,-1); - \draw[line join=miter] (2.5,0) -- ++(.5,1) -- ++(.5,-1); + \draw[line join=bevel] (1.25,0) -- ++(.5,1) -- ++(.5,-1); + \draw[line join=miter] (2.5,0) -- ++(.5,1) -- ++(.5,-1); \useasboundingbox (0,1.5); % make bounding box bigger \end{tikzpicture} \end{codeexample} @@ -288,9 +288,9 @@ styles. \begin{key}{/tikz/miter limit=\meta{factor} (initially 10)} When you use the miter join and there is a very sharp corner (a small angle), the miter join may protrude very far over the actual - joining point. In this case, if it were to protrude by + joining point. In this case, if it were to protrude by more than \meta{factor} times the line width, the miter join is - replaced by a bevel join. + replaced by a bevel join. \begin{codeexample}[] \begin{tikzpicture}[line width=5pt] @@ -309,7 +309,7 @@ styles. \textsc{metafont}. For example following pattern |on 2pt off 3pt on 4pt off 4pt| means ``draw 2pt, then leave out 3pt, then draw 4pt once more, then leave out 4pt - again, repeat''. + again, repeat''. \begin{codeexample}[] \begin{tikzpicture}[dash pattern=on 2pt off 3pt on 4pt off 4pt] @@ -389,6 +389,56 @@ dashing conveniently. \end{stylekey} +\begin{stylekey}{/tikz/dashdotted} + Shorthand for setting a dashed and dotted dash pattern. + +\begin{codeexample}[] +\tikz \draw[dashdotted] (0pt,0pt) -- (50pt,0pt); +\end{codeexample} +\end{stylekey} + +\begin{stylekey}{/tikz/densely dashdotted} + Shorthand for setting a densely dashed and dotted dash pattern. + +\begin{codeexample}[] +\tikz \draw[densely dashdotted] (0pt,0pt) -- (50pt,0pt); +\end{codeexample} +\end{stylekey} + +\begin{stylekey}{/tikz/loosely dashdotted} + Shorthand for setting a loosely dashed and dotted dash pattern. + +\begin{codeexample}[] +\tikz \draw[loosely dashdotted] (0pt,0pt) -- (50pt,0pt); +\end{codeexample} +\end{stylekey} + + +\begin{stylekey}{/tikz/dashdotdotted} + Shorthand for setting a dashed and dotted dash pattern with more dots. + +\begin{codeexample}[] +\tikz \draw[dashdotdotted] (0pt,0pt) -- (50pt,0pt); +\end{codeexample} +\end{stylekey} + +\begin{stylekey}{/tikz/densely dashdotdotted} + Shorthand for setting a densely dashed and dotted dash pattern with more dots. + +\begin{codeexample}[] +\tikz \draw[densely dashdotdotted] (0pt,0pt) -- (50pt,0pt); +\end{codeexample} +\end{stylekey} + +\begin{stylekey}{/tikz/loosely dashdotdotted} + Shorthand for setting a loosely dashed and dotted dash pattern with more dots. + +\begin{codeexample}[] +\tikz \draw[loosely dashdotdotted] (0pt,0pt) -- (50pt,0pt); +\end{codeexample} +\end{stylekey} + + \subsubsection{Graphic Parameters: Draw Opacity} When a line is drawn, it will normally ``obscure'' everything behind @@ -426,14 +476,14 @@ and may change in the future. The permissible values are all predefined arrow tips, though you can also define new arrow tip kinds as explained in Section~\ref{section-arrows}. This is often necessary to obtain - ``double'' arrow tips and arrow tips that have a fixed size. Since - |pgflibraryarrows| is loaded by default, all arrow tips described in - Section~\ref{section-library-arrows} are available. + ``double'' arrow tips and arrow tips that have a fixed size. You + need to load the |arrows| library if you need arrow tips other than + the default ones, see Section~\ref{section-library-arrows}. One arrow tip kind is special: |>| (and all arrow tip kinds containing the - arrow tip kind such as |<<| or \verb!>|!). This arrow tip type is not + arrow tip kind such as |<<| or \verb!>|!). This arrow tip type is not fixed. Rather, you can redefine it using the |>=| option, see - below. + below. \example You can also combine arrow tip types as in \begin{codeexample}[] @@ -469,16 +519,16 @@ and may change in the future. \begin{tikzpicture}[scale=2] \begin{scope}[>=latex] \draw[->] (0pt,6ex) -- (1cm,6ex); - \draw[>->>] (0pt,5ex) -- (1cm,5ex); + \draw[>->>] (0pt,5ex) -- (1cm,5ex); \draw[|<->|] (0pt,4ex) -- (1cm,4ex); \end{scope} \begin{scope}[>=diamond] \draw[->] (0pt,2ex) -- (1cm,2ex); \draw[>->>] (0pt,1ex) -- (1cm,1ex); \draw[|<->|] (0pt,0ex) -- (1cm,0ex); - \end{scope} + \end{scope} \end{tikzpicture} -\end{codeexample} +\end{codeexample} % << \end{key} @@ -545,7 +595,7 @@ and may change in the future. \begin{key}{/tikz/double distance=\meta{dimension} (initially 0.6pt)} Sets the distance the ``two'' lines are spaced apart. In reality, - this is the thickness of the line that is used + this is the thickness of the line that is used to draw the path for the second time. The thickness of the \emph{first} time the path is drawn is twice the normal line width plus the given \meta{dimension}. As a side-effect, this option @@ -560,8 +610,48 @@ and may change in the future. \end{codeexample} \end{key} +\begin{key}{/tikz/double distance between line centers=\meta{dimension}} + This option works like |double distance|, only the distance is not + the distance between (inner) borders of the two main lines, ut + between their centers. Thus, the thickness the + \emph{first} time the path is drawn is the normal line width + plus the given \meta{dimension}, while the line width of the + \emph{second} line that is drawn is \meta{dimension} minus the + normal line width. As a side-effect, this option ``selects'' the + |double| option. + +\begin{codeexample}[] +\begin{tikzpicture}[double distance between line centers=3pt] + \foreach \lw in {0.5,1,1.5,2,2.5} + \draw[line width=\lw pt,double] (\lw,0) -- ++(4mm,0); +\end{tikzpicture} +\end{codeexample} +\begin{codeexample}[] +\begin{tikzpicture}[double distance=3pt] + \foreach \lw in {0.5,1,1.5,2,2.5} + \draw[line width=\lw pt,double] (\lw,0) -- ++(4mm,0); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{stylekey}{/tikz/double equal sign distance} + This style selects a double line distance such that it corresponds + to the distance of the two lines in an equal sign. +\begin{codeexample}[] +\Huge $=\implies$\tikz[baseline,double equal sign distance] + \draw[double,thick,-implies](0,0.55ex) --++(3ex,0); +\end{codeexample} +\begin{codeexample}[] +\normalsize $=\implies$\tikz[baseline,double equal sign distance] + \draw[double,-implies](0,0.6ex) --++(3ex,0); +\end{codeexample} +\begin{codeexample}[] +\tiny $=\implies$\tikz[baseline,double equal sign distance] + \draw[double,very thin,-implies](0,0.5ex) -- ++(3ex,0); +\end{codeexample} +\end{stylekey} + - @@ -597,7 +687,7 @@ To fill a path, use the following option: is used), the path is filled \emph{first}, then the path is drawn \emph{second}. This is especially useful if different colors are selected for drawing and for filling. Even if the same color is - used, there is a difference between this command and a plain + used, there is a difference between this command and a plain |fill|: A ``filldrawn'' area will be slightly larger than a filled area because of the thickness of the ``pen.'' @@ -622,12 +712,12 @@ that contains a simple picture like a star. Then these tiles are (conceptually) repeated infinitely in all directions, but clipped against the path. -Tiling patterns come in two variants: \emph{inherently +Tiling patterns come in two variants: \emph{inherently colored patterns} and \emph{form-only patterns}. An inherently colored pattern is, say, a red star with a black border and will always look like this. A form-only pattern may have a different color each time it is used, only the form of the pattern will stay the same. As such, -form-only patterhns do not have any colors of their own, but when it +form-only patterns do not have any colors of their own, but when it is used the current \emph{pattern color} is used as its color. Patterns are not overly flexible. In particular, it is not possible to @@ -646,10 +736,10 @@ pattern. For complicated case, it may be easier to use two nested fill color will fill the path with a solid color once more. Strangely, no \meta{name}s are permissible by default. You need to - load for instance |pgflibrarypatterns|, see + load for instance the |patterns| library, see Section~\ref{section-library-patterns}, to install predefined - patterns. - + patterns. + \begin{codeexample}[] \begin{tikzpicture} \draw[pattern=dots] (0,0) circle (1cm); @@ -660,8 +750,8 @@ pattern. For complicated case, it may be easier to use two nested \begin{key}{/tikz/pattern color=\meta{color}} This option is used to set the color to be used for form-only - patterns. This option has no effect on inherently colored patterns. - + patterns. This option has no effect on inherently colored patterns. + \begin{codeexample}[] \begin{tikzpicture} \draw[pattern color=red,pattern=fivepointed stars] (0,0) circle (1cm); @@ -718,7 +808,7 @@ should be determined: \draw[->] (0,1) -- (.4,1); \draw[->] (0.25,0.75) -- (0.4,.75); - + \draw[->] (0.5,0.5) -- +(0,1) node[above] {crossings: $1+1 = 2$}; \end{scope} \end{tikzpicture} @@ -736,7 +826,7 @@ should be determined: and declare the point to be ``inside'' if the number of hits is odd. Using the even-odd rule, it is easy to ``drill holes'' into a path. - + \begin{codeexample}[] \begin{tikzpicture} \filldraw[fill=examplefill,even odd rule] @@ -753,7 +843,94 @@ should be determined: \label{section-fill-opacity} Analogously to the |draw opacity|, you can also set the filling opacity. Please see Section~\ref{section-tikz-transparency} for more -details. +details. + + +\subsection{Generalized Filling: Using Arbitrary Pictures to Fill a Path} + +Sometimes you wish to ``fill'' a path with something even more +complicated than a pattern, let alone a single color. For instance, +you might wish to use an image to fill the path or some other, +complicated drawing. In principle, this effect can be achieved +by first using the path for clipping and then, subsequently, drawing +the desired image or picture. However, there is an option that makes +this process much easier: + +\begin{key}{/tikz/path picture=\meta{code}} + When this option is given on a path and when the \meta{code} is not + empty, the following happens: After all other ``filling'' operations + are done with the path, which are caused by the options |fill|, + |pattern| and |shade|, a local scope is opened and the path is + temporarily installed as a clipping path. Then, the \meta{code} is + executed, which can now draw something. Then, the local scope ends + and, possibly, the path is stroked, provided the |draw| option has + been given. + + As with other keys like |fill| or |draw| this option needs to be + given on a path, setting the |path picture| outside a path has not + effect (the path picture is cleared at the beginning of each path). + + The \meta{code} can be any normal \tikzname\ code like |\draw ...| + or |\node ...|. As always, when you include an external graphic you + need to put it inside a |\node|. + + Note that no special actions are taken to transform the origin in + any way. This means that the coordinate |(0,0)| is still where is + was when the path was being constructed and not -- as one might + expect -- at the lower left corner of the path. However, you can use + the following special node to access the size of the path: + \begin{predefinednode}{path picture bounding box} + This node is of shape |rectangle|. Its size and position are those + of |current path bounding box| just before the \meta{code} + of the path picture started to be executed. The \meta{code} can + construct its own paths, so accessing the + |current path bounding box| inside the \meta{code} yields the + bounding box of any path that is currently being constructed + inside the \meta{code}. + \end{predefinednode} + +\begin{codeexample}[] +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + \filldraw [fill=blue!10,draw=blue,thick] (1.5,1) circle (1) + [path picture={ + \node at (path picture bounding box.center) { + This is a long text. + };} + ]; +\end{tikzpicture} +\end{codeexample} + +\begin{codeexample}[] +\begin{tikzpicture}[cross/.style={path picture={ + \draw[black] + (path picture bounding box.south east) -- + (path picture bounding box.north west) + (path picture bounding box.south west) -- + (path picture bounding box.north east); + }}] + \draw [help lines] (0,0) grid (3,2); + \filldraw [cross,fill=blue!10,draw=blue,thick] (1,1) circle (1); + \path [cross,top color=red,draw=red,thick] (2,0) -- (3,2) -- (3,0); +\end{tikzpicture} +\end{codeexample} + +\begin{codeexample}[] + \begin{tikzpicture}[path image/.style={ + path picture={ + \node at (path picture bounding box.center) { + \includegraphics[height=3cm]{#1} + };}}] + \draw [help lines] (0,0) grid (3,2); + + \draw [path image=brave-gnu-world-logo,draw=blue,thick] + (0,1) circle (1); + \draw [path image=brave-gnu-world-logo,draw=red,very thick,->] + (1,0) parabola[parabola height=2cm] (3,0); + +\end{tikzpicture} +\end{codeexample} +\end{key} \subsection{Shading a Path} @@ -791,9 +968,6 @@ path is temporarily used for clipping and then the rectangular shading is drawn, scaled and shifted such that all parts of the path are filled. - -\subsubsection{Choosing a Shading Type} - The default shading is a smooth transition from gray to white and from above to bottom. However, other shadings are also possible, for example a shading that will sweep a color from the @@ -805,44 +979,27 @@ needed, which are explained below. \begin{key}{/tikz/shading=\meta{name}} This selects a shading named \meta{name}. The following shadings are - predefined: - \begin{itemize} - \item \declare{|axis|} - This is the default shading in which the color changes gradually - between three horizontal lines. The top line is at the top - (uppermost) point of the path, the middle is in the middle, the - bottom line is at the bottom of the path. - + predefined: |axis|, |radial|, and |ball|. \begin{codeexample}[] \tikz \shadedraw [shading=axis] (0,0) rectangle (1,1); -\end{codeexample} - - The default top color is gray, the default bottom color is white, - the default middle is the ``middle'' of these two. - \item \declare{|radial|} - This shading fills the path with a gradual sweep from a certain - color in the middle to another color at the border. If the path is - a circle, the outer color will be reached exactly at the - border. If the shading is not a circle, the outer color will - continue a bit towards the corners. The default inner color is - gray, the default outer color is white. - -\begin{codeexample}[] \tikz \shadedraw [shading=radial] (0,0) rectangle (1,1); +\tikz \shadedraw [shading=ball] (0,0) circle (.5cm); \end{codeexample} - \item \declare{|ball|} - This shading fills the path with a shading that ``looks like a - ball.'' The default ``color'' of the ball is blue (for no - particular reason). -\begin{codeexample}[] -\tikz \shadedraw [shading=ball] (0,0) rectangle (1,1); -\end{codeexample} + The shadings as well as additional shadings are described in more + detail in Section~\ref{section-library-shadings}. + To change the color of a shading, special options are needed like + |left color|, which sets the color of an axis shading from left to + right. These options implicitly also select the right shading type, + see the following example \begin{codeexample}[] -\tikz \shadedraw [shading=ball] (0,0) circle (.5cm); +\tikz \shadedraw [left color=red,right color=blue] + (0,0) rectangle (1,1); \end{codeexample} - \end{itemize} + + For a complete list of the possible options see + Section~\ref{section-library-shadings} once more. \begin{key}{/tikz/shading angle=\meta{degrees} (initially 0)} This option rotates the shading (not the path!) by the given @@ -862,101 +1019,6 @@ filling paths are given in Section~\ref{section-shading-a-path}. -\subsubsection{Choosing a Shading Color} - -The following options can be used to change the colors used for -shadings. When one of these options is given, the |shade| option is -automatically selected and also the ``right'' shading. - -\begin{key}{/tikz/top color=\meta{color}} - This option prescribes the color to be used at the top in an |axis| - shading. When this option is given, several things happen: - \begin{enumerate} - \item - The |shade| option is selected. - \item - The |shading=axis| option is selected. - \item - The middle color of the axis shading is set to the average of the - given top color \meta{color} and of whatever color is currently - selected for the bottom. - \item - The rotation angle of the shading is set to 0. - \end{enumerate} - -\begin{codeexample}[] -\tikz \draw[top color=red] (0,0) rectangle (2,1); -\end{codeexample} -\end{key} - -\begin{key}{/tikz/bottom color=\meta{color}} - This option works like |top color|, only for the bottom color. -\end{key} - -\begin{key}{/tikz/middle color=\meta{color}} - This option specifies the color for the middle of an axis - shading. It also sets the |shade| and |shading=axis| options, but it - does not change the rotation angle. - - \emph{Note:} Since both |top color| and |bottom color| change the - middle color, this option should be given \emph{last} if all of - these options need to be given: - -\begin{codeexample}[] -\tikz \draw[top color=white,bottom color=black,middle color=red] - (0,0) rectangle (2,1); -\end{codeexample} -\end{key} - -\begin{key}{/tikz/left color=\meta{color}} - This option does exactly the same as |top color|, except that the - shading angle is set to $90^\circ$. -\end{key} - -\begin{key}{/tikz/right color=\meta{color}} - Works like |left color|. -\end{key} - -\begin{key}{/tikz/inner color=\meta{color}} - This option sets the color used at the center of a |radial| - shading. When this option is used, the |shade| and |shading=radial| - options are set. - -\begin{codeexample}[] -\tikz \draw[inner color=red] (0,0) rectangle (2,1); -\end{codeexample} -\end{key} - -\begin{key}{/tikz/outer color=\meta{color}} - This option sets the color used at the border and outside of a - |radial| shading. - -\begin{codeexample}[] -\tikz \draw[outer color=red,inner color=white] - (0,0) rectangle (2,1); -\end{codeexample} -\end{key} - - -\begin{key}{/tikz/ball color=\meta{color}} - This option sets the color used for the ball shading. It sets the - |shade| and |shading=ball| options. Note that the ball will never - ``completely'' have the color \meta{color}. At its ``highlight'' spot - a certain amount of white is mixed in, at the border a certain - amount of black. Because of this, it also makes sense to say - |ball color=white| or |ball color=black| - -\begin{codeexample}[] -\begin{tikzpicture} - \shade[ball color=white] (0,0) circle (2ex); - \shade[ball color=red] (1,0) circle (2ex); - \shade[ball color=black] (2,0) circle (2ex); -\end{tikzpicture} -\end{codeexample} -\end{key} - - - \subsection{Establishing a Bounding Box} \pgfname\ is reasonably good at keeping track of the size of your picture @@ -973,7 +1035,8 @@ a shorthand for |\path[use as bounding box]|. the size of all \emph{subsequent} paths are ignored. However, if there were previous path operations that have already established a larger bounding box, it will not be made - smaller by this operation. + smaller by this operation (consider the |\pgfresetboundingbox| command + to reset the previous bounding box). In a sense, |use as bounding box| has the same effect as clipping all subsequent drawing against the current path---without actually @@ -992,7 +1055,7 @@ Left of picture\begin{tikzpicture} In a second application this option can be used to get better control over the white space around the picture: - + \begin{codeexample}[] Left of picture \begin{tikzpicture} @@ -1005,15 +1068,18 @@ right of picture. Note: If this option is used on a path inside a \TeX\ group (scope), the effect ``lasts'' only till the end of the scope. Again, this behavior is the same as for clipping. + + + Consider using |\useasboundingbox| together with |\pgfresetboundingbox| in order to replace the bounding box with a new one. \end{key} There is a node that allows you to get the size of the current bounding box. The |current bounding box| node has the |rectangle| -shape and its size is always the size of the current +shape and its size is always the size of the current bounding box. Similarly, the |current path bounding box| node has the |rectangle| -hape and the size of the bounding box of the current path. +shape and the size of the bounding box of the current path. \begin{codeexample}[] @@ -1032,6 +1098,72 @@ hape and the size of the bounding box of the current path. \end{codeexample} +Occasionally, you may want to align multiple |tikzpicture| environments horizontally and/or vertically at some prescribed position. The vertical alignment can be realized by means of the |baseline| option since \TeX\ supports the concept of box depth natively. For horizontal alignment, things are slightly more involved. The following approach is realized by means of negative |\hspace|s before and/or after the picture, thereby removing parts of the picture. However, the actual amount of negative horizontal space is provided by means of image coordinates using the |trim left| and |trim right| keys: + +\begin{key}{/tikz/trim left=\meta{dimension or coordinate or \texttt{default}} (default 0pt)} + The |trim left| key tells \pgfname\space to discard everything which is left of the provided \meta{dimension or coordinate}. Here, \meta{dimension} is a single $x$ coordinate of the picture and \meta{coordinate} is a point with $x$ and $y$ coordinates (but only its $x$ coordinate will be used). The effect is the same as if you issue |\hspace{-s}| where |s| is the difference of the picture's bounding box lower left $x$ coordinate and the $x$ coordinate specified as \meta{dimension or coordinate}: +\begin{codeexample}[] +Text before image.% + \begin{tikzpicture}[trim left] + \draw (-1,-1) grid (3,2); + \fill (0,0) circle (5pt); + \end{tikzpicture}% +Text after image. +\end{codeexample} + Since |trim left| uses the default |trim left=0pt|, everything left of $x=0$ is removed from the bounding box. + + The following example has once the relative long label $-1$ and once the shorter label $1$. Horizontal alignment is established with |trim left|: +\begin{codeexample}[pre={\vbox\bgroup\hsize=5cm},post=\egroup,width=8cm] +\begin{tikzpicture} + \draw (0,1) -- (0,0) -- (1,1) -- cycle; + \fill (0,0) circle (2pt); + \node[left] at (0,0) {$-1$}; +\end{tikzpicture} +\par +\begin{tikzpicture} + \draw (0,1) -- (0,0) -- (1,1) -- cycle; + \fill (0,0) circle (2pt); + \node[left] at (0,0) {$1$}; +\end{tikzpicture} +\par +\begin{tikzpicture}[trim left] + \draw (0,1) -- (0,0) -- (1,1) -- cycle; + \fill (0,0) circle (2pt); + \node[left] at (0,0) {$-1$}; +\end{tikzpicture} +\par +\begin{tikzpicture}[trim left] + \draw (0,1) -- (0,0) -- (1,1) -- cycle; + \fill (0,0) circle (2pt); + \node[left] at (0,0) {$1$}; +\end{tikzpicture} +\end{codeexample} + + Use |trim left=default| to reset the value. +\end{key} + +\begin{key}{/tikz/trim right=\meta{dimension or coordinate or \texttt{default}}} + This key is similar to |trim left|: it discards everything which is right of the provided \meta{dimension or coordinate}. As for |trim left|, \meta{dimension} denotes a single $x$ coordinate of the picture and \meta{coordinate} a coordinate with $x$ and $y$ value (although only its $x$ component will be used). + + We use the same example from above and add |trim right|: +\begin{codeexample}[] +Text before image.% + \begin{tikzpicture}[trim left, trim right=2cm, baseline] + \draw (-1,-1) grid (3,2); + \fill (0,0) circle (5pt); + \end{tikzpicture}% +Text after image. +\end{codeexample} + In addition to |trim left=0pt|, we also discard everything which is right of $x$|=2cm|. Furthermore, the |baseline| key supports vertical alignment as well (using the $y$|=0cm| baseline). + + Use |trim right=default| to reset the value. +\end{key} + +Note that |baseline|, |trim left| and |trim right| are currently the \emph{only} supported way of truncated bounding boxes which are compatible with image externalization (see the |external| library for details). + +\begin{key}{/pgf/trim lowlevel=\mchoice{true,false} (initially false)} + This affects only the basic level image externalization: the initial configuration |trim lowlevel=false| stores the normal image, without trimming, and the trimming into a separate file. This allows reduced bounding boxes without clipping the rest away. The |trim lowlevel=true| information causes the image externalization to store the trimmed image, possibly resulting in clipping. +\end{key} \subsection{Clipping and Fading (Soft Clipping)} @@ -1071,7 +1203,7 @@ transparency in general. \end{codeexample} It is usually a \emph{very} good idea to apply the |clip| option only - to the first path command in a scope. + to the first path command in a scope. If you ``only wish to clip'' and do not wish to draw anything, you can use the |\clip| command, which is a shorthand for |\path[clip]|. @@ -1094,7 +1226,7 @@ transparency in general. \draw (0,0) -- (30:1cm); \begin{scope}[fill=red] \fill[clip] (0.2,0.2) rectangle (0.5,0.5); - + \draw (0,0) -- (40:1cm); \draw (0,0) -- (50:1cm); \draw (0,0) -- (60:1cm); @@ -1110,8 +1242,8 @@ transparency in general. code we could not have moved the |fill=red| to the |\fill| command. The reasons for this have to do with the internals of the \pdf\ specification. You do not want to know the details. It is best - simply not to specify any options for these - commands. + simply not to specify any options for these + commands. \end{key} @@ -1187,7 +1319,7 @@ options: In the following example, we use one |preaction| to add a shadow and another to provide a shading, while the main action is to use a - pattern. + pattern. \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); @@ -1262,7 +1394,7 @@ options: \end{tikzpicture} \end{codeexample} - In another example, we use a postaction to ``colorzie'' a path: + In another example, we use a postaction to ``colorize'' a path: \begin{codeexample}[] \begin{tikzpicture} @@ -1287,7 +1419,7 @@ that slightly varied. Such morphings are a special case of the more general ``decorations'' described in detail in Section~\ref{section-tikz-decorations}. For instance, in the following example the path is drawn twice: Once normally and then in a morphed -(=decorated) manner. +(=decorated) manner. \begin{codeexample}[] \begin{tikzpicture} \draw (0,0) rectangle (3,2); @@ -1305,4 +1437,3 @@ pre- or postaction. It is also possible to deform shapes: fill=blue!20,draw,thick,circle] {Hello!}; \end{tikzpicture} \end{codeexample} - diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex index 448bd24a029..1847b27bc92 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex @@ -15,8 +15,8 @@ A \emph{coordinate} is a position on the canvas on which your picture is drawn. \tikzname\ uses a special syntax for specifying coordinates. Coordinates are always put in round brackets. The general -syntax is -\declare{|(|\opt{|[|\meta{options}|]|}\meta{coordinate specification}|)|}. +syntax is +\declare{|(|\opt{|[|\meta{options}|]|}\meta{coordinate specification}|)|}. The \meta{coordinate specification} specified coordinates using one of many different possible \emph{coordinate systems}. Examples are the @@ -109,7 +109,7 @@ Let us start with the basic coordinate systems. To specify a coordinate in the coordinate system implicitly, you use two dimensions that are separated by a comma as in |(0cm,3pt)| or - |(2cm,\textheight)|. + |(2cm,\textheight)|. \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); @@ -127,11 +127,10 @@ Let us start with the basic coordinate systems. $z$-vectors. By default, the $x$-vector points 1cm to the right, the $y$-vector points 1cm upwards, but this can be changed arbitrarily as explained in Section~\ref{section-xyz}. The default - $z$-vector points to $\bigl(-\frac{1}{\sqrt2} - \textrm{cm},-\frac{1}{\sqrt2}\textrm{cm}\bigr)$. + $z$-vector points to $\bigl(-3.85\textrm{mm},-3.85\textrm{mm}\bigr)$. To specify the factors by which the vectors should be multiplied - before being added, you use the following three options: + before being added, you use the following three options: \begin{key}{/tikz/cs/x=\meta{factor} (initially 0)} Factor by which the $x$-vector is multiplied. \end{key} @@ -152,7 +151,7 @@ Let us start with the basic coordinate systems. This coordinate system can also be selected implicitly. To do so, you just provide two or three comma-separated factors (not - dimensions). + dimensions). \begin{codeexample}[] \begin{tikzpicture}[->] \draw (0,0) -- (1,0); @@ -179,7 +178,7 @@ of two coordinate |(|\meta{x}|,0)| and |(0pt,|\meta{y}|)| is used. \meta{y} internally uses a mixture of dimensions and dimensionless values, then all dimensionless values are ``upgraded'' to dimensions by interpreting them as |pt|. So, |2+3cm| is the same dimension as -|2pt+3cm|. +|2pt+3cm|. \begin{coordinatesystem}{canvas polar} The |canvas polar| coordinate system allows you to specify @@ -210,9 +209,9 @@ by interpreting them as |pt|. So, |2+3cm| is the same dimension as \tikz \draw (0,0) -- (canvas polar cs:angle=30,radius=1cm); \end{codeexample} - The implicit form for canvas polar coordinates is the following: + The implicit form for canvas polar coordinates is the following: you specify the angle and the distance, separated by a colon as in - |(30:1cm)|. + |(30:1cm)|. \begin{codeexample}[] \tikz \draw (0cm,0cm) -- (30:1cm) -- (60:1cm) -- (90:1cm) @@ -284,7 +283,7 @@ by interpreting them as |pt|. So, |2+3cm| is the same dimension as \begin{coordinatesystem}{xy polar} This is just an alias for |xyz polar|, which some people might prefer as there is no z-coordinate involved in the |xyz polar| - coordinates. + coordinates. \end{coordinatesystem} @@ -308,7 +307,7 @@ The |barycentric cs| allows you to specify such coordinates easily. should be a comma-separated list of expressions of the form \meta{node name}|=|\meta{number}. Note that (currently) the list should not contain any spaces before or after the \meta{node name} - (unlike normal key-value pairs). + (unlike normal key-value pairs). The specified coordinate is now computed as follows: Each pair provides one vector and a number. The vector is the |center| anchor @@ -323,7 +322,7 @@ The |barycentric cs| allows you to specify such coordinates easily. \coordinate (content) at (90:3cm); \coordinate (structure) at (210:3cm); \coordinate (form) at (-30:3cm); - + \node [above] at (content) {content oriented}; \node [below left] at (structure) {structure oriented}; \node [below right] at (form) {form oriented}; @@ -361,12 +360,12 @@ you use the following coordinate system: You can use three options to specify which coordinate you mean: \begin{key}{/tikz/cs/name=\meta{node name}} Specifies the node in which you which to specify a coordinate. The - \meta{node name} is + \meta{node name} is the name that was previously used to name the node using the |name=|\meta{node name} option or the special node name syntax. \end{key} \begin{key}{/tikz/anchor=\meta{anchor}} - Specifies an anchor of the node. Here is an example: + Specifies an anchor of the node. Here is an example: \begin{codeexample}[] \begin{tikzpicture} \node (shape) at (0,2) [draw] {|class Shape|}; @@ -398,7 +397,7 @@ you use the following coordinate system: It is possible to provide \emph{neither} the |anchor=| option nor the |angle=| option. In this case, \tikzname\ will calculate an - appropriate border position for you. Here is an example: + appropriate border position for you. Here is an example: \begin{codeexample}[] \begin{tikzpicture} @@ -418,12 +417,12 @@ you use the following coordinate system: with the curve-to operation |..|. For other path commands, such as |parabola| or |plot|, the center will be used. If this is not desired, you should give a named anchor or an angle anchor. - + Note that if you use an automatic coordinate for both the start and the end of a line-to, as in |--(node cs:name=b)--|, then \emph{two} border coordinates are computed with a move-to between them. This is usually exactly what you want. - + If you use relative coordinates together with automatic anchor coordinates, the relative coordinates are computed relative to the node's center, not relative to the border point. Here is an @@ -458,159 +457,117 @@ Similarly, in the following examples both control points are $(1,1)$: (2,2) node(c) [rectangle,rotate=20,draw,fill] {A rectangle} (5,2) node(d) [rectangle,rotate=-30,draw,fill] {Another rectangle}; \draw[thick] (a.south) -- (b) -- (c) -- (d); - \draw[thick,red,->] (a) |- +(1,3) -| (c) |- (b); - \draw[thick,blue,<->] (b) .. controls +(right:2cm) and +(down:1cm) .. (d); + \draw[thick,red,->] (a) |- +(1,3) -| (c) |- (b); + \draw[thick,blue,<->] (b) .. controls +(right:2cm) and +(down:1cm) .. (d); \end{tikzpicture} \end{codeexample} \end{coordinatesystem} - -\subsubsection{Intersection Coordinate Systems} - -Often you wish to specify a point that is on the -intersection of two lines or shapes. For this, the following -coordinate system is useful: - -\begin{coordinatesystem}{intersection} - First, you must specify two objects that should be - intersected. These ``objects'' can either be lines or the shapes of - nodes. There are two option to specify the first object: - \begin{key}{/tikz/cs/first line={\ttfamily\char`\{}|(|\meta{first - coordinate}|)--(|\meta{second coordinate}|)|{\ttfamily\char`\}}} - Specifies that the first object is a line that goes from - \meta{first coordinate} to meta{second coordinate}. - \end{key} - Note that you have to write |--| between the coordinate, but this - does not mean that anything is added to the path. This is simply a - special syntax. - \begin{key}{/tikz/cs/first node=\meta{node}} - Specifies that the first object is a previously defined node named - \meta{node}. - \end{key} - - To specify the second object, you use one of the following keys: - \begin{key}{/tikz/cs/second line={\ttfamily\char`\{}|(|\meta{first - coordinate}|)--(|\meta{second coordinate}|)|{\ttfamily\char`\}}} - As above. - \end{key} - \begin{key}{/tikz/cs/second node=\meta{node}} - Specifies that the second object is a previously defined node - named \meta{node}. - \end{key} - - Since it is possible that two objects have multiple intersections, - you may need to specify which solution you want: - \begin{key}{/tikz/cs/solution=\meta{number} (initially 1)} - Specifies which solution should be used. Numbering starts with 1. - \end{key} - The coordinate specified in this way is the \meta{number}th - intersection of the two objects. If the objects do not intersect, - an error may occur. +% Deprecated: + +% \subsubsection{Intersection Coordinate Systems} + +% Often you wish to specify a point that is on the +% intersection of two lines or shapes. For this, the following +% coordinate system is useful: + +% \begin{coordinatesystem}{intersection} +% First, you must specify two objects that should be +% intersected. These ``objects'' can either be lines or the shapes of +% nodes. There are two option to specify the first object: +% \begin{key}{/tikz/cs/first line={\ttfamily\char`\{}|(|\meta{first +% coordinate}|)--(|\meta{second coordinate}|)|{\ttfamily\char`\}}} +% Specifies that the first object is a line that goes from +% \meta{first coordinate} to meta{second coordinate}. +% \end{key} +% Note that you have to write |--| between the coordinate, but this +% does not mean that anything is added to the path. This is simply a +% special syntax. +% \begin{key}{/tikz/cs/first node=\meta{node}} +% Specifies that the first object is a previously defined node named +% \meta{node}. +% \end{key} + +% To specify the second object, you use one of the following keys: +% \begin{key}{/tikz/cs/second line={\ttfamily\char`\{}|(|\meta{first +% coordinate}|)--(|\meta{second coordinate}|)|{\ttfamily\char`\}}} +% As above. +% \end{key} +% \begin{key}{/tikz/cs/second node=\meta{node}} +% Specifies that the second object is a previously defined node +% named \meta{node}. +% \end{key} + +% Since it is possible that two objects have multiple intersections, +% you may need to specify which solution you want: +% \begin{key}{/tikz/cs/solution=\meta{number} (initially 1)} +% Specifies which solution should be used. Numbering starts with 1. +% \end{key} +% The coordinate specified in this way is the \meta{number}th +% intersection of the two objects. If the objects do not intersect, +% an error may occur. + +% \begin{codeexample}[] +% \begin{tikzpicture} +% \draw[help lines] (0,0) grid (3,2); +% \draw (0,0) coordinate (A) -- (3,2) coordinate (B) +% (1,2) -- (3,0); + +% \fill[red] (intersection cs: +% first line={(A)--(B)}, +% second line={(1,2)--(3,0)}) circle (2pt); +% \end{tikzpicture} +% \end{codeexample} + +% The implicit way of specifying this coordinate system is to write +% \declare{|(intersection |\opt{\meta{number}}| of |\meta{first +% object}% +% | and |\meta{second object}|)|}. Here, \meta{first object} either +% has the form \meta{$p_1$}|--|\meta{$p_2$} or it is just a node +% name. Likewise for \meta{second object}. Note that there are \emph{no} +% parentheses around the $p_i$. Thus, you would write +% |(intersection of A--B and 1,2--3,0)| for the intersection of the +% line through the coordinates |A| and |B| and the line through the +% points $(1,2)$ and $(3,0)$. You would write +% |(intersection 2 of c_1 and c_2)| for the second +% intersection of the node named |c_1| and the node named +% |c_2|. + +% \tikzname\ needs an explicit algorithm for computing the +% intersection of two shapes and such an algorithm is available only +% for few shapes. Currently, the following intersection will be +% computed correctly: +% \begin{itemize} +% \item a line and a line +% \item a |circle| node and a line (in any order) +% \item a |circle| and a |circle| +% \end{itemize} +% \begin{codeexample}[] +% \begin{tikzpicture}[scale=.25] +% \coordinate [label=-135:$a$] (a) at ($ (0,0) + (rand,rand) $); +% \coordinate [label=45:$b$] (b) at ($ (3,2) + (rand,rand) $); + +% \coordinate [label=-135:$u$] (u) at (-1,1); +% \coordinate [label=45:$v$] (v) at (6,0); + +% \draw (a) -- (b) +% (u) -- (v); + +% \node (c1) at (a) [draw,circle through=(b)] {}; +% \node (c2) at (b) [draw,circle through=(a)] {}; + +% \coordinate [label=135:$c$] (c) at (intersection 2 of c1 and c2); +% \coordinate [label=-45:$d$] (d) at (intersection of u--v and c2); +% \coordinate [label=135:$e$] (e) at (intersection of u--v and a--b); + +% \foreach \p in {a,b,c,d,e,u,v} +% \fill [opacity=.5] (\p) circle (8pt); +% \end{tikzpicture} +% \end{codeexample} +% \end{coordinatesystem} -\begin{codeexample}[] -\begin{tikzpicture} - \draw[help lines] (0,0) grid (3,2); - \draw (0,0) coordinate (A) -- (3,2) coordinate (B) - (1,2) -- (3,0); - - \fill[red] (intersection cs: - first line={(A)--(B)}, - second line={(1,2)--(3,0)}) circle (2pt); -\end{tikzpicture} -\end{codeexample} - - The implicit way of specifying this coordinate system is to write - \declare{|(intersection |\opt{\meta{number}}| of |\meta{first - object}% - | and |\meta{second object}|)|}. Here, \meta{first obejct} either - has the form \meta{$p_1$}|--|\meta{$p_2$} or it is just a node - name. Likewise for \meta{second object}. Note that there are \emph{no} - parentheses around the $p_i$. Thus, you would write - |(intersection of A--B and 1,2--3,0)| for the intersection of the - line through the coordinates |A| and |B| and the line through the - points $(1,2)$ and $(3,0)$. You would write - |(intersection 2 of c_1 and c_2)| for the second - intersection of the node named |c_1| and the node named - |c_2|. - - \tikzname\ needs an explicit algorithm for computing the - intersection of two shapes and such an algorithm is available only - for few shapes. Currently, the following intersection will be - computed correctly: - \begin{itemize} - \item a line and a line - \item a |circle| node and a line (in any order) - \item a |circle| and a |circle| - \end{itemize} -\begin{codeexample}[] -\begin{tikzpicture}[scale=.25] - \coordinate [label=-135:$a$] (a) at ($ (0,0) + (rand,rand) $); - \coordinate [label=45:$b$] (b) at ($ (3,2) + (rand,rand) $); - \coordinate [label=-135:$u$] (u) at (-1,1); - \coordinate [label=45:$v$] (v) at (6,0); - - \draw (a) -- (b) - (u) -- (v); - - \node (c1) at (a) [draw,circle through=(b)] {}; - \node (c2) at (b) [draw,circle through=(a)] {}; - - \coordinate [label=135:$c$] (c) at (intersection 2 of c1 and c2); - \coordinate [label=-45:$d$] (d) at (intersection of u--v and c2); - \coordinate [label=135:$e$] (e) at (intersection of u--v and a--b); - - \foreach \p in {a,b,c,d,e,u,v} - \fill [opacity=.5] (\p) circle (8pt); -\end{tikzpicture} -\end{codeexample} -\end{coordinatesystem} - -A frequent special case of intersections is the intersection of a -vertical line going through a point $p$ and a horizontal line going -through some other point $q$. For this situation there is another -coordinate system. - -\begin{coordinatesystem}{perpendicular} - This coordinate system works the same way as |intersection|, only - the lines are specified differently: - - \begin{key}{/tikz/cs/horizontal line through={\ttfamily\char`\{}|(|\meta{coordinate}|)|{\ttfamily\char`\}}} - Specifies that one line is a horizontal line that goes through the - given coordinate. - \end{key} - \begin{key}{/tikz/cs/vertical line through={\ttfamily\char`\{}|(|\meta{coordinate}|)|{\ttfamily\char`\}}} - Specifies that the other line is vertical and goes through the - given coordinate. - \end{key} - - The implicit syntax is to write \declare{|(|\meta{p}\verb! |- !\meta{q}|)|} or - \declare{|(|\meta{q}\verb! -| !\meta{p}|)|}. - - For example, \verb!(2,1 |- 3,4)! and \verb!(3,4 -| 2,1)! both yield - the same as \verb!(2,4)! (provided the $xy$-coordinate system has not - been modified). - - The most useful application of the syntax is to draw a line up to some - point on a vertical or horizontal line. Here is an example: - -\begin{codeexample}[] -\begin{tikzpicture} - \path (30:1cm) node(p1) {$p_1$} (75:1cm) node(p2) {$p_2$}; - - \draw (-0.2,0) -- (1.2,0) node(xline)[right] {$q_1$}; - \draw (2,-0.2) -- (2,1.2) node(yline)[above] {$q_2$}; - - \draw[->] (p1) -- (p1 |- xline); - \draw[->] (p2) -- (p2 |- xline); - \draw[->] (p1) -- (p1 -| yline); - \draw[->] (p2) -- (p2 -| yline); -\end{tikzpicture} -\end{codeexample} -\end{coordinatesystem} - - \subsubsection{Tangent Coordinate Systems} \begin{coordinatesystem}{tangent} @@ -626,19 +583,18 @@ coordinate system. The following options may be given: \begin{key}{/tikz/cs/node=\meta{node}} This key specifies the node on whose border the tangent should - lie. + lie. \end{key} \begin{key}{/tikz/cs/point=\meta{point}} - This key speicifes the point through which the tangent should go. + This key specifies the point through which the tangent should go. \end{key} \begin{key}{/tikz/cs/solution=\meta{number}} Specifies which solution should be used if there are more than one. \end{key} - As for intersection coordinate system, a special algorithm is needed - in order to compute the tangent for a given shape. Currently, - tangents can be computed for nodes whose shape is one of the - following: + A special algorithm is needed in order to compute the tangent for a + given shape. Currently, tangents can be computed for nodes whose + shape is one of the following: \begin{itemize} \item |coordinate| \item |circle| @@ -651,7 +607,7 @@ coordinate system. \coordinate (a) at (3,2); \node [circle,draw] (c) at (1,1) [minimum size=40pt] {$c$}; - + \draw[red] (a) -- (tangent cs:node=c,point={(a)},solution=1) -- (c.center) -- (tangent cs:node=c,point={(a)},solution=2) -- cycle; \end{tikzpicture} @@ -660,6 +616,8 @@ coordinate system. There is no implicit syntax for this coordinate system. \end{coordinatesystem} + + \subsubsection{Defining New Coordinate Systems} While the set of coordinate systems that \tikzname\ can parse via @@ -687,8 +645,8 @@ commands are used: defined. \begin{codeexample}[] \makeatletter -\define@key{cylindricalkeys}{angle}{\def\myangle{#1}} -\define@key{cylindricalkeys}{radius}{\def\myradius{#1}} +\define@key{cylindricalkeys}{angle}{\def\myangle{#1}} +\define@key{cylindricalkeys}{radius}{\def\myradius{#1}} \define@key{cylindricalkeys}{z}{\def\myz{#1}} \tikzdeclarecoordinatesystem{cylindrical}% {% @@ -704,11 +662,217 @@ commands are used: \end{command} \begin{command}{\tikzaliascoordinatesystem\marg{new name}\marg{old name}} - Creates an alias of \meta{old name}. + Creates an alias of \meta{old name}. \end{command} +\subsection{Coordinates at Intersections} +\label{section-intersection-coordinates} + +You will wish to compute the intersection of two paths. For the +special and frequent case of two perpendicular lines, a special +coordinate system called |perpendicular| is available. For more +general cases, the |intersection| library can be used. + + +\subsubsection{Intersections of Perpendicular Lines} + +A frequent special case of path intersections is the intersection of a +vertical line going through a point $p$ and a horizontal line going +through some other point $q$. For this situation there is a useful +coordinate system. + +\begin{coordinatesystem}{perpendicular} + You can specify the two lines using the following keys: + + \begin{key}{/tikz/cs/horizontal line through={\ttfamily\char`\{}|(|\meta{coordinate}|)|{\ttfamily\char`\}}} + Specifies that one line is a horizontal line that goes through the + given coordinate. + \end{key} + \begin{key}{/tikz/cs/vertical line through={\ttfamily\char`\{}|(|\meta{coordinate}|)|{\ttfamily\char`\}}} + Specifies that the other line is vertical and goes through the + given coordinate. + \end{key} + + However, in almost all cases you should, instead, use the implicit + syntax. Here, you write \declare{|(|\meta{p}\verb! |- !\meta{q}|)|} or + \declare{|(|\meta{q}\verb! -| !\meta{p}|)|}. + + For example, \verb!(2,1 |- 3,4)! and \verb!(3,4 -| 2,1)! both yield + the same as \verb!(2,4)! (provided the $xy$-coordinate system has not + been modified). + + The most useful application of the syntax is to draw a line up to some + point on a vertical or horizontal line. Here is an example: + +\begin{codeexample}[] +\begin{tikzpicture} + \path (30:1cm) node(p1) {$p_1$} (75:1cm) node(p2) {$p_2$}; + + \draw (-0.2,0) -- (1.2,0) node(xline)[right] {$q_1$}; + \draw (2,-0.2) -- (2,1.2) node(yline)[above] {$q_2$}; + + \draw[->] (p1) -- (p1 |- xline); + \draw[->] (p2) -- (p2 |- xline); + \draw[->] (p1) -- (p1 -| yline); + \draw[->] (p2) -- (p2 -| yline); +\end{tikzpicture} +\end{codeexample} +\end{coordinatesystem} + + +\subsubsection{Intersections of Arbitrary Paths} + +\begin{tikzlibrary}{intersections} + This library enables the calculation of intersections of + two arbitrary paths. However, due to the low accuracy of + \TeX, the paths should not be ``too complicated''. + In particular, you should not try to intersect paths consisting + lots of very small segments such as plots or decorated paths. +\end{tikzlibrary} + +To find the intersections of two paths in \tikzname, they must be +``named''. A ``named path'' is, quite simply, a path that has been +named using the following key: + +\begin{keylist}{% + /tikz/name path=\meta{name}, + /tikz/name path global=\meta{name}} + The effect of this key is that, after the path has been constructed, + just before it is used, it is associated with \meta{name}. For |name path|, + this association survives beyond the final semi-colon of the path + but not the end of the surrounding scope. For |name path global|, the association + will survive beyond any scope as well. Handle with care. + + Any paths created by nodes on the (main) path are ignored, unless + this key is explicitly used. If the same \meta{name} is used for the + main path and the node path(s), then the paths will be added + together and then associated with \meta{name}. +\end{keylist} + +To find the intersection of named paths, the following key is used: + +\begin{key}{/tikz/name intersections=\marg{options}} + This key changes the key path to |/tikz/intersection| and processes + \meta{options}. These options determine, among other things, + which paths to use for the intersection. Having processed the + options, any intersections are then found. A coordinate is created + at each intersection, which by default, will be named + |intersection-1|, |intersection-2|, and so on. + Optionally, the prefix |intersection| can be changed, and the + total number of intersections stored in a \TeX-macro. + +\begin{codeexample}[] +\begin{tikzpicture}[every node/.style={opacity=1, black, above left}] + \draw [help lines] grid (3,2); + \draw [name path=ellipse] (2,0.5) ellipse (0.75cm and 1cm); + \draw [name path=rectangle, rotate=10] (0.5,0.5) rectangle +(2,1); + \fill [red, opacity=0.5, name intersections={of=ellipse and rectangle}] + (intersection-1) circle (2pt) node {1} + (intersection-2) circle (2pt) node {2}; +\end{tikzpicture} +\end{codeexample} + +The following keys can be used in \meta{options}: + +\begin{key}{/tikz/intersection/of=\meta{name path 1}| and |\meta{name path 2}} + This key is used to specify the names of the paths to use for + the intersection. +\end{key} + +\begin{key}{/tikz/intersection/name=\meta{prefix} (initially intersection)} + This key specifies the prefix name for the coordinate nodes placed + at each intersection. +\end{key} + +\begin{key}{/tikz/intersection/total=\meta{macro}} + This key will mean than the total number of intersections found + will be stored in \meta{macro}. +\end{key} + +\begin{codeexample}[] +\begin{tikzpicture} + \clip (-2,-2) rectangle (2,2); + \draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1); + \draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2); + + \fill [name intersections={of=curve 1 and curve 2, name=i, total=\t}] + [red, opacity=0.5, every node/.style={above left, black, opacity=1}] + \foreach \s in {1,...,\t}{(i-\s) circle (2pt) node {\footnotesize\s}}; +\end{tikzpicture} +\end{codeexample} + + + \begin{key}{/tikz/intersection/by=\meta{comma-separated list}} + This key allows you to specify a list of names for the intersection + coordinates. The intersection coordinates will still be named + \meta{prefix}|-|\meta{number}, but additionally the first + coordinate will also be named by the first element of the + \meta{comma-separated list}. What happens is that the + \meta{comma-separated list} is passed to the |\foreach| statement + and for \meta{list member} a coordinate is created at the + already-named intersection. +\begin{codeexample}[] +\begin{tikzpicture} + \clip (-2,-2) rectangle (2,2); + \draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1); + \draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2); + + \fill [name intersections={of=curve 1 and curve 2, by={a,b}}] + (a) circle (2pt) + (b) circle (2pt); +\end{tikzpicture} +\end{codeexample} + + You can also use the |...| notation of the |\foreach| statement + inside the \meta{comma-separated list}. + + In case an element of the \meta{comma-separated list} starts with + options in square brackets, these options are used when the + coordinate is created. A coordinate name can still, but need not, + follow the options. This + makes it easy to add labels to intersections: +\begin{codeexample}[] +\begin{tikzpicture} + \clip (-2,-2) rectangle (2,2); + \draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1); + \draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2); + + \fill [name intersections={ + of=curve 1 and curve 2, + by={[label=center:a],[label=center:...],[label=center:i]}}]; +\end{tikzpicture} +\end{codeexample} + \end{key} + + \begin{key}{/tikz/intersection/sort by=\meta{path name}} +By default, the intersections are simply returned in the order that +the intersection algorithm finds them. Unfortunately, this is not +necessarily a ``helpful'' ordering. This key can be used to sort +the intersections along the path specified by \meta{path name}, +which should be one of the paths mentioned in the +|/tikz/intersection/of| key. + +\begin{codeexample}[] +\begin{tikzpicture} +\clip (-0.5,-0.75) rectangle (3.25,2.25); +\foreach \pathname/\shift in {line/0cm, curve/2cm}{ + \tikzset{xshift=\shift} + \draw [->, name path=curve] (1,1.5) .. controls (-1,1) and (2,0.5) .. (0,0); + \draw [->, name path=line] (0,-.5) -- (1,2) ; + \fill [name intersections={of=line and curve,sort by=\pathname, name=i}] + [red, opacity=0.5, every node/.style={left=.25cm, black, opacity=1}] + \foreach \s in {1,2,3}{(i-\s) circle (2pt) node {\footnotesize\s}}; +} +\end{tikzpicture} +\end{codeexample} + + \end{key} +\end{key} + + + \subsection{Relative and Incremental Coordinates} @@ -753,7 +917,7 @@ relative to the start of the curve. This special behavior makes it easy to specify that a curve should ``leave or arrives from a certain direction'' at the start or end. In the following example, the curve ``leaves'' at $30^\circ$ and -``arrives'' at $60^\circ$: +``arrives'' at $60^\circ$: \begin{codeexample}[] \begin{tikzpicture} @@ -802,13 +966,14 @@ decide which you need. \draw[red] (2,0) -- ++(1,0) { [current point is local] -- ++(0,1) } -- ++(-1,0); \end{tikzpicture} -\end{codeexample} +\end{codeexample} In the above example, we could also have given the option outside the scope, for instance as a parameter to the whole scope. \end{key} \subsection{Coordinate Calculations} +\label{tikz-lib-calc} \begin{tikzlibrary}{calc} You need to load this library in order to use the coordinate @@ -837,7 +1002,7 @@ of the point |a|: The general syntax is the following: \begin{quote} - \declare{|(|\opt{|[|\meta{options}|]|}|$|\meta{coordinate computation}|$)|}. + \declare{|(|\opt{|[|\meta{options}|]|}|$|\meta{coordinate computation}|$)|}. \end{quote} As you can see, the syntax uses the \TeX\ math symbol |$| to %$ @@ -849,12 +1014,12 @@ The \meta{coordinate computation} has the following structure: \item It starts with \begin{quote} - \opt{\meta{factor}|*|}\meta{coordinate}\opt{\meta{modifiers}} + \opt{\meta{factor}|*|}\meta{coordinate}\opt{\meta{modifiers}} \end{quote} \item This is optionally followed by |+| or |-| and then another \begin{quote} - \opt{\meta{factor}|*|}\meta{coordinate}\opt{\meta{modifiers}} + \opt{\meta{factor}|*|}\meta{coordinate}\opt{\meta{modifiers}} \end{quote} \item This is once more followed by |+| or |-| and another of the above @@ -886,7 +1051,7 @@ everything up to the next occurrence of |*(|. Note that there is no space between the asterisk and the parenthesis. It is permissible to put the \meta{factor} is curly braces. This can -be used whenever it is unclear where the \meta{factor} would end. +be used whenever it is unclear where the \meta{factor} would end. Here are some examples of coordinate specifications that consist of exactly one \meta{factor} and one \meta{coordinate}: @@ -927,14 +1092,14 @@ factor between $0$ and $1$, not a percentage, and, second, as the the first. It is permissible to use \meta{numbers} that are smaller than $0$ or larger than $1$. The \meta{number} is evaluated using the |\pgfmathparse| command and, thus, it can involve complicated -computations. +computations. \begin{codeexample}[] \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \draw (1,0) -- (3,2); - + \foreach \i in {0,0.2,0.5,0.9,1} \node at ($(1,0)!\i!(3,2)$) {\i}; \end{tikzpicture} @@ -1009,7 +1174,7 @@ following: Use the point that is distanced \meta{dimension} from \draw [help lines] (0,0) grid (3,2); \draw (1,0) -- (3,2); - + \foreach \i in {0cm,1cm,15mm} \node at ($(1,0)!\i!(3,2)$) {\i}; \end{tikzpicture} @@ -1060,7 +1225,7 @@ Here is an example: The effect is the following: We project the \meta{projection coordinate} orthogonally onto to the line from \meta{coordinate} to \meta{second coordinate}. This makes it easy to compute projected -points: +points: \begin{codeexample}[] \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex index 3baa481990f..a00c1df01ad 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex @@ -43,7 +43,7 @@ look at some examples: \filldraw[fill=blue!20] (0,3) decorate [decoration=saw] { -- (3,3) } decorate [decoration={coil,aspect=0}] { -- (2,1) } - decorate [decoration=bumps] { -| (0,3) }; + decorate [decoration=bumps] { -| (0,3) }; \end{tikzpicture} \end{codeexample} @@ -97,12 +97,12 @@ morphing; rather there are three kinds of decorations. path in the sense that what used to be a straight line might afterwards be a squiggly line or might have bumps. However, a line is still and a line and path deforming decorations do not change - the number of subpaths. + the number of subpaths. Examples of such decorations are the |snake| or the |zigzag| decoration. Many such decorations are defined in the library |decorations.pathmorphing|. - + \item \emph{Path replacing} decorations completely replace the path by a different path that is only ``loosely based'' on the original path. For instance, the |crosses| decoration replaces a path @@ -117,7 +117,7 @@ morphing; rather there are three kinds of decorations. Examples of path replacing decorations are |crosses| or |ticks| or |shape backgrounds|. Such decorations are defined in the library |decorations.pathreplacing|, but also in |decorations.shapes|. - + \item \emph{Path removing} decorations completely remove the to-be-decorated path. Thus, they have no effect on the main path that is being constructed. Instead, they typically have numerous @@ -156,7 +156,7 @@ it once, and then decorate the decorated path once more. \tikz \fill [fill=blue!20,draw=blue,thick] decorate[decoration={crosses,segment length=2mm}] { decorate[decoration={zigzag,segment length=10mm,amplitude=2.5mm}] { - (0,0) rectangle (3,2) + (0,0) rectangle (3,2) } }; \end{codeexample} @@ -204,9 +204,9 @@ command. paths (that is, you can nest applications of the |decorate| path command, see below). - Due to the limits on the precision in \TeX, some inaccuraces in + Due to the limits on the precision in \TeX, some inaccuracies in positioning when crossing input segment boundaries may occasionally be - found. + found. You can use nodes normally inside the \meta{subpath}. \begin{codeexample}[] @@ -218,7 +218,7 @@ command. \draw [blue] decorate [decoration={crosses}] {(3,0) -- (hi)}; \end{tikzpicture} \end{codeexample} - + The following key is used to select the decoration and also to select further ``rendering options'' for the decoration. @@ -240,21 +240,21 @@ command. \draw [red] decorate [decoration=crosses] {(0,2) -- (3,0)}; \end{tikzpicture} \end{codeexample} - + The \meta{decoration options} are special options (which have the path prefix |/pgf/decoration/|) that determine the properties of the decoration. Which options are appropriate for a decoration depend strongly on the decoration, you will have to look up the appropriate options in the documentation of the decoration, see Section~\ref{section-library-decorations}. - + There is one option (available only in \tikzname) that is special: \begin{key}{/pgf/decoration/name=\meta{name} (initially none)} Use this key to set which decoration is to be used. The \meta{name} can both be a decoration or a meta-decoration (you need to worry about the difference only if you wish to define your own decorations). - + If you set \meta{name} to |none|, no decorations are added. \begin{codeexample}[] \begin{tikzpicture} @@ -265,7 +265,7 @@ command. \end{codeexample} Since this option is used so often, you can also leave out the |name=| part. Thus, the above example can be rewritten more - succinctly: + succinctly: \begin{codeexample}[] \begin{tikzpicture} \draw [help lines] grid (3,2); @@ -287,7 +287,7 @@ command. Recall that some decorations actually completely remove the to-be-decorated path. In such cases, the construction of the main path is resumed after the |decorate| path command ends. - + \begin{codeexample}[] \begin{tikzpicture}[decoration={text along path,text= around and around and around and around we go}] @@ -303,7 +303,7 @@ command. decoration replaces a straight line like \tikz\draw (0,0) -- (1,0); by \tikz[decoration=Koch snowflake] \draw decorate{(0,0) -- (1,0)};. Repeatedly applying this transformation to a triangle - yields a fractal that looks a bit like a snowflake, hence the name. + yields a fractal that looks a bit like a snowflake, hence the name. \begin{codeexample}[] \begin{tikzpicture}[decoration=Koch snowflake,draw=blue,fill=blue!20,thick] \filldraw (0,0) -- ++(60:1) -- ++(-60:1) -- cycle ; @@ -342,7 +342,7 @@ you to decorate a path ``after the fact.'' \begin{codeexample}[] \begin{tikzpicture}[decoration=zigzag] \draw [help lines] (0,0) grid (3,5); - + \draw [fill=blue!20,decorate] (1.5,4) circle (1cm); \node at (1.5,2.5) [fill=red!20,decorate,ellipse] {Ellipse}; @@ -357,7 +357,7 @@ you to decorate a path ``after the fact.'' cause the decoration to be applied only before or after the main path has been used. Incidentally, this is another application of the |decorate| option that you cannot achieve with the decorate path - command. + command. \begin{codeexample}[] \begin{tikzpicture}[decoration=zigzag] \node at (1.5,1) [inner sep=6mm,fill=red!20,ellipse, @@ -373,10 +373,10 @@ you to decorate a path ``after the fact.'' \draw [help lines] grid (3,2); \fill [draw=red,fill=red!20, postaction={decorate,decoration={raise=2pt,text along path, - text=around and around and around and around we go}}] + text=around and around and around and around we go}}] (0,1) arc (180:-180:1.5cm and 1cm); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{key} @@ -488,7 +488,7 @@ not with meta-decorations. Note that the default |pre| option is |lineto|, not |curveto|. This means that the default |pre| decoration will not follow curves (for efficiency reasons). Change the |pre| key to |curveto| if you have a - curved path. + curved path. \begin{codeexample}[] \begin{tikzpicture} \tikz [decoration={zigzag,pre length=3cm}] @@ -512,12 +512,12 @@ not with meta-decorations. \begin{key}{/pgf/decorations/post=\meta{decoration} (initially lineto)} - Works like |pre|, only for the end of the decoration. + Works like |pre|, only for the end of the decoration. \end{key} \begin{key}{/pgf/decorations/post length=\meta{dimension} (initially 0pt)} - Works like |pre length|, only for the end of the decoration. + Works like |pre length|, only for the end of the decoration. \end{key} Here is a typical example that shows how these keys can be used: @@ -535,4 +535,4 @@ Here is a typical example that shows how these keys can be used: -\endinput
\ No newline at end of file +\endinput diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex index 1ecb8efa5f3..b3e19fdefd6 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex @@ -15,7 +15,7 @@ Zeichenprogramm.'' To use \tikzname, as a \LaTeX\ user say |\usepackage{tikz}| somewhere in the preamble, as a plain \TeX\ user say |\input tikz.tex|. \tikzname's job is to make your life easier by providing an easy-to-learn and easy-to-use syntax for describing -graphics. +graphics. The commands and syntax of \tikzname\ were influenced by several sources. The basic command names and the notion of path operations is @@ -23,7 +23,7 @@ taken from \textsc{metafont}, the option mechanism comes from \textsc{pstricks}, the notion of styles is reminiscent of \textsc{svg}. To make it all work together, some compromises were necessary. I also added some ideas of my own, like coordinate -transformations. +transformations. The following basic design principles underlie \tikzname: \begin{enumerate} @@ -47,7 +47,7 @@ separated by commas, in round brackets as in |(1cm,2pt)|. You can also specify a point in polar coordinates by using a colon instead of a comma as in |(30:1cm)|, which means ``1cm in a 30 -degrees direction.'' +degrees direction.'' If you do not provide a unit, as in |(2,1)|, you specify a point in \pgfname's $xy$-coordinate system. By default, the unit $x$-vector @@ -105,12 +105,12 @@ command, which is an abbreviation for |\path[fill]|. The |\filldraw| command is an abbreviation for |\path[fill,draw]|. Shading is caused by the |shade| option (there are |\shade| and |\shadedraw| abbreviations) and clipping by the -|clip| option. There is is also a |\clip| command, which does the +|clip| option. There is also a |\clip| command, which does the same as |\path[clip]|, but not commands like |\drawclip|. Use, say, |\draw[clip]| or |\path[draw,clip]| instead. All of these commands can only be used inside |{tikzpicture}| -environments. +environments. \tikzname\ allows you to use different colors for filling and stroking. @@ -126,7 +126,7 @@ passed as optional parameters to the path drawing and filling commands. This usage is similar to \textsc{pstricks}. For example, the following will draw a thick, red triangle; \begin{codeexample}[] -\tikz \draw[line width=2pt,color=red] (1,0) -- (0,0) -- (1,0) -- cycle; +\tikz \draw[line width=2pt,color=red] (1,0) -- (0,0) -- (0,1) -- cycle; \end{codeexample} \subsection{Special Syntax for Specifying Nodes} @@ -139,9 +139,9 @@ in the following example: Nodes are inserted at the current position of the path, but only \emph{after} the path has been rendered. When special options are given, as in -|\draw (1,1) node[circle,draw] {text};|, the text is not just put +|\draw (1,1) node[circle,draw] {text};|, the text is not just put at the current position. Rather, it is surrounded by a circle and -this circle is ``drawn.'' +this circle is ``drawn.'' You can add a name to a node for later reference either by using the option |name=|\meta{node name} or by stating the node name in @@ -153,8 +153,8 @@ it is possible (though a bit challenging) to define new shapes. \subsection{Special Syntax for Specifying Trees} In addition to the ``node syntax,'' \tikzname\ also introduces a -special syntax for drawing trees. The syntax is intergrated with the -special node syntax and only few new commands need to be remebered. +special syntax for drawing trees. The syntax is intergraded with the +special node syntax and only few new commands need to be remembered. In essence, a |node| can be followed by any number of children, each introduced by the keyword |child|. The children are nodes themselves, each of which may have children in turn. @@ -191,7 +191,7 @@ redrawn with different options: \begin{codeexample}[] \begin{tikzpicture} [parent anchor=east,child anchor=west,grow=east, - every node/.style={ball color=red,circle,text=white} + every node/.style={ball color=red,circle,text=white}, edge from parent/.style={draw,dashed,thick,red}] \node {root} child {node {left}} @@ -240,9 +240,9 @@ the picture. \tikzname\ supports both \pgfname's \emph{coordinate} transformation system to perform transformations as well as \emph{canvas} -transformations, a more low-level transformation system. (For +transformations, a more low-level transformation system. (For details on the difference between coordinate transformations and -canvas transformations see Section~\ref{section-design-transformations}.) +canvas transformations see Section~\ref{section-design-transformations}.) The syntax is setup in such a way that is harder to use canvas transformations than coordinate transformations. There are two reasons diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex index 856d918c540..265880d2b6e 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex @@ -21,7 +21,7 @@ a vertical lines. There are different ways of solving such problems. For example, by making clever use of anchors, nearly all such alignment problems can be solved. However, this often leads to complicated code. An often simpler way is to use \emph{matrices}, -the use of which is explaied in the current section. +the use of which is explained in the current section. A \tikzname\ matrix is similar to \LaTeX's |{tabular}| or |{array}| environment, only instead of text each cell contains a @@ -49,7 +49,7 @@ matrix. Instead of the usual \TeX-box that makes up the |text| part of the node's shape, the matrix is used. Thus, in particular, a matrix can have a shape, this shape can be drawn or filled, it can be used in a tree, and so on. Also, you can refer to the different anchors of a -matrix. +matrix. \begin{key}{/tikz/matrix=\meta{true or false} (default true)} This option can be passed to a |node| path command. It signals that @@ -88,7 +88,7 @@ effect as for normal nodes: normally). Before the matrix is typeset, the rotational and scaling part of the transformation matrix is reset. \item For multi-part shapes you can only set the |text| part of the - node. + node. \item All options starting with |text| such as |text width| have no effect. \end{enumerate} @@ -180,7 +180,7 @@ left end of the second column (unless |column sep| is used). The right end of the second column touches the left end of the third column, and so on. (Internally, two columns are actually used to achieve the desired horizontal alignment, but that is only and implementation -detail.) +detail.) \begin{codeexample}[] \begin{tikzpicture}[every node/.style={draw}] @@ -215,7 +215,7 @@ columns. Second, you can add options to the |&| character and the |\\| command to adjust the spacing between two specific columns or rows. Additionally, you can specify whether the space between two columns or rows should be considered between the origins of cells in -the column or row or between their borders. +the column or row or between their borders. \begin{key}{/tikz/column sep=\meta{spacing list}} This option sets a default space that is added between every two @@ -244,7 +244,7 @@ the column or row or between their borders. concerning the two keywords, the last occurrence of one of the keywords is important. If the last occurrence is |between borders| or if neither occurs, then the space is inserted between the two columns - normally. However, if the last occurs is |between origins|, then the + normally. However, if the last occurs is |between origins|, then the following happens: The distance between the columns is adjusted such that the difference between the origins of all the cells in the first column (remember that they all lie on straight line) and the @@ -254,7 +254,7 @@ the column or row or between their borders. \emph{The |between origins| option can only be used for columns mentioned in the first row, that is, you cannot specify this option for columns introduced only in later rows.} - + \begin{codeexample}[] \begin{tikzpicture} \matrix [draw,column sep={1cm,between origins},nodes=draw] @@ -326,7 +326,7 @@ the |\\| command for rows. This optional spacing list can only be given the first time a new column is started (usually in the first row), subsequent usages -of this option in later rows have no effect. +of this option in later rows have no effect. \begin{codeexample}[] \begin{tikzpicture} \matrix [draw,nodes=draw,column sep=1mm] @@ -378,7 +378,7 @@ of the all cell pictures: Inside this style (and inside all cells), the current \meta{row} and \meta{column} number are also accessible via the counters - |\pgfmatrixcurrentrow| and |\pgfmatrixcurrentcolumn|. + |\pgfmatrixcurrentrow| and |\pgfmatrixcurrentcolumn|. \end{stylekey} \begin{key}{/tikz/cells=\meta{options}} @@ -393,7 +393,7 @@ of the all cell pictures: The main use of this option is the install some options for the nodes \emph{inside} the matrix that should not apply to the matrix - \emph{itself}. + \emph{itself}. \begin{codeexample}[] \begin{tikzpicture} @@ -446,7 +446,7 @@ executed before all of the below). [row 1/.style={red}, column 2/.style={green!50!black}, row 3 column 3/.style={blue}] - + \matrix { \node {8}; & \node{1}; & \node {6}; \\ @@ -593,7 +593,7 @@ uses a different command to separate cells, namely the command |\pgfmatrixnextcell| and using a normal |&| character will normally fail. What happens is that, \tikzname\ makes |&| an active character and then defines this character to be equal to -|\pgfmatrixnextcell|. In most situations this will work +|\pgfmatrixnextcell|. In most situations this will work nicely, but sometimes |&| cannot be made active; for instance because the matrix is used in an argument of some macro or the matrix contains nodes that contain normal |{tabular}| @@ -619,55 +619,55 @@ having to type |\pgfmatrixnextcell| each time: \subsection{Examples} The following examples are adapted from code by Mark Wibrow. The first -two redraw pictures from Timothy van Zandt's PSTricks documentation: +two redraw pictures from Timothy van Zandt's PStricks documentation: {\catcode`\|=12 \begin{codeexample}[] -\begin{tikzpicture} +\begin{tikzpicture} \matrix [matrix of math nodes,row sep=1cm] - { - |(U)| U &[2mm] &[8mm] \\ - & |(XZY)| X \times_Z Y & |(X)| X \\ + { + |(U)| U &[2mm] &[8mm] \\ + & |(XZY)| X \times_Z Y & |(X)| X \\ & |(Y)| Y & |(Z)| Z \\ - }; - \begin{scope}[every node/.style={midway,auto,font=\scriptsize}] - \draw [double, dashed] (U) -- node {$x$} (X); + }; + \begin{scope}[every node/.style={midway,auto,font=\scriptsize}] + \draw [double, dashed] (U) -- node {$x$} (X); \draw (X) -- node {$p$} (X -| XZY.east) (X) -- node {$f$} (Z) -- node {$g$} (Y) -- node {$q$} (XZY) -- node {$y$} (U); \end{scope} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} \begin{codeexample}[] -\begin{tikzpicture}[>=stealth,->,shorten >=2pt,looseness=.5,auto] +\begin{tikzpicture}[>=stealth,->,shorten >=2pt,looseness=.5,auto] \matrix [matrix of math nodes, column sep={2cm,between origins}, row sep={3cm,between origins}, nodes={circle, draw, minimum size=7.5mm}] - { - & |(A)| A & \\ - |(B)| B & |(E)| E & |(C)| C \\ + { + & |(A)| A & \\ + |(B)| B & |(E)| E & |(C)| C \\ & |(D)| D \\ - }; + }; \begin{scope}[every node/.style={font=\small\itshape}] - \draw (A) to [bend left] (B) node [midway] {g}; - \draw (B) to [bend left] (A) node [midway] {f}; - \draw (D) -- (B) node [midway] {c}; - \draw (E) -- (B) node [midway] {b}; - \draw (E) -- (C) node [near end] {a}; - \draw [-,line width=8pt,draw=graphicbackground] - (D) to [bend right, looseness=1] (A); - \draw (D) to [bend right, looseness=1] (A) - node [near start] {b} node [near end] {e}; + \draw (A) to [bend left] node [midway] {g} (B); + \draw (B) to [bend left] node [midway] {f} (A); + \draw (D) -- node [midway] {c} (B); + \draw (E) -- node [midway] {b} (B); + \draw (E) -- node [near end] {a} (C); + \draw [-,line width=8pt,draw=graphicbackground] + (D) to [bend right, looseness=1] (A); + \draw (D) to [bend right, looseness=1] + node [near start] {b} node [near end] {e} (A); \end{scope} \end{tikzpicture} \end{codeexample} \begin{codeexample}[] -\begin{tikzpicture} +\begin{tikzpicture} \matrix (network) [matrix of nodes,% nodes in empty cells, @@ -675,72 +675,72 @@ two redraw pictures from Timothy van Zandt's PSTricks documentation: column sep={1cm,between origins}, row sep={1cm,between origins}] { - & & & \\ - & & & \\ + & & & \\ + & & & \\ |[draw=none]| & |[xshift=1mm]| & |[xshift=-1mm]| \\ - }; - \foreach \a in {1,...,4}{ - \draw (network-3-2) -- (network-2-\a); - \draw (network-3-3) -- (network-2-\a); - \draw [-stealth] ([yshift=5mm]network-1-\a.north) -- (network-1-\a); - \foreach \b in {1,...,4} - \draw (network-1-\a) -- (network-2-\b); - } - \draw [stealth-] ([yshift=-5mm]network-3-2.south) -- (network-3-2); - \draw [stealth-] ([yshift=-5mm]network-3-3.south) -- (network-3-3); -\end{tikzpicture} + }; + \foreach \a in {1,...,4}{ + \draw (network-3-2) -- (network-2-\a); + \draw (network-3-3) -- (network-2-\a); + \draw [-stealth] ([yshift=5mm]network-1-\a.north) -- (network-1-\a); + \foreach \b in {1,...,4} + \draw (network-1-\a) -- (network-2-\b); + } + \draw [stealth-] ([yshift=-5mm]network-3-2.south) -- (network-3-2); + \draw [stealth-] ([yshift=-5mm]network-3-3.south) -- (network-3-3); +\end{tikzpicture} \end{codeexample} The following example is adapted from code written by Kjell Magne -Fauske, which is based on the following paper: K.~Bossley, M.~Brown, +Fauske, which is based on the following paper: K.~Bossley, M.~Brown, and C.~Harris, Neurofuzzy identification of an autonomous underwater vehicle, \emph{International Journal of Systems Science}, 1999, 30, 901--913. \begin{codeexample}[] \begin{tikzpicture} - [auto, - decision/.style={diamond, draw=blue, thick, fill=blue!20, - text width=4.5em, text badly centered, - inner sep=1pt}, - block/.style ={rectangle, draw=blue, thick, fill=blue!20, - text width=5em, text centered, rounded corners, + [auto, + decision/.style={diamond, draw=blue, thick, fill=blue!20, + text width=4.5em,align=flush center, + inner sep=1pt}, + block/.style ={rectangle, draw=blue, thick, fill=blue!20, + text width=5em,align=center, rounded corners, minimum height=4em}, line/.style ={draw, thick, -latex',shorten >=2pt}, cloud/.style ={draw=red, thick, ellipse,fill=red!20, minimum height=2em}] - + \matrix [column sep=5mm,row sep=7mm] { % row 1 - \node [cloud] (expert) {expert}; & - \node [block] (init) {initialize model}; & + \node [cloud] (expert) {expert}; & + \node [block] (init) {initialize model}; & \node [cloud] (system) {system}; \\ % row 2 - & \node [block] (identify) {identify candidate model}; & \\ + & \node [block] (identify) {identify candidate model}; & \\ % row 3 - \node [block] (update) {update model}; & - \node [block] (evaluate) {evaluate candidate models}; & \\ + \node [block] (update) {update model}; & + \node [block] (evaluate) {evaluate candidate models}; & \\ % row 4 - & \node [decision] (decide) {is best candidate}; & \\ + & \node [decision] (decide) {is best candidate}; & \\ % row 5 & \node [block] (stop) {stop}; & \\ - }; + }; \begin{scope}[every path/.style=line] - \path (init) -- (identify); - \path (identify) -- (evaluate); - \path (evaluate) -- (decide); - \path (update) |- (identify); - \path (decide) -| node [near start] {yes} (update); - \path (decide) -- node [midway] {no} (stop); - \path [dashed] (expert) -- (init); - \path [dashed] (system) -- (init); - \path [dashed] (system) |- (evaluate); + \path (init) -- (identify); + \path (identify) -- (evaluate); + \path (evaluate) -- (decide); + \path (update) |- (identify); + \path (decide) -| node [near start] {yes} (update); + \path (decide) -- node [midway] {no} (stop); + \path [dashed] (expert) -- (init); + \path [dashed] (system) -- (init); + \path [dashed] (system) |- (evaluate); \end{scope} -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} } -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex index 700d15208e2..77726100290 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex @@ -8,6 +8,7 @@ % See the file doc/generic/pgf/licenses/LICENSE for more details. \section{Syntax for Path Specifications} +\label{section-paths} A \emph{path} is a series of straight and curved line segments. It is specified following a |\path| command and the specification must @@ -59,7 +60,7 @@ present section. the path always applies to all parts of the path. If several different colors are given for different parts of the path, only the last one (on the outermost scope) ``wins'': - + \begin{codeexample}[] \tikz \draw (0,0) -- (1,1) [color=red] -- (2,0) -- (3,1) @@ -77,13 +78,13 @@ present section. By default, the |\path| command does ``nothing'' with the path, it just ``throws it away.'' Thus, if you write - |\path(0,0)--(1,1);|, nothing is drawn + |\path(0,0)--(1,1);|, nothing is drawn in your picture. The only effect is that the area occupied by the picture is (possibly) enlarged so that the path fits inside the area. To actually ``do'' something with the path, an option like |draw| or |fill| must be given somewhere on the path. Commands like |\draw| do this implicitly. - + Finally, it is also possible to give \emph{node specifications} on a path. Such specifications can come at different locations, but they are always allowed when a normal path operation could follow. A node @@ -97,8 +98,8 @@ present section. specified by the path options (like filling and drawing the path due to a |fill| and a |draw| option somewhere in the \meta{specification}), the nodes are added in a post-processing - step. - + step. + The following style influences scopes: \begin{stylekey}{/tikz/every path (initially \normalfont empty)} This style is installed at the beginning of every path. This can @@ -117,6 +118,44 @@ present section. \end{command} +\begin{key}{/tikz/insert path=\meta{path}} + This key can be used inside an option to add something to the + current path. This is mostly useful for defining styles that create + graphic contents. This option should be used with care, for instance + it should not be used as an argument of, say, a |node|. In the + following example, we use a style to add little circles to a path. +\begin{codeexample}[] +\tikz [c/.style={insert path={circle[radius=2pt]}}] + \draw (0,0) -- (1,1) [c] -- (3,2) [c]; +\end{codeexample} + The effect is the same as of + |(0,0) -- (1,1) circle[radius=2pt] -- (3,2) circle[radius=2pt]|. +\end{key} + +The following options are for experts only: + +\begin{key}{/tikz/append after command=\meta{path}} + Some of the path commands described in the following sections take + optional arguments. For these commands, when you use this key inside + these options, the \meta{path} will be inserted \emph{after} the + path command is done. For instance, when you give this command in + the option list of a node, the \meta{path} will be added after the + node. This is used by, for instance, the |label| option to allow you + to specify a label in the option list of a node, but have this + |label| cause a node to be added after another node. +\begin{codeexample}[] +\tikz \draw node [append after command={(foo)--(1,1)},draw] (foo){foo}; +\end{codeexample} + If this key is called multiple times, the effects accumulate, that + is, all of the paths are added in the order to keys were found. +\end{key} + +\begin{key}{/tikz/prefix after command=\meta{path}} + Works like |append after command|, only the accumulation order is + inverse: The \meta{path} is added before any earlier paths added + using either |append after command| or |prefix after command|. +\end{key} + \subsection{The Move-To Operation} @@ -129,7 +168,7 @@ expected. \index{empty@\protect\meta{empty} path operation}% \index{Path operations!empty@\protect\texttt{\meta{empty}}}% The move-to operation normally starts a path at a certain - point. This does not cause a line segment to be created, but it + point. This does not cause a line segment to be created, but it specifies the starting point of the next segment. If a path is already under construction, that is, if several segments have already been created, a move-to operation will start a new part of the @@ -191,6 +230,7 @@ construction operations. \begin{pathoperation}[noindex]{-|}{\meta{coordinate}} \index{--1@\protect\texttt{-\protect\pgfmanualbar} path operation}% \index{Path operations!--1@\protect\texttt{-\protect\pgfmanualbar}}% + \pgfmanualpdflabel[\catcode`\|=12 ]{-|}{}% This operation means ``first horizontal, then vertical.'' \begin{codeexample}[] @@ -204,6 +244,7 @@ construction operations. \begin{pathoperation}[noindex]{|-}{\meta{coordinate}} \index{--2@\protect\texttt{\protect\pgfmanualbar-} path operation}% \index{Path operations!--2@\protect\texttt{\protect\pgfmanualbar-}}% + \pgfmanualpdflabel[\catcode`\|=12 ]{|-}{}% This operations means ``first vertical, then horizontal.'' \end{pathoperation} } @@ -217,7 +258,7 @@ curve. \begin{pathoperation}{..}{\declare{|controls|}\meta{c}\opt{|and|\meta{d}}\declare{|..|\meta{y}}} This operation extends the current path from the current point, let us call it $x$, via a curve to a the current point~$y$. - The curve is a cubic Bézier curve. For such a curve, + The curve is a cubic Bézier curve. For such a curve, apart from $y$, you also specify two control points $c$ and $d$. The idea is that the curve starts at $x$, ``heading'' in the direction of~$c$. Mathematically spoken, the tangent of the curve at $x$ goes @@ -301,7 +342,7 @@ influenced by the following option: \begin{key}{/tikz/rounded corners=\meta{inset} (default 4pt)} When this option is in force, all corners (places where a line is continued either via line-to or a curve-to operation) are replaced by - little arcs so that the corner becomes smooth. + little arcs so that the corner becomes smooth. \begin{codeexample}[] \tikz \draw [rounded corners] (0,0) -- (1,1) @@ -310,11 +351,11 @@ influenced by the following option: The \meta{inset} describes how big the corner is. Note that the \meta{inset} is \emph{not} scaled along if you use a scaling option - like |scale=2|. + like |scale=2|. \begin{codeexample}[] \begin{tikzpicture} - \draw[color=gray,very thin] (10pt,15pt) circle (10pt); + \draw[color=gray,very thin] (10pt,15pt) circle[radius=10pt]; \draw[rounded corners=10pt] (0,0) -- (0pt,25pt) -- (40pt,25pt); \end{tikzpicture} \end{codeexample} @@ -342,80 +383,175 @@ Here is a rectangle with rounded corners: corner will still be round, but ``not as nice.'' Second, if there are very short line segments in a path, the - ``rounding'' may cause inadverted effects. In such case it may be + ``rounding'' may cause inadvertent effects. In such case it may be necessary to temporarily switch off the rounding using - |sharp corners|. + |sharp corners|. \end{key} \begin{key}{/tikz/sharp corners} This options switches off any rounding on subsequent corners of the - path. + path. \end{key} \subsection{The Circle and Ellipse Operations} -A circle can be approximated well using four Bézier curves. However, -it is difficult to do so correctly. For this reason, a special syntax -is available for adding such an approximation of a circle to the -current path. +Circles and ellipses are common path elements for which there is a +special path operation. + +\begin{pathoperation}{circle}{\opt{|[|\meta{options}|]|}} + This command adds a circle to the current path where the center of + the circle is the current point by default, but you can use the |at| + option to change this. The new current point of the path + will be (typically just remain) the center of the circle. + + The radius of the circle is specified using the following options: + \begin{key}{/tikz/x radius=\meta{value}} + Sets the horizontal radius of the circle (which, when this value + is different form the vertical radius, is actually an + ellipse). The \meta{value} may either be a dimension or a + dimensionless number. In the latter case, the number is + interpreted in the $xy$-coordinate system (if the $x$-unit is set + to, say, |2cm|, then |x radius=3| will have the same effect as + |x radius=6cm|). + \end{key} + \begin{key}{/tikz/y radius=\meta{value}} + Works like the |x radius|. + \end{key} + \begin{key}{/tikz/radius=\meta{value}} + Sets the |x radius| and |y radius| simultaneously. + \end{key} + \begin{key}{/tikz/at=\meta{coordinate}} + If this option is explicitly set inside the \meta{options} (or + indirectly via the |every circle| style), the \meta{coordinate} is + used as the center of the circle instead of the current + point. Setting |at| to some value in an enclosing scope has no + effect. + \end{key} + The \meta{options} may also contain additional options like, say, a + |rotate| or |scale|, that will only have an effect on the circle. +\begin{codeexample}[] +\begin{tikzpicture} + \draw (1,0) circle [radius=1.5]; + \fill (1,0) circle [x radius=1cm, y radius=5mm, rotate=30]; +\end{tikzpicture} +\end{codeexample} + + It is possible to set the |radius| also in some enclosing scope, in + this case the options can be left out (but see the note below on + what may follow: +\begin{codeexample}[] +\begin{tikzpicture}[radius=2pt] + \draw (0,0) circle -- (1,1) circle -- ++(0,1) circle; +\end{tikzpicture} +\end{codeexample} -\begin{pathoperation}{circle}{|(|\meta{radius}|)|} - The center of the circle is given by the current point. The new - current point of the path will remain to be the center of the - circle. -\end{pathoperation} + The following style is used with every circle: + \begin{stylekey}{/tikz/every circle} + You can use this key to setup, say, a default radius for every + circle. The key will also be used with the |ellipse| operation. + \end{stylekey} -\begin{pathoperation}{ellipse}{|(|\meta{half width}| and |\meta{half height}|)|} - Note that you can add spaces after |ellipse|, but you have to place - spaces around |and|. + In case you feel that the names |radius| and |x radius| are too long + for your taste, you can easily created shorter aliases: +\begin{codeexample}[code only] +\tikzset{r/.style={radius=#1},rx/.style={x radius=#1},ry/.style={y radius=#1}} +\end{codeexample} + You can then say |circle [r=1cm]| or |circle [rx=1,ry=1.5]|. The + reason \tikzname\ uses the longer names by default is that it + encourages people to write more readable code. + + \emph{Note:} There also exists an older syntax for circles, where + the radius of the circle is given in parentheses right after the + |circle| command as in |circle (1pt)|. Although this syntax is a bit + more succinct, it is harder to understand for readers of the code + and the use of parentheses for something other than a coordinate is + ill-chosen. + + \tikzname\ will use the following rule to determine whether the old + or the normal syntax is used: If |circle| is directly followed by + something that (expands to) an opening parenthesis, then the old + syntax is used and inside these following parentheses there must be + a single number or dimension representing a radius. In all other + cases the new syntax is used. +\end{pathoperation} +\begin{pathoperation}{ellipse}{|[|\meta{options}|]|} + This command has exactly the same effect as |circle|. The older + syntax for this command is |ellipse (|\meta{x radius} |and| \meta{y + radius}|)|. As for the |circle| command, this syntax is not as + good as the standard syntax. \begin{codeexample}[] \begin{tikzpicture} - \draw (1,0) circle (.5cm); - \draw (3,0) ellipse (1cm and .5cm) -- ++(3,0) circle (.5cm) - -- ++(2,-.5) circle (.25cm); + \draw [help lines] (0,0) grid (3,2); + \draw (1,1) ellipse [x radius=1cm,y radius=.5cm]; \end{tikzpicture} \end{codeexample} \end{pathoperation} + \subsection{The Arc Operation} The \emph{arc operation} allows you to add an arc to the current path. -\begin{pathoperation}{arc}{|(|\meta{start angle}|:|\meta{end - angle}|:|\meta{radius}\opt{| and |\meta{half height}}|)|} - The arc operation adds a part of a circle of the given radius - between the given angles. The arc will start at the current point - and will end at the end of the arc. +\begin{pathoperation}{arc}{\oarg{options}} + The |arc| operation adds a part of an ellipse to the current + path. The radii of the ellipse are given by the values of |x radius| + and |y radius|, which should be set in the \meta{options}. The arc + will start at the current point and will end at the end of the + arc. The arc will start and end at angles computed from the three + keys |start angle|, |end angle|, and |delta angle|. Normally, the + first two keys specify the start and end angle. However, in case one + of them is empty, it is computed from the other key plus or minus + the |delta angle|. In detail, if |end angle| is empty, it is set to + the start angle plus the delta angle. If the start angle is missing, + it is set to the end angle minus the delta angle. If all three keys + are set, the delta angle is ignored. + \begin{key}{/tikz/start angle=\meta{degrees}} + Sets the start angle. + \end{key} + \begin{key}{/tikz/end angle=\meta{degrees}} + Sets the end angle. + \end{key} + \begin{key}{/tikz/delta angle=\meta{degrees}} + Sets the delta angle. + \end{key} \begin{codeexample}[] -\begin{tikzpicture} - \draw (0,0) arc (180:90:1cm) -- (2,.5) arc (90:0:1cm); - \draw (4,0) -- +(30:1cm) arc (30:60:1cm) -- cycle; - \draw (8,0) arc (0:270:1cm and .5cm) -- cycle; +\begin{tikzpicture}[radius=1cm] + \draw (0,0) arc[start angle=180, end angle=90] + -- (2,.5) arc[start angle=90, delta angle=-90]; + \draw (4,0) -- +(30:1cm) + arc [start angle=30, delta angle=30] -- cycle; + \draw (8,0) arc [start angle=0, end angle=270, + x radius=1cm, y radius=5mm] -- cycle; \end{tikzpicture} \end{codeexample} \begin{codeexample}[] -\begin{tikzpicture} +\begin{tikzpicture}[radius=1cm,delta angle=30] \draw (-1,0) -- +(3.5,0); \draw (1,0) ++(210:2cm) -- +(30:4cm); - \draw (1,0) +(0:1cm) arc (0:30:1cm); - \draw (1,0) +(180:1cm) arc (180:210:1cm); + \draw (1,0) +(0:1cm) arc [start angle=0]; + \draw (1,0) +(180:1cm) arc [start angle=180]; \path (1,0) ++(15:.75cm) node{$\alpha$}; \path (1,0) ++(15:-.75cm) node{$\beta$}; \end{tikzpicture} \end{codeexample} + + There also exists a shorter syntax for the arc operation, namely + |arc| begin directly followed by |(|\meta{start angle}|:|\meta{end + angle}|:|\meta{radius}). However, this syntax is harder to read, + so the normal syntax should be preferred in general. \end{pathoperation} \subsection{The Grid Operation} You can add a grid to the current path using the |grid| path -operation. +operation. \begin{pathoperation}{grid}{\opt{\oarg{options}}\meta{corner}} This operations adds a grid filling a rectangle whose two corners @@ -431,7 +567,7 @@ operation. The \meta{options}, which are local to the |grid| operation, can be used to influence the appearance of the grid. The stepping of the - grid is governed by the following options: + grid is governed by the following options: \begin{key}{/tikz/step=\meta{number or dimension or coordinate} (initially 1cm)} @@ -451,10 +587,10 @@ operation. \draw[red] (0,0) grid [step=.75cm] (3,2); \end{tikzpicture} \begin{tikzpicture} - \draw (0,0) circle (1); + \draw (0,0) circle [radius=1]; \draw[blue] (0,0) grid [step=(45:1)] (3,2); \end{tikzpicture} -\end{codeexample} +\end{codeexample} A complication arises when the $x$- and/or $y$-vector do not point along the axes. Because of this, the actual rule for computing the @@ -463,18 +599,18 @@ operation. vectors: The first vector is either $(\meta{x-grid-step-number},0)$ or $(\meta{x-grid-step-dimension},0\mathrm{pt})$, the second vector is $(0,\meta{y-grid-step-number})$ or - $(0\mathrm{pt},\meta{x-grid-step-dimension})$. -\end{key} + $(0\mathrm{pt},\meta{x-grid-step-dimension})$. +\end{key} \begin{key}{/tikz/xstep=\meta{dimension or number} (initially 1cm)} - Sets the stepping in the $x$-direction. + Sets the stepping in the $x$-direction. \begin{codeexample}[] \tikz \draw (0,0) grid [xstep=.5,ystep=.75] (3,2); \end{codeexample} \end{key} \begin{key}{/tikz/ystep=\meta{dimension or number} (initially 1cm)} - Sets the stepping in the $y$-direction. + Sets the stepping in the $y$-direction. \end{key} It is important to note that the grid is always ``phased'' such that @@ -511,7 +647,7 @@ parabola[parabola height=-1.5ex] +(2ex,0ex);. This operation adds a parabola through the current point and the given \meta{coordinate}. If the |bend| is given, it specifies where the bend should go; the \meta{options} can also be used to specify - where the bend is. By default, the bend is at the old current point. + where the bend is. By default, the bend is at the old current point. \begin{codeexample}[] \begin{tikzpicture} @@ -567,7 +703,7 @@ parabola[parabola height=-1.5ex] +(2ex,0ex);. option: \begin{key}{/tikz/parabola height=\meta{dimension}} This option has the same effect as - |[bend pos=0.5,bend={+(0pt,|\meta{dimension}|)}]|. + |[bend pos=0.5,bend={+(0pt,|\meta{dimension}|)}]|. \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); @@ -627,6 +763,43 @@ Note that there is no way to (conveniently) draw an interval on a sine or cosine curve whose end points are not multiples of $\pi/2$. +\subsection{The SVG Operation} + +The |svg| operation can be used to extend the current path by a path +given in the \textsc{svg} path data syntax. This syntax is described +in detail in Section 8.3 of the \textsc{svg 1.1} specification, please +consult this specification for details. + +\begin{pathoperation}{svg}{\opt{\oarg{options}}|"|\meta{path data}|"|} + This operation adds the path specified in the \meta{path data} in + \textsc{svg 1.1 path data} syntax to the current path. Unlike the + \textsc{svg}-specification, it \emph{is} permissible that the path + data does not start with a moveto command (|m| or |M|), in which + case the last point of the current path is used as start point. + The optional \meta{options} apply locally to this path operation, + typically you will use them to setup, say, some transformations. + +\begin{codeexample}[] +\begin{tikzpicture} + \filldraw [fill=red!20] (0,1) svg[scale=2] "h 10 v 10 h -10" + node [above left] {upper left} -- cycle; + + \draw svg "M 0 0 L 20 20 h 10 a 10 10 0 0 0 -20 0"; +\end{tikzpicture} +\end{codeexample} + + An \textsc{svg} coordinate like |10 20| is always interpreted as + |(10pt,20pt)|, so the basic unit is always points (|pt|). The + $xy$-coordinate system is not used. However, you can use scaling to + (locally) change the basic unit. For instance, |svg[scale=1cm]| + (yes, this works, although some rather evil magic is involved) will + cause 1cm to be the basic unit. + + \emph{Warning:} The arc operations (|a| and |A|) are not numerically + stable. This means that they will be quite imprecise, except when + the angle is a multiple of $90^\circ$ (as is, fortunately, most + often the case). +\end{pathoperation} \subsection{The Plot Operation} @@ -647,7 +820,7 @@ to |b|, exactly as if you had written |(a) -- (b)|. However, if you write |(a) to [out=135,in=45] (b)| a curve is added to the path, which leaves at an angle of 135$^\circ$ at |a| and arrives at an angle of 45$^\circ$ at |b|. This is because the options |in| and |out| -trigger a special path to be used instead of the straight line. +trigger a special path to be used instead of the straight line. \begin{pathoperation}{to}{\opt{|[|\meta{options}|]|} \opt{\meta{nodes}} |(|\meta{coordinate}|)|} @@ -655,15 +828,15 @@ trigger a special path to be used instead of the straight line. This path operation inserts the path current set via the |to path| option at the current position. The \meta{options} can be used to modify (perhaps implicitly) the |to path| and to setup how the path - will be rendered. + will be rendered. Before the |to path| is inserted, a number of macros are setup that can ``help'' the |to path|. These are |\tikztostart|, |\tikztotarget|, and |\tikztonodes|; they are explained in the - following. - + following. + \medskip - \textbf{Start and Target Coordinates.}\ \ + \textbf{Start and Target Coordinates.}\ \ The |to| operation is always followed by a \meta{coordinate}, called the target coordinate. The macro |\tikztotarget| is set to this coordinate (without the parentheses). There is also a \emph{start @@ -673,11 +846,11 @@ trigger a special path to be used instead of the straight line. macro |\tikztostart| is |0pt,0pt| and the |\tikztotarget| is |0,2|. For the second |to|, the macro |\tikztostart| is |10pt,10pt| and |\tikztotarget| is |a|. - + \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); - + \draw (0,0) to (0,2); \node (a) at (2,2) {a}; \draw[red] (10pt,10pt) to (a); @@ -690,11 +863,11 @@ trigger a special path to be used instead of the straight line. It is possible to add nodes to the paths constructed by a |to| operation. To do so, you specify the nodes between the |to| keyword and the coordinate (if there are options to the |to| - operation, these come first). The effect of |(a) to node {x} (b)| + operation, these come first). The effect of |(a) to node {x} (b)| (typically) is the same as if you had written |(a) -- node {x} (b)|, namely that the node is placed on the - to. This can be used to add labels to tos: - + to. This can be used to add labels to tos: + \begin{codeexample}[] \begin{tikzpicture} \draw (0,0) to node [sloped,above] {x} (3,2); @@ -704,23 +877,22 @@ trigger a special path to be used instead of the straight line. \end{codeexample} \medskip - \textbf{Styles for nodes.}\ \ + \textbf{Styles for to-paths.}\ \ In addition to the \meta{options} given after the |to| operation, the following style is also set at the beginning of the to path: \begin{stylekey}{/tikz/every to (initially \normalfont empty)} - This style is installed at the beginning of every to. By - default, it is set to |draw|. + This style is installed at the beginning of every to. \begin{codeexample}[] -\tikz[every to/.style={draw,dashed}] - \path (0,0) to (3,2); +\tikz[every to/.style={bend left}] + \draw (0,0) to (3,2); \end{codeexample} \end{stylekey} \medskip - \textbf{Options.}\ \ + \textbf{Options.}\ \ The \meta{options} given with the |to| allow you to influence the appearance of the |to path|. Mostly, these options are used to - change the |to path|. This can be used to change the path from a + change the |to path|. This can be used to change the path from a straight line to, say, a curve. The path used is set using the following option: @@ -729,9 +901,9 @@ trigger a special path to be used instead of the straight line. inserted. More precisely, the following path is added: \begin{quote} - |[every to,|\meta{options}|] |\meta{path} + |{[every to,|\meta{options}|] |\meta{path} |}| \end{quote} - + The \meta{options} are the options given to the |to| operation, the \meta{path} is the path set by this option |to path|. @@ -743,7 +915,7 @@ trigger a special path to be used instead of the straight line. \item \declare{|\tikztotarget|} will expand to the to-coordinate. \item \declare{|\tikztonodes|} will expand to the nodes between the |to| operation and the coordinate. Furthermore, these - nodes will have the |pos| option set implicitly. + nodes will have the |pos| option set implicitly. \end{itemize} Let us have a look at a simple example. The standard straight line @@ -772,7 +944,7 @@ trigger a special path to be used instead of the straight line. Now let us have a look at how we can modify the \meta{path} sensibly. The simplest way is to use a curve. - + \begin{codeexample}[] \begin{tikzpicture}[to path={ .. controls +(1,0) and +(1,0) .. (\tikztotarget) \tikztonodes}] @@ -780,7 +952,7 @@ trigger a special path to be used instead of the straight line. \node (a) at (0,0) {a}; \node (b) at (2,1) {b}; \node (c) at (1,2) {c}; - + \draw (a) to node {x} (b) (a) to (c); \end{tikzpicture} @@ -790,16 +962,16 @@ trigger a special path to be used instead of the straight line. \begin{codeexample}[] \tikzset{ - my loop/.style={->,to path={ + my loop/.style={to path={ .. controls +(80:1) and +(100:1) .. (\tikztotarget) \tikztonodes}}, my state/.style={circle,draw}} - + \begin{tikzpicture}[shorten >=2pt] \node [my state] (a) at (210:1) {$q_a$}; \node [my state] (b) at (330:1) {$q_b$}; - - \draw (a) to node[below] {1} (b) - to [my loop] node[above right] {0} (b); + + \draw[->] (a) to node[below] {1} (b) + to [my loop] node[above right] {0} (b); \end{tikzpicture} \end{codeexample} @@ -809,9 +981,10 @@ trigger a special path to be used instead of the straight line. computations. \end{key} - \begin{key}{/tikz/executed at end to=\meta{code}} + \begin{key}{/tikz/execute at end to=\meta{code}} Works like the previous option, only this code is executed after the to path has been added. + % FIXME : provide examples... \end{key} @@ -834,7 +1007,7 @@ local, effects. \begin{pathoperation}{let}{\meta{assignment} \opt{|,|\meta{assignment}}% \opt{|,|\meta{assignment}\dots}\declare{| in |}} - When this path operation is encountered, the \meta{assignment}s are + When this path operation is encountered, the \meta{assignment}s are evaluated, one by one. This will store coordinate and number in special \emph{registers} (which are local to \tikzname, they have nothing to do with \TeX\ registers). Subsequently, one can access the @@ -853,7 +1026,7 @@ local, effects. the resulting dimension with a trailing |pt|. A \meta{number register} can be named arbitrarily and is a normal \TeX\ parameter to the |\n| macro. Possible names are |{left corner}|, but also just a single - digit like~|5|. + digit like~|5|. Let us call the path that follows a let operation its \emph{body}. Inside the body, the |\n| macro can be used to access @@ -871,7 +1044,7 @@ local, effects. |\n2| expands to |3|. \end{command} - The second kind of \meta{assignements} have the following form: + The second kind of \meta{assignments} have the following form: \begin{quote} |\p|\meta{point register}|={|\meta{formula}|}| \end{quote} @@ -895,7 +1068,7 @@ local, effects. |=|-sign or in the body of the let operation, then it expands to the $x$-part (measured in \TeX\ points) of the coordinate stored in the \meta{register}, followed, by a comma, followed by the - $y$-part. + $y$-part. For instance, if we say |let \p1=(1pt,1pt+2pt) in ...|, then inside the |...| part the macro |\p1| will expand to exactly the @@ -913,7 +1086,7 @@ local, effects. Works like |\x|, only for the $y$-part. \end{command} Note that the above macros are available only inside a let - operation. + operation. Here is an example where let clauses are used to assemble a coordinate from the $x$-coordinate of a first point and the $y$-coordinate of a @@ -928,7 +1101,7 @@ local, effects. \fill[red] let \p1 = (first point), \p2 = (second point) in - (\x1,\y2) circle (2pt); + (\x1,\y2) circle [radius=2pt]; \end{tikzpicture} \end{codeexample} @@ -948,9 +1121,9 @@ local, effects. coordinate (p1) at (\p1) coordinate (p2) at (\p2) coordinate (center) at (\p{center}); - + \draw (p1) -- (p2); - \fill[red] (center) circle (2pt); + \fill[red] (center) circle [radius=2pt]; \end{tikzpicture} \end{codeexample} @@ -968,7 +1141,7 @@ local, effects. \draw let \p1 = ($ (a)!(c)!(b) - (c) $), \n1 = {veclen(\x1,\y1)} - in (c) circle (\n1); + in circle [at=(c), radius=\n1]; \end{tikzpicture} \end{codeexample} \end{pathoperation} @@ -993,8 +1166,8 @@ please see Section~\ref{section-scopes-relative}. There are two more operations that can be found in paths: |node| and |edge|. The first is used to add a so-called node to a -path. This operation is special in the following sense: It does not -change the current path in any way. In other words, this operation +path. This operation is special in the following sense: It does not +change the current path in any way. In other words, this operation is not really a path operation, but has an effect that is ``external'' to the path. The |edge| operation has similar effect in that it adds something \emph{after} the main path has been @@ -1002,7 +1175,7 @@ drawn. However, it works like the |to| operation, that is, it adds a |to| path to the picture after the main path has been drawn. Since these operations are quite complex, they are described in the -separate Section~\ref{section-nodes}. +separate Section~\ref{section-nodes}. diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex index b8fa8ed3588..00f8d874b6c 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex @@ -49,7 +49,7 @@ and energy into mastering the \pgfname\ commands for creating plots: in the plot and sizes in the text. \item The automatic grid generated by most programs is mostly - distracting. + distracting. \item The automatic ticks generated by most programs are cryptic numerics. (Try adding a tick reading ``$\pi$'' at the right point.) @@ -156,8 +156,7 @@ The file |plots/pgfmanual-sine.table| reads: \end{codeexample} It was produced from the following source, using |gnuplot|: \begin{codeexample}[code only] -set terminal table -set output "../plots/pgfmanual-sine.table" +set table "../plots/pgfmanual-sine.table" set format "%.5f" set samples 20 plot [x=0:10] sin(x) @@ -189,7 +188,7 @@ option. The \meta{coordinate expression} is then evaluated for different values for |\x| and the resulting coordinates are plotted. Note that you will often have to put the $x$- or $y$-coordinate inside -braces, namely whenever you use an expression involving a paranthesis. +braces, namely whenever you use an expression involving a parenthesis. The following options influence how the \meta{coordinate expression} is evaluated: @@ -221,10 +220,10 @@ is evaluated: \begin{codeexample}[] \begin{tikzpicture}[domain=0:4] \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); - + \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$}; - + \draw[color=red] plot (\x,\x) node[right] {$f(x) =x$}; \draw[color=blue] plot (\x,{sin(\x r)}) node[right] {$f(x) = \sin x$}; \draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x) = \frac{1}{20} \mathrm e^x$}; @@ -254,17 +253,20 @@ easily produce the necessary points. Currently, \tikzname\ knows how to call \textsc{gnuplot}. When \tikzname\ encounters your operation -|plot[id=|\meta{id}|] function{x*sin(x)}| for +|plot[id=|\meta{id}|] function{x*sin(x)}| for the first time, it will create a file called \meta{prefix}\meta{id}|.gnuplot|, where \meta{prefix} is |\jobname.| by default, that is, the name of you main |.tex| file. If no \meta{id} is given, it will be empty, which is alright, but it is better when each plot has a unique \meta{id} for reasons explained in a moment. Next, \tikzname\ writes some initialization code into this file followed by -|plot x*sin(x)|. The initialization code sets up things +|plot x*sin(x)|. The initialization code sets up things such that the |plot| operation will write the coordinates into another file called \meta{prefix}\meta{id}|.table|. Finally, this table file -is read as if you had said |plot file{|\meta{prefix}\meta{id}|.table}|. +is read as if you had said |plot file{|\meta{prefix}\meta{id}|.table}|. However, +there is just one difference: |gnuplot| supports a ``type'' field following +the coordinates. If this type field contains `|u|' which means unbounded, \tikzname\ will +ignore the complete coordinate\footnote{Thanks to Andy Schlaikjer for this patch.}. For the plotting mechanism to work, two conditions must be met: \begin{enumerate} @@ -293,7 +295,7 @@ graphic for the second time: If upon reaching already exists \emph{and} if the \meta{prefix}\meta{id}|.gnuplot| file contains what \tikzname\ thinks that it ``should'' contain, the |.table| file is immediately read without trying to call a |gnuplot| -program. This approach has the following advantages: +program. This approach has the following advantages: \begin{enumerate} \item If you pass a bundle of your |.tex| file and all |.gnuplot| and @@ -329,10 +331,10 @@ plots, use |t| as the variable for parametric plots. Here are some examples: \begin{codeexample}[] \begin{tikzpicture}[domain=0:4] \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); - + \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$}; - + \draw[color=red] plot[id=x] function{x} node[right] {$f(x) =x$}; \draw[color=blue] plot[id=sin] function{sin(x)} node[right] {$f(x) = \sin x$}; \draw[color=orange] plot[id=exp] function{0.05*exp(x)} node[right] {$f(x) = \frac{1}{20} \mathrm e^x$}; @@ -344,7 +346,7 @@ The plot in influenced by the following options: First, the options |samples| and |domain| explained earlier. Second, there are some more specialized options. -\begin{key}{/tikz/parametric=\meta{boolena} (default true)} +\begin{key}{/tikz/parametric=\meta{boolean} (default true)} Sets whether the plot is a parametric plot. If true, then |t| must be used instead of |x| as the parameter and two comma-separated functions must be given in the \meta{gnuplot formula}. An example is @@ -365,7 +367,7 @@ specialized options. \begin{key}{/tikz/prefix=\meta{prefix}} The \meta{prefix} is put before each plot file name. The default is - |\jobname.|, but + |\jobname.|, but if you have many plots, it might be better to use, say |plots/| and have all plots placed in a directory. You have to create the directory yourself. @@ -378,7 +380,7 @@ specialized options. \begin{codeexample}[code only] plot[raw gnuplot,id=raw-example] function{set samples 25; plot sin(x)} \end{codeexample} - This can be + This can be useful for complicated things that need to be passed to \textsc{gnuplot}. However, for really complicated situations you should create a special external generating \textsc{gnuplot} file @@ -386,7 +388,7 @@ plot[raw gnuplot,id=raw-example] function{set samples 25; plot sin(x)} \end{key} The following styles influence the plot: -\begin{stylekey}{/tikz/every plot (initially \normalfont empyt)} +\begin{stylekey}{/tikz/every plot (initially \normalfont empty)} This style is installed in each plot, that is, as if you always said \begin{codeexample}[code only] plot[every plot,...] @@ -405,14 +407,14 @@ As we saw already, it is possible to add \emph{marks} to a plot using the |mark| option. When this option is used, a copy of the plot mark is placed on each point of the plot. Note that the marks are placed \emph{after} the whole path has been drawn/filled/shaded. In -this respect, they are handled like text nodes. +this respect, they are handled like text nodes. In detail, the following options govern how marks are drawn: \begin{key}{/tikz/mark=\meta{mark mnemonic}} Sets the mark to a mnemonic that has previously been defined using the |\pgfdeclareplotmark|. By default, |*|, |+|, and |x| are available, which draw a filled circle, a plus, and a cross as marks. Many more - marks become available when the library |pgflibraryplotmarks| is + marks become available when the library |plotmarks| is loaded. Section~\ref{section-plot-marks} lists the available plot marks. @@ -420,7 +422,7 @@ In detail, the following options govern how marks are drawn: it \tikzname. The |ball color| determines the balls's color. Do not use this option with a large number of marks since it will take very long to render in PostScript. - + \begin{tabular}{lc} Option & Effect \\\hline \vrule height14pt width0pt \plotmarkentrytikz{ball} @@ -430,7 +432,7 @@ In detail, the following options govern how marks are drawn: \begin{key}{/tikz/mark repeat=\meta{r}} This option tells \tikzname\ that only every $r$th mark should be drawn. - + \begin{codeexample}[] \tikz \draw plot[mark=x,mark repeat=3,smooth] file {plots/pgfmanual-sine.table}; \end{codeexample} @@ -440,7 +442,7 @@ In detail, the following options govern how marks are drawn: This option tells \tikzname\ that the first mark to be draw should be the $p$th, followed by the $(p+r)$th, then the $(p+2r)$th, and so on. - + \begin{codeexample}[] \tikz \draw plot[mark=x,mark repeat=3,mark phase=6,smooth] file {plots/pgfmanual-sine.table}; \end{codeexample} @@ -450,7 +452,7 @@ In detail, the following options govern how marks are drawn: This option allows you to specify explicitly the indices at which a mark should be placed. Counting starts with 1. You can use the |\foreach| syntax, that is, |...| can be used. - + \begin{codeexample}[] \tikz \draw plot[mark=x,mark indices={1,4,...,10,11,12,...,16,20},smooth] file {plots/pgfmanual-sine.table}; @@ -465,23 +467,34 @@ In detail, the following options govern how marks are drawn: This option is not really necessary, since you achieve the same effect by specifying |scale=|\meta{factor} as a local option, where \meta{factor} is the quotient of the desired size and the default - size. However, using |mark size| is a bit faster and more natural. + size. However, using |mark size| is a bit faster and more natural. \end{key} -\begin{key}{/tikz/mark options=\meta{options}} - These options are applied to marks when they are drawn. For example, +\begin{stylekey}{/tikz/every mark} + This style is installed before drawing plot marks. For example, you can scale (or otherwise transform) the plot mark or set its - color. + color. +\end{stylekey} + +\begin{key}{/tikz/mark options=\meta{options}} + Redefines |every mark| such that it sets \marg{options}. \begin{codeexample}[] \tikz \fill[fill=blue!20] plot[mark=triangle*,mark options={color=blue,rotate=180}] file{plots/pgfmanual-sine.table} |- (0,0); \end{codeexample} \end{key} + +\begin{stylekey}{/tikz/no marks} + Disables markers (the same as |mark=none|). +\end{stylekey} +\begin{stylekey}{/tikz/no markers} + Disables markers (the same as |mark=none|). +\end{stylekey} -\subsection{Smooth Plots, Sharp Plots, and Comb Plots} +\subsection{Smooth Plots, Sharp Plots, Jump Plots, Comb Plots and Bar Plots} There are different things the |plot| operation can do with the points it reads from a file or from the inlined list of points. By default, @@ -514,7 +527,7 @@ use options to change the behavior of |plot|. curves. A value of $1$ results in a circle if four points at quarter-positions on a circle are given. The default is $0.55$. The ``correct'' value depends on the details of plot. - + \begin{codeexample}[] \begin{tikzpicture}[smooth cycle] \draw plot[tension=0.2] @@ -529,7 +542,7 @@ use options to change the behavior of |plot|. \begin{key}{/tikz/smooth cycle} This option causes the points on the path to be connected using a - closed smooth curve. + closed smooth curve. \begin{codeexample}[] \tikz[scale=0.5] @@ -538,6 +551,45 @@ use options to change the behavior of |plot|. \end{codeexample} \end{key} +\begin{key}{/tikz/const plot} + This option causes the points on the path to be connected using piecewise constant series of lines: + +\begin{codeexample}[] +\tikz\draw plot[const plot] file{plots/pgfmanual-sine.table}; +\end{codeexample} +\end{key} + +\begin{key}{/tikz/const plot mark left} + Just an alias for |/tikz/const plot|. +\begin{codeexample}[] +\tikz\draw plot[const plot mark left,mark=*] file{plots/pgfmanual-sine.table}; +\end{codeexample} +\end{key} + +\begin{key}{/tikz/const plot mark right} + A variant of |/tikz/const plot| which places its mark on the right ends: +\begin{codeexample}[] +\tikz\draw plot[const plot mark right,mark=*] file{plots/pgfmanual-sine.table}; +\end{codeexample} +\end{key} + + +\begin{key}{/tikz/jump mark left} + This option causes the points on the path to be drawn using piecewise constant, non-connected series of lines. If there are any marks, they will be placed on left open ends: + +\begin{codeexample}[] +\tikz\draw plot[jump mark left, mark=*] file{plots/pgfmanual-sine.table}; +\end{codeexample} +\end{key} + +\begin{key}{/tikz/jump mark right} + This option causes the points on the path to be drawn using piecewise constant, non-connected series of lines. If there are any marks, they will be placed on right open ends: + +\begin{codeexample}[] +\tikz\draw plot[jump mark right, mark=*] file{plots/pgfmanual-sine.table}; +\end{codeexample} +\end{key} + \begin{key}{/tikz/ycomb} This option causes the |plot| operation to interpret the plotting points differently. Instead of connecting them, for each point of @@ -560,7 +612,7 @@ use options to change the behavior of |plot|. \begin{key}{/tikz/xcomb} - This option works like |ycomb| except that the bars are horizontal. + This option works like |ycomb| except that the bars are horizontal. \begin{codeexample}[] \tikz \draw plot[xcomb,mark=x] coordinates{(1,0) (0.8,0.2) (0.6,0.4) (0.2,1)}; @@ -579,6 +631,57 @@ use options to change the behavior of |plot|. \end{codeexample} \end{key} +\begin{key}{/tikz/ybar} + This option produces fillable bar plots. It is thus very similar to |ycomb|, but it employs rectangular shapes instead of line-to operations. It thus allows to use any fill- or pattern style. + +\begin{codeexample}[] +\tikz\draw[draw=blue,fill=blue!60!black] plot[ybar] file{plots/pgfmanual-sine.table}; +\end{codeexample} + +\begin{codeexample}[] +\begin{tikzpicture}[ybar] + \draw[color=red,fill=red!80,bar width=6pt] + plot coordinates{(0,1) (.5,1.2) (1,.6) (1.5,.7) (2,.9)}; + \draw[color=red!50,fill=red!20,bar width=4pt,bar shift=3pt] + plot coordinates{(0,1.2) (.5,1.3) (1,.5) (1.5,.2) (2,.5)}; +\end{tikzpicture} +\end{codeexample} + The use of |bar width| and |bar shift| is explained in the plot handler library documentation, section~\ref{section-plotlib-bar-handlers}. Please refer to page~\pageref{key-bar-width}. +\end{key} + +\begin{key}{/tikz/xbar} + This option works like |ybar| except that the bars are horizontal. + +\begin{codeexample}[] +\tikz \draw[pattern=north west lines] plot[xbar] + coordinates{(1,0) (0.4,1) (1.7,2) (1.6,3)}; +\end{codeexample} +\end{key} + +\begin{key}{/tikz/ybar interval} + As |/tikz/ybar|, this options produces vertical bars. However, bars are centered at coordinate \emph{intervals} instead of interval edges, and the bar's width is also determined relatively to the interval's length: + +\begin{codeexample}[] +\begin{tikzpicture}[ybar interval,x=10pt] + \draw[color=red,fill=red!80] + plot coordinates{(0,2) (2,1.2) (3,.3) (5,1.7) (8,.9) (9,.9)}; +\end{tikzpicture} +\end{codeexample} + Since there are $N$ intervals $[x_i,x_{i+1}]$ for given $N+1$ coordinates, you will always have one coordinate more than bars. The last $y$ value will be ignored. + + You can configure relative shifts and relative bar width, which is explained in the plot handler library documentation, section~\ref{section-plotlib-bar-handlers}. Please refer to page~\pageref{key-bar-interval-width}. +\end{key} + +\begin{key}{/tikz/xbar interval} + Works like |ybar interval|, but for horizontal bar plots. + +\begin{codeexample}[] +\begin{tikzpicture}[xbar interval,x=0.5cm,y=0.5cm] + \draw[color=red,fill=red!80] + plot coordinates {(3,0) (2,1) (4,1.5) (1,4) (2,6) (2,7)}; +\end{tikzpicture} +\end{codeexample} +\end{key} \begin{key}{/tikz/only marks} This option causes only marks to be shown; no path segments are @@ -590,4 +693,3 @@ use options to change the behavior of |plot|. plot[only marks,mark=x] coordinates{(0,0) (1,1) (2,0) (3,-1)}; \end{codeexample} \end{key} - diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex index 85891e6d9de..063b4570a7e 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex @@ -26,7 +26,7 @@ apply to everything within the environment. \begin{package}{tikz} This package does not have any options. - + This will automatically load the \pgfname\ and the |pgffor| package. \pgfname\ needs to know what \TeX\ driver you are intending to use. In @@ -35,7 +35,7 @@ apply to everything within the environment. situation where \pgfname\ cannot know the driver ``by itself'' is when you use plain \TeX\ or Con\TeX t together with |dvipdfm|. In this case, you have to write |\def\pgfsysdriver{pgfsys-dvipdfm.def}| - \emph{before} you input |tikz.tex|. + \emph{before} you input |tikz.tex|. \end{package} @@ -45,7 +45,7 @@ apply to everything within the environment. libraries separated by commas. Instead of curly braces, you can also use square brackets, which is something Con\TeX t users will like. If you try to load a library a second time, nothing will - happen. + happen. \example |\usetikzlibrary{arrows}| @@ -66,7 +66,7 @@ apply to everything within the environment. \subsubsection{Creating a Picture Using an Environment} -The ``outermost'' scope of \tikzname\ is the |{tikzpicture}| +The ``outermost'' scope of \tikzname\ is the |{tikzpicture}| environment. You may give drawing commands only inside this environment, giving them outside (as is possible in many other packages) will result in chaos. @@ -79,7 +79,7 @@ filenames of temporary files written while plotting functions using an external program. The graphic options are specified in \emph{key lists}, see Section~\ref{section-graphic-options} below for details. All graphic options are local to the |{tikzpicture}| to which -they apply. +they apply. \begin{environment}{{tikzpicture}\opt{\oarg{options}}} All \tikzname\ commands should be given inside this @@ -87,7 +87,7 @@ they apply. packages, it is not possible to use, say, |\pgfpathmoveto| outside this environment and doing so will result in chaos. For \tikzname, commands like |\path| are only defined inside this environment, so - there is little chance that you will do something wrong here. + there is little chance that you will do something wrong here. When this environment is encountered, the \meta{options} are parsed, see Section~\ref{section-graphic-options}. All options given @@ -108,7 +108,7 @@ they apply. then resizes the picture box such that the box has this size. To ``make its guess,'' everytime \pgfname\ encounters a coordinate, it updates the bounding box's size such that it encompasses all these - coordinates. This will usually give a good + coordinates. This will usually give a good approximation of the bounding box, but will not always be accurate. First, the line thickness of diagonal lines is not taken into account correctly. Second, controls points of a curve often lie far @@ -117,7 +117,7 @@ they apply. The following key influences the baseline of the resulting picture: - \begin{key}{/tikz/baseline=\meta{dimension or coordinate} (default 0pt)} + \begin{key}{/tikz/baseline=\meta{dimension or coordinate or \texttt{default}} (default 0pt)} Normally, the lower end of the picture is put on the baseline of the surrounding text. For example, when you give the code |\tikz\draw(0,0)circle(.5ex);|, \pgfname\ will find out that the @@ -137,7 +137,7 @@ $A \mathbin{\tikz[baseline] \draw[->>] (0pt,.5ex) -- (3ex,.5ex);} B$ \end{codeexample} Instead of a \meta{dimension} you can also provide a coordinate in - parantheses. Then the effect is to put the baseline on the + parentheses. Then the effect is to put the baseline on the $y$-coordinate that the give \meta{coordinate} has \emph{at the end of the picture}. This means that, at the end of the picture, the \meta{coordinate} is evaluated and then the baseline is set @@ -154,6 +154,8 @@ Top align: \tikz[baseline=(current bounding box.north)] \draw (0,0) rectangle (1cm,1ex); \end{codeexample} + + Use |baseline=default| to reset the |baseline| option to its initial configuration. \end{key} \begin{key}{/tikz/execute at begin picture=\meta{code}} @@ -222,25 +224,23 @@ In other \TeX\ format, you should use instead the following commands: \subsubsection{Creating a Picture Using a Command} -The following two commands are used for ``small'' graphics. - -\begin{command}{\tikz\opt{\oarg{options}}\marg{commands}} - This command places the \meta{commands} inside a - |{tikzpicture}| environment and adds a semicolon at the end. This is - just a convenience. +The following command is an alternative to |{tikzpicture}| that is +particular useful for graphics consisting of a single or few +commands. - The \meta{commands} may not contain a paragraph (an empty - line). This is a precaution to ensure that users really use this - command only for small graphics. - - \example |\tikz{\draw (0,0) rectangle (2ex,1ex)}| yields - \tikz{\draw (0,0) rectangle (2ex,1ex);} -\end{command} +\begin{command}{\tikz\opt{\oarg{options}}\marg{path commands}} + This command places the \meta{path commands} inside a + |{tikzpicture}| environment. The \meta{path commands} may + contain paragraphs and fragile material (like verbatim text). + If there is only one path command, it need not be surrounded by + curly braces, if there are several, you need to add them (this is + similar to the |\foreach| statement and also to the rules in + programming languages like Java or C concerning the placement of + curly braces). -\begin{command}{\tikz\opt{\oarg{options}}\meta{text}|;|} - If the \meta{text} does not start with an opening brace, the end of - the \meta{text} is the next semicolon that is encountered. + \example |\tikz{\draw (0,0) rectangle (2ex,1ex);}| yields + \tikz{\draw (0,0) rectangle (2ex,1ex);} \example |\tikz \draw (0,0) rectangle (2ex,1ex);| yields \tikz \draw (0,0) rectangle (2ex,1ex); @@ -259,7 +259,7 @@ some other kind of decoration. Since backgrounds are often not needed at all, the definition of styles for adding backgrounds has been put in the library package |backgrounds|. This package is documented in -Section~\ref{section-tikz-backgrounds}. +Section~\ref{section-tikz-backgrounds}. \subsection{Using Scopes to Structure a Picture} @@ -291,7 +291,7 @@ chance of doing anything wrong. \end{scope} \end{tikzpicture} \end{codeexample} - + The following style influences scopes: \begin{stylekey}{/tikz/every scope (initially \normalfont empty)} This style is installed at the beginning of every scope. @@ -309,7 +309,7 @@ chance of doing anything wrong. This option installs some code that will be executed at the end of the current scope. Using this option multiple times will cause the code to accumulate. This option must also be given - in the optional argument of the |{scope}| environment. + in the optional argument of the |{scope}| environment. Again, the effect applies only to the current scope, not to subscopes. \end{key} @@ -329,7 +329,7 @@ chance of doing anything wrong. There is a small library that makes using scopes a bit easier: \begin{tikzlibrary}{scopes} This library defines a shorthand for starting and ending |{scope}| - environments. + environments. \end{tikzlibrary} When this library is loaded, the following happens: At certain places inside a \tikzname\ picture, it is allowed to start a scope just using @@ -353,7 +353,7 @@ square brackets: \end{tikzpicture} \end{codeexample} -In the above example, |{ [thick]| actually causes a +In the above example, |{ [thick]| actually causes a |\begin{scope}[thick]| to be inserted, and the corresponding closing |}| causes an |\end{scope}| to be inserted. @@ -481,7 +481,7 @@ used in different pictures. In this case, we have to use the |\tikzset| command somewhere at the beginning. \begin{codeexample}[] \tikzset{help lines/.style={blue!50,very thin}} -% ... +% ... \begin{tikzpicture} \draw (0,0) grid +(2,2); \draw[help lines] (2,0) grid +(2,2); @@ -504,7 +504,7 @@ In the above example, the option |blue!50| is appended to the style last one will ``win.'' There also exists a handler called |/.prefix style| that adds something at the beginning of the style. -Just as normal keys, styles can be parametrized. This means that you +Just as normal keys, styles can be parameterized. This means that you write \meta{style}|=|\meta{value} when you use the style instead of just \meta{style}. In this case, all occurrences of |#1| in \meta{style} are replaced by \meta{value}. Here is an example that @@ -517,7 +517,7 @@ shows how this can be used. \end{tikzpicture} \end{codeexample} -For parametrized styles you can also set a \emph{default} value using +For parameterized styles you can also set a \emph{default} value using the |/.default| handler: \begin{codeexample}[] @@ -529,6 +529,4 @@ the |/.default| handler: \end{codeexample} For more details on using and setting styles, see also -Section~\ref{section-keys}. - - +Section~\ref{section-keys}. diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex index 950dbe71a28..5cd58695209 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex @@ -15,12 +15,12 @@ In the present section, the usage of \emph{nodes} in \tikzname\ is explained. A node is typically a rectangle or circle or -another simple shape with some text on it. +another simple shape with some text on it. Nodes are added to paths using the special path operation |node|. Nodes \emph{are not part of the path itself}. Rather, they are added to the picture after the path has -been drawn. +been drawn. In Section~\ref{section-nodes-basic} the basic syntax of the node operation is explained, followed in Section~\ref{section-nodes-multi} @@ -38,8 +38,7 @@ Section~\ref{section-nodes-connecting} it is explained how a node can be used as a ``pseudo-coordinate.'' Section~\ref{section-nodes-edges} introduces the |edge| operation, which works similar to the |to| operation and also similar to the |node| -operation. Finally, Section~\ref{section-nodes-executing} explains the -special |after node path| options. +operation. \subsection{Nodes and Their Shapes} @@ -71,7 +70,7 @@ current position of the path \emph{after the path has been drawn}. Thus, all nodes are drawn ``on top'' of the path and retained until the path is complete. If there are several nodes on a path, they are drawn on top of the path in the order they are -encountered. +encountered. \begin{codeexample}[] \tikz \fill[fill=examplefill] @@ -87,7 +86,7 @@ The syntax for specifying nodes is the following: after |at| and not, as would normally be the case, at the last position. The |at| syntax is not available when a node is given inside a path operation (it would not make any sense, there). - + The |(|\meta{name}|)| is a name for later reference and it is optional. You may also add the option |name=|\meta{name} to the \meta{option} list; it has the same effect. @@ -99,7 +98,7 @@ The syntax for specifying nodes is the following: can name a node just |1| or perhaps |start of chart| or even |y_1|. Your node name should \emph{not} contain any punctuation like a dot, a comma, or a colon since these are used to detect what kind - of coordinate you mean when you reference a node. + of coordinate you mean when you reference a node. \end{key} \begin{key}{/tikz/alias=\meta{another node name}} @@ -110,7 +109,7 @@ The syntax for specifying nodes is the following: \end{key} \begin{key}{/tikz/at=\meta{coordinate}} - This is another way of specifying ath |at| coordinate. Note that, + This is another way of specifying the |at| coordinate. Note that, typically, you will have to enclose the \meta{coordinate} in curly braces so that a comma inside the \meta{coordinate} does not confuse \TeX. @@ -125,7 +124,7 @@ The syntax for specifying nodes is the following: node (unless some special other options are used, deep sigh). As mentioned before, we can add a border and even a background to a - node: + node: \begin{codeexample}[] \tikz \fill[fill=examplefill] (0,0) node {first node} @@ -136,8 +135,8 @@ The syntax for specifying nodes is the following: The ``border'' is actually just a special case of a much more general mechanism. Each node has a certain \emph{shape} which, by default, is a rectangle. However, we can also ask \tikzname\ to use a circle shape - instead or an ellipse shape (you have to include |pgflibraryshapes| for - the latter shape): + instead or an ellipse shape (you have to include one of the + |shapes.geometric| library for the latter shape): \begin{codeexample}[] \tikz \fill[fill=examplefill] @@ -164,15 +163,15 @@ The syntax for specifying nodes is the following: check whether this option is the name of some shape. If so, that shape is selected as if you had said |shape=|\meta{shape name}. - By default, the following shapes are available: |rectangle|, + By default, the following shapes are available: |rectangle|, % this par has to be adapted: no more shapes library available, only several sublibraries |circle|, |coordinate|, and, when the package |pgflibraryshapes| is loaded, also |ellipse|. Details of these shapes, like their anchors and size options, are discussed in Section~\ref{section-the-shapes}. \end{key} - + The following styles influences how nodes are rendered: \begin{stylekey}{/tikz/every node (initially \normalfont empty)} - This style is installed at the beginning of every node. + This style is installed at the beginning of every node. \begin{codeexample}[] \begin{tikzpicture}[every node/.style={draw}] \draw (0,0) node {A} -- (1,1) node {B}; @@ -185,7 +184,7 @@ The syntax for specifying nodes is the following: rectangle nodes, and so on. \begin{codeexample}[] \begin{tikzpicture} - [every rectangle node/.style={draw}, + [every rectangle node/.style={draw}, every circle node/.style={draw,double}] \draw (0,0) node[rectangle] {A} -- (1,1) node[circle] {B}; \end{tikzpicture} @@ -199,7 +198,7 @@ There is a special syntax for specifying ``light-weighed'' nodes: This has the same effect as |node[shape=coordinate][|\meta{options}|](|\meta{name}|)at(|\meta{coordinate}|){}|, - + where the |at| part might be missing. \end{pathoperation} @@ -232,7 +231,7 @@ special commands for creating paths containing only a node: \end{itemize} By loading library packages, you can define more shapes like ellipses or diamonds; see Section~\ref{section-libs-shapes} for the complete -list of shapes. +list of shapes. \label{section-tikz-coordinate-shape} The |coordinate| shape is handled in a special way by \tikzname. When @@ -241,14 +240,14 @@ this has the same effect as if you had said |(x.center)|. None of the special ``line shortening rules'' apply in this case. This can be useful since, normally, the line shortening causes paths to be segmented and they cannot be used for filling. Here is an example that -demonstrates the difference: +demonstrates the difference: \begin{codeexample}[] \begin{tikzpicture}[every node/.style={draw}] \path[yshift=1.5cm,shape=rectangle] (0,0) node(a1){} (1,0) node(a2){} (1,1) node(a3){} (0,1) node(a4){}; \filldraw[fill=examplefill] (a1) -- (a2) -- (a3) -- (a4); - + \path[shape=coordinate] (0,0) coordinate(b1) (1,0) coordinate(b2) (1,1) coordinate(b3) (0,1) coordinate(b4); @@ -278,7 +277,7 @@ shapes: to make it a bit ``larger.'' For those familiar with \textsc{css}, this is the same as - \emph{padding}. + \emph{padding}. \begin{codeexample}[] \begin{tikzpicture} @@ -297,7 +296,7 @@ shapes: \begin{key}{/pgf/inner ysep=\meta{dimension} (initially .3333em)} \keyalias{tikz} Specifies the inner separation in the $y$-direction, only. -\end{key} +\end{key} \begin{key}{/pgf/outer sep=\meta{dimension} (initially .5\string\pgflinewidth)} \keyalias{tikz} @@ -313,7 +312,7 @@ shapes: exactly on the ``outside border'' of the path (not on the path itself). When the shape is filled, but not drawn, this may not be desirable. In this case, the |outer sep| should be set to zero - point. + point. \begin{codeexample}[] \begin{tikzpicture} \draw[line width=5pt] @@ -321,7 +320,7 @@ shapes: (2,0) node[inner sep=.5\pgflinewidth+2pt,draw] (d) {drawn}; \draw[->] (1,-1) -- (f); - \draw[->] (1,-1) -- (d); + \draw[->] (1,-1) -- (d); \end{tikzpicture} \end{codeexample} \end{key} @@ -341,7 +340,7 @@ shapes: This option ensures that the height of the shape (including the inner, but ignoring the outer separation) will be at least \meta{dimension}. Thus, if the text plus the inner separation is not - at least as large as \meta{dimension}, the shape will be enlarged + at least as large as \meta{dimension}, the shape will be enlarged appropriately. However, if the text is already larger than \meta{dimension}, the shape will not be shrunk. \begin{codeexample}[] @@ -387,12 +386,12 @@ shapes: \label{section-rotating-shape-borders} -Some shapes (but not all), support a special kind of rotation. This -rotation affects only the border of a shape and is independent of the +Some shapes (but not all), support a special kind of rotation. This +rotation affects only the border of a shape and is independent of the node contents, but \emph{in addition} to any other transformations. \begin{codeexample}[] -\tikzstyle{every node}=[dart, shape border uses incircle, +\tikzstyle{every node}=[dart, shape border uses incircle, inner sep=1pt, draw] \begin{tikzpicture} \foreach \a/\b/\c in {A/0/0, B/45/0, C/0/45, D/45/45} @@ -400,22 +399,22 @@ node contents, but \emph{in addition} to any other transformations. \end{tikzpicture} \end{codeexample} -There are two types of rotation: restricted and unrestricted. Which -type of rotation is applied is determined by on how the shape border -is constructed. If the shape border is contructed using an incircle, -that is, a circle that tightly fits the node contents (including +There are two types of rotation: restricted and unrestricted. Which +type of rotation is applied is determined by on how the shape border +is constructed. If the shape border is constructed using an incircle, +that is, a circle that tightly fits the node contents (including the |inner sep|), then the rotation can be unrestricted. If, however, the border is constructed using the natural dimensions of the node -contents, the rotation is restricted to integer multiples of 90 +contents, the rotation is restricted to integer multiples of 90 degrees. Why should there be two kinds of rotation and border construction? Borders constructed using the natural dimensions of the node contents -provide a much tighter fit to the node contents, but to maintain -this tight fit, the border rotation must be restricted to integer +provide a much tighter fit to the node contents, but to maintain +this tight fit, the border rotation must be restricted to integer multiples of 90 degrees. By using an incircle, unrestricted rotation is possible, but the border will not make a very tight fit to the -node contents. +node contents. \begin{codeexample}[] \tikzstyle{every node}=[isosceles triangle, draw] @@ -425,16 +424,16 @@ node contents. \end{tikzpicture} \end{codeexample} -There are \pgfname{} keys determine how a shape border is -contructed, and to specify its rotation. -It should be noted that not all shapes support these keys, so -reference should be made to the documentation for individual -shapes. +There are \pgfname{} keys determine how a shape border is +constructed, and to specify its rotation. +It should be noted that not all shapes support these keys, so +reference should be made to the documentation for individual +shapes. \begin{key}{/pgf/shape border uses incircle=\opt{\meta{boolean}} (default true)} \keyalias{tikz} - Determines if the border of a shape is constructed using the + Determines if the border of a shape is constructed using the incircle. If no value is given \meta{boolean} will take the default value |true|. \end{key} @@ -443,15 +442,15 @@ shapes. \begin{key}{/pgf/shape border rotate=\meta{angle} (initially 0)} \keyalias{tikz} Rotates the border of a shape independently of the node contents, - but in addition to any other transformations. If the shape + but in addition to any other transformations. If the shape border is not constructed using the incircle, the rotation will be rounded to the nearest integer multiple of 90 degrees when the - shape is drawn. + shape is drawn. \end{key} -Note that if the border of the shape is rotated, -the compass point anchors, and `text box' anchors (including -|mid east|, |base west|, and so on), \emph{do not rotate}, but the +Note that if the border of the shape is rotated, +the compass point anchors, and `text box' anchors (including +|mid east|, |base west|, and so on), \emph{do not rotate}, but the other anchors do: \begin{codeexample}[] @@ -459,7 +458,7 @@ other anchors do: \begin{tikzpicture} \node at (0,0) (A) {A}; \node [shape border rotate=30] at (1.5,0) (B) {B}; - \foreach \s/\t in + \foreach \s/\t in {left side/base east, bottom side/north, bottom left corner/base}{ \fill[red] (A.\s) circle(1.5pt) (B.\s) circle(1.5pt); \fill[blue] (A.\t) circle(1.5pt) (B.\t) circle(1.5pt); @@ -467,10 +466,10 @@ other anchors do: \end{tikzpicture} \end{codeexample} -Finally, a somewhat unfortunate side-effect of rotating shape borders -is that the supporting shapes do not distinguish between -|outer xsep| and |outer ysep|, and typically, the larger of the -two values will be used. +Finally, a somewhat unfortunate side-effect of rotating shape borders +is that the supporting shapes do not distinguish between +|outer xsep| and |outer ysep|, and typically, the larger of the +two values will be used. @@ -494,13 +493,14 @@ lower level, \pgfname\ provides a system for specifying that a shape consists of several parts. On the \tikzname\ level, you specify the different node parts by using the following command: -\begin{command}{\nodepart\marg{part name}} +\begin{command}{\nodepart\opt{|[|\meta{options}|]|}\marg{part name}} This command can only be used inside the \meta{text} argument of a |node| path operation. It works a little bit like a |\part| command in \LaTeX. It will stop the typesetting of whatever node part was typeset until now and then start putting all following text into the node part named \meta{part name}---until another |\partname| is - encountered or until the node \meta{text} ends. + encountered or until the node \meta{text} ends. The \meta{options} + will be local to this part. \begin{codeexample}[] \begin{tikzpicture} @@ -508,7 +508,7 @@ different node parts by using the following command: { % No \nodepart has been used, yet. So, the following is put in the % ``text'' node part by default. - $q_1$ + $q_1$ \nodepart{lower} % Ok, end ``text'' part, start ``output'' part $00$ }; % output part ended. @@ -521,7 +521,7 @@ different node parts by using the following command: \begin{stylekey}{/tikz/every \meta{part name} node part (initially \normalfont empty)} This style is installed at the beginning of every node part named - \meta{part name}. + \meta{part name}. \begin{codeexample}[] \tikz [every lower node part/.style={red}] \node [circle split,draw] {$q_1$ \nodepart{lower} $00$}; @@ -531,13 +531,15 @@ different node parts by using the following command: -\subsection{Options for the Text in Nodes} +\subsection{The Node Text} \label{section-nodes-options} +\subsubsection{Text Parameters: Color and Opacity} + The simplest option for the text in nodes is its color. Normally, this color is just the last color installed using |color=|, possibly -inherited from another scope. However, it is possible to specificly +inherited from another scope. However, it is possible to specifically set the color used for text using the following option: \begin{key}{/tikz/text=\meta{color}} @@ -556,10 +558,12 @@ Just like the color itself, you may also wish to set the opacity of the text only. For this, use the option |text opacity| option, which is detailed in Section~\ref{section-tikz-transparency}. +\subsubsection{Text Parameters: Font} + Next, you may wish to adjust the font used for the text. Use the following option for this: \begin{key}{/tikz/font=\meta{font commands}} - Sets the font used for text labels. + Sets the font used for text labels. \begin{codeexample}[] \begin{tikzpicture} \draw[font=\itshape] (1,0) -- +(1,1) node[above] {italic}; @@ -568,92 +572,244 @@ following option for this: A perhaps more useful example is the following: \begin{codeexample}[] -\tikz [every text node part/.style={font=\itshape}, +\tikz [every text node part/.style={font=\itshape}, every lower node part/.style={font=\footnotesize}] \node [circle split,draw] {state \nodepart{lower} output}; \end{codeexample} \end{key} + +\subsubsection{Text Parameters: Alignment and Width for Multi-Line Text} + Normally, when a node is typeset, all the text you give in the braces -is but in one long line (in an |\hbox|, to be precise) and the node +is put in one long line (in an |\hbox|, to be precise) and the node will become as wide as necessary. -You can change this behaviour using the following options. They allow -you to limit the width of a node (naturally, at the expense of its -height). +From time to time you may wish to create nodes that contain multiple +lines of text. There are three different ways of achieving this: +\begin{enumerate} +\item Inside the node, you can put some standard environment that + produces multi-line, aligned text. For instance, you can use a + |{tabular}| inside a node: +\begin{codeexample}[] +\tikz \node [draw] { + \begin{tabular}{cc} + upper left & upper right\\ + lower left & lower right + \end{tabular} +}; +\end{codeexample} + This approach offers the most flexibility in the sense that it + allows you to use all of the alignment commands offered by your + format of choice. +\item You use |\\| inside your node to mark the end of lines and then + request \tikzname\ to arrange these lines in some manner. This will + only be done, however, if the |align| option has been given. +\begin{codeexample}[] +\tikz[align=left] \node[draw] {This is a\\demonstration.}; +\end{codeexample} +\begin{codeexample}[] +\tikz[align=center] \node[draw] {This is a\\demonstration.}; +\end{codeexample} + The |\\| command takes an optional extra space as an argument in square + brackets. +\begin{codeexample}[] +\tikz \node[fill=examplefill,align=right] + {This is a\\[-2pt] demonstration text for\\[1ex] alignments.}; +\end{codeexample} +\item You can request that \tikzname\ does an automatic line-breaking + for you inside the node by specifying a fixed |text width| for the + node. In this case, you can still use |\\| to enforce a + line-break. Note that when you specify a text width, the node will + have this width, independently of whether the text actually + ``reaches the end'' of the node. +\end{enumerate} +Let us now first have a look at the |text width| command. \begin{key}{/tikz/text width=\meta{dimension}} This option will put the text of a node in a box of the given width - (more precisely, in a |{minipage}| of this width; for plain \TeX\ a - rudimentary ``minipage emulation'' is used). - - If the node text is not as wide as \meta{dimension}, it will - nevertheless be put in a box of this width. If it is larger, line - breaking will be done. + (something akin to a |{minipage}| of this width, only portable + across formats). If the node text is not as wide as + \meta{dimension}, it will nevertheless be put in a box of this + width. If it is larger, line breaking will be done. By default, when this option is given, a ragged right border will be - used. This is sensible since, typically, these boxes are narrow and - justifying the text looks ugly. + used (|align=left|). This is sensible since, typically, these boxes + are narrow and justifying the text looks ugly. You can, however, + change the alignment using |align| or directly using commands line + |\centering|. \begin{codeexample}[] \tikz \draw (0,0) node[fill=examplefill,text width=3cm] - {This is a demonstration text for showing how line breaking works.}; + {This is a demonstration text for showing how line breaking works.}; \end{codeexample} + Setting \meta{dimension} to an empty string causes the automatic + line breaking to be disabled. \end{key} -\begin{key}{/tikz/text justified} - Causes the text to be justified instead of (right)ragged. Use this - only with pretty broad nodes. -{% -\hbadness=10000 +\begin{key}{/tikz/align=\meta{how}} + This key is used to setup an alignment for multi-line text inside a + node. If |text width| is set to some width (let us call this + \emph{alignment with line breaking}), the |align| key will + setup the |\leftskip| and the |\rightskip| in such a way that the + text is broken and aligned according to \meta{how}. If |text width| + is not set (that is, set to the empty string; let us call this + \emph{alignment without line breaking}), then a different + mechanism is used internally, namely the key |node halign header|, is + set to an appropriate value. While this key, which is documented + below, is not to be used by beginners, the net effect is simple: + When |text width| is not set, you can use |\\| to break lines and + align them according to \meta{how} and the resulting node's width + will be minimal to encompass the resulting lines. + + In detail, you can set \meta{how} to one of the following values: + \begin{description} + \item[|align=|\declare{|left|}] + For alignment without line breaking, the different lines are simply + aligned such that their left borders are below one another. \begin{codeexample}[] -\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text justified] - {This is a demonstration text for showing how line breaking works.}; +\tikz \node[fill=examplefill,align=left] + {This is a\\ demonstration text for\\ alignments.}; +\end{codeexample} + For alignment with line breaking, the same will happen only + the lines will now, additionally, be broken automatically: +\begin{codeexample}[] +\tikz \node[fill=examplefill,text width=3cm,align=left] + {This is a demonstration text for showing how line breaking works.}; \end{codeexample} -} - In the above example, \TeX\ complains (rightfully) about three very - badly typeset lines. (For this manual I asked \TeX\ to stop - complaining by using |\hbadness=10000|, but this is a foul deed, - indeed.) -\end{key} -\begin{key}{/tikz/text ragged} - Causes the text to be typeset with a ragged right. This uses the - original plain \TeX\ definition of a ragged right border, in which - \TeX\ will try to balance the right border as well as possible. This - is the default. + \item[|align=|\declare{|flush left|}] + For alignment without line breaking this option has exactly the + same effect as |left|. However, for alignment with line breaking, + there is a difference: While |left| uses the + original plain \TeX\ definition of a ragged right border, in which + \TeX\ will try to balance the right border as well as possible, + |flush left| causes the right border to be ragged in the + \LaTeX-style, in which no balancing occurs. This looks ugly, but + it may be useful for very narrow boxes and when you wish to avoid + hyphenations. \begin{codeexample}[] -\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text ragged] - {This is a demonstration text for showing how line breaking works.}; +\tikz \node[fill=examplefill,text width=3cm,align=flush left] + {This is a demonstration text for showing how line breaking works.}; \end{codeexample} -\end{key} -\begin{key}{/tikz/text badly ragged} - Causes the right border to be ragged in the \LaTeX-style, in which - no balancing occurs. This looks ugly, but it may be useful for very - narrow boxes and when you wish to avoid hyphenations. + \item[|align=|\declare{|right|}] + Works like |left|, only for right alignment. \begin{codeexample}[] -\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text badly ragged] - {This is a demonstration text for showing how line breaking works.}; +\tikz \node[fill=examplefill,align=right] + {This is a\\ demonstration text for\\ alignments.}; +\end{codeexample} +\begin{codeexample}[] +\tikz \node[fill=examplefill,text width=3cm,align=right] + {This is a demonstration text for showing how line breaking works.}; \end{codeexample} -\end{key} -\begin{key}{/tikz/text centered} - Centers the text, but tries to balance the lines. + \item[|align=|\declare{|flush right|}] + Works like |flush left|, only for right alignment. \begin{codeexample}[] -\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text centered] - {This is a demonstration text for showing how line breaking works.}; +\tikz \node[fill=examplefill,text width=3cm,align=flush right] + {This is a demonstration text for showing how line breaking works.}; \end{codeexample} -\end{key} -\begin{key}{/tikz/text badly centered} - Centers the text, without balancing the lines. + \item[|align=|\declare{|center|}] + Works like |left| or |right|, only for centered alignment. +\begin{codeexample}[] +\tikz \node[fill=examplefill,align=center] + {This is a\\ demonstration text for\\ alignments.}; +\end{codeexample} \begin{codeexample}[] -\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text badly centered] - {This is a demonstration text for showing how line breaking works.}; +\tikz \node[fill=examplefill,text width=3cm,align=center] + {This is a demonstration text for showing how line breaking works.}; \end{codeexample} + + \item[|align=|\declare{|flush center|}] + Works like |flush left| or |flush right|, only for center alignment. +\begin{codeexample}[] +\tikz \node[fill=examplefill,text width=3cm,align=flush center] + {This is a demonstration text for showing how line breaking works.}; +\end{codeexample} + + \item[|align=|\declare{|justify|}] + For alignment without line breaking, this has the same effect as + |left|. For alignment with line breaking, this causes the text to + be ``justified.'' Use this + only with pretty broad nodes. +{% +\hbadness=10000 +\begin{codeexample}[] +\tikz \node[fill=examplefill,text width=3cm,align=justify] + {This is a demonstration text for showing how line breaking works.}; +\end{codeexample} +} + In the above example, \TeX\ complains (rightfully) about three very + badly typeset lines. (For this manual I asked \TeX\ to stop + complaining by using |\hbadness=10000|, but this is a foul deed, + indeed.) + + \item[|align=|\declare{|none|}] + Disables all alignments and |\\| will not be redefined. + \end{description} \end{key} + +\begin{key}{/tikz/node halign header=\meta{macro storing a header} (initially + \normalfont empty)} + This is the key that is used by |align| internally for alignment + without line breaking. Read the following only if you are familiar + with the |\halign| command. + + This key only has an effect if |text width| + is empty, otherwise it is ignored. Furthermore, if \meta{header} is + empty, then this key also has no effect. So, suppose |text width| is + empty, but \meta{header} is not. In this case the following happens: + + When the node text is parsed, the command |\\| is redefined + internally. This redefinition is done in such a way that the text + from the start of the node to the first occurrence of |\\| is put in + an |\hbox|. Then the text following |\\| up to the next |\\| is put + in another |\hbox|. This goes on until the text between the last + |\\| and the closing |}| is also put in an |\hbox|. + + The \meta{macro storing a header} should be a macro that contains + some text suitable for use as a header for the |\halign| + command. For instance, you might define +\begin{codeexample}[code only] +\def\myheader{\hfil\hfil##\hfil\cr} +\tikz [node halign header=\myheader] ... +\end{codeexample} + You cannot just say |node halign header=\hfil\hfil#\hfil\cr| because + this confuses \TeX\ inside matrices, so this detour via a macro is + needed. + + Next, conceptually, all these boxes are recursively put inside an + |\halign| command. Assuming that \meta{first} is the first of the + above boxes, the command |\halign{|\meta{header} |\box|\meta{first} + |\cr}| is used to create a new box, which we will call the + \meta{previous box}. Then, the following box is created, where + \meta{second} is the second input box: + |\halign{|\meta{header} |\box|\meta{previous box} |\cr| + |\box|\meta{second}|\cr}|. Let us call the resulting box the + \meta{previous box} once more. Then the next box that is created is + |\halign{|\meta{header} |\box|\meta{previous box} |\cr| + |\box|\meta{third}|\cr}|. + + All of this means that if \meta{header} is an |\halign| header + like |\hfil#\hfil\cr|, then all boxes will be centered relative to + one another. Similarly, a \meta{header} of |\hfil#\cr| causes the + text to be flushed right. + + Note that this mechanism is not flexible enough to all multiple + columns inside \meta{header}. You will have to use a |tabular| or a + |matrix| in such cases. + + One further note: Since the text of each line is placed in a box, + settings will be local to each ``line.'' This is very similar to the + way a cell in a |tabular| or a |matrix| behaves. +\end{key} + + +\subsubsection{Text Parameters: Height and Depth of Text} + In addition to changing the width of nodes, you can also change the height of nodes. This can be done in two ways: First, you can use the option |minimum height|, which ensures that the height of the whole @@ -677,20 +833,19 @@ special situations. write |text height=| without specifying anything, the ``natural'' size of the text box remains unchanged. \begin{codeexample}[] -\tikz \node[draw] {y}; -\tikz \node[draw,text height=10pt] {y}; +\tikz \node[draw] {y}; +\tikz \node[draw,text height=10pt] {y}; \end{codeexample} \end{key} \begin{key}{/tikz/text depth=\meta{dimension}} This option works like |text height|, only for the depth of the text box. This option is mostly useful when you need to ensure a uniform - depth of text boxes that need to be aligned. + depth of text boxes that need to be aligned. \end{key} - \subsection{Positioning Nodes} \label{section-nodes-anchors} @@ -747,7 +902,7 @@ position. directions.'' Furthermore, the standard shapes also define a |base| anchor, as well as |base west| and |base east|, for placing things on the baseline of the text. - + The standard shapes also define a |mid| anchor (and |mid west| and |mid east|). This anchor is half the height of the character ``x'' above the base line. This anchor is useful for vertically centering @@ -778,7 +933,7 @@ more intuitively: \begin{key}{/tikz/above=\meta{offset} (default 0pt)} Does the same as |anchor=south|. If the \meta{offset} is specified, the node is additionally shifted upwards by the given - \meta{offset}. + \meta{offset}. \begin{codeexample}[] \tikz \fill (0,0) circle (2pt) node[above] {above}; \end{codeexample} @@ -806,7 +961,7 @@ more intuitively: takes an \meta{offset} parameter, but using this parameter without using the |positioning| library is deprecated. (The |positioning| library changes the meaning of this parameter to something more - sensible.) + sensible.) \begin{codeexample}[] \tikz \fill (0,0) circle (2pt) node[above left] {above left}; \end{codeexample} @@ -831,7 +986,7 @@ more intuitively: % as the options without |of|, however, their parameter is different: % You must provide the name of another node. The current node will then % be placed, say, above this specified node at a distance given by the -% option |node distance|. +% option |node distance|. % \begin{key}{/tikz/above of=\meta{node}} % This option causes the node to be placed at the distance % |node distance| above of \meta{node}. The anchor is |center|. @@ -874,7 +1029,7 @@ more intuitively: % \begin{key}{/tikz/node distance=\meta{dimension}} % Sets the distance between nodes that are placed using the % |... of| options. Note that this distance is the distance between -% the centers of the nodes, not the distance between their borders. +% the centers of the nodes, not the distance between their borders. % \end{key} @@ -895,7 +1050,7 @@ differently. \begin{key}{/tikz/above=\opt{\meta{specification}} (default 0pt)} With the |positioning| library loaded, the |above| option does not - take a simple \meta{dimension} as its paramter. Rather, it can + take a simple \meta{dimension} as its parameter. Rather, it can (also) take a more elaborate \meta{specification} as parameter. This \meta{specification} has the following general form: It starts with an optional \meta{shifting part} and is followed by an optional @@ -957,14 +1112,14 @@ differently. |of somenode.north| or |of 2,3|. In this case, the following happens: First, the node's |at| parameter is set to the \meta{coordinate}. Second, the node is shifted according to the - \meta{shift-part}. Third, the anchor is set to |south|. + \meta{shift-part}. Third, the anchor is set to |south|. Here is a basic example: \begin{codeexample}[] \begin{tikzpicture}[every node/.style=draw] \draw[help lines] (0,0) grid (2,2); \node (somenode) at (1,1) {some node}; - + \node [above=5mm of somenode.north east] {\tiny 5mm of somenode.north east}; \node [above=1cm of somenode.north] {\tiny 1cm of somenode.north}; \end{tikzpicture} @@ -978,13 +1133,13 @@ differently. rather the value of the |node distance| key is used, see below. \item The \meta{of-part} can have be |of |\meta{node name}. An example would be |of somenode|. In this case, the following - usually happens: + usually happens: \begin{itemize} \item The anchor is set to |south|. \item The node is shifted according to the \meta{shifting part} or, if it is missing, according to the value of |node distance|. \item The node's |at| parameter is set to \meta{node - name}|.north|. + name}|.north|. \end{itemize} The net effect of all this is that the new node will be placed in such a way that the distance between is south border and @@ -993,7 +1148,7 @@ differently. \begin{tikzpicture}[every node/.style=draw] \draw[help lines] (0,0) grid (2,2); \node (some node) at (1,1) {some node}; - + \node (other node) [above=1cm of some node] {\tiny above=1cm of some node}; \draw [<->] (some node.north) -- (other node.south) @@ -1013,7 +1168,7 @@ differently. will be placed in such a way that its center is 1cm above the center of |somenode|. Repeatedly placing nodes in this way will result in nodes that are centered on ``grid coordinate,'' hence - the name of the option. + the name of the option. \begin{codeexample}[] \begin{tikzpicture}[every node/.style=draw] \draw[help lines] (0,0) grid (2,3); @@ -1035,7 +1190,7 @@ differently. \begin{key}{/tikz/node distance=\meta{shifting part} (initially 1cm and 1cm)} The value of this key is used as \meta{shifting part} is used if and only if a \meta{of-part} is present, but no \meta{shifting - part}. + part}. \begin{codeexample}[] \begin{tikzpicture}[every node/.style=draw,node distance=5mm] \draw[help lines] (0,0) grid (2,3); @@ -1095,7 +1250,7 @@ differently. left. A more mathematical way of phrasing this is the following: A plain \meta{dimension} is measured in the $l_2$-norm, while a \meta{dimension}| and |\meta{dimension} is measured in the - $l_1$-norm. + $l_1$-norm. \end{enumerate} The following example should help to illustrate the difference: \begin{codeexample}[] @@ -1116,7 +1271,7 @@ differently. \node [below left=of b] {7}; \node [below right=of b] {8}; \end{scope} \end{tikzpicture} -\end{codeexample} +\end{codeexample} \begin{codeexample}[] \begin{tikzpicture}[every node/.style={draw,rectangle}] \draw[help lines] (0,0) grid (2,5); @@ -1135,7 +1290,7 @@ differently. \node [below left=of b] {7}; \node [below right=of b] {8}; \end{scope} \end{tikzpicture} -\end{codeexample} +\end{codeexample} \begin{codeexample}[] \begin{tikzpicture}[every node/.style={draw,rectangle},on grid] \draw[help lines] (0,0) grid (4,4); @@ -1154,7 +1309,7 @@ differently. \node [below left=of b] {7}; \node [below right=of b] {8}; \end{scope} \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{key} \begin{key}{/tikz/below left=\opt{\meta{specification}}} @@ -1183,12 +1338,12 @@ keys: \node (X) at (0,1) {X}; \node (a) [right=of X] {a}; \node (y) [right=of a] {y}; - + \node (X) at (0,0) {X}; \node (a) [base right=of X] {a}; \node (y) [base right=of a] {y}; \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{key} \begin{key}{/tikz/base right=\opt{\meta{specification}}} Works like |base left|. @@ -1213,7 +1368,7 @@ library and the |matrix| library. The first is mostly useful for creating ``chains of nodes'' and, more generally, ``flows.'' The second allows you to arrange multiple nodes in rows and columns. These methods for positioning nodes are described in two separate -Sections~\ref{section-matrices} and~\ref{section-chains}. +Sections~\ref{section-matrices} and~\ref{section-chains}. \subsection{Fitting Nodes to a Set of Coordinates} @@ -1225,7 +1380,7 @@ given using anchors and size parameters, rather one would sometimes have a box be placed and be sized such that it ``is just large enough to contain this, that, and that point.'' This situation typically arises when a picture has been drawn an, afterwards, parts of the -picture are supposed to be encircled or hilighted. +picture are supposed to be encircled or highlighted. In this situation the |fit| option from the |fit| library is useful, see Section~\ref{section-library-fit} for a the details. The idea is @@ -1295,7 +1450,7 @@ example, it certainly sometimes makes sense to rotate a node by You can give transformation option \emph{inside} the option list of the node. \emph{These} transformations always apply to the node. \begin{codeexample}[] -\begin{tikzpicture}[every node/.style={draw}] +\begin{tikzpicture}[every node/.style={draw}] \draw[help lines](0,0) grid (3,2); \draw (1,0) node{A} (2,0) node[rotate=90,scale=1.5] {B}; @@ -1332,7 +1487,7 @@ ways are described in the following. dictates how ``far'' on the line the point should be. A \meta{fraction} or 0 is the previous coordinate, 1 is the current one, everything else is in between. In particular, 0.5 is the - middle. + middle. Now, what is ``the previous line''? This depends on the previous path construction operation. @@ -1354,7 +1509,7 @@ ways are described in the following. connect the start and end points to the control points). The exact math is a bit complicated (depending on your point of view, of course); you may wish to consult a good book on computer graphics - and Bézier curves if you are intrigued. + and Bézier curves if you are intrigued. \begin{codeexample}[] \tikz \draw (0,0) .. controls +(right:3.5cm) and +(right:3.5cm) .. (0,3) \foreach \p in {0,0.125,...,1} {node[pos=\p]{\p}}; @@ -1376,7 +1531,7 @@ ways are described in the following. For all other path construction operations, \emph{the position placement does not work}, currently. This will hopefully change in - the future (especially for the arc operation). + the future (especially for the arc operation). \end{key} \begin{key}{/tikz/auto=\meta{left or right} (default \normalfont is scope's setting)} @@ -1392,7 +1547,7 @@ ways are described in the following. |anchor| option or by one of the |above|, |below|, etc.\ options. This option only has an effect for nodes that are placed on lines or - curves. + curves. \begin{codeexample}[] \begin{tikzpicture} @@ -1419,7 +1574,7 @@ ways are described in the following. |right| is set instead and the other way round. \begin{codeexample}[] \begin{tikzpicture}[auto] - \draw[help lines,use as bounding box] (0,-.5) grid (4,5); + \draw[help lines,use as bounding box] (0,-.5) grid (4,5); \draw (0.5,0) .. controls (9,6) and (-5,6) .. (3.5,0) \foreach \pos in {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1} @@ -1449,7 +1604,7 @@ ways are described in the following. \begin{key}{/tikz/sloped} This option causes the node to be rotated such that a horizontal - line becomes a tangent to the curve. The rotation is normally + line becomes a tangent to the curve. The rotation is normally done in such a way that text is never ``upside down.'' To get upside-down text, use can use |[rotate=180]| or |[allow upside down]|, see below. @@ -1467,7 +1622,7 @@ ways are described in the following. \begin{key}{/tikz/allow upside down=\meta{boolean} (default true, initially false)} - If set to |true|, \tikzname\ will not ``righten'' upside down text. + If set to |true|, \tikzname\ will not ``righten'' upside down text. \begin{codeexample}[] \tikz [allow upside down] \draw (0,0) .. controls +(up:2cm) and +(left:2cm) .. (1,3) @@ -1536,7 +1691,7 @@ What happens is the following: The syntax of the line-to path operation is actually |--| \opt{|node|\meta{node specification}}\meta{coordinate}. (It is even possible to give multiple nodes in this way.) When the optional -|node| is encountered, that is, +|node| is encountered, that is, when the |--| is directly followed by |node|, then the specification(s) are read and ``stored away.'' Then, after the \meta{coordinate} has finally been reached, they are inserted again, @@ -1559,7 +1714,7 @@ should make this clearer: \begin{codeexample}[] \begin{tikzpicture}[near end] - \draw (0cm,4em) -- (3cm,4em) node{A}; + \draw (0cm,4em) -- (3cm,4em) node{A}; \draw (0cm,3em) -- node{B} (3cm,3em); \draw (0cm,2em) -- node[midway] {C} (3cm,2em); \draw (0cm,1em) -- (3cm,1em) node[midway] {D} ; @@ -1577,30 +1732,79 @@ the operation with the |pos| option set. In addition to the |node| path operation, nodes can also be added using the |label| and the |pin| option. This is mostly useful -for simple nodes. +for simple nodes. -\begin{key}{/tikz/label=\opt{|[|\meta{options}|]|}\meta{angle}|:|\meta{text}} +\begin{key}{/tikz/label=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}} + \label{label-option}% When this option is given to a |node| operation, it causes \emph{another} node to be added to the path after the current node has been finished. This extra node will have the text - \meta{text}. It is placed according to the following rule: Suppose - the |node| currently under construction is called |main node| and let us - call the label node |label node|. Then the anchor of |label node| is - placed at |main node.|\meta{angle}. The anchor that is chosen - depends on the \meta{angle}. If the \meta{angle} lies between - $-3^\circ$ and $+3^\circ$, then the anchor |west| is chosen, which - causes |label node| to be placed right of the right end - |main node|. If \meta{angle} lies between $4^\circ$ and $86^\circ$, - the anchor |south west| is chosen, causing the |label node| to be - placed above and right of the |main node|; and so on. + \meta{text}. It is placed, in principle, in the direction + \meta{angle} relative to the main node, but the exact rules are a + bit complex. Suppose the |node| currently under construction is called + |main node| and let us call the label node |label node|. Then the + following happens: + \begin{enumerate} + \item The \meta{angle} is used to determine a position on the border + of the |main node|. If the \meta{angle} is missing, the value of + the following key is used instead: + \begin{key}{/tikz/label position=\meta{angle} (initially above)} + Sets the default position for labels. + \end{key} + The \meta{angle} determines the position on the border of the + shape in two different ways. Normally, the border position is + given by |main node.|\meta{angle}. This means that the + \meta{angle} can either be a number like |0| or |-340|, but it can + also be an anchor like |north|. Additionally, the special angles + |above|, |below|, |left|, |right|, |above left|, and so on are + automatically replaced by the corresponding angles |90|, |270|, + |180|, |0|, |135|, and so on. + + A special case arises when the following key is set: + \begin{key}{/tikz/absolute=\meta{true or false} (default true)} + When this key is set, the \meta{angle} is interpreted + differently: We still use a point on the border of the + |main node|, but the angle is measured ``absolutely,'' that is, + an angle of |0| refers to the point on the border that lies on a + straight line from the |main node|'s center to the right + (relative to the paper, not relative to the local coordinate + system or either the node or the scope). + + The difference can be seen in the following example: +\begin{codeexample}[] +\tikz [rotate=-80,every label/.style={draw,red}] + \node [transform shape,rectangle,draw,label=right:label] {main node}; +\end{codeexample} +\begin{codeexample}[] +\tikz [rotate=-80,every label/.style={draw,red},absolute] + \node [transform shape,rectangle,draw,label=right:label] {main node}; +\end{codeexample} + \end{key} + \item Then, an anchor point for the |label node|. It is determined + in such a way that the |labe node| will ``face away'' from the + border of the |main node|. The anchor that is chosen depends on + the position of the border point that is chosen and its position + relative to the center of the |main node| and on whether the + |transform shape| option is set. In general, the choice should be + what you would expect, but you may have to set the anchor yourself + in difficult situations. \begin{codeexample}[] \tikz - \node [circle,draw,label=60:$60^\circ$,label=below:$-90^\circ$] {my circle}; + \node [circle,draw, + label=default, + label=60:$60^\circ$, + label=below:$-90^\circ$] {my circle}; \end{codeexample} - - As can be seen in the above example, instead of specifying - \meta{angle} as a number, it is also possible to use |left|, - |right|, |above|, |above left|, and so on. + \item + One \meta{angle} is special: If you set the \meta{angle} to + |center|, then the label will be placed on the center of the main + node. This is mainly useful for adding a label text to an existing + node, especially if it has been rotated. +\begin{codeexample}[] +\tikz \node [transform shape,rotate=90, + rectangle,draw,label={[red]center:R}] {main node}; +\end{codeexample} + \end{enumerate} You can pass \meta{options} to the node |label node|. For this, you provide the options in square brackets before the \meta{angle}. If you @@ -1640,9 +1844,9 @@ for simple nodes. \begin{key}{/tikz/pin=\opt{|[|\meta{options}|]|}\meta{angle}|:|\meta{text}} This is option is quite similar to the |label| option, but there is - one difference: In addition to adding a extra node to the picture, + one difference: In addition to adding a extra node to the picture, it also adds an edge from this node to the main node. This causes - the node to look like a pin that has been added to the main node: + the node to look like a pin that has been added to the main node: \begin{codeexample}[] \tikz \node [circle,fill=blue!50,minimum size=1cm,pin=60:$q_0$] {}; \end{codeexample} @@ -1660,12 +1864,15 @@ for simple nodes. pin=above:Z] {my circle}; \end{codeexample} \end{key} - \begin{stylekey}{/tikz/every pin (initially \normalfont draw=none,fill=none)} + \begin{stylekey}{/tikz/every pin (initially {draw=none,fill=none})} This style is used in every node created by the |pin| option. \end{stylekey} + \begin{key}{/tikz/pin position=\meta{angle} (initially above)} + The default pin position. Works like |label position|. + \end{key} \begin{stylekey}{/tikz/every pin edge (initially help lines)} - This style is used in every edge created by the |pin| optins. + This style is used in every edge created by the |pin| options. \begin{codeexample}[] \tikz [pin distance=15mm, every pin edge/.style={<-,shorten <=1pt,decorate, @@ -1678,7 +1885,7 @@ for simple nodes. \begin{key}{/tikz/pin edge=\meta{options} (initially \normalfont empty)} This option can be used to set the options that are to be used - in the edge created by the |pin| option. + in the edge created by the |pin| option. \begin{codeexample}[] \tikz[pin distance=10mm] \node [circle,draw,pin={[pin edge={blue,thick}]right:X}, @@ -1701,7 +1908,7 @@ for simple nodes. Once you have defined a node and given it a name, you can use this name to reference it. This can be done in two ways, see also Section~\ref{section-node-coordinates}. Suppose you have said -|\path(0,0) node(x) {Hello World!};| in order to define a node named |x|. +|\path(0,0) node(x) {Hello World!};| in order to define a node named |x|. \begin{enumerate} \item Once the node |x| has been defined, you can use @@ -1752,7 +1959,7 @@ The |edge| operation works like a |to| operation that is added after the main path has been drawn, much like a node is added after the main path has been drawn. This allows you to have each |edge| to have a different appearance. As the |node| operation, an |edge| temporarily -suspends the construction of the current path and a new path $p$ is +suspends the construction of the current path and a new path $p$ is constructed. This new path $p$ will be drawn after the main path has been drawn. Note that $p$ can be totally different from the main path with respect to its options. Also note that if there are @@ -1773,22 +1980,22 @@ are encountered on the path. coordinate is already part of the main path). The |\tikztostart| is the last coordinate on the path just before - the |edge| operation, just as for the |node| or |to| operations. + the |edge| operation, just as for the |node| or |to| operations. However, there is one exception to this rule: If the |edge| operation is directly preceded by a |node| operation, then this just-declared node is the start coordinate (and not, as would normally be the case, the coordinate where this just-declared node is placed -- a small, but subtle difference). In this regard, |edge| differs from both |node| and |to|. - + If there are several |edge| operations in a row, the start coordinate - is the same for all of them as their target coordiantes are not, + is the same for all of them as their target coordinates are not, after all, part of the main path. The start coordinate is, thus, the coordinate preceding the first |edge| operation. This is similar to nodes insofar as the |edge| operation does not modify the current path at all. In particular, it does not change the last coordinate visited, see the following example: - + \begin{codeexample}[] \begin{tikzpicture} \node (a) at (0:1) {$a$}; @@ -1797,12 +2004,12 @@ are encountered on the path. edge [<-] (b); \node (d) at (270:1) {$d$} edge [->] (a) edge [dotted] (b) - edge [<-] (c); + edge [<-] (c); \end{tikzpicture} \end{codeexample} A different way of specifying the above graph using the |edge| - operation is the following: + operation is the following: \begin{codeexample}[] \begin{tikzpicture} @@ -1831,14 +2038,14 @@ are encountered on the path. edge [-,dotted] node[below,sloped] {missing} (d) (c) edge (a) edge (d) - (d) edge [red] node[above,sloped] {very} + (d) edge [red] node[above,sloped] {very} node[below,sloped] {bad} (a); \end{tikzpicture} \end{codeexample} Instead of |every to|, the style |every edge| is installed at the beginning of the main path. - \begin{stylekey}{/tikz/every edge (inititially draw)} + \begin{stylekey}{/tikz/every edge (inititially draw)} % inititially --> initially? (ff) (this is the definition of the key, so please have a look) Executed for each |edge|. \begin{codeexample}[] \begin{tikzpicture}[every to/.style={draw,dashed}] @@ -1858,7 +2065,7 @@ are encountered on the path. It is possible (but not quite trivial) to reference nodes in pictures other than the current one. This means that you can create a picture and a node therein and, later, you can draw a line from some other -position to this node. +position to this node. To reference nodes in different pictures, proceed as follows: \begin{enumerate} @@ -1883,9 +2090,9 @@ Let us have a look at the effect of these options. depending on which backend driver is used. Also, even if remembering works, the position may only be available on a second run of \TeX. - Provided that remebering works, you may consider saying + Provided that remembering works, you may consider saying \begin{codeexample}[code only] -\tikzsytle{every picture}+=[remember picture] +\tikzstyle{every picture}+=[remember picture] \end{codeexample} to make \tikzname\ remember all pictures. This will add one line in the |.aux| file for each picture in your document -- which typically @@ -1943,7 +2150,7 @@ that we do not wish to count as part of the picture. \begin{codeexample}[] \begin{tikzpicture}[remember picture] \node (c) [circle,draw] {Big circle}; - + \draw [overlay,->,very thick,red,opacity=.5] (c) to[bend left] (n1) (n1) -| (n2); \end{tikzpicture} @@ -1996,55 +2203,22 @@ page). -\subsection{Late Code and Options} +\subsection{Late Code and Late Options} All options given to a node only locally affect this one node. While this is a blessing in most cases, you may sometimes want to cause options to have effects ``later'' on. The other way round, you may sometimes note ``only later'' that some options should be added to the -options of a node. The present section describes ways of achieving -these effects. - - -\subsubsection{Executing Code After Nodes} - -\label{section-nodes-executing} - -It is possible to add a path right after a node using the option -|after node path|. The idea is that a style might use this option to -add some additional stuff to the node that has just been -typeset. Examples of such styles include the |label| option and the -|pin| option. - -\begin{key}{/tikz/after node path=\meta{path}} - The \meta{path} is added to the main path right after the node, as - if you had given the path thereafter. This option can only be given - inside the option list of a node and multiple calls of this option - accumulate. - - Inside the \meta{path} you have access to the node that has just - been created via the macro \declare{|\tikzlastnode|}. -\begin{codeexample}[] -\tikz - \draw node [draw,after node path={(\tikzlastnode) circle (2cm)}] - {hello}; -\end{codeexample} - - Note that in the above example, if we had written |\path| instead of - |\draw|, the circle would not have been drawn since the circle is - part of the main path, not part of the node itself. -\end{key} - -\begin{command}{\tikzaddafternodepathoption\marg{code}} - This command allows you to specify that the \meta{code} should be - executed at the beginning of the |after node path| of the current - node. The code will also be executed immediately, but also again at - the beginning of an |after node path|. +options of a node. + +As explained in Section~\ref{section-paths}, you +can use the options |append after command| and +|prefix after command| to add a path after a node. The following macro may be +useful there: +\begin{command}{\tikzlastnode} + Expands to the last node on the path. \end{command} - -\subsection{Late Options} - A \emph{late option} for a node is an option that is given a long time after the node has already been constructed. @@ -2055,10 +2229,11 @@ after the node has already been constructed. and, then, the \meta{options} are executed in a local scope. Most of these options will have no effect since you \emph{cannot change the appearance of the node,} that is, you cannot change a red node - into a green node using late options. However, giving the - the |after node path| option inside the \meta{options} (directly or - indirectly) does have the desired effect: The after node path gets - executed with the |\tikzlastnode| set to the determined node. + into a green node using late options. However, giving + the |append after command| and |prefix after command| options inside + the \meta{options} (directly or indirectly) does have the desired + effect: The given path gets executed with the |\tikzlastnode| + set to the determined node. The net effect of all this is that you can provide, say, the |label| option inside the \meta{options} to a add a label to a node that has @@ -2077,11 +2252,12 @@ after the node has already been constructed. \node (a) [draw,circle] {Hello}; \path (a) [late options={label=above:world}]; \end{tikzpicture} -\end{codeexample} +\end{codeexample} + \end{key} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex index f4d9bedfcfa..27ba94e4cf4 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex @@ -21,7 +21,7 @@ $(1\mathrm{cm},5\mathrm{pt})$, to the position a point is finally placed on the display or paper. In order to find out where the point should go, it is constantly ``transformed,'' which means that it is mostly shifted around and possibly rotated, slanted, scaled, and -otherwise mutilated. +otherwise mutilated. In detail, (at least) the following transformations are applied to a coordinate like $(1,2)$ before a point on the screen is chosen: @@ -32,7 +32,7 @@ coordinate like $(1,2)$ before a point on the screen is chosen: current $y$-vector twice to obtain the new point.'' \item \pgfname\ applies its coordinate transformation matrix to the - resulting coordinate. This yields the final position of the point + resulting coordinate. This yields the final position of the point inside the picture. \item The backend driver (like |dvips| or |pdftex|) adds transformation @@ -41,11 +41,11 @@ coordinate like $(1,2)$ before a point on the screen is chosen: \item \textsc{pdf} (or PostScript) apply the canvas transformation matrix to the point, which can once more change the position on the - page. + page. \item The viewer application or the printer applies the device transformation matrix to transform the coordinate to its final pixel - coordinate on the screen or paper. + coordinate on the screen or paper. \end{enumerate} In reality, the process is even more involved, but the above should @@ -87,7 +87,7 @@ options: \begin{key}{/tikz/x=\meta{value} (initially 1cm)} If \meta{value} is a dimension, the $x$-vector of - \pgfname's $xyz$-coordinate system is setup to point + \pgfname's $xyz$-coordinate system is setup to point \meta{value} to the right, that is, to $(\meta{value},0pt)$. \begin{codeexample}[] @@ -95,11 +95,11 @@ options: \draw (0,0) -- +(1,0); \draw[x=2cm,color=red] (0,0.1) -- +(1,0); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \begin{codeexample}[] \tikz \draw[x=1.5cm] (0,0) grid (2,2); -\end{codeexample} +\end{codeexample} The last example shows that the size of steppings in grids, just like all other dimensions, are not affected by the $x$-vector. After all, @@ -108,7 +108,7 @@ options: If \meta{value} is a coordinate, the $x$-vector of \pgfname's $xyz$-coordinate system to the specified coordinate. If - \meta{value} contains a comma, it must be put in braces. + \meta{value} contains a comma, it must be put in braces. \begin{codeexample}[] \begin{tikzpicture} @@ -134,7 +134,7 @@ options: resulting vector points to $(0,\meta{value})$. \end{key} -\begin{key}{/tikz/z=\meta{value} (initially \normalfont$-\sqrt{2}$cm)} +\begin{key}{/tikz/z=\meta{value} (initially \normalfont$-3.85$mm)} Works like the |y=| option, but now a dimension is means the point $(\meta{value},\meta{value})$. @@ -201,7 +201,7 @@ below. Transformations apply immediately when they are encountered ``in the middle of a path'' and they apply only to the coordinates on the path -following the transformation option. +following the transformation option. \begin{codeexample}[] \tikz \draw (0,0) rectangle (1,0.5) [xshift=2cm] (0,0) rectangle (1,0.5); @@ -213,7 +213,7 @@ that all transformations are done using \TeX, which has a fairly low accuracy. Furthermore, in certain situations it is necessary that \tikzname\ \emph{inverts} the current transformation matrix and this will fail if the transformation matrix is badly conditioned or even -singular (if you do not know what singular matrices are, you are blessed). +singular (if you do not know what singular matrices are, you are blessed). \begin{key}{/tikz/shift={\ttfamily\char`\{}\meta{coordinate}{\ttfamily\char`\}}} Adds the \meta{coordinate} to all coordinates. @@ -234,9 +234,9 @@ singular (if you do not know what singular matrices are, you are blessed). or scaling relative to the origin or skewing will no longer have an effect. - This option is useful in situtations where a complicated + This option is useful in situations where a complicated transformation is used to ``get to a position,'' but you then wish - to draw something ``normal'' at this position. + to draw something ``normal'' at this position. \begin{codeexample}[] \begin{tikzpicture} @@ -249,7 +249,7 @@ singular (if you do not know what singular matrices are, you are blessed). \end{key} \begin{key}{/tikz/xshift=\meta{dimension}} - Adds \meta{dimension} to the $x$ value of all coordinates. + Adds \meta{dimension} to the $x$ value of all coordinates. \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); @@ -280,7 +280,7 @@ singular (if you do not know what singular matrices are, you are blessed). \begin{key}{/tikz/scale around={\ttfamily\char`\{}\meta{factor}|:|\meta{coordinate}{\ttfamily\char`\}}} Scales the coordinate system by \meta{factor}, put with the ``origin - of scaling'' centered on \meta{coordinate} rather than the origin. + of scaling'' centered on \meta{coordinate} rather than the origin. \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); @@ -293,7 +293,7 @@ singular (if you do not know what singular matrices are, you are blessed). \begin{key}{/tikz/xscale=\meta{factor}} Multiplies only the $x$-value of all coordinates by the given - \meta{factor}. + \meta{factor}. \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); @@ -368,7 +368,7 @@ singular (if you do not know what singular matrices are, you are blessed). \left(\begin{smallmatrix} x \\ y \end{smallmatrix}\right) + \left(\begin{smallmatrix} t_x \\ t_y \end{smallmatrix}\right)$. Usually, you do not use this option - directly. + directly. \begin{codeexample}[] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex index ba56a91a53e..5f7eba71c8c 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex @@ -26,7 +26,7 @@ obscure the background, rather they blend the background with the new color. At first sight, using such semitransparent colors might seem quite straightforward, but the math going on in the background is quite involved and the correct handling of transparency fills some 64 pages -in the PDF specification. +in the PDF specification. In the present section, we start with the different ways of specifying ``how transparent'' newly drawn objects should be. The simplest way is @@ -34,7 +34,7 @@ to just specify a percentage like ``60\% transparent.'' A much more general way is to use something that I call a \emph{fading,} also known as a soft mask or a mask. -At the end of the section we adress the problem of creating so-called +At the end of the section we address the problem of creating so-called \emph{transparency groups}. This problem arises when you paint over a position several times with a semitransparent color. Sometimes you want the effect to accumulate, sometimes you do not. @@ -42,8 +42,8 @@ want the effect to accumulate, sometimes you do not. \emph{Note:} Transparency is best supported by the pdf\TeX\ driver. The \textsc{svg} driver also has some support. For PostScript output, opacity is rendered correctly only with the most recent -versions of GhostScript. Printers and other programs will typically -ignore the opacity setting. +versions of Ghostscript. Printers and other programs will typically +ignore the opacity setting. @@ -60,8 +60,8 @@ following options. yields lines that are semitransparent. Note that when you use PostScript as your output format, - this option works only with recent versions of GhostScript. - + this option works only with recent versions of Ghostscript. + \begin{codeexample}[] \begin{tikzpicture}[line width=1ex] \draw (0,0) -- (3,1); @@ -73,7 +73,7 @@ following options. Note that the |draw opacity| options only sets the opacity of drawn lines. The opacity of fillings is set using the option |fill opacity| (documented in Section~\ref{section-fill-opacity}. The -option |opacity| sets both at the same time. +option |opacity| sets both at the same time. \begin{key}{/tikz/opacity=\meta{value}} Sets both the drawing and filling opacity to \meta{value}. @@ -111,21 +111,21 @@ option |opacity| sets both at the same time. \end{codeexample} \end{stylekey} - \begin{stylekey}{/tikz/semitransparent} + \begin{stylekey}{/tikz/semitransparent} \begin{codeexample}[] \tikz{\fill[red] (0,0) rectangle (1,0.5); \fill[semitransparent] (0.5,0) rectangle (1.5,0.25); } \end{codeexample} \end{stylekey} - \begin{stylekey}{/tikz/nearly opaque} + \begin{stylekey}{/tikz/nearly opaque} \begin{codeexample}[] \tikz{\fill[red] (0,0) rectangle (1,0.5); \fill[nearly opaque] (0.5,0) rectangle (1.5,0.25); } \end{codeexample} \end{stylekey} - - \begin{stylekey}{/tikz/very nearly opaque} + + \begin{stylekey}{/tikz/very nearly opaque} \begin{codeexample}[] \tikz{\fill[red] (0,0) rectangle (1,0.5); \fill[very nearly opaque] (0.5,0) rectangle (1.5,0.25); } @@ -154,8 +154,8 @@ option |opacity| sets both at the same time. operations, this opacity also applies to text and images. Note, again, that when you use PostScript as your output format, - this option works only with recent versions of GhostScript. - + this option works only with recent versions of Ghostscript. + \begin{codeexample}[] \begin{tikzpicture}[thick,fill opacity=0.5] \filldraw[fill=red] (0:1cm) circle (12mm); @@ -175,7 +175,7 @@ option |opacity| sets both at the same time. \end{key} \begin{key}{/tikz/text opacity=\meta{value}} - Sets the opacity of text labels, overriding the |fill opacity| setting. + Sets the opacity of text labels, overriding the |fill opacity| setting. \begin{codeexample}[] \begin{tikzpicture}[every node/.style={fill,draw}] \draw[line width=2mm,blue!50,line cap=round] (0,0) grid (3,2); @@ -224,12 +224,12 @@ each point of an area to transparency of the point. This transparency can by any number between 0 and 1. A \emph{fading picture} is a normal graphic that, in a way to be described in a moment, determines the transparency of points inside the fading. Each fading has an -underlying fading picture. +underlying fading picture. The fading picture is a normal graphic drawn using any of the normal graphic drawing commands. A fading and its fading picture are related as follows: Given any point of the fading, the transparency of this -point is determined by the lumonisity of the fading picture at the +point is determined by the luminosity of the fading picture at the same position. The luminosity of a point determines ``how bright'' the point is. The brighter the point in the fading picture, the more opaque is the point in the fading. In particular, a white point of the @@ -244,7 +244,7 @@ will be \emph{transparent}. For this reason, \tikzname\ defines a color called |transparent| that is the same as |black|. The nice thing about this definition is that the color |transparent!|\meta{percentage} in the fading picture yields a -pixel that is \meta{percantage} per cent transparent in the fading. +pixel that is \meta{percentage} per cent transparent in the fading. Turning a fading picture into a normal picture is achieved using the following commands, which are \emph{only defined in the library}, @@ -260,10 +260,11 @@ namely the library |fadings|. So, to use them, you have to say Use this option with the |{tikzfadingfrompicture}| environment to set the name of the fading. You \emph{must} provide this option. \end{key} - + The following shading is 2cm by 2cm and changes gets more and more transparent from left to right, but is 50\% transparent for a large circle in the middle. +{\tikzexternaldisable \begin{codeexample}[] \begin{tikzfadingfrompicture}[name=fade right] \shade[left color=transparent!0, @@ -277,13 +278,13 @@ namely the library |fadings|. So, to use them, you have to say \fill [black!20] (-1.2,-1.2) rectangle (1.2,1.2); \pattern [pattern=checkerboard,pattern color=black!30] (-1.2,-1.2) rectangle (1.2,1.2); - + \fill [path fading=fade right,red] (-1,-1) rectangle (1,1); \end{tikzpicture} \end{codeexample} In the next example we create a fading picture that contains some text. When the fading is used, we only see the shading ``through - it.'' + it.'' \begin{codeexample}[] \begin{tikzfadingfrompicture}[name=tikz] \node [text=transparent!20] @@ -301,6 +302,7 @@ namely the library |fadings|. So, to use them, you have to say (-2,-1) rectangle (2,1); \end{tikzpicture} \end{codeexample} +}% \end{environment} \begin{plainenvironment}{{tikzfadingfrompicture}\oarg{options}} @@ -313,7 +315,7 @@ namely the library |fadings|. So, to use them, you have to say \begin{command}{\tikzfading\oarg{options}} This command is used to define a fading similarly to that way a - shading is defined. In the \meta{options} you should + shading is defined. In the \meta{options} you should \begin{enumerate} \item use the |name=|\meta{name} option to set a name for the fading, \item use the |shading| option to set the name of the shading that @@ -338,7 +340,7 @@ namely the library |fadings|. So, to use them, you have to say \fill [red,path fading=fade right] (-1,-1) rectangle (1,1); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \begin{codeexample}[] \tikzfading[name=fade out, @@ -354,7 +356,7 @@ namely the library |fadings|. So, to use them, you have to say \fill [blue,path fading=fade out] (-1,-1) rectangle (1,1); \end{tikzpicture} -\end{codeexample} +\end{codeexample} \end{command} @@ -363,7 +365,7 @@ namely the library |fadings|. So, to use them, you have to say Aa fading specifies for each pixel of a certain area how transparent this pixel will be. The following options are used to install such a -fading for the current scope or path. +fading for the current scope or path. \pgfdeclarefading{fade down}{% \tikzset{top color=pgftransparent!0,bottom color=pgftransparent!100} @@ -376,7 +378,7 @@ fading for the current scope or path. \begin{key}{/tikz/path fading=\meta{name} (default \normalfont scope's setting)} This option tells \tikzname\ that the current path should be faded - with the fading \meta{name}. If no \meta{name} is given, the + with the fading \meta{name}. If no \meta{name} is given, the \meta{name} set for the whole scope is used. Similarly to options like |draw| or |fill|, this option is reset for each path, so you have to add it to each path that should be faded. You can also @@ -404,7 +406,7 @@ fading for the current scope or path. path. When set to |false|, the fading is only shifted so that it is centered on the path's center, but it is not resized. This can be useful for special-purpose fadings, for instance when you use a - fading to ``punsh out'' something. + fading to ``punsh out'' something. % TODOsp: punsh out --> punch out?? \end{key} \begin{key}{/tikz/fading transform=\meta{transformation options}} @@ -424,14 +426,14 @@ fading for the current scope or path. \end{tikzpicture} \end{codeexample} \end{key} - + \begin{key}{/tikz/fading angle=\meta{degree}} A shortcut for |fading transform={rotate=|\meta{degree}|}|. \end{key} Note that you can ``fade just about anything.'' In particular, you can fade a shading. - + \begin{codeexample}[] \begin{tikzpicture} % Checker board @@ -448,7 +450,7 @@ fading for the current scope or path. \begin{codeexample}[] \tikzfading[name=fade inside, inner color=transparent!80, - outer color=transparent!30] + outer color=transparent!30] \begin{tikzpicture} % Checker board \fill [black!20] (0,0) rectangle (4,4); @@ -488,7 +490,7 @@ visually rather pleasing effects: \subsubsection{Fading a Scope} -In addtion to fading individual paths, you may also wish to ``fade a +In addition to fading individual paths, you may also wish to ``fade a scope,'' that is, you may wish to install a fading that is used globally to specify the transparency for all objects drawn inside a scope. This effect can also be thought of as a ``soft clip'' and it @@ -498,7 +500,7 @@ in the scope are faded. You will use a |transparency group| in conjunction, see the end of this section. \begin{key}{/tikz/scope fading=\meta{fading}} - In principle, this key works in excatly the same way as the + In principle, this key works in exactly the same way as the |path fading| key. The only difference is, that the effect of the fading will persist after the current path till the end of the scope. Thus, the \meta{fading} is applied to all subsequent drawings @@ -512,7 +514,7 @@ conjunction, see the end of this section. the |scope fading| option with a |{scope}| only sets the name of the fading to be used. You have to explicitly provide the |scope fading| with a path to actually install a fading. - + \begin{codeexample}[] \begin{tikzpicture} \fill [black!20] (-2,-2) rectangle (2,2); @@ -554,7 +556,7 @@ conjunction, see the end of this section. This is some text that will fade out as we go right and down. It is pretty hard to achieve this effect in other ways. -}; +}; \end{codeexample} \end{key} @@ -564,7 +566,7 @@ conjunction, see the end of this section. Consider the following cross and sign. They ``look wrong'' because we can see how they were constructed, while this is not really part of -the desired effect. +the desired effect. \begin{codeexample}[] \begin{tikzpicture}[opacity=.5] @@ -615,9 +617,9 @@ Transparency groups are used to render them correctly: are painted multiple times (up to three times), but only the last color ``wins.'' - Then, when the scope is finished, it is painted as a whole. The + Then, when the scope is finished, it is painted as a whole. The \emph{fill} transparency settings are now applied to the resulting - picutre. For instance, the pixel that has been painted three times + picture. For instance, the pixel that has been painted three times is just red at the end, so this red color will be blended with whatever is ``behind'' the group on the page. @@ -625,12 +627,12 @@ Transparency groups are used to render them correctly: objects in a transparency group that lie outside the picture. This has to do with internal bounding box computations. Section~\ref{section-transparency} explains how to sidestep this - problem. + problem. \end{key} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex index f3f2a514f33..ac0a00bda5f 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex @@ -33,7 +33,7 @@ mathematician or a computer scientist by looking at the direction their trees grow. A computer scientist's trees will grow downward while a mathematician's tree will grow upward. Naturally, the \emph{correct} way is the mathematician's way, which can be specify as -follows: +follows: \begin{codeexample}[] \begin{tikzpicture} \node {root} [grow'=up] @@ -49,7 +49,7 @@ In \tikzname, trees are specified by adding \emph{children} to a node on a path using the |child| operation: \begin{pathoperation}{child}{\opt{\oarg{options}}% - \opt{|foreach|\meta{variables}|in|\marg{values}}\opt{\marg{child path}}} + \opt{|foreach|\meta{variables}|in|\marg{values}}\opt{\marg{child path}}} This operation should directly follow a completed |node| operation or another |child| operation, although it is permissible that the first |child| operation is preceded by options (we will come to @@ -61,7 +61,7 @@ node on a path using the |child| operation: |child| and its arguments until it reaches a path operation that is not a |child|. Note that this will fix the character codes of all text inside the child arguments, which means, in essence, that you - cannot use verbatim text inside the nodes inside a |child|. Sorry. + cannot use verbatim text inside the nodes inside a |child|. Sorry. Once the children have been collected and counted, \tikzname\ starts generating the child nodes. For each child of a parent node @@ -80,7 +80,7 @@ node on a path using the |child| operation: each value in this list, a new |child| is added to the node. The syntax for \meta{variables} and for \meta{values} is the same as for the |\foreach| statement, see Section~\ref{section-foreach}. For - example, when you say + example, when you say \begin{codeexample}[code only] node {root} child [red] foreach \name in {1,2} {node {\name}} \end{codeexample} @@ -88,7 +88,7 @@ node {root} child [red] foreach \name in {1,2} {node {\name}} \begin{codeexample}[code only] node {root} child[red] {node {1}} child[ref] {node {2}} \end{codeexample} - When you write + When you write \begin{codeexample}[code only] node {root} child[\pos] foreach \name/\pos in {1/left,2/right} {node[\pos] {\name}} \end{codeexample} @@ -103,7 +103,7 @@ node {root} child[left] {node[left] {1}} child[right] {node[right] {2}} [level distance=4mm,level/.style={sibling distance=8mm/#1}] \coordinate child foreach \x in {0,1} - {child foreach \y in {0,1} + {child foreach \y in {0,1} {child foreach \z in {0,1}}}; \end{tikzpicture} \end{codeexample} @@ -130,7 +130,7 @@ first child, the \meta{child path} has the child node |node {y}|. For the second child, no child node is specified and, thus, it is just |coordinate|. -As for any normal node, you can give the child node a name, shift it +As for any normal node, you can give the child node a name, shift it around, or use options to influence how it is rendered. \begin{codeexample}[] \begin{tikzpicture} @@ -147,14 +147,14 @@ node. However, the node specification may be followed by arbitrary other material that will be added to the picture, transformed to the child's coordinate system. For your convenience, a move-to |(0,0)| operation is inserted automatically at the beginning of the path. Here -is an example: +is an example: \begin{codeexample}[] \begin{tikzpicture} \node {root} child {[fill] circle (2pt)} child {[fill] circle (2pt)}; -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} @@ -210,7 +210,7 @@ Here is an example: \begin{codeexample}[] \begin{tikzpicture} \node (root) {root} - child + child child { child {coordinate (special)} child @@ -223,6 +223,7 @@ Here is an example: \end{codeexample} \subsection{Specifying Options for Trees and Children} +\label{section-tree-options} Each |child| may have its own \meta{options}, which apply to ``the whole child,'' including all of its grandchildren. Here is an @@ -240,7 +241,7 @@ example: The options of the root node have no effect on the children since the options of a node are always ``local'' to that node. Because of this, the edges in the following tree are black, not red. - + \begin{codeexample}[] \begin{tikzpicture}[thick] \node [red] {root} @@ -328,7 +329,7 @@ There are additional styles that influence how children are rendered: \begin{stylekey}{/tikz/level \meta{number} (initially \normalfont empty)} This style is used in addition to the |level| style. So, when you say |\node {x} child child;|, then the following key list is - executed: |level=1,level 1|. + executed: |level=1,level 1|. \begin{codeexample}[] \begin{tikzpicture} @@ -352,7 +353,7 @@ There are additional styles that influence how children are rendered: Perhaps the most difficult part in drawing a tree is the correct layout of the children. Typically, the children have different sizes and it is not easy to arrange them in such a manner that not too much -space is wasted, the children do not overlap, and they are either +space is wasted, the children do not overlap, and they are either evenly spaced or their centers are evenly distributed. Calculating good positions is especially difficult since a good position for the first child may depend on the size of the last child. @@ -375,14 +376,14 @@ distance between children (appropriately called the distances may change from level to level. The direction in which the tree grows can be changed globally and for parts of the tree. You can even specify your own ``growth function'' to arrange children on a -circle or along special lines or curves. +circle or along special lines or curves. \subsubsection{Default Growth Function} The default growth function works as follows: Assume that we are given a node and five children. These children will be placed on a line with their centers (or, more generally, with their anchors) spaced apart by -the current |sibling distance|. The line is +the current |sibling distance|. The line is orthogonal to the current \emph{direction of growth}, which is set with the |grow| and |grow'| option (the latter option reverses the ordering of the children). The distance from the line to the parent node @@ -402,7 +403,7 @@ is given by the |level distance|. \draw[|<->|,thick] (root-1.center) -- node[above,sloped] {sibling distance} (root-2.center); - \draw[|<->|,thick] (root.center) + \draw[|<->|,thick] (root.center) -- node[above,sloped] {level distance} +(-10:\tikzleveldistance); \end{tikzpicture} \end{codeexample} @@ -410,10 +411,10 @@ is given by the |level distance|. \begin{key}{/tikz/level distance=\meta{distance} (initially 15mm)} This key determines the distance between different levels of the - tree, more precisely, between the parent and the line + tree, more precisely, between the parent and the line on which its children are arranged. When given to a single child, this will set the distance for this child only. - + \begin{codeexample}[] \begin{tikzpicture} \node {root} @@ -425,14 +426,14 @@ is given by the |level distance|. child child } - child[level distance=10mm]; + child[level distance=10mm]; \end{tikzpicture} \end{codeexample} - + \begin{codeexample}[] \begin{tikzpicture} - [level 1/.style={level distance=10mm}, - level 2/.style={level distance=5mm}] + [level 1/.style={level distance=10mm}, + level 2/.style={level distance=5mm}] \node {root} child child { @@ -447,7 +448,7 @@ is given by the |level distance|. \begin{key}{/tikz/sibling distance=\meta{distance} (initially 15mm)} This key specifies the distance between the anchors of the - children of a parent node. + children of a parent node. \begin{codeexample}[] \begin{tikzpicture} @@ -494,7 +495,7 @@ is given by the |level distance|. }; \end{tikzpicture} \end{codeexample} -\end{key} +\end{key} \begin{key}{/tikz/grow=\meta{direction}} @@ -543,7 +544,7 @@ is given by the |level distance|. child child[grow=right] { child child child - }; + }; \end{tikzpicture} \end{codeexample} @@ -561,7 +562,7 @@ is given by the |level distance|. coordinate (wrong) }; \draw[<-,red] ([yshift=-2mm]wrong) -- +(0,-1) - node[below]{This is wrong!}; + node[below]{This is wrong!}; \end{tikzpicture} \end{codeexample} @@ -616,10 +617,10 @@ will not be rendered. to be used for computing the children's position. For example, when there is only one child and the |level distance| is |2cm|, then the child node will be placed two centimeters below the \meta{anchor} of - the parent node. ``Beinng placed'' means that the child node's + the parent node. ``Being placed'' means that the child node's anchor (which is the anchor specified using the |anchor=| option in the |node| command of the child) is two centimeters below the parent - node's \meta{anchor}. + node's \meta{anchor}. In the following example, the two red lines both have length |1cm|. \begin{codeexample}[] @@ -640,7 +641,7 @@ will not be rendered. \begin{codeexample}[] \begin{tikzpicture} [level distance=2cm,growth parent anchor=north, - every node/.style={anchor=north,rectangle,draw} + every node/.style={anchor=north,rectangle,draw} every child node/.style={anchor=south}] \node at (0,0) {root} child {node {small}}; @@ -673,7 +674,7 @@ will not be rendered. transform the coordinate system further. For example, it could be rotated or scaled. - Additional growth functions are defined in the library, see + Additional growth functions are defined in the library, see Section~\ref{section-tree-library}. \end{key} @@ -703,7 +704,7 @@ edge called the |edge from parent|. This edge is added to the This options allows you to set the edge from parent path to a new path. Initially, this path is the following: \begin{codeexample}[code only] -(\tikzparentnode\tikzparentanchor) -- (\tikzchildnode\tikzchildanchor) +(\tikzparentnode\tikzparentanchor) -- (\tikzchildnode\tikzchildanchor) \end{codeexample} The |\tikzparentnode| is a macro that will expand to the name of the parent node. This works even when you have not assigned a name @@ -740,7 +741,7 @@ edge called the |edge from parent|. This edge is added to the Specifies the anchor where the edge from parent meets the child node by setting the macro |\tikzchildanchor| to |.|\meta{anchor}. - + If you specify |border| as the \meta{anchor}, then the macro |\tikzchildanchor| is set to the empty string. The effect of this is that the edge from the parent will meet the child on the @@ -769,10 +770,10 @@ edge called the |edge from parent|. This edge is added to the also installed prior to inserting the path: \begin{stylekey}{/tikz/edge from parent (initially draw)} This style is inserted right before the edge from parent path and - before the \meta{options} are inserted. + before the \meta{options} are inserted. \begin{codeexample}[] \begin{tikzpicture} - [edge from parent/.style={draw,red,thick}] + [edge from parent/.style={draw,red,thick}] \node {root} child {node {left} edge from parent[dashed]} child {node {right} @@ -796,7 +797,7 @@ edge called the |edge from parent|. This edge is added to the As an example, consider the following code: \begin{codeexample}[code only] -\node (root) {} child {node (child) {} edge to parent node {label}}; +\node (root) {} child {node (child) {} edge to parent node {label}}; \end{codeexample} The |edge to parent| operation and the following |node| operation will, together, have the same effect as if we had said: @@ -832,7 +833,7 @@ edge called the |edge from parent|. This edge is added to the -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex index 08f4ce97686..2ca446abecc 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex @@ -21,7 +21,7 @@ publisher). Up to know, he wrote down his text and graphics on papyrus, but his publisher suddenly insists that he must submit in electronic form. Euclid tries to argue with the publisher that electronics will only be discovered thousands of years later, but the -publisher informs him that the use of amber is no longer cutting edge +publisher informs him that the use of papyrus is no longer cutting edge technology and Euclid will just have to keep up with modern tools. Slightly disgruntled, Euclid starts converting his papyrus @@ -53,11 +53,10 @@ E. Joyce, to be found on his website at Clark University.} \draw [input] (A) -- (B); - \node [help lines,draw,label=left:\D] (D) at (A) [circle through=(B)] {}; - \node [help lines,draw,label=right:\E] (E) at (B) [circle through=(A)] {}; + \node [name path=D,help lines,draw,label=left:\D] (D) at (A) [circle through=(B)] {}; + \node [name path=E,help lines,draw,label=right:\E] (E) at (B) [circle through=(A)] {}; - \coordinate [label=above:\C] - (C) at (intersection 2 of D and E); + \path [name intersections={of=D and E,by={[label=above:\C]C}}]; \draw [output] (A) -- (C); \draw [output] (B) -- (C); @@ -69,7 +68,7 @@ E. Joyce, to be found on his website at Clark University.} \fill[triangle!80] (A) -- (C) -- (B) -- cycle; \end{pgfonlayer} - \node [below right,text width=10cm,text justified] at (4,3) + \node [below right,text width=10cm,align=justify] at (4,3) { \small \textbf{Proposition I}\par @@ -106,26 +105,28 @@ Let us have a look at how Euclid can turn this into \tikzname\ code. \subsubsection{Setting up the Environment} As in the previous tutorials, Euclid needs to load \tikzname, together -with some libraries. These libraries are |calc|, |through|, and -|backgrounds|. Depending on which format he uses, Euclid would use one -of the following in the preamble: +with some libraries. These libraries are |calc|, |intersections|, +|through|, and |backgrounds|. Depending on which format\footnote{Note + that \pgfname/\tikzname{} is not supported by recent Con\TeX t versions + (like mark IV, the Lua\TeX-aware part of Con\TeX t).} he uses, +Euclid would use one of the following in the preamble: \begin{codeexample}[code only] % For LaTeX: \usepackage{tikz} -\usetikzlibrary{calc,through,backgrounds} +\usetikzlibrary{calc,intersections,through,backgrounds} \end{codeexample} \begin{codeexample}[code only] % For plain TeX: \input tikz.tex -\usetikzlibrary{calc,through,backgrounds} +\usetikzlibrary{calc,intersections,through,backgrounds} \end{codeexample} \begin{codeexample}[code only] % For ConTeXt: \usemodule[tikz] -\usetikzlibrary[calc,through,backgrounds] +\usetikzlibrary[calc,intersections,through,backgrounds] \end{codeexample} @@ -330,48 +331,58 @@ as above. Euclid can now draw the line and the circles. The final problem is to compute the intersection of the two circles. This computation is a bit -involved if you want to do it ``by hand.'' Fortunately, the so-called -intersection coordinate system allows us to specify points as the -intersection of two objects (in order for the following code to work, -the |calc| library must be loaded; it defines the necessary code for -computing the intersection of circles): +involved if you want to do it ``by hand.'' Fortunately, the +intersection library allows us to compute the intersection of +arbitrary paths. + +The idea is simple: First, you ``name'' two paths using the +|name path| option. Then, at some later point, you can use the option +|name intersections|, which creates coordinates called +|intersection-1|, |intersection-2|, and so on at all intersections of +the paths. Euclid assigns the names |D| and |E| to the paths of the +two circles (which happen to be the same names as the nodes +themselves, but nodes and their paths live in different +``namespaces''). \begin{codeexample}[] \begin{tikzpicture} \coordinate [label=left:$A$] (A) at (0,0); \coordinate [label=right:$B$] (B) at (1.25,0.25); \draw (A) -- (B); - \node (D) [draw,circle through=(B),label=left:$D$] at (A) {}; - \node (E) [draw,circle through=(A),label=right:$E$] at (B) {}; + \node (D) [name path=D,draw,circle through=(B),label=left:$D$] at (A) {}; + \node (E) [name path=E,draw,circle through=(A),label=right:$E$] at (B) {}; - \coordinate [label=above:$C$] (C) at (intersection 2 of D and E); + % Name the coordinates, but do not draw anything: + \path [name intersections={of=D and E}]; + + \coordinate [label=above:$C$] (C) at (intersection-1); \draw [red] (A) -- (C); \draw [red] (B) -- (C); \end{tikzpicture} \end{codeexample} -We could also have written |intersection 1 of| or just -|intersection of| to get access to the other intersection of the -circles. - -Although Euclid does not need it for the current picture, it is just a -small step to computing the bisection of the line $AB$: +It turns out that this can be further shortened: The +|name intersections| takes an optional argument |by|, which lets you +specify names for the coordinates and options for them. This creates +more compact code. Although Euclid does not need it for the current +picture, it is just a small step to computing the bisection of the line $AB$: \begin{codeexample}[] \begin{tikzpicture} \coordinate [label=left:$A$] (A) at (0,0); \coordinate [label=right:$B$] (B) at (1.25,0.25); - \draw (A) -- (B); + \draw [name path=A--B] (A) -- (B); - \node (D) [draw,circle through=(B),label=left:$D$] at (A) {}; - \node (E) [draw,circle through=(A),label=right:$E$] at (B) {}; + \node (D) [name path=D,draw,circle through=(B),label=left:$D$] at (A) {}; + \node (E) [name path=E,draw,circle through=(A),label=right:$E$] at (B) {}; - \coordinate [label=above:$C$] (C) at (intersection 2 of D and E); - \coordinate [label=below:$C'$] (C') at (intersection 1 of D and E); + \path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C'$]C'}}]; - \draw [red] (C) -- (C'); - \node [fill=red,inner sep=1pt,label=-45:$F$] (F) at (intersection of C--C' and A--B) {}; + \draw [name path=C--C',red] (C) -- (C'); + + \path [name intersections={of=A--B and C--C',by=F}]; + \node [fill=red,inner sep=1pt,label=-45:$F$] at (F) {}; \end{tikzpicture} \end{codeexample} @@ -398,10 +409,10 @@ end. \draw [input] (A) -- (B); - \node [help lines,draw,label=left:\D] (D) at (A) [circle through=(B)] {}; - \node [help lines,draw,label=right:\E] (E) at (B) [circle through=(A)] {}; + \node [name path=D,help lines,draw,label=left:\D] (D) at (A) [circle through=(B)] {}; + \node [name path=E,help lines,draw,label=right:\E] (E) at (B) [circle through=(A)] {}; - \coordinate [label=above:\C] (C) at (intersection 2 of D and E); + \path [name intersections={of=D and E,by={[label=above:\C]C}}]; \draw [output] (A) -- (C) -- (B); @@ -412,7 +423,7 @@ end. \fill[triangle!80] (A) -- (C) -- (B) -- cycle; \end{pgfonlayer} - \node [below right, text width=10cm,text justified] at (4,3) { + \node [below right, text width=10cm,align=justify] at (4,3) { \small\textbf{Proposition I}\par \emph{To construct an \textcolor{triangle}{equilateral triangle} on a given \textcolor{input}{finite straight line}.} @@ -449,20 +460,23 @@ The second proposition in the Elements is the following: \draw [help lines] (D) -- ($ (D)!3.75!(A) $) coordinate [label=-135:\E] (E); \draw [help lines] (D) -- ($ (D)!3.75!(B) $) coordinate [label=-45:\F] (F); - \node (H) at (B) [help lines,circle through=(C),draw,label=135:\H] {}; - - \coordinate [label=right:\G] (G) at (intersection of B--F and H); + \node (H) at (B) [name path=H,help lines,circle through=(C),draw,label=135:\H] {}; + \path [name path=B--F] (B) -- (F); + \path [name intersections={of=H and B--F}] + coordinate [label=right:\G] (G) at (intersection-1); - \node (K) at (D) [help lines,circle through=(G),draw,label=135:\K] {}; + \node (K) at (D) [name path=K,help lines,circle through=(G),draw,label=135:\K] {}; - \coordinate [label=below:\L] (L) at (intersection of A--E and K); + \path [name path=A to E line] (A) -- (E); + \path [name intersections={of=K and A to E line}] + coordinate [label=below:\L] (L) at (intersection-1); \draw [output] (A) -- (L); \foreach \point in {A,B,C,D,G,L} \fill [black,opacity=.5] (\point) circle (2pt); - \node [below right, text width=9cm,text justified] at (4,4) { + \node [below right, text width=9cm,align=justify] at (4,4) { \small\textbf{Proposition II}\par \emph{To place a \textcolor{output}{straight line} equal to a given \textcolor{input}{straight line} with @@ -602,6 +616,7 @@ straight line to \meta{q}. We know that the point $G$ is on the way from $B$ to $F$. The distance is given by the radius of the circle~$H$. Here is the code form computing $H$: +{\tikzexternaldisable \begin{codeexample}[pre={ \begin{tikzpicture} \coordinate [label=left:$A$] (A) at (0,0); @@ -610,17 +625,18 @@ computing $H$: \draw (A) -- (B) -- (C); \coordinate [label=above:$D$] (D) at ($ (A) ! .5 ! (B) ! {sin(60)*2} ! 90:(B) $) {}; - \node (H) [label=135:$H$,draw,circle through=(C)] at (B) {}; \draw (D) -- ($ (D) ! 3.5 ! (B) $) coordinate [label=below:$F$] (F); \draw (D) -- ($ (D) ! 2.5 ! (A) $) coordinate [label=below:$E$] (E); },post={\end{tikzpicture}}] + \node (H) [label=135:$H$,draw,circle through=(C)] at (B) {}; \path let \p1 = ($ (B) - (C) $) in coordinate [label=left:$G$] (G) at ($ (B) ! veclen(\x1,\y1) ! (F) $); \fill[red,opacity=.5] (G) circle (2pt); \end{codeexample} -However, there is a simpler way: As for circles, we can also intersect -a line and a circle using the |intersection| coordinate system: +However, there is a simpler way: We can simply name the path of the +circle and of the line in question and then use |name intersections| +to compute the intersections. \begin{codeexample}[pre={ \begin{tikzpicture} @@ -630,13 +646,15 @@ a line and a circle using the |intersection| coordinate system: \draw (A) -- (B) -- (C); \coordinate [label=above:$D$] (D) at ($ (A) ! .5 ! (B) ! {sin(60)*2} ! 90:(B) $) {}; - \node (H) [label=135:$H$,draw,circle through=(C)] at (B) {}; \draw (D) -- ($ (D) ! 3.5 ! (B) $) coordinate [label=below:$F$] (F); \draw (D) -- ($ (D) ! 2.5 ! (A) $) coordinate [label=below:$E$] (E); },post={\end{tikzpicture}}] - \coordinate [label=left:$G$] (G) at (intersection of B--F and H); + \node (H) [name path=H,label=135:$H$,draw,circle through=(C)] at (B) {}; + \path [name path=B--F] (B) -- (F); + \path [name intersections={of=H and B--F,by={[label=left:$G$]G}}]; \fill[red,opacity=.5] (G) circle (2pt); \end{codeexample} +}% \subsubsection{The Complete Code} @@ -662,13 +680,13 @@ a line and a circle using the |intersection| coordinate system: \draw [help lines] (D) -- ($ (D)!3.75!(A) $) coordinate [label=-135:\E] (E); \draw [help lines] (D) -- ($ (D)!3.75!(B) $) coordinate [label=-45:\F] (F); - \node (H) at (B) [help lines,circle through=(C),draw,label=135:\H] {}; - - \coordinate [label=right:\G] (G) at (intersection of B--F and H); + \node (H) at (B) [name path=H,help lines,circle through=(C),draw,label=135:\H] {}; + \path [name path=B--F] (B) -- (F); + \path [name intersections={of=H and B--F,by={[label=right:\G]G}}]; - \node (K) at (D) [help lines,circle through=(G),draw,label=135:\K] {}; - - \coordinate [label=below:\L] (L) at (intersection of A--E and K); + \node (K) at (D) [name path=K,help lines,circle through=(G),draw,label=135:\K] {}; + \path [name path=A--E] (A) -- (E); + \path [name intersections={of=K and A--E,by={[label=below:\L]L}}]; \draw [output] (A) -- (L); @@ -677,4 +695,4 @@ a line and a circle using the |intersection| coordinate system: % \node ... \end{tikzpicture} -\end{codeexample}
\ No newline at end of file +\end{codeexample} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex index f7b8d211110..725702513fb 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex @@ -28,14 +28,14 @@ using pens and rules, it looks like this\footnote{The shown diagram was not scan % The size: minimum size=6mm, % The border: - very thick, + very thick, draw=red!50!black!50, % 50% red and 50% black, % and that mixed with 50% white % The filling: top color=white, % a shading that is white at the top... bottom color=red!50!black!20, % and something else at the bottom % Font - font=\itshape + font=\itshape }, terminal/.style={ % The shape: @@ -74,7 +74,7 @@ using pens and rules, it looks like this\footnote{The shown diagram was not scan \node [support] (after dot) {}; \node [terminal] {digit}; \node [support] (after digit) {}; - \node [support] (skip) {}; + \node [support] (skip) {}; \node [support] (before E) {}; \node [terminal] {E}; \node [support] (after E) {}; @@ -186,14 +186,14 @@ corners involved. Naturally, she sets up a style: % The size: minimum size=6mm, % The border: - very thick, + very thick, draw=red!50!black!50, % 50% red and 50% black, % and that mixed with 50% white % The filling: top color=white, % a shading that is white at the top... bottom color=red!50!black!20, % and something else at the bottom % Font - font=\itshape + font=\itshape }] \node [nonterminal] {unsigned integer}; \end{tikzpicture} @@ -260,7 +260,7 @@ nodes is not aligned: \p3 = (E.base) in (-.5,\y1) -- (3.5,\y1) (-.5,\y2) -- (3.5,\y2) - (-.5,\y3) -- (3.5,\y3); + (-.5,\y3) -- (3.5,\y3); \end{tikzpicture} \end{codeexample} \noindent (Ilka has moved the style definition to the preamble by @@ -316,7 +316,7 @@ graphics this is perfectly alright, but it has several disadvantages: recalculate the coordinates. \item The source code of the graphic is not very clear since the relationships between the positions of the nodes are not made - explicit. + explicit. \end{enumerate} For these reasons, Ilka decides to try out different ways of arranging @@ -376,7 +376,7 @@ does not affect anchors, she gets the following result: \end{tikzpicture} \end{codeexample} A third way is to use matrices, which we will do later. - + Now that the nodes have been placed, Ilka needs to add connections. Here, some connections are more difficult than other. Consider for instance the ``repeat'' line around the @@ -397,7 +397,7 @@ Ilka can put this into code as follows: % start right of digit.east, that is, at the point that is the % linear combination of digit.east and the vector (2mm,0pt). We % use the ($ ... $) notation for computing linear combinations - ($ (digit.east) + (2mm,0) $) + ($ (digit.east) + (2mm,0) $) % Now go down -- ++(0,-.5) % And back to the left of digit.west @@ -425,7 +425,7 @@ setup a style that contains the correct path: \end{codeexample} Ilka can even go a step further and make her |skip look| style -parametrized. For this, the skip loop's vertical offset is passed as +parameterized. For this, the skip loop's vertical offset is passed as parameter |#1|. Also, in the following code Ilka specifies the start and targets differently, namely as the positions that are ``in the middle between the nodes.'' @@ -472,7 +472,7 @@ containing only the minus node. & \node [nonterminal] {unsigned integer}; \\ % Third row: - & & & & \node [terminal] {-}; & \\ + & & & & \node [terminal] {-}; & \\ }; \end{tikzpicture} \end{codeexample} @@ -606,7 +606,7 @@ option. When the first branch ends, only the plus node has been added and the current chain is the original chain once more and we are back to the |E| node. Now we start a new branch for the minus node. After this -branch, the current chain ens at |E| node once more. +branch, the current chain ends at |E| node once more. Finally, the rightmost unsigned integer is added to the (main) chain, which is why it is joined correctly with the |E| node. The two @@ -652,9 +652,9 @@ to be used for the join. \begin{codeexample}[] \begin{tikzpicture}[start chain,node distance=5mm and 2mm, - every node/.style={on chain}, - nonterminal/.append style={join=by ->}, - terminal/.append style={join=by ->}, + every node/.style={on chain}, + nonterminal/.append style={join=by ->}, + terminal/.append style={join=by ->}, point/.style={join=by -,circle,fill=red,minimum size=2pt,inner sep=0pt}] \node [point] {}; \node [nonterminal] {unsigned integer}; \node [point] {}; \node [terminal] {.}; @@ -693,8 +693,8 @@ node name and optionally some options. The effect is that the named node is made part of the current chain. \begin{codeexample}[pre={\tikzset{node distance=5mm and 2mm, - every node/.style={on chain}, - terminal/.append style={join=by ->}, + every node/.style={on chain}, + terminal/.append style={join=by ->}, point/.style={join=by -,circle,fill=red,minimum size=2pt,inner sep=0pt}}}] \begin{tikzpicture}[start chain] % plus some styles that are not shown \node [point] {}; diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex new file mode 100644 index 00000000000..ec0ea535f38 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex @@ -0,0 +1,1301 @@ +% Copyright 2008 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\section{Tutorial: A Lecture Map for Johannes} + +In this tutorial we explore the tree and mind map mechanisms of +\tikzname. + +Johannes is quite excited: For the first time he will be teaching a +course all by himself during the upcoming semester! Unfortunately, the +course is not on his favorite subject, which is of course Theoretical Immunology, +but on Complexity Theory, but as a young academic Johannes is not +likely to complain too loudly. In order to help the students get a +general overview of what is going to happen during the course as a +whole, he intends to draw some kind of tree or graph containing the +basic concepts. He got this idea from his old professor who seems to +be using these ``lecture maps'' with some success. Independently of +the success of these maps, Johannes thinks they look quite neat. + + + +\subsection{Problem Statement} + +Johannes wishes to create a lecture map with the following features: +\begin{enumerate} +\item It should contain a tree or graph depicting the main concepts. +\item It should somehow visualize the different lectures that will be + taught. Note that the lectures are not necessarily the same as the + concepts since the graph may contain more concepts than will be + addressed in lectures and some concepts may be addressed during more + than one lecture. +\item The map should also contain a calendar showing when the + individual lectures will be given. +\item The aesthetical reasons, the whole map should have a visually + nice and information-rich background. +\end{enumerate} + +As always, Johannes will have to include the right libraries and +setup the environment. Since Johannes is going to use the +|mindmap| library and since he wishes to show a calendar, he will need +the |mindmap| and the |calendar| libraries. In order to put something +on a background layer, it seems like a good idea to also include the +|background| library. + + +\subsection{Introduction to Trees} + +The first choice Johannes must make is whether he will organize the +concepts are a tree, with root concepts and concept branches and leaf +concepts, or as a general graph. The tree implicitly organizes the +concepts, while a graph is more flexible. Johannes decides to +compromise: Basically, the concepts will be organized as a +tree. However, he will selectively add connections between concepts +that are related, but which appear on different levels or branches of +the tree. + +Johannes starts with a tree-like list of concepts that he feels are +important in Computational Complexity: + +\begin{itemize} +\item Computational Problems + \begin{itemize}\itemsep=0pt\parskip=0pt + \item Problem Measures + \item Problem Aspects + \item Problem Domains + \item Key Problems + \end{itemize} +\item Computational Models + \begin{itemize}\itemsep=0pt\parskip=0pt + \item Turing Machines + \item Random-Access Machines + \item Circuits + \item Binary Decision Diagrams + \item Oracle Machines + \item Programming in Logic + \end{itemize} +\item Measuring Complexity + \begin{itemize}\itemsep=0pt\parskip=0pt + \item Complexity Measures + \item Classifying Complexity + \item Comparing Complexity + \item Describing Complexity + \end{itemize} +\item Solving Problems + \begin{itemize}\itemsep=0pt\parskip=0pt + \item Exact Algorithms + \item Randomization + \item Fixed-Parameter Algorithms + \item Parallel Computation + \item Partial Solutions + \item Approximation + \end{itemize} +\end{itemize} + +Johannes will surely need to modify this list later on, but it looks +good as a first approximation. He will also need to add a number of +subtopics (like \emph{lots} of complexity classes under the topic +``classifying complexity''), but he will do this as he constructs the +map. + +Turning the list of topics into a \tikzname-tree is easy, in +principle. The basic idea is that a node can have \emph{children}, +which in turn can have children of their own, and so on. To add a +child to a node, Johannes can simply write |child {|\meta{node}|}| +right after a node. The \meta{node} should, in turn, be the code for +creating a node. To add another node, Johannes can use |child| once +more, and so on. Johannes is eager to try out this construct and +writes down the following: + +\begin{codeexample}[] +\tikz + \node {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; +\end{codeexample} + +Well, that did not quite work out as expected (although, what, +exactly, did one expect?). There are two problems: +\begin{enumerate} +\item The overlap of the nodes is due to the fact that \tikzname\ is + not particularly smart when it comes to placing child nodes. Even + though it is possible to configure \tikzname\ to use rather clever + placement methods, \tikzname\ has no way of taking the actual size + of the child nodes into account. This may seem strange but the + reason is that the child nodes are rendered and placed one at a + time, so the size of the last node is not known when the first node + is being processed. In essence, you have to specify appropriate + level and sibling node spacings ``by hand.'' +\item The standard computer-science-top-down rendering of a tree is + rather ill-suited to visualizing the concepts. It would be better to + either rotate the map by ninety degrees or, even better, to use some + sort of circular arrangement. +\end{enumerate} + +Johannes redraws the tree, but this time with some more appropriate +options set, which he found more or less by trial-and-error: + +\begin{codeexample}[render instead={ +\tikz [font=\footnotesize, + grow=right, level 1/.style={sibling distance=6em}, + level 2/.style={sibling distance=1em}, level distance=5cm] + \node {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } child { node {Problem Aspects} } + child { node {Problem Domains} } child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } child { node {Random-Access Machines} } + child { node {Circuits} } child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } child { node {Classifying Complexity} } + child { node {Comparing Complexity} } child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } + child { node {Partial Solutions} } child { node {Approximation} } + }; + }] +\tikz [font=\footnotesize, + grow=right, level 1/.style={sibling distance=6em}, + level 2/.style={sibling distance=1em}, level distance=5cm] + \node {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + ... % as before +\end{codeexample} + +Still not quite what Johannes had in mind, but he is getting +somewhere. + +For configuring the tree, two parameters are of particular importance: +The |level distance| tells \tikzname\ the distance between (the +centers of) the nodes on adjacent levels or layers of a tree. The +|sibling distance| is, as the name suggests, the distance between (the +centers of) siblings of the tree. + +You can globally set these parameters for a tree by simply setting +them somewhere before the tree starts, but you will +typically wish them to be different for different levels of the +tree. In this case, you should set styles like |level 1| or +|level 2|. For the first level of the tree, the |level 1| style is +used, for the second level the |level 2| style, and so on. You can +also set the sibling and level distances only for certain nodes by +passing these options to the |child| command as options. (Note that +the options of a |node| command are local to the node and have no +effect on the children. Also note that it is possible to specify +options that do have an effect on the children. Finally note that +specifying options for children ``at the right place'' is an arcane +art and you should peruse Section~\ref{section-tree-options} on +a rainy Sunday afternoon, if you are really interested.) + +The |grow| key is used to configure the direction in which a tree +grows. You can change growth direction ``in the middle of a tree'' +simply by changing this key for a single child or a whole level. By +including the |tree| library you also get access to additional growth +strategies such as a ``circular'' growth: + + +\begin{codeexample}[render instead={ +\tikz [text width=2.7cm, align=flush center, + grow cyclic, + level 1/.style={level distance=2.5cm,sibling angle=90}, + level 2/.style={text width=2cm, font=\footnotesize, level distance=3cm,sibling angle=30}] + \node[font=\bfseries] {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } child { node {Problem Aspects} } + child { node {Problem Domains} } child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } child { node {Random-Access Machines} } + child { node {Circuits} } child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } child { node {Classifying Complexity} } + child { node {Comparing Complexity} } child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } + child { node {Partial Solutions} } child { node {Approximation} } + }; + }] +\tikz [text width=2.7cm, align=flush center, + grow cyclic, + level 1/.style={level distance=2.5cm,sibling angle=90}, + level 2/.style={text width=2cm, font=\footnotesize, level distance=3cm,sibling angle=30}] + \node[font=\bfseries] {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + ... % as before +\end{codeexample} + + +Johannes is pleased to learn that he can access and manipulate the +nodes of tree like any normal node. In particular, he can name them +using the |name=| option or the |(|\meta{name}|)| notation and he can +use any available shape or style for the trees nodes. He can connect +trees later on using the normal |\draw (some node) -- (another node);| +syntax. In essence, the |child| command just computes an appropriate +position for a node and adds a line from the child to the parent +node. + + +\subsection{Creating the Lecture Map} + +Johannes now has a first possible layout for his lecture map. The next +step is to make it ``look nicer.'' For this, the |mindmap| library is +helpful since it makes a number of styles available that will make a +tree look like a nice ``mind map'' or ``concept map.'' + +The first step is to include the |mindmap| library, which Johannes +already did. Next, he must add one of the following options to a scope +that will contain the lecture map: |mindmap| or |large mindmap| or +|huge mindmap|. These options all have the same effect, except that +for a |large mindmap| the predefined font size and node sizes are +somewhat larger than for a standard |mindmap| and for a |huge mindmap| +they are even larger. So, a |large mindmap| does not necessarily need +to have a lot of concepts, but it will need a lot of paper. + +The second step is to add the |concept| option to every node that +will, indeed, be a concept of the mindmap. The idea is that some nodes +of a tree will be real concepts, while other nodes might just be +``simple children.'' Typically, this is not the case, so you might +consider saying |every node/.style=concept|. + +The third step is to setup the sibling \emph{angle} (rather than a +sibling distance) to specify the angle between sibling concepts. + +\begin{codeexample}[render instead={ +\tikz [mindmap, every node/.style=concept, concept color=black!20, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \node [root concept] {Computational Complexity} % root + child { node {\hbox to 2cm{Computational\hss} Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child { node {\hbox to 2cm{Computational\hss} Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {\hbox to1.5cm{Programming\hss} in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {\hbox to 1.5cm{Randomization\hss}} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {\hbox to1.5cm{Approximation\hss}} } + };}] +\tikz [mindmap, every node/.style=concept, concept color=black!20, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \node [root concept] {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + ... % as before +\end{codeexample} + +When Johannes typesets the above map, \TeX\ (rightfully) starts +complaining about several overfull boxes and, indeed, words like +``Randomization'' stretch out beyond the circle of the concept. This +seems a bit mysterious at first sight: Why does \TeX\ not hyphenate +the word? The reason is that \TeX\ will never hyphenate the first word +of a paragraph because it starts looking for ``hyphenatable'' letters +only after a so-called glue. In order to have \TeX\ hyphenate these +single words, Johannes must use a bit of evil trickery: He inserts a +|\hskip0pt| before the word. This has no effect except for inserting +an (invisible) glue before the word and, thereby, allowing \TeX\ to +hyphenate the first word also. Since Johannes does not want to add +|\hskip0pt| inside each node, he uses the |execute at begin node| +option to make \tikzname\ insert this text with every node. + + +\begin{codeexample}[render instead={ +\begin{tikzpicture} + [mindmap, + every node/.style={concept, execute at begin node=\hskip0pt}, + concept color=black!20, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \clip (-1,2) rectangle ++ (-4,5); + \node [root concept] {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; +\end{tikzpicture} +}] +\begin{tikzpicture} + [mindmap, + every node/.style={concept, execute at begin node=\hskip0pt}, + concept color=black!20, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \clip (-1,2) rectangle ++ (-4,5); + \node [root concept] {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + ... % as before +\end{tikzpicture} +\end{codeexample} + + +In the above example a clipping was used to show only part of the +lecture map, in order to save space. The same will be done in the +following examples, we return to the complete lecture map at the end of this +tutorial. + +Johannes is now eager to colorize the map. The idea is to use +different colors for different parts of the map. He can then, during +his lectures, talk about the ``green'' or the ``red'' topics. This +will make it easier for his students to locate the topic he is talking +about on the map. Since ``computational problems'' somehow sounds +``problematic,'' Johannes chooses red for them, while he picks green +for the ``solving problems.'' The topics ``measuring complexity'' and +``computational models'' get more neutral colors; Johannes picks +orange and blue. + +To set the colors, Johannes must use the |concept color| option, +rather than just, say, |node [fill=red]|. Setting just the fill color +to |red| would, indeed, make the node red, but it would \emph{just} +make the node red and not the bar connecting the concept to its parent +and also not its children. By comparison, the special |concept color| +option will not only set the color of the node and its children, but +it will also (magically) create appropriate shadings so that the color +of a parent concept smoothly changes to the color of a child concept. + +For the root concept Johannes decides to do something special: He sets +the concept color to black, sets the line width to a large value, and +sets the fill color to white. The effect of this is that the root +concept will encircled with a thick black line and the children are +connected to the central concept via bars. + +\begin{codeexample}[render instead={ +\begin{tikzpicture} + [mindmap, + every node/.style={concept, execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black}, + text=white, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \clip (0,-1) rectangle ++(4,5); + \node [root concept] {Computational Complexity} % root + child [concept color=red] { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child [concept color=blue] { node {Computational Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child [concept color=orange] { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child [concept color=green!50!black] { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; + \end{tikzpicture}}] +\begin{tikzpicture} + [mindmap, + every node/.style={concept, execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, fill=white, line width=1ex, text=black}, + text=white, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \clip (0,-1) rectangle ++(4,5); + \node [root concept] {Computational Complexity} % root + child [concept color=red] { node {Computational Problems} + child { node {Problem Measures} } + ... % as before + } + child [concept color=blue] { node {Computational Models} + child { node {Turing Machines} } + ... % as before + } + child [concept color=orange] { node {Measuring Complexity} + child { node {Complexity Measures} } + ... % as before + } + child [concept color=green!50!black] { node {Solving Problems} + child { node {Exact Algorithms} } + ... % as before + }; +\end{tikzpicture} +\end{codeexample} + +Johannes adds three finishing touches: First, he changes the font +of the main concepts to small caps. Second, he decides that some +concepts should be ``faded,'' namely those that are important in +principle and belong on the map, but which he will not talk about in +his lecture. To achieve this, Johannes defines four styles, one for +each of the four main branches. These styles (a) setup the +correct concept color for the whole branch and (b) define the |faded| +style appropriately for this branch. Third, he adds a +|circular drop shadow|, defined in the |shadows| library, to the +concepts, just to make things look a bit more fancy. + +\begin{codeexample}[render instead={ +\begin{tikzpicture}[mindmap] + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] {Computational Complexity} % root + child [computational problems] { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child [faded] { node {Problem Domains} } + child { node {Key Problems} } + } + child [computational models] { node {Computational Models} + child { node {Turing Machines} } + child [faded] { node {Random-Access Machines} } + child { node {Circuits} } + child [faded] { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child [measuring complexity] { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child [faded] { node {Describing Complexity} } + } + child [solving problems] { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; + \end{scope} +\end{tikzpicture}}] +\begin{tikzpicture}[mindmap] + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, fill=white, line width=1ex, text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] {Computational Complexity} % root + child [computational problems] { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child [faded] { node {Problem Domains} } + child { node {Key Problems} } + } + child [computational models] { node {Computational Models} + child { node {Turing Machines} } + child [faded] { node {Random-Access Machines} } + ... + \end{scope} +\end{tikzpicture} +\end{codeexample} + + +\subsection{Adding the Lecture Annotations} + +Johannes will give about a dozen lectures during the course +``computational complexity.'' For each lecture he has compiled a +(short) list of learning targets that state what knowledge and +qualifications his students should acquire during this particular +lecture (note that learning targets are not the same as the contents +of a lecture). For each lecture he intends to put a little rectangle +on the map containing these learning targets and the name of the +lecture, each time somewhere near to the topic of the lecture. Such +``little rectangles'' are called ``annotations'' by the mindmap +library. + +In order to place the annotations next to the concepts, Johannes must +assign names to the nodes of the concepts. He could rely on +\tikzname's automatic naming of the nodes in a tree, where the +children of a node named |root| are named |root-1|, |root-2|, +|root-3|, and so on. However, since Johannes is not sure about the +final order of the concepts in the tree, it seems better to explicitly +name all concepts of the tree in the following manner: + +\begin{codeexample}[code only] +\node [root concept] (Computational Complexity) {Computational Complexity} + child [computational problems] { node (Computational Problems) {Computational Problems} + child { node (Problem Measures) {Problem Measures} } + child { node (Problem Aspects) {Problem Aspects} } + child [faded] { node (Problem Domains) {Problem Domains} } + child { node (Key Problems) {Key Problems} } + } +... +\end{codeexample} + +The |annotation| style of the mind map library mainly sets up a +rectangular shape of appropriate size. Johannes configures the style +by defining |every annotation| appropriately. + +\begin{codeexample}[render instead={ +\begin{tikzpicture}[mindmap] + \clip (-5.25,-3) rectangle ++ (4,5); + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] (Computational Complexity) {Computational Complexity} % root + child [computational problems] { node (Computational Problems) {Computational Problems} + child { node (Problem Measures) {Problem Measures} } + child { node (Problem Aspects) {Problem Aspects} } + child [faded] { node (problem Domains) {Problem Domains} } + child { node (Key Problems) {Key Problems} } + } + child [computational models] { node (Computational Models) {Computational Models} + child { node (Turing Machines) {Turing Machines} } + child [faded] { node (Random-Access Machines) {Random-Access Machines} } + child { node (Circuits) {Circuits} } + child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } + child { node (Oracle Machines) {Oracle Machines} } + child { node (Programming in Logic) {Programming in Logic} } + } + child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} + child { node (Complexity Measures) {Complexity Measures} } + child { node (Classifying Complexity) {Classifying Complexity} } + child { node (Comparing Complexity) {Comparing Complexity} } + child [faded] { node (Describing Complexity) {Describing Complexity} } + } + child [solving problems] { node (Solving Problems) {Solving Problems} + child { node (Exact Algorithms) {Exact Algorithms} } + child { node (Randomization) {Randomization} } + child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } + child { node (Parallel Computation) {Parallel Computation} } + child { node (Partial Solutions) {Partial Solutions} } + child { node (Approximation) {Approximation} } + }; + \end{scope} + \begin{scope}[every annotation/.style={fill=black!40}] + \node [annotation, above] at (Computational Problems.north) { + Lecture 1: Computational Problems + \begin{itemize} + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + \end{itemize} + }; + \end{scope} +\end{tikzpicture}}] +\begin{tikzpicture}[mindmap] + \clip (-5,-5) rectangle ++ (4,5); + \begin{scope}[ + every node/.style={concept, circular drop shadow, ...}] % as before + \node [root concept] (Computational Complexity) ... % as before + \end{scope} + + \begin{scope}[every annotation/.style={fill=black!40}] + \node [annotation, above] at (Computational Problems.north) { + Lecture 1: Computational Problems + \begin{itemize} + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + \end{itemize} + }; + \end{scope} +\end{tikzpicture} +\end{codeexample} + +Well, that does not yet look quite perfect. The spacing or the +|{itemize}| is not really appropriate and the node is too +large. Johannes can configure these things ``by hand,'' but it seems +like a good idea to define a macro that will take care of these things +for him. The ``right'' way to do this is to define a |\lecture| macro +that takes a list of key-value pairs as argument and produces the +desired annotation. However, to keep things simple, Johannes' +|\lecture| macro simply takes a fixed number of arguments having the +following meaning: The first argument is the number of the lecture, +the second is the name of the lecture, the third are positioning +options like |above|, the fourth is the position where the node is +placed, the fifth is the list of items to be shown, and the sixth is a +date when the lecture will be held (this parameter is not yet needed, +we will, however, need it later on). + +\begin{codeexample}[code only] +\def\lecture#1#2#3#4#5#6{ + \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) { + Lecture #1: \textcolor{orange}{\textbf{#2}} + \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt + \parskip=0pt\labelwidth=8pt\leftmargin=8pt + \itemindent=0pt\labelsep=2pt} + #5 + \endlist + }; +} +\end{codeexample} +\def\lecture#1#2#3#4#5#6{ + \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) { + Lecture #1: \textcolor{orange}{\textbf{#2}} + \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt + \parskip=0pt\labelwidth=8pt\leftmargin=8pt + \itemindent=0pt\labelsep=2pt} + #5 + \endlist + }; +} + +\begin{codeexample}[render instead={ +\begin{tikzpicture}[mindmap,every annotation/.style={fill=white}] + \clip (-5.25,-3) rectangle ++ (4,5); + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] (Computational Complexity) {Computational Complexity} % root + child [computational problems] { node (Computational Problems) {Computational Problems} + child { node (Problem Measures) {Problem Measures} } + child { node (Problem Aspects) {Problem Aspects} } + child [faded] { node (problem Domains) {Problem Domains} } + child { node (Key Problems) {Key Problems} } + } + child [computational models] { node (Computational Models) {Computational Models} + child { node (Turing Machines) {Turing Machines} } + child [faded] { node (Random-Access Machines) {Random-Access Machines} } + child { node (Circuits) {Circuits} } + child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } + child { node (Oracle Machines) {Oracle Machines} } + child { node (Programming in Logic) {Programming in Logic} } + } + child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} + child { node (Complexity Measures) {Complexity Measures} } + child { node (Classifying Complexity) {Classifying Complexity} } + child { node (Comparing Complexity) {Comparing Complexity} } + child [faded] { node (Describing Complexity) {Describing Complexity} } + } + child [solving problems] { node (Solving Problems) {Solving Problems} + child { node (Exact Algorithms) {Exact Algorithms} } + child { node (Randomization) {Randomization} } + child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } + child { node (Parallel Computation) {Parallel Computation} } + child { node (Partial Solutions) {Partial Solutions} } + child { node (Approximation) {Approximation} } + }; + \end{scope} + \lecture{1}{Computational Problems}{above,xshift=-3mm}{Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} +\end{tikzpicture}}] +\begin{tikzpicture}[mindmap,every annotation/.style={fill=white}] + \clip (-5,-5) rectangle ++ (4,5); + \begin{scope}[ + every node/.style={concept, circular drop shadow, ... % as before + \node [root concept] (Computational Complexity) ... % as before + \end{scope} + + \lecture{1}{Computational Problems}{above,xshift=-3mm} + {Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} +\end{tikzpicture} +\end{codeexample} + +In the same fashion Johannes can now add the other lecture +annotations. Obviously, Johannes will have some trouble fitting +everything on a single A4-sized page, but by adjusting the spacing and +some experimentation he can quickly arrange all the annotations as needed. + + +\subsection{Adding the Background} + +Johannes has already used colors to organize his lecture map into four +regions, each having a different color. In order to emphasize these +regions even more strongly, he wishes to add a background coloring to +each of these regions. + +Adding these background colors turns out to be more tricky than +Johannes would have thought. At first sight, what he needs is some +sort of ``color wheel'' that is blue in the lower right direction and +then changes smoothly to orange in the upper right direction and then +to green in the upper left direction and so on. Unfortunately, there +is no easy way of creating a true such a color wheel shading (although +it can be done, in principle, but only at a very high cost, see +page~\pageref{shading-color-wheel} for an example). + +Johannes decides to do something a bit more basic: He creates four +large rectangles, one for each of the four quadrants around the +central concept, each colored with a light version of the +quadrant. Then, in order to ``smooth'' the change between adjacent +rectangles, he puts four shadings on top of them. + +Since these background rectangles should go ``behind'' everything +else, Johannes puts all his background stuff on the |background| +layer. + +In the following code, only the central concept is shown to save some +space: +\begin{codeexample}[] +\begin{tikzpicture}[ + mindmap, + concept color=black, + root concept/.append style={ + concept, + circular drop shadow, + fill=white, line width=1ex, + text=black, font=\large\scshape} + ] + + \clip (-1.5,-5) rectangle ++(4,10); + + \node [root concept] (Computational Complexity) {Computational Complexity}; + + \begin{pgfonlayer}{background} + \clip (-1.5,-5) rectangle ++(4,10); + + \colorlet{upperleft}{green!50!black!25} + \colorlet{upperright}{orange!25} + \colorlet{lowerleft}{red!25} + \colorlet{lowerright}{blue!25} + + % The large rectangles: + \fill [upperleft] (Computational Complexity) rectangle ++(-20,20); + \fill [upperright] (Computational Complexity) rectangle ++(20,20); + \fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20); + \fill [lowerright] (Computational Complexity) rectangle ++(20,-20); + + % The shadings: + \shade [left color=upperleft,right color=upperright] + ([xshift=-1cm]Computational Complexity) rectangle ++(2,20); + \shade [left color=lowerleft,right color=lowerright] + ([xshift=-1cm]Computational Complexity) rectangle ++(2,-20); + \shade [top color=upperleft,bottom color=lowerleft] + ([yshift=-1cm]Computational Complexity) rectangle ++(-20,2); + \shade [top color=upperright,bottom color=lowerright] + ([yshift=-1cm]Computational Complexity) rectangle ++(20,2); + \end{pgfonlayer} +\end{tikzpicture} +\end{codeexample} + + + +\subsection{Adding the Calendar} + +Johannes intends to plan his lecture rather carefully. In particular, +he already knows when each of his lectures will be held during the +course. Naturally, this does not mean that Johannes will slavishly +follow the plan and he might need longer for some subjects than he +anticipated, but nevertheless he has a detailed plan of when which +subject will be addressed. + +Johannes intends to share this plan with his students by adding a +calendar to the lecture map. In addition to serving as a reference +on which particular day a certain topic will be addressed, the +calendar is also useful so show the overall chronological order of the +course. + +In order to add a calendar to a \tikzname\ graphic, the |calendar| +library is most useful. The library provides the |\calendar| command, +which takes a large number of options and which can be configured in +many ways to produce just about any kind of calendar imaginable. For +Johannes' purposes, a simple |day list downward| will be a nice option +since it produces a list of days that go ``downward''. + +\begin{codeexample}[leave comments] +\tiny +\begin{tikzpicture} + \calendar [day list downward, + name=cal, + dates=2009-04-01 to 2009-04-14] + if (weekend) + [black!25]; +\end{tikzpicture} +\end{codeexample} + +Using the |name| option, we gave a name to the calendar, which will +allow us to reference the nodes that make up the individual days of +the calendar later on. For instance, the rectangular node containing the +|1| that represents April 1st, 2009, can be referenced as +|(cal-2009-04-01)|. The |dates| option is used to specify an +interval for which the calendar should be drawn. Johannes will need +several months in his calendar, but the above example only shows two +weeks to save some space. + +Note the |if (weekend)| construct. The |\calendar| command is followed +by options and then by |if|-statements. These |if|-statements are +checked for each day of the calendar and when a date passes this test, +the options or the code following the |if|-statement is executed. In +the above example, we make weekend days (Saturdays and Sundays, to be +precise) lighter than normal days. (Use your favorite calendar to +check that, indeed, April 5th, 2009, is a Sunday.) + +As mentioned above, Johannes can reference the nodes that are used to +typeset days. Recall that his |\lecture| macro already got passed a +date, which we did not use, yet. We can now use it to place the +lecture's title next to the date when the lecture will be held: + + +\begin{codeexample}[code only] +\def\lecture#1#2#3#4#5#6{ + % As before: + \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) { + Lecture #1: \textcolor{orange}{\textbf{#2}} + \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt + \parskip=0pt\labelwidth=8pt\leftmargin=8pt + \itemindent=0pt\labelsep=2pt} + #5 + \endlist + }; + % New: + \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; +} +\end{codeexample} +\def\lecture#1#2#3#4#5#6{ + \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; +} + +Johannes can now use this new |\lecture| command as follows (in the +example, only the new part of the definition is used): + +\begin{codeexample}[] +\tiny +\begin{tikzpicture} + \calendar [day list downward, + name=cal, + dates=2009-04-01 to 2009-04-14] + if (weekend) + [black!25]; + + % As before: + \lecture{1}{Computational Problems}{above,xshift=-3mm} + {Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} +\end{tikzpicture} +\end{codeexample} + + +As a final step, Johannes needs to add a few more options to the +calendar command: He uses the |month text| option to configure how the +text of a month is rendered (see Section~\ref{section-calender} for +details) and then typesets the month text at a special position at the +beginning of each month. + +\begin{codeexample}[leave comments] +\tiny +\begin{tikzpicture} + \calendar [day list downward, + month text=\%mt\ \%y0, + month yshift=3.5em, + name=cal, + dates=2009-04-01 to 2009-05-01] + if (weekend) + [black!25] + if (day of month=1) { + \node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext}; + }; + + \lecture{1}{Computational Problems}{above,xshift=-3mm} + {Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} + + \lecture{2}{Computational Models}{above,xshift=-3mm} + {Computational Models.north}{ + \item Knowledge of Turing machines + \item Being able to compare the computational power of different + models + }{2009-04-15} +\end{tikzpicture} +\end{codeexample} + + + +\subsection{The Complete Code} + +Putting it all together, Johannes gets the following code: + +First comes the definition of the |\lecture| command: + +\begin{codeexample}[code only] +\def\lecture#1#2#3#4#5#6{ + % As before: + \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm, fill=white] at (#4) { + Lecture #1: \textcolor{orange}{\textbf{#2}} + \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt + \parskip=0pt\labelwidth=8pt\leftmargin=8pt + \itemindent=0pt\labelsep=2pt} + #5 + \endlist + }; + % New: + \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; +} +\end{codeexample} + +This is followed by the main mindmap setup\dots + +\begin{codeexample}[code only] +\noindent +\begin{tikzpicture} + \begin{scope}[ + mindmap, + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] +\end{codeexample} +\dots and contents: +\begin{codeexample}[code only] + \node [root concept] (Computational Complexity) {Computational Complexity} % root + child [computational problems] { node [yshift=-1cm] (Computational Problems) {Computational Problems} + child { node (Problem Measures) {Problem Measures} } + child { node (Problem Aspects) {Problem Aspects} } + child [faded] { node (problem Domains) {Problem Domains} } + child { node (Key Problems) {Key Problems} } + } + child [computational models] { node [yshift=-1cm] (Computational Models) {Computational Models} + child { node (Turing Machines) {Turing Machines} } + child [faded] { node (Random-Access Machines) {Random-Access Machines} } + child { node (Circuits) {Circuits} } + child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } + child { node (Oracle Machines) {Oracle Machines} } + child { node (Programming in Logic) {Programming in Logic} } + } + child [measuring complexity] { node [yshift=1cm] (Measuring Complexity) {Measuring Complexity} + child { node (Complexity Measures) {Complexity Measures} } + child { node (Classifying Complexity) {Classifying Complexity} } + child { node (Comparing Complexity) {Comparing Complexity} } + child [faded] { node (Describing Complexity) {Describing Complexity} } + } + child [solving problems] { node [yshift=1cm] (Solving Problems) {Solving Problems} + child { node (Exact Algorithms) {Exact Algorithms} } + child { node (Randomization) {Randomization} } + child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } + child { node (Parallel Computation) {Parallel Computation} } + child { node (Partial Solutions) {Partial Solutions} } + child { node (Approximation) {Approximation} } + }; + \end{scope} +\end{codeexample} +Now comes the calendar code: +\begin{codeexample}[code only] + \tiny + \calendar [day list downward, + month text=\%mt\ \%y0, + month yshift=3.5em, + name=cal, + at={(-.5\textwidth-5mm,.5\textheight-1cm)}, + dates=2009-04-01 to 2009-06-last] + if (weekend) + [black!25] + if (day of month=1) { + \node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext}; + }; +\end{codeexample} +The lecture annotations: +\begin{codeexample}[code only] + \lecture{1}{Computational Problems}{above,xshift=-5mm,yshift=5mm}{Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} + + \lecture{2}{Computational Models}{above left} + {Computational Models.west}{ + \item Knowledge of Turing machines + \item Being able to compare the computational power of different + models + }{2009-04-15} +\end{codeexample} +Finally, the background: +\begin{codeexample}[code only] + \begin{pgfonlayer}{background} + \clip[xshift=-1cm] (-.5\textwidth,-.5\textheight) rectangle ++(\textwidth,\textheight); + + \colorlet{upperleft}{green!50!black!25} + \colorlet{upperright}{orange!25} + \colorlet{lowerleft}{red!25} + \colorlet{lowerright}{blue!25} + + % The large rectangles: + \fill [upperleft] (Computational Complexity) rectangle ++(-20,20); + \fill [upperright] (Computational Complexity) rectangle ++(20,20); + \fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20); + \fill [lowerright] (Computational Complexity) rectangle ++(20,-20); + + % The shadings: + \shade [left color=upperleft,right color=upperright] + ([xshift=-1cm]Computational Complexity) rectangle ++(2,20); + \shade [left color=lowerleft,right color=lowerright] + ([xshift=-1cm]Computational Complexity) rectangle ++(2,-20); + \shade [top color=upperleft,bottom color=lowerleft] + ([yshift=-1cm]Computational Complexity) rectangle ++(-20,2); + \shade [top color=upperright,bottom color=lowerright] + ([yshift=-1cm]Computational Complexity) rectangle ++(20,2); + \end{pgfonlayer} +\end{tikzpicture} +\end{codeexample} + +The next page shows the resulting lecture map in all its glory (it +would be somewhat more glorious, if there were more lecture +annotations, but you should get the idea). + +\def\lecture#1#2#3#4#5#6{ + % As before: + \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm, fill=white] at (#4) { + Lecture #1: \textcolor{orange}{\textbf{#2}} + \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt + \parskip=0pt\labelwidth=8pt\leftmargin=8pt + \itemindent=0pt\labelsep=2pt} + #5 + \endlist + }; + % New: + \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; +} + +\noindent +\begin{tikzpicture} + \begin{scope}[ + mindmap, + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] (Computational Complexity) {Computational Complexity} % root + child [computational problems] { node [yshift=-1cm] (Computational Problems) {Computational Problems} + child { node (Problem Measures) {Problem Measures} } + child { node (Problem Aspects) {Problem Aspects} } + child [faded] { node (problem Domains) {Problem Domains} } + child { node (Key Problems) {Key Problems} } + } + child [computational models] { node [yshift=-1cm] (Computational Models) {Computational Models} + child { node (Turing Machines) {Turing Machines} } + child [faded] { node (Random-Access Machines) {Random-Access Machines} } + child { node (Circuits) {Circuits} } + child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } + child { node (Oracle Machines) {Oracle Machines} } + child { node (Programming in Logic) {Programming in Logic} } + } + child [measuring complexity] { node [yshift=1cm] (Measuring Complexity) {Measuring Complexity} + child { node (Complexity Measures) {Complexity Measures} } + child { node (Classifying Complexity) {Classifying Complexity} } + child { node (Comparing Complexity) {Comparing Complexity} } + child [faded] { node (Describing Complexity) {Describing Complexity} } + } + child [solving problems] { node [yshift=1cm] (Solving Problems) {Solving Problems} + child { node (Exact Algorithms) {Exact Algorithms} } + child { node (Randomization) {Randomization} } + child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } + child { node (Parallel Computation) {Parallel Computation} } + child { node (Partial Solutions) {Partial Solutions} } + child { node (Approximation) {Approximation} } + }; + \end{scope} + + \tiny + \calendar [day list downward, + month text=\%mt\ \%y0, + month yshift=3.5em, + name=cal, + at={(-.5\textwidth-5mm,.5\textheight-1cm)}, + dates=2009-04-01 to 2009-06-last] + if (weekend) + [black!25] + if (day of month=1) { + \node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext}; + }; + + \lecture{1}{Computational Problems}{above,xshift=-5mm,yshift=5mm}{Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} + + \lecture{2}{Computational Models}{above left} + {Computational Models.west}{ + \item Knowledge of Turing machines + \item Being able to compare the computational power of different + models + }{2009-04-15} + + \begin{pgfonlayer}{background} + \clip[xshift=-1cm] (-.5\textwidth,-.5\textheight) rectangle ++(\textwidth,\textheight); + + \colorlet{upperleft}{green!50!black!25} + \colorlet{upperright}{orange!25} + \colorlet{lowerleft}{red!25} + \colorlet{lowerright}{blue!25} + + % The large rectangles: + \fill [upperleft] (Computational Complexity) rectangle ++(-20,20); + \fill [upperright] (Computational Complexity) rectangle ++(20,20); + \fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20); + \fill [lowerright] (Computational Complexity) rectangle ++(20,-20); + + % The shadings: + \shade [left color=upperleft,right color=upperright] + ([xshift=-1cm]Computational Complexity) rectangle ++(2,20); + \shade [left color=lowerleft,right color=lowerright] + ([xshift=-1cm]Computational Complexity) rectangle ++(2,-20); + \shade [top color=upperleft,bottom color=lowerleft] + ([yshift=-1cm]Computational Complexity) rectangle ++(-20,2); + \shade [top color=upperright,bottom color=lowerright] + ([yshift=-1cm]Computational Complexity) rectangle ++(20,2); + \end{pgfonlayer} +\end{tikzpicture} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex index 0f5e1a2d185..f9c5eb8de53 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex @@ -1,4 +1,4 @@ -% Copyright 2006 by Till Tantau +% Copyright 2006 by Tilo Tantau % % This file may be distributed and/or modified % @@ -14,7 +14,7 @@ In this second tutorial we explore the node mechanism of Hagen must give a talk tomorrow about his favorite formalism for distributed systems: Petri nets! Hagen used to give his talks using a -blackboard and everyone seemed to be perfectly concent with +blackboard and everyone seemed to be perfectly concent with % TODOsp: concent --> consent? this. Unfortunately, his audience has been spoiled recently with fancy projector-based presentations and there seems to be a certain amount of peer pressure that this Petri nets should also be drawn using a @@ -43,7 +43,7 @@ capacities. The graphic should look like this, ideally: \node [place] (s) [below=of c1,label=above:$s\le 3$] {}; \node [place] (c2) [below=of s] {}; \node [place,tokens=1] (w2) [below=of c2] {}; - + \node [transition] (e1) [left=of c1] {} edge [pre,bend left] (w1) edge [post,bend right] (s) @@ -53,7 +53,7 @@ capacities. The graphic should look like this, ideally: edge [pre,bend right] (w2) edge [post,bend left] (s) edge [post] (c2); - + \node [transition] (l1) [right=of c1] {} edge [pre] (c1) edge [pre,bend left] (s) @@ -64,7 +64,7 @@ capacities. The graphic should look like this, ideally: edge [pre,bend right] (s) edge [post,bend left] node {2} (w2); \end{scope} - + \begin{scope}[xshift=6cm] % Second net \node [place,tokens=1] @@ -76,7 +76,7 @@ capacities. The graphic should look like this, ideally: \node [place] (c2') [below=of s1',xshift=5mm] {}; \node [place,tokens=1] (w2') [below=of c2'] {}; - + \node [transition] (e1') [left=of c1'] {} edge [pre,bend left] (w1') edge [post] (s1') @@ -88,7 +88,7 @@ capacities. The graphic should look like this, ideally: edge [post] (s1') edge [pre] (s2') edge [post] (c2'); - + \node [transition] (l1') [right=of c1'] {} edge [pre] (c1') edge [pre] (s1') @@ -110,7 +110,7 @@ capacities. The graphic should look like this, ideally: \draw [shorten >=1mm,-to,thick,decorate,decoration={snake,amplitude=.4mm,segment length=2mm,pre=moveto,pre length=1mm,post length=2mm}] (r1) -- (r2) - node [above=1mm,midway,text width=3cm,text centered] + node [above=1mm,midway,text width=3cm,align=center] {replacement of the \textcolor{red}{capacity} by \textcolor{red}{two places}}; \end{tikzpicture} @@ -131,7 +131,7 @@ special arrow tip used in the graphic, the |decoration.pathmorphing| library for the ``snaking line'' in the middle, the background library for the two rectangular areas that are behind the two main parts of the picture, the |fit| library to easily compute the sizes of -these ractangles, and the |placements| library for placing nodes +these rectangles, and the |positioning| library for placing nodes relative to other nodes. @@ -143,7 +143,7 @@ When using \LaTeX\ use: \documentclass{article} % say \usepackage{tikz} -\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,placments,fit} +\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri} \begin{document} \begin{tikzpicture} @@ -160,7 +160,7 @@ When using plain \TeX\ use: \begin{codeexample}[code only] %% Plain TeX file \input tikz.tex -\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,placments,fit} +\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri} \baselineskip=12pt \hsize=6.3truein \vsize=8.7truein @@ -173,17 +173,19 @@ When using plain \TeX\ use: \subsubsection{Setting up the Environment in Con\TeX t} -When using Con\TeX\ use: +When using Con\TeX\ use\footnote{Note that \pgfname/\tikzname{} is not + supported by recent Con\TeX t versions (like mark IV, the + Lua\TeX-aware part of Con\TeX t).}: \begin{codeexample}[code only] %% ConTeXt file \usemodule[tikz] -\usetikzlibrary[arrows,decorations.pathmorphing,backgrounds,placments,fit] +\usetikzlibrary[arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri] \starttext \starttikzpicture \draw (0,0) -- (1,1); \stoptikzpicture -\startext +\stoptext \end{codeexample} @@ -218,18 +220,18 @@ a node can get a \emph{name} for later reference. In Hagen's picture we will use nodes for the places and for the transitions of the Petri net (the places are the circles, the transitions are the rectangles). Let us start with the upper half of -the left Petir net. In this upper half we have three places and two +the left Petri net. In this upper half we have three places and two transitions. Instead of drawing three circles and two rectangles, we use three nodes of shape |circle| and two nodes of shape |rectangle|. \begin{codeexample}[] \begin{tikzpicture} - \path ( 0,2) node [shape=circle,draw] {} - ( 0,1) node [shape=circle,draw] {} - ( 0,0) node [shape=circle,draw] {} + \path ( 0,2) node [shape=circle,draw] {} + ( 0,1) node [shape=circle,draw] {} + ( 0,0) node [shape=circle,draw] {} ( 1,1) node [shape=rectangle,draw] {} - (-1,1) node [shape=rectangle,draw] {}; + (-1,1) node [shape=rectangle,draw] {}; \end{tikzpicture} \end{codeexample} @@ -256,7 +258,7 @@ So, the code |(0,2) node [shape=circle,draw] {}| means the following: temporarily suspend the construction of the main path while the node is build. This node will be a |circle| around an empty text. This circle is to be |draw|n, but not filled or otherwise used. Once this -whole node is constructed, it is saved until after the +whole node is constructed, it is saved until after the main path is finished. Then, it is drawn.'' Then following |(0,1) node [shape=circle,draw] {}| then has the following effect: ``Continue the main path with a move-to to |(0,1)|. Then construct a @@ -280,11 +282,11 @@ last coordinate. Hagen can then write the following: \begin{codeexample}[] \begin{tikzpicture} - \path node at ( 0,2) [shape=circle,draw] {} - node at ( 0,1) [shape=circle,draw] {} - node at ( 0,0) [shape=circle,draw] {} + \path node at ( 0,2) [shape=circle,draw] {} + node at ( 0,1) [shape=circle,draw] {} + node at ( 0,0) [shape=circle,draw] {} node at ( 1,1) [shape=rectangle,draw] {} - node at (-1,1) [shape=rectangle,draw] {}; + node at (-1,1) [shape=rectangle,draw] {}; \end{tikzpicture} \end{codeexample} @@ -296,15 +298,15 @@ be improved further: The |\node| command is an abbreviation for \begin{codeexample}[] \begin{tikzpicture} \node at ( 0,2) [circle,draw] {}; - \node at ( 0,1) [circle,draw] {}; - \node at ( 0,0) [circle,draw] {}; + \node at ( 0,1) [circle,draw] {}; + \node at ( 0,0) [circle,draw] {}; \node at ( 1,1) [rectangle,draw] {}; - \node at (-1,1) [rectangle,draw] {}; + \node at (-1,1) [rectangle,draw] {}; \end{tikzpicture} \end{codeexample} Hagen likes this syntax much better than the previous one. Note that -Hagen has also omitted the |shape=| since, like |color=|, \tikzname\ +Hagen has also omitted the |shape=| since, like |color=|, \tikzname\ allows you to omit the |shape=| if there is no confusion. @@ -318,10 +320,10 @@ different colors, resulting in the following code: \begin{codeexample}[] \begin{tikzpicture}[thick] \node at ( 0,2) [circle,draw=blue!50,fill=blue!20] {}; - \node at ( 0,1) [circle,draw=blue!50,fill=blue!20] {}; - \node at ( 0,0) [circle,draw=blue!50,fill=blue!20] {}; + \node at ( 0,1) [circle,draw=blue!50,fill=blue!20] {}; + \node at ( 0,0) [circle,draw=blue!50,fill=blue!20] {}; \node at ( 1,1) [rectangle,draw=black!50,fill=black!20] {}; - \node at (-1,1) [rectangle,draw=black!50,fill=black!20] {}; + \node at (-1,1) [rectangle,draw=black!50,fill=black!20] {}; \end{tikzpicture} \end{codeexample} @@ -338,10 +340,10 @@ places and another style for transitions: [place/.style={circle,draw=blue!50,fill=blue!20,thick}, transition/.style={rectangle,draw=black!50,fill=black!20,thick}] \node at ( 0,2) [place] {}; - \node at ( 0,1) [place] {}; - \node at ( 0,0) [place] {}; + \node at ( 0,1) [place] {}; + \node at ( 0,0) [place] {}; \node at ( 1,1) [transition] {}; - \node at (-1,1) [transition] {}; + \node at (-1,1) [transition] {}; \end{tikzpicture} \end{codeexample} @@ -361,10 +363,10 @@ adds some space around the text. The amount is set using the option place/.style={circle,draw=blue!50,fill=blue!20,thick}, transition/.style={rectangle,draw=black!50,fill=black!20,thick}] \node at ( 0,2) [place] {}; - \node at ( 0,1) [place] {}; - \node at ( 0,0) [place] {}; + \node at ( 0,1) [place] {}; + \node at ( 0,0) [place] {}; \node at ( 1,1) [transition] {}; - \node at (-1,1) [transition] {}; + \node at (-1,1) [transition] {}; \end{tikzpicture} \end{codeexample} @@ -376,7 +378,7 @@ a longer text, it will be larger, but if the text is empty, then the node will have |minimum size|. This option is also useful to ensure that several nodes containing different amounts of text have the same size. The options |minimum height| and |minimum width| allow you to -specify the minimum height and width independently. +specify the minimum height and width independently. So, what Hagen needs to do is to provide |minimum size| for the nodes. To be on the safe side, he also sets |inner sep=0pt|. This @@ -389,12 +391,12 @@ the automatically added space. [place/.style={circle,draw=blue!50,fill=blue!20,thick, inner sep=0pt,minimum size=6mm}, transition/.style={rectangle,draw=black!50,fill=black!20,thick, - inner sep=0pt,minimum size=4mm}] + inner sep=0pt,minimum size=4mm}] \node at ( 0,2) [place] {}; - \node at ( 0,1) [place] {}; - \node at ( 0,0) [place] {}; + \node at ( 0,1) [place] {}; + \node at ( 0,0) [place] {}; \node at ( 1,1) [transition] {}; - \node at (-1,1) [transition] {}; + \node at (-1,1) [transition] {}; \end{tikzpicture} \end{codeexample} @@ -426,10 +428,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, % ... setup styles \begin{tikzpicture} \node (waiting 1) at ( 0,2) [place] {}; - \node (critical 1) at ( 0,1) [place] {}; - \node (semaphore) at ( 0,0) [place] {}; + \node (critical 1) at ( 0,1) [place] {}; + \node (semaphore) at ( 0,0) [place] {}; \node (leave critical) at ( 1,1) [transition] {}; - \node (enter critical) at (-1,1) [transition] {}; + \node (enter critical) at (-1,1) [transition] {}; \end{tikzpicture} \end{codeexample} } @@ -437,7 +439,7 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, Hagen is pleased to note that the names help in understanding the code. Names for nodes can be pretty arbitrary, but they should not contain commas, periods, parentheses, colons, and some other special -characters. However, they can contain underscores and hyphens. +characters. However, they can contain underscores and hyphens. The syntax for the |node| operation is quite liberal with respect to the order in which node names, the |at| specifier, and the options @@ -453,10 +455,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting 1) at ( 0,2) {}; - \node[place] (critical 1) at ( 0,1) {}; - \node[place] (semaphore) at ( 0,0) {}; + \node[place] (critical 1) at ( 0,1) {}; + \node[place] (semaphore) at ( 0,0) {}; \node[transition] (leave critical) at ( 1,1) {}; - \node[transition] (enter critical) at (-1,1) {}; + \node[transition] (enter critical) at (-1,1) {}; \end{tikzpicture} \end{codeexample} } @@ -481,19 +483,19 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {}; - \node[transition] (enter critical) [left=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; \end{tikzpicture} \end{codeexample} } -With the |replacements| library loaded, when an option like |below| -is followed by |of|, then the position of the node is shifted +With the |positioning| library loaded, when an option like |below| +is followed by |of|, then the position of the node is shifted in such a manner that it is placed at the distance |node distance| in the specified direction of the given direction. The |node distance| is -either the distance between the centers of the nodes (when the +either the distance between the centers of the nodes (when the |on grid| option is set to true) or the distance between the borders (when the |on grid| option is set to false, which is the default). @@ -519,12 +521,12 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {}; - \node[transition] (enter critical) [left=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; - \node [red,above] at (semaphore.north) {$s\le 3$}; + \node [red,above] at (semaphore.north) {$s\le 3$}; \end{tikzpicture} \end{codeexample} } @@ -538,7 +540,7 @@ This is a general approach that will ``always work.'' |label=above:$s\le 3$|. This option is interpreted as follows: We want a node above the |semaphore| node and this node should read ``$s \le 3$.'' Instead of |above| we could also use things like - |below left| before the colon or a number like |60|. + |below left| before the colon or a number like |60|. { \tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, inner sep=0pt,minimum size=6mm}, @@ -547,11 +549,11 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; + \node[place] (critical) [below=of waiting] {}; \node[place] (semaphore) [below=of critical, - label=above:$s\le3$] {}; + label=above:$s\le3$] {}; \node[transition] (leave critical) [right=of critical] {}; - \node[transition] (enter critical) [left=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; \end{tikzpicture} \end{codeexample} } @@ -576,13 +578,13 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, transition/.style={rectangle,draw=black!50,fill=black!20,thick, inner sep=0pt,minimum size=4mm}} \begin{codeexample}[] -\begin{tikzpicture}[every label/.style={red}] +\begin{tikzpicture}[every label/.style={red}] \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; + \node[place] (critical) [below=of waiting] {}; \node[place] (semaphore) [below=of critical, - label=above:$s\le3$] {}; + label=above:$s\le3$] {}; \node[transition] (leave critical) [right=of critical] {}; - \node[transition] (enter critical) [left=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; \end{tikzpicture} \end{codeexample} } @@ -611,10 +613,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {}; - \node[transition] (enter critical) [left=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; \draw [->] (critical.west) -- (enter critical.east); \end{tikzpicture} \end{codeexample} @@ -631,10 +633,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {}; - \node[transition] (enter critical) [left=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; \draw [->] (enter critical.east) -- (critical.west); \draw [->] (waiting.west) .. controls +(left:5mm) and +(up:5mm) .. (enter critical.north); @@ -657,10 +659,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {}; - \node[transition] (enter critical) [left=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; \draw [->] (enter critical) -- (critical); \draw [->] (waiting) .. controls +(left:8mm) and +(up:8mm) .. (enter critical); @@ -682,7 +684,7 @@ anchor by hand. Hagen would now like to simplify the curve operation somehow. It turns out that this can be accomplished using a special path operation: the |to| operation. This operation takes many options (you can even define -new ones yourself). One pair of option is useful for Hagen: The pair +new ones yourself). One pair of options is useful for Hagen: The pair |in| and |out|. These options take angles at which a curve should leave or reach the start or target coordinates. Without these options, a straight line is drawn: @@ -695,10 +697,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {}; - \node[transition] (enter critical) [left=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; \draw [->] (enter critical) to (critical); \draw [->] (waiting) to [out=180,in=90] (enter critical); \end{tikzpicture} @@ -718,10 +720,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {}; - \node[transition] (enter critical) [left=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; \draw [->] (enter critical) to (critical); \draw [->] (waiting) to [bend right=45] (enter critical); \draw [->] (enter critical) to [bend right=45] (semaphore); @@ -734,10 +736,10 @@ edges: Using the |edge| path operation. This operation is very similar to the |to| operation, but there is one important difference: Like a node the edge generated by the |edge| operation is not part of the main path, but is added only later. This may not seem very important, -but is has some nice consequences. For example, every edge can have +but it has some nice consequences. For example, every edge can have its own arrow tips and its own color and so one and, still, all the edges can be given on the same path. This allows Hagen to write the -following: +following: { @@ -748,8 +750,8 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, \begin{codeexample}[] \begin{tikzpicture} \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {}; \node[transition] (enter critical) [left=of critical] {} edge [->] (critical) @@ -779,8 +781,8 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick, post/.style={->,shorten >=1pt,>=stealth',semithick}] \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {} edge [pre] (critical) @@ -830,21 +832,21 @@ each |to| operation. For Hagen that |auto| option is not really necessary since the two ``2'' labels could also easily be placed ``by hand.'' However, in a complicated plot with numerous edges automatic placement can be a -blessing. +blessing. { \tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, inner sep=0pt,minimum size=6mm}, transition/.style={rectangle,draw=black!50,fill=black!20,thick, inner sep=0pt,minimum size=4mm}, -pre/.style={<-,shorten <=1pt,>=stealth',semithick}, -post/.style={->,shorten >=1pt,>=stealth',semithick}} +pre/.style={<-,shorten <=1pt,>=stealth',semithick}, +post/.style={->,shorten >=1pt,>=stealth',semithick}} \begin{codeexample}[] % Styles as before \begin{tikzpicture}[bend angle=45] \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {} edge [pre] (critical) @@ -866,7 +868,7 @@ With the node mechanism Hagen can now easily create the two Petri nets. What he is unsure of is how he can create the snaked line between the nets. -For this he can use a \emph{decoration}. +For this he can use a \emph{decoration}. To draw the snake, Hagen only needs to set the two options |decoration=snake| and |decorate| on the path. This causes all lines of the path to be replaced by @@ -883,7 +885,7 @@ Well, that does not look quite right, yet. The problem is that the snake happens to end exactly at the position where the arrow begins. Fortunately, there is an option that helps here. Also, the snake should be a bit smaller, which can be influenced by even more -options. +options. \begin{codeexample}[] \begin{tikzpicture} @@ -894,17 +896,34 @@ options. \end{codeexample} Now Hagen needs to add the text above the snake. This text is a bit -challenging since it is a multi-line text. To typeset such text, Hagen -needs to specify a width for the text and he needs to specify that the -text should be centered. +challenging since it is a multi-line text. Hagen has two options for +this: First, he can specify an |align=center| and then use the |\\| +command to enforce the line breaks at the desired positions. +\begin{codeexample}[] +\begin{tikzpicture} + \draw [->,decorate, + decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}] + (0,0) -- (3,0) + node [above,align=center,midway] + { + replacement of\\ + the \textcolor{red}{capacity}\\ + by \textcolor{red}{two places} + }; +\end{tikzpicture} +\end{codeexample} + +Instead of specifying the line breaks ``by hand,'' Hagen can also +specify a width for the text and let \TeX\ perform the line breaking +for him: \begin{codeexample}[] \begin{tikzpicture} \draw [->,decorate, decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}] (0,0) -- (3,0) - node [above,text width=3cm,text centered,midway] + node [above,text width=3cm,align=center,midway] { replacement of the \textcolor{red}{capacity} by \textcolor{red}{two places} @@ -945,14 +964,14 @@ nodes and coordinates given as parameters to the |fit| option. inner sep=0pt,minimum size=6mm}, transition/.style={rectangle,draw=black!50,fill=black!20,thick, inner sep=0pt,minimum size=4mm}, -pre/.style={<-,shorten <=1pt,>=stealth',semithick}, +pre/.style={<-,shorten <=1pt,>=stealth',semithick}, post/.style={->,shorten >=1pt,>=stealth',semithick}} \begin{codeexample}[] % Styles as before \begin{tikzpicture}[bend angle=45] \node[place] (waiting) {}; - \node[place] (critical) [below=of waiting] {}; - \node[place] (semaphore) [below=of critical] {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; \node[transition] (leave critical) [right=of critical] {} edge [pre] (critical) @@ -964,7 +983,7 @@ post/.style={->,shorten >=1pt,>=stealth',semithick}} edge [post,bend right] (semaphore); \begin{pgfonlayer}{background} - \node [fill=black!30,fit=(waiting) (critical) (semaphore) + \node [fill=black!30,fit=(waiting) (critical) (semaphore) (leave critical) (enter critical)] {}; \end{pgfonlayer} \end{tikzpicture} @@ -1004,13 +1023,14 @@ Now comes the code for the nets: red place/.style={place,draw=red!75,fill=red!20}, every label/.style={red}, every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}} +\tikzexternaldisable \begin{codeexample}[pre=\begin{tikzpicture},post=\end{tikzpicture}] \node [place,tokens=1] (w1) {}; \node [place] (c1) [below=of w1] {}; \node [place] (s) [below=of c1,label=above:$s\le 3$] {}; \node [place] (c2) [below=of s] {}; \node [place,tokens=1] (w2) [below=of c2] {}; - + \node [transition] (e1) [left=of c1] {} edge [pre,bend left] (w1) edge [post,bend right] (s) @@ -1037,8 +1057,9 @@ every transition/.style={thick,draw=black!75,fill=black!20}, red place/.style= {place,draw=red!75,fill=red!20}, every label/.style={red}, every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}} +\tikzexternaldisable \begin{codeexample}[pre=\begin{tikzpicture},post=\end{tikzpicture}] - \begin{scope}[xshift=6cm] + \begin{scope}[xshift=6cm] \node [place,tokens=1] (w1') {}; \node [place] (c1') [below=of w1'] {}; \node [red place] (s1') [below=of c1',xshift=-5mm] @@ -1047,7 +1068,7 @@ every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto} [label=right:$\bar s$] {}; \node [place] (c2') [below=of s1',xshift=5mm] {}; \node [place,tokens=1] (w2') [below=of c2'] {}; - + \node [transition] (e1') [left=of c1'] {} edge [pre,bend left] (w1') edge [post] (s1') @@ -1083,7 +1104,7 @@ The code for the background and the snake is the following: \draw [shorten >=1mm,-to,thick,decorate, decoration={snake,amplitude=.4mm,segment length=2mm, pre=moveto,pre length=1mm,post length=2mm}] - (r1) -- (r2) node [above=1mm,midway,text width=3cm,text centered] + (r1) -- (r2) node [above=1mm,midway,text width=3cm,align=center] {replacement of the \textcolor{red}{capacity} by \textcolor{red}{two places}}; \end{tikzpicture} \end{codeexample} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex.orig b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex.orig new file mode 100644 index 00000000000..99ac79cd642 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex.orig @@ -0,0 +1,1108 @@ +% Copyright 2006 by Tilo Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\section{Tutorial: A Petri-Net for Hagen} + +In this second tutorial we explore the node mechanism of +\tikzname\ and \pgfname. + +Hagen must give a talk tomorrow about his favorite formalism for +distributed systems: Petri nets! Hagen used to give his talks using a +blackboard and everyone seemed to be perfectly concent with % TODOsp: concent --> consent? +this. Unfortunately, his audience has been spoiled recently with fancy +projector-based presentations and there seems to be a certain amount +of peer pressure that this Petri nets should also be drawn using a +graphic program. One of the professors at his institutes recommends +\tikzname\ for this and Hagen decides to give it a try. + + +\subsection{Problem Statement} + +For his talk, Hagen wishes to create a graphic that demonstrates how a +net with place capacities can be simulated by a net without +capacities. The graphic should look like this, ideally: + +\begin{quote} +\begin{tikzpicture} + [node distance=1.3cm,>=stealth',bend angle=45,auto, + place/.style={circle,thick,draw=blue!75,fill=blue!20,minimum size=6mm}, + red place/.style={place,draw=red!75,fill=red!20}, + transition/.style={rectangle,thick,draw=black!75,fill=black!20,minimum size=4mm}, + every label/.style={red},on grid] + + \begin{scope} + % First net + \node [place,tokens=1] (w1) {}; + \node [place] (c1) [below=of w1] {}; + \node [place] (s) [below=of c1,label=above:$s\le 3$] {}; + \node [place] (c2) [below=of s] {}; + \node [place,tokens=1] (w2) [below=of c2] {}; + + \node [transition] (e1) [left=of c1] {} + edge [pre,bend left] (w1) + edge [post,bend right] (s) + edge [post] (c1); + + \node [transition] (e2) [left=of c2] {} + edge [pre,bend right] (w2) + edge [post,bend left] (s) + edge [post] (c2); + + \node [transition] (l1) [right=of c1] {} + edge [pre] (c1) + edge [pre,bend left] (s) + edge [post,bend right] node[swap] {2} (w1); + + \node [transition] (l2) [right=of c2] {} + edge [pre] (c2) + edge [pre,bend right] (s) + edge [post,bend left] node {2} (w2); + \end{scope} + + \begin{scope}[xshift=6cm] + % Second net + \node [place,tokens=1] + (w1') {}; + \node [place] (c1') [below=of w1'] {}; + \node [red place] (s1') [below=of c1',xshift=-5mm,label=left:$s$] {}; + \node [red place,tokens=3] + (s2') [below=of c1',xshift=5mm,label=right:$\bar s$] {}; + \node [place] (c2') [below=of s1',xshift=5mm] {}; + \node [place,tokens=1] + (w2') [below=of c2'] {}; + + \node [transition] (e1') [left=of c1'] {} + edge [pre,bend left] (w1') + edge [post] (s1') + edge [pre] (s2') + edge [post] (c1'); + + \node [transition] (e2') [left=of c2'] {} + edge [pre,bend right] (w2') + edge [post] (s1') + edge [pre] (s2') + edge [post] (c2'); + + \node [transition] (l1') [right=of c1'] {} + edge [pre] (c1') + edge [pre] (s1') + edge [post] (s2') + edge [post,bend right] node[swap] {2} (w1'); + + \node [transition] (l2') [right=of c2'] {} + edge [pre] (c2') + edge [pre] (s1') + edge [post] (s2') + edge [post,bend left] node {2} (w2'); + \end{scope} + + \begin{pgfonlayer}{background} + \node (r1) [fill=black!10,rounded corners,fit=(w1)(w2)(e1)(e2)(l1)(l2)] {}; + \node (r2) [fill=black!10,rounded corners,fit=(w1')(w2')(e1')(e2')(l1')(l2')] {}; + \end{pgfonlayer} + + \draw [shorten >=1mm,-to,thick,decorate,decoration={snake,amplitude=.4mm,segment + length=2mm,pre=moveto,pre length=1mm,post length=2mm}] + (r1) -- (r2) + node [above=1mm,midway,text width=3cm,align=center] + {replacement of the \textcolor{red}{capacity} by \textcolor{red}{two places}}; + +\end{tikzpicture} +\end{quote} + + +\subsection{Setting up the Environment} + +For the picture Hagen will need to load the \tikzname\ package as did +Karl in the previous tutorial. However, Hagen will also need to load +some additional \emph{library packages} that Karl did not need. These +library packages contain additional definitions like extra arrow tips +that are typically not needed in a picture and that need to be +loaded explicitly. + +Hagen will need to load several libraries: The |arrows| library for the +special arrow tip used in the graphic, the |decoration.pathmorphing| +library for the ``snaking line'' in the middle, the background +library for the two rectangular areas that are behind the two main +parts of the picture, the |fit| library to easily compute the sizes of +these rectangles, and the |positioning| library for placing nodes +relative to other nodes. + + +\subsubsection{Setting up the Environment in \LaTeX} + +When using \LaTeX\ use: + +\begin{codeexample}[code only] +\documentclass{article} % say + +\usepackage{tikz} +\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri} + +\begin{document} +\begin{tikzpicture} + \draw (0,0) -- (1,1); +\end{tikzpicture} +\end{document} +\end{codeexample} + + +\subsubsection{Setting up the Environment in Plain \TeX} + +When using plain \TeX\ use: + +\begin{codeexample}[code only] +%% Plain TeX file +\input tikz.tex +\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri} +\baselineskip=12pt +\hsize=6.3truein +\vsize=8.7truein +\tikzpicture + \draw (0,0) -- (1,1); +\endtikzpicture +\bye +\end{codeexample} + + +\subsubsection{Setting up the Environment in Con\TeX t} + +When using Con\TeX\ use: +\begin{codeexample}[code only] +%% ConTeXt file +\usemodule[tikz] +\usetikzlibrary[arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri] + +\starttext + \starttikzpicture + \draw (0,0) -- (1,1); + \stoptikzpicture +\stoptext +\end{codeexample} + + + +\subsection{Introduction to Nodes} + +In principle, we already know how to create the graphics that Hagen +desires (except perhaps for the snaked line, we will come to that): We +start with big light gray rectangle and then add lots of circles and +small rectangle, plus some arrows. + +However, this approach has numerous disadvantages: First, it is hard +to change anything at a later stage. For example, if we decide to add +more places to the Petri nets (the circles are called places in Petri +net theory), all of the coordinates change and we need to recalculate +everything. Second, it is hard to read the code for the Petri net as +it just a long and complicated list of coordinates and drawing +commands -- the underlying structure of the Petri net is lost. + +Fortunately, \tikzname\ offers a powerful mechanism for avoiding the +above problems: nodes. We already came across nodes in the previous +tutorial, where we used them to add labels to Karl's graphic. In the +present tutorial we will see that nodes are much more powerful. + +A node is a small part of a picture. When a node is created, you +provide a position where the node should be drawn and a +\emph{shape}. A node of shape |circle| will be drawn as a circle, a +node of shape |rectangle| as a rectangle, and so on. A node may also +contain same text, which is why Karl used nodes to show text. Finally, +a node can get a \emph{name} for later reference. + +In Hagen's picture we will use nodes for the places and for the +transitions of the Petri net (the places are the circles, the +transitions are the rectangles). Let us start with the upper half of +the left Petri net. In this upper half we have three places and two +transitions. Instead of drawing three circles and two rectangles, we +use three nodes of shape |circle| and two nodes of shape +|rectangle|. + +\begin{codeexample}[] +\begin{tikzpicture} + \path ( 0,2) node [shape=circle,draw] {} + ( 0,1) node [shape=circle,draw] {} + ( 0,0) node [shape=circle,draw] {} + ( 1,1) node [shape=rectangle,draw] {} + (-1,1) node [shape=rectangle,draw] {}; +\end{tikzpicture} +\end{codeexample} + +Hagen notes that this does not quite look like the final picture, but +it seems like a good first step. + +Let us have a more detailed look at the code. The whole picture +consists of a single path. Ignoring the |node| operations there is not +much going on in this path: It is just a sequence of coordinates with +nothing ``happening'' between them. Indeed, even if something were to +happen like a line-to or a curve-to, the |\path| command would not +``do'' anything with the resulting path. So, all the magic must be in +the |node| commands. + +In the previous tutorial we learned that a |node| will add a piece of +text at the last coordinate. Thus, each of the five nodes is added at +a different position. In the above code, this text is empty +(because of the empty |{}|). So, why do we see anything at all? The +answer is the |draw| option for the |node| operation: It causes the +``shape around the text'' to be drawn. + +So, the code |(0,2) node [shape=circle,draw] {}| means the following: +``In the main path, add a move-to to the coordinate |(0,2)|. Then, +temporarily suspend the construction of the main path while the node +is build. This node will be a |circle| around an empty text. This +circle is to be |draw|n, but not filled or otherwise used. Once this +whole node is constructed, it is saved until after the +main path is finished. Then, it is drawn.'' Then following +|(0,1) node [shape=circle,draw] {}| then has the following effect: +``Continue the main path with a move-to to |(0,1)|. Then construct a +node at this position also. This node is also shown after the main +path is finished.'' And so on. + + + +\subsection{Placing Nodes Using the At Syntax} + +Hagen now understands how the |node| operation adds nodes to the path, +but it seems a bit silly to create a path using the |\path| operation, +consisting of numerous superfluous move-to operations, only to place +nodes. He is pleased to learn that there are ways to add nodes in a +more sensible manner. + +First, the |node| operation allows one to add +|at (|\meta{coordinate}|)| in order to directly specify where the node +should be placed, sidestepping the rule that nodes are placed on the +last coordinate. Hagen can then write the following: + +\begin{codeexample}[] +\begin{tikzpicture} + \path node at ( 0,2) [shape=circle,draw] {} + node at ( 0,1) [shape=circle,draw] {} + node at ( 0,0) [shape=circle,draw] {} + node at ( 1,1) [shape=rectangle,draw] {} + node at (-1,1) [shape=rectangle,draw] {}; +\end{tikzpicture} +\end{codeexample} + +Now Hagen is still left with a single empty path, but at least the +path no longer contains strange move-tos. It turns out that this can +be improved further: The |\node| command is an abbreviation for +|\path node|, which allows Hagen to write: + +\begin{codeexample}[] +\begin{tikzpicture} + \node at ( 0,2) [circle,draw] {}; + \node at ( 0,1) [circle,draw] {}; + \node at ( 0,0) [circle,draw] {}; + \node at ( 1,1) [rectangle,draw] {}; + \node at (-1,1) [rectangle,draw] {}; +\end{tikzpicture} +\end{codeexample} + +Hagen likes this syntax much better than the previous one. Note that +Hagen has also omitted the |shape=| since, like |color=|, \tikzname\ +allows you to omit the |shape=| if there is no confusion. + + + +\subsection{Using Styles} + +Feeling adventurous, Hagen tries to make the nodes look nicer. In the +final picture, the circles and rectangle should be filled with +different colors, resulting in the following code: + +\begin{codeexample}[] +\begin{tikzpicture}[thick] + \node at ( 0,2) [circle,draw=blue!50,fill=blue!20] {}; + \node at ( 0,1) [circle,draw=blue!50,fill=blue!20] {}; + \node at ( 0,0) [circle,draw=blue!50,fill=blue!20] {}; + \node at ( 1,1) [rectangle,draw=black!50,fill=black!20] {}; + \node at (-1,1) [rectangle,draw=black!50,fill=black!20] {}; +\end{tikzpicture} +\end{codeexample} + +While this looks nicer in the picture, the code starts to get a bit +ugly. Ideally, we would like our code to transport the message ``there +are three places and two transitions'' and not so much which +filling colors should be used. + +To solve this problem, Hagen uses styles. He defines a style for +places and another style for transitions: + +\begin{codeexample}[] +\begin{tikzpicture} + [place/.style={circle,draw=blue!50,fill=blue!20,thick}, + transition/.style={rectangle,draw=black!50,fill=black!20,thick}] + \node at ( 0,2) [place] {}; + \node at ( 0,1) [place] {}; + \node at ( 0,0) [place] {}; + \node at ( 1,1) [transition] {}; + \node at (-1,1) [transition] {}; +\end{tikzpicture} +\end{codeexample} + + +\subsection{Node Size} + +Before Hagen starts naming and connecting the nodes, let us first +make sure that the nodes get their final appearance. They are still +too small. Indeed, Hagen wonders why they have any size at all, after +all, the text is empty. The reason is than \tikzname\ automatically +adds some space around the text. The amount is set using the option +|inner sep|. So, to increase the size of the nodes, Hagen could write: + +\begin{codeexample}[] +\begin{tikzpicture} + [inner sep=2mm, + place/.style={circle,draw=blue!50,fill=blue!20,thick}, + transition/.style={rectangle,draw=black!50,fill=black!20,thick}] + \node at ( 0,2) [place] {}; + \node at ( 0,1) [place] {}; + \node at ( 0,0) [place] {}; + \node at ( 1,1) [transition] {}; + \node at (-1,1) [transition] {}; +\end{tikzpicture} +\end{codeexample} + +However, this is not really the best way to achieve the desired +effect. It is much better to use the |minimum size| option +instead. This option allows Hagen to specify a minimum size that the +node should have. If the nodes actually needs to be bigger because of +a longer text, it will be larger, but if the text is empty, then the +node will have |minimum size|. This option is also useful to ensure +that several nodes containing different amounts of text have the same +size. The options |minimum height| and |minimum width| allow you to +specify the minimum height and width independently. + +So, what Hagen needs to do is to provide |minimum size| for the +nodes. To be on the safe side, he also sets |inner sep=0pt|. This +ensures that the nodes will really have size |minimum size| and not, +for very small minimum sizes, the minimal size necessary to encompass +the automatically added space. + +\begin{codeexample}[] +\begin{tikzpicture} + [place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, + transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}] + \node at ( 0,2) [place] {}; + \node at ( 0,1) [place] {}; + \node at ( 0,0) [place] {}; + \node at ( 1,1) [transition] {}; + \node at (-1,1) [transition] {}; +\end{tikzpicture} +\end{codeexample} + + + + +\subsection{Naming Nodes} + +Hagen's next aim is to connect the nodes using arrows. This seems like +a tricky business since the arrows should not start in the middle of +the nodes, but somewhere on the border and Hagen would very much like +to avoid computing these positions by hand. + +Fortunately, \pgfname\ will perform all the necessary calculations for +him. However, he first has to assign names to the nodes so that he can +reference them later on. + +There are two ways to name a node. The first is the use the |name=| +option. The second method is to write the desired name in parentheses +after the |node| operation. Hagen thinks that this second method seems +strange, but he will soon change his opinion. + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +% ... setup styles +\begin{tikzpicture} + \node (waiting 1) at ( 0,2) [place] {}; + \node (critical 1) at ( 0,1) [place] {}; + \node (semaphore) at ( 0,0) [place] {}; + \node (leave critical) at ( 1,1) [transition] {}; + \node (enter critical) at (-1,1) [transition] {}; +\end{tikzpicture} +\end{codeexample} +} + +Hagen is pleased to note that the names help in understanding the +code. Names for nodes can be pretty arbitrary, but they should not +contain commas, periods, parentheses, colons, and some other special +characters. However, they can contain underscores and hyphens. + +The syntax for the |node| operation is quite liberal with respect to +the order in which node names, the |at| specifier, and the options +must come. Indeed, you can even have multiple option blocks between +the |node| and the text in curly braces, they accumulate. You can +rearrange them arbitrarily and perhaps the following might be preferable: + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting 1) at ( 0,2) {}; + \node[place] (critical 1) at ( 0,1) {}; + \node[place] (semaphore) at ( 0,0) {}; + \node[transition] (leave critical) at ( 1,1) {}; + \node[transition] (enter critical) at (-1,1) {}; +\end{tikzpicture} +\end{codeexample} +} + + + +\subsection{Placing Nodes Using Relative Placement} + +Although Hagen still wishes to connect the nodes, he first wishes to +address another problem again: The placement of the nodes. Although he +likes the |at| syntax, in this particular case he would prefer placing +the nodes ``relative to each other.'' So, Hagen would like to say that +the |critical 1| node should be below the |waiting 1| node, wherever +the |waiting 1| node might be. There are different ways of achieving +this, but the nicest one in Hagen's case is the |below| option: + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; +\end{tikzpicture} +\end{codeexample} +} + +With the |positioning| library loaded, when an option like |below| +is followed by |of|, then the position of the node is shifted +such a manner that it is placed at the distance |node distance| in the +specified direction of the given direction. The |node distance| is +either the distance between the centers of the nodes (when the +|on grid| option is set to true) or the distance between the borders +(when the |on grid| option is set to false, which is the default). + +Even though the above code has the same effect the earlier code, Hagen +can pass it to his colleagues who will be able to just read and +understand it, perhaps without even having to see the picture. + + + +\subsection{Adding Labels Next to Nodes} + +Before we have a look at how Hagen can connect the nodes, let us add +the capacity ``$s \le 3$'' to the bottom node. For this, two +approaches are possible: +\begin{enumerate} +\item Hagen can just add a new node above the |north| anchor of the + |semaphore| node. +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + + \node [red,above] at (semaphore.north) {$s\le 3$}; +\end{tikzpicture} +\end{codeexample} +} +This is a general approach that will ``always work.'' + +\item Hagen can use the special |label| option. This option is given + to a |node| and it causes \emph{another} node to be added next to + the node where the option is given. Here is the idea: When we + construct the |semaphore| node, we wish to indicate that we want + another node with the capacity above it. For this, we use the option + |label=above:$s\le 3$|. This option is interpreted as follows: We + want a node above the |semaphore| node and this node should read + ``$s \le 3$.'' Instead of |above| we could also use things like + |below left| before the colon or a number like |60|. +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical, + label=above:$s\le3$] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; +\end{tikzpicture} +\end{codeexample} +} + It is also possible to give multiple |label| options, this causes + multiple labels to be drawn. +\begin{codeexample}[] +\tikz + \node [circle,draw,label=60:$60^\circ$,label=below:$-90^\circ$] {my circle}; +\end{codeexample} + Hagen is not fully satisfied with the |label| option since the label + is not red. To achieve this, he has two options: First, he can + redefine the |every label| style. Second, he can add options to the + label's node. These options are given following the |label=|, so he + would write |label=[red]above:$s\le3$|. However, this does not quite + work since \TeX\ thinks that the |]| closes the whole option list of + the |semaphore| node. So, Hagen has to add braces and writes + |label={[red]above:$s\le3$}|. Since this looks a bit ugly, Hagen + decides to redefine the |every label| style. +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture}[every label/.style={red}] + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical, + label=above:$s\le3$] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; +\end{tikzpicture} +\end{codeexample} +} +\end{enumerate} + + + +\subsection{Connecting Nodes} + +It is now high time to connect the nodes. Let us start with something +simple, namely with the straight line from |enter critical| to +|critical|. We want this line to start at the right side of +|enter critical| and to end at the left side of |critical|. For +this, we can use the \emph{anchors} of the nodes. Every node defines a +whole bunch of anchors that lie on its border or inside it. For +example, the |center| anchor is at the center of the node, the |west| +anchor is on the left of the node, and so on. To access the coordinate +of a node, we use a coordinate that contains the node's name followed +by a dot, followed by the anchor's name: + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (critical.west) -- (enter critical.east); +\end{tikzpicture} +\end{codeexample} +} + +Next, let us tackle the curve from |waiting| to |enter critical|. This +can be specified using curves and controls: + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (enter critical.east) -- (critical.west); + \draw [->] (waiting.west) .. controls +(left:5mm) and +(up:5mm) + .. (enter critical.north); +\end{tikzpicture} +\end{codeexample} +} + +Hagen sees how he can now add all his edges, but the whole process +seems a but awkward and not very flexible. Again, the code seems to +obscure the structure of the graphic rather than showing it. + +So, let us start improving the code for the edges. First, Hagen can +leave out the anchors: + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (enter critical) -- (critical); + \draw [->] (waiting) .. controls +(left:8mm) and +(up:8mm) + .. (enter critical); +\end{tikzpicture} +\end{codeexample} +} + +Hagen is a bit surprised that this works. After all, how did +\tikzname\ know that the line from |enter critical| to |critical| +should actually start on the borders? Whenever \tikzname\ encounters a +whole node name as a ``coordinate,'' it tries to ``be smart'' about +the anchor that it should choose for this node. Depending on what +happens next, \tikzname\ will choose an anchor that lies on the border +of the node on a line to the next coordinate or control point. The +exact rules are a bit complex, but the chosen point will usually be +correct -- and when it is not, Hagen can still specify the desired +anchor by hand. + +Hagen would now like to simplify the curve operation somehow. It turns +out that this can be accomplished using a special path operation: the +|to| operation. This operation takes many options (you can even define +new ones yourself). One pair of option is useful for Hagen: The pair +|in| and |out|. These options take angles at which a curve should +leave or reach the start or target coordinates. Without these options, +a straight line is drawn: + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (enter critical) to (critical); + \draw [->] (waiting) to [out=180,in=90] (enter critical); +\end{tikzpicture} +\end{codeexample} +} + +There is another option for the |to| operation, that is even better +suited to Hagen's problem: The |bend right| option. This option also +takes an angle, but this angle only specifies the angle by which the +curve is bend to the right: + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (enter critical) to (critical); + \draw [->] (waiting) to [bend right=45] (enter critical); + \draw [->] (enter critical) to [bend right=45] (semaphore); +\end{tikzpicture} +\end{codeexample} +} + +It is now time for Hagen to learn about yet another way of specifying +edges: Using the |edge| path operation. This operation is very similar +to the |to| operation, but there is one important difference: Like a +node the edge generated by the |edge| operation is not part of the +main path, but is added only later. This may not seem very important, +but is has some nice consequences. For example, every edge can have +its own arrow tips and its own color and so one and, still, all the +edges can be given on the same path. This allows Hagen to write the +following: + + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {} + edge [->] (critical) + edge [<-,bend left=45] (waiting) + edge [->,bend right=45] (semaphore); +\end{tikzpicture} +\end{codeexample} +} + +Each |edge| caused a new path to be constructed, consisting of a |to| +between the node |enter critical| and the node following the |edge| +command. + +The finishing touch is to introduce two styles |pre| and |post| and to +use the |bend angle=45| option to set the bend angle once and for all: + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}} +\begin{codeexample}[] +% Styles place and transition as before +\begin{tikzpicture} + [bend angle=45, + pre/.style={<-,shorten <=1pt,>=stealth',semithick}, + post/.style={->,shorten >=1pt,>=stealth',semithick}] + + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + + \node[transition] (leave critical) [right=of critical] {} + edge [pre] (critical) + edge [post,bend right] (waiting) + edge [pre, bend left] (semaphore); + \node[transition] (enter critical) [left=of critical] {} + edge [post] (critical) + edge [pre, bend left] (waiting) + edge [post,bend right] (semaphore); +\end{tikzpicture} +\end{codeexample} +} + + + + +\subsection{Adding Labels Next to Lines} + +The next thing that Hagen needs to add is the ``$2$'' at the arcs. For +this Hagen can use \tikzname's automatic node placement: By adding the +option |auto|, \tikzname\ will position nodes on curves and lines in +such a way that they are not on the curve but next to it. Adding +|swap| will mirror the label with respect to the line. Here is a +general example: + +{ +\begin{codeexample}[] +\begin{tikzpicture}[auto,bend right] + \node (a) at (0:1) {$0^\circ$}; + \node (b) at (120:1) {$120^\circ$}; + \node (c) at (240:1) {$240^\circ$}; + + \draw (a) to node {1} node [swap] {1'} (b) + (b) to node {2} node [swap] {2'} (c) + (c) to node {3} node [swap] {3'} (a); +\end{tikzpicture} +\end{codeexample} +} + +What is happening here? The nodes are given somehow inside the |to| +operation! When this is done, the node is placed on the middle of the +curve or line created by the |to| operation. The |auto| option then +causes the node to be moved in such a way that it does not lie on the +curve, but next to it. In the example we provide even two nodes on +each |to| operation. + +For Hagen that |auto| option is not really necessary since the two +``2'' labels could also easily be placed ``by hand.'' However, in a +complicated plot with numerous edges automatic placement can be a +blessing. + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}, +pre/.style={<-,shorten <=1pt,>=stealth',semithick}, +post/.style={->,shorten >=1pt,>=stealth',semithick}} +\begin{codeexample}[] +% Styles as before +\begin{tikzpicture}[bend angle=45] + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + + \node[transition] (leave critical) [right=of critical] {} + edge [pre] (critical) + edge [post,bend right] node[auto,swap] {2} (waiting) + edge [pre, bend left] (semaphore); + \node[transition] (enter critical) [left=of critical] {} + edge [post] (critical) + edge [pre, bend left] (waiting) + edge [post,bend right] (semaphore); +\end{tikzpicture} +\end{codeexample} +} + + + +\subsection{Adding the Snaked Line and Multi-Line Text} + +With the node mechanism Hagen can now easily create the two Petri +nets. What he is unsure of is how he can create the snaked line +between the nets. + +For this he can use a \emph{decoration}. +To draw the snake, Hagen only needs to set the two options +|decoration=snake| and |decorate| on +the path. This causes all lines of the path to be replaced by +snakes. It is also possible to use snakes only in certain parts of a +path, but Hagen will not need this. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw [->,decorate,decoration=snake] (0,0) -- (2,0); +\end{tikzpicture} +\end{codeexample} + +Well, that does not look quite right, yet. The problem is that the +snake happens to end exactly at the position where the arrow +begins. Fortunately, there is an option that helps here. Also, the +snake should be a bit smaller, which can be influenced by even more +options. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw [->,decorate, + decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}] + (0,0) -- (3,0); +\end{tikzpicture} +\end{codeexample} + +Now Hagen needs to add the text above the snake. This text is a bit +challenging since it is a multi-line text. Hagen has two options for +this: First, he can specify an |align=center| and then use the |\\| +command to enforce the line breaks at the desired positions. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw [->,decorate, + decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}] + (0,0) -- (3,0) + node [above,align=center,midway] + { + replacement of\\ + the \textcolor{red}{capacity}\\ + by \textcolor{red}{two places} + }; +\end{tikzpicture} +\end{codeexample} + +Instead of specifying the line breaks ``by hand,'' Hagen can also +specify a width for the text and let \TeX\ perform the line breaking +for him: + +\begin{codeexample}[] +\begin{tikzpicture} + \draw [->,decorate, + decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}] + (0,0) -- (3,0) + node [above,text width=3cm,align=center,midway] + { + replacement of the \textcolor{red}{capacity} by + \textcolor{red}{two places} + }; +\end{tikzpicture} +\end{codeexample} + + + +\subsection{Using Layers: The Background Rectangles} + +Hagen still needs to add the background rectangles. These are a bit +tricky: Hagen would like to draw the rectangles \emph{after} the Petri +nets are finished. The reason is that only then can he conveniently +refer to the coordinates that make up the corners of the +rectangle. If Hagen draws the rectangle first, then he needs to know +the exact size of the Petri net -- which he does not. + +The solution is to use \emph{layers}. When the background library is +loaded, Hagen can put parts of his picture inside a |{pgfonlayer}| +environment. Then this part of the picture becomes part of the layer +that is given as an argument to this environment. When the +|{tikzpicture}| environment ends, the layers are put on top of each +other, starting with the background layer. This causes everything +drawn on the background layer to be behind the main text. + +The next tricky question is, how big should the rectangle be? +Naturally, Hagen can compute the size ``by hand'' or using some clever +observations concerning the $x$- and $y$-coordinates of the nodes, but +it would be nicer to just have \tikzname\ compute a rectangle into +which all the nodes ``fit.'' For this, the |fit| library can be +used. It defines the |fit| options, which, when give to a node, causes +the node to be resized and shifted such that it exactly covers all the +nodes and coordinates given as parameters to the |fit| option. + +{ +\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, +transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}, +pre/.style={<-,shorten <=1pt,>=stealth',semithick}, +post/.style={->,shorten >=1pt,>=stealth',semithick}} +\begin{codeexample}[] +% Styles as before +\begin{tikzpicture}[bend angle=45] + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + + \node[transition] (leave critical) [right=of critical] {} + edge [pre] (critical) + edge [post,bend right] node[auto,swap] {2} (waiting) + edge [pre, bend left] (semaphore); + \node[transition] (enter critical) [left=of critical] {} + edge [post] (critical) + edge [pre, bend left] (waiting) + edge [post,bend right] (semaphore); + + \begin{pgfonlayer}{background} + \node [fill=black!30,fit=(waiting) (critical) (semaphore) + (leave critical) (enter critical)] {}; + \end{pgfonlayer} +\end{tikzpicture} +\end{codeexample} +} + + + + +\subsection{The Complete Code} + +Hagen has now finally put everything together. Only then does he learn +that there is already a library for drawing Petri nets! It turns out +that this library mainly provides the same definitions as Hagen +did. For example, it defines a |place| style in a similar way as Hagen +did. Adjusting the code so that it uses the library shortens Hagen +code a bit, as shown in the following. + +First, Hagen needs less style definitions, but he still needs to +specify the colors of places and transitions. + +\begin{codeexample}[code only] +\begin{tikzpicture} + [node distance=1.3cm,on grid,>=stealth',bend angle=45,auto, + every place/.style= {minimum size=6mm,thick,draw=blue!75,fill=blue!20}, + every transition/.style={thick,draw=black!75,fill=black!20}, + red place/.style= {place,draw=red!75,fill=red!20}, + every label/.style= {red}] +\end{codeexample} + +Now comes the code for the nets: + +{ +\tikzset{% + every place/.style={minimum size=6mm,thick,draw=blue!75,fill=blue!20}, + every transition/.style={thick,draw=black!75,fill=black!20}, + red place/.style={place,draw=red!75,fill=red!20}, + every label/.style={red}, + every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}} +\tikzexternaldisable +\begin{codeexample}[pre=\begin{tikzpicture},post=\end{tikzpicture}] + \node [place,tokens=1] (w1) {}; + \node [place] (c1) [below=of w1] {}; + \node [place] (s) [below=of c1,label=above:$s\le 3$] {}; + \node [place] (c2) [below=of s] {}; + \node [place,tokens=1] (w2) [below=of c2] {}; + + \node [transition] (e1) [left=of c1] {} + edge [pre,bend left] (w1) + edge [post,bend right] (s) + edge [post] (c1); + \node [transition] (e2) [left=of c2] {} + edge [pre,bend right] (w2) + edge [post,bend left] (s) + edge [post] (c2); + \node [transition] (l1) [right=of c1] {} + edge [pre] (c1) + edge [pre,bend left] (s) + edge [post,bend right] node[swap] {2} (w1); + \node [transition] (l2) [right=of c2] {} + edge [pre] (c2) + edge [pre,bend right] (s) + edge [post,bend left] node {2} (w2); +\end{codeexample} +} + +{ +\tikzset{ +every place/.style= {minimum size=6mm,thick,draw=blue!75,fill=blue!20}, +every transition/.style={thick,draw=black!75,fill=black!20}, +red place/.style= {place,draw=red!75,fill=red!20}, +every label/.style={red}, +every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}} +\tikzexternaldisable +\begin{codeexample}[pre=\begin{tikzpicture},post=\end{tikzpicture}] + \begin{scope}[xshift=6cm] + \node [place,tokens=1] (w1') {}; + \node [place] (c1') [below=of w1'] {}; + \node [red place] (s1') [below=of c1',xshift=-5mm] + [label=left:$s$] {}; + \node [red place,tokens=3] (s2') [below=of c1',xshift=5mm] + [label=right:$\bar s$] {}; + \node [place] (c2') [below=of s1',xshift=5mm] {}; + \node [place,tokens=1] (w2') [below=of c2'] {}; + + \node [transition] (e1') [left=of c1'] {} + edge [pre,bend left] (w1') + edge [post] (s1') + edge [pre] (s2') + edge [post] (c1'); + \node [transition] (e2') [left=of c2'] {} + edge [pre,bend right] (w2') + edge [post] (s1') + edge [pre] (s2') + edge [post] (c2'); + \node [transition] (l1') [right=of c1'] {} + edge [pre] (c1') + edge [pre] (s1') + edge [post] (s2') + edge [post,bend right] node[swap] {2} (w1'); + \node [transition] (l2') [right=of c2'] {} + edge [pre] (c2') + edge [pre] (s1') + edge [post] (s2') + edge [post,bend left] node {2} (w2'); + \end{scope} +\end{codeexample} +} + +The code for the background and the snake is the following: + +\begin{codeexample}[code only] + \begin{pgfonlayer}{background} + \node (r1) [fill=black!10,rounded corners,fit=(w1)(w2)(e1)(e2)(l1)(l2)] {}; + \node (r2) [fill=black!10,rounded corners,fit=(w1')(w2')(e1')(e2')(l1')(l2')] {}; + \end{pgfonlayer} + + \draw [shorten >=1mm,-to,thick,decorate, + decoration={snake,amplitude=.4mm,segment length=2mm, + pre=moveto,pre length=1mm,post length=2mm}] + (r1) -- (r2) node [above=1mm,midway,text width=3cm,align=center] + {replacement of the \textcolor{red}{capacity} by \textcolor{red}{two places}}; +\end{tikzpicture} +\end{codeexample} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex index 8b9cfe6bae9..b2dcfbe5a05 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex @@ -26,7 +26,7 @@ Karl was never entirely satisfied with the result. Karl's son, who was even less satisfied with the results (he did not have to take the exams, after all), told Karl that he might wish to try out a new package for creating graphics. A bit confusingly, -this package seems to have two names: First, Karl had to download and +this package seems to have two names: First, Karl had to download and install a package called \pgfname. Then it turns out that inside this package there is another package called \tikzname, which is supposed to stand for ``\tikzname\ ist \emph{kein} Zeichenprogramm.'' Karl finds this @@ -65,7 +65,7 @@ cosine. What he would like to have is something that looks like this % The graphic \draw[help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4); - + \draw (0,0) circle (1cm); \begin{scope}[axes] @@ -74,20 +74,20 @@ cosine. What he would like to have is something that looks like this \foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1} \draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) node[below,fill=white] {$\xtext$}; - + \foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1} \draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt) node[left,fill=white] {$\ytext$}; \end{scope} - + \filldraw[fill=green!20,draw=anglecolor] (0,0) -- (3mm,0pt) arc(0:30:3mm); \draw (15:2mm) node[anglecolor] {$\alpha$}; - + \draw[important line,sincolor] (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} +(0,-.5); - + \draw[important line,coscolor] (0,0) -- node[below=2pt,fill=white] {$\cos \alpha$} (\costhirty,0); - + \draw[important line,tancolor] (1,0) -- node [right=1pt,fill=white] { @@ -96,7 +96,7 @@ cosine. What he would like to have is something that looks like this } (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t); \draw (0,0) -- (t); - + \draw[xshift=1.85cm] node [right,text width=6cm,information text] { The {\color{anglecolor} angle $\alpha$} is $30^\circ$ in the @@ -110,10 +110,10 @@ cosine. What he would like to have is something that looks like this line, which is the {\color{coscolor}cosine of $\alpha$}, must be \[ {\color{coscolor}\cos\alpha} = \sqrt{1 - 1/4} = \textstyle - \frac{1}{2} \sqrt 3. + \frac{1}{2} \sqrt 3. \]% This shows that {\color{tancolor}$\tan \alpha$}, which is the - height of the orange line, is + height of the orange line, is \[ {\color{tancolor}\tan\alpha} = \frac{{\color{sincolor}\sin \alpha}}{\color{coscolor}\cos \alpha} = 1/\sqrt 3. @@ -160,7 +160,7 @@ We are working on Admittedly, not quite the whole picture, yet, but we do have the axes established. Well, not quite, but we have the lines that make up the axes drawn. Karl suddenly has a sinking feeling -that the picture is still some way off. +that the picture is still some way off. Let's have a more detailed look at the code. First, the package |tikz| is loaded. This package is a so-called ``frontend'' to the @@ -187,7 +187,7 @@ Karl's wife Gerda, who also happens to be a math teacher, is not a ``the old way.'' She can also use \tikzname. Instead of |\usepackage{tikz}| she has to write |\input tikz.tex| and instead of |\begin{tikzpicture}| she writes |\tikzpicture| and instead of - |\end{tikzpicture}| she writes |\endtikzpicture|. + |\end{tikzpicture}| she writes |\endtikzpicture|. Thus, she would use: \begin{codeexample}[code only] @@ -206,7 +206,7 @@ We are working on Gerda can typeset this file using either |pdftex| or |tex| together with |dvips|. \tikzname\ will automatically discern which driver she is -using. If she wishes to use |dvipdfm| together with |tex|, she +using. If she wishes to use |dvipdfm| together with |tex|, she either needs to modify the file |pgf.cfg| or can write |\def\pgfsysdriver{pgfsys-dvipdfm.def}| somewhere \emph{before} she inputs |tikz.tex| or |pgf.tex|. @@ -219,7 +219,7 @@ Karl's uncle Hans uses Con\TeX t. Like Gerda, Hans can also use \tikzname. Instead of |\usepackage{tikz}| he says |\usemodule[tikz]|. Instead of |\begin{tikzpicture}| he writes |\starttikzpicture| and instead of |\end{tikzpicture}| he writes -|\stoptikzpicture|. +|\stoptikzpicture|. His version of the example looks like this: \begin{codeexample}[code only] @@ -232,16 +232,19 @@ His version of the example looks like this: \draw (-1.5,0) -- (1.5,0); \draw (0,-1.5) -- (0,1.5); \stoptikzpicture. -\stoptext +\stoptext \end{codeexample} -Hans will now typeset this file in the usual way using |texexec|. +Hans will now typeset this file in the usual way using +|texexec|\footnote{Note that \pgfname/\tikzname{} is not supported by + recent Con\TeX t versions (like mark IV, the Lua\TeX-aware part of + Con\TeX t).}. \subsection{Straight Path Construction} -The basic building block of all pictures in \tikzname\ is the path. +The basic building block of all pictures in \tikzname\ is the path. A \emph{path} is a series of straight lines and curves that are connected (that is not the whole picture, but let us ignore the complications for the moment). You start a path by specifying the @@ -265,7 +268,7 @@ puts it inside a |{tikzpicture}| environment. As a rule of thumb, all \tikzname\ graphic drawing commands must occur as an argument of |\tikz| or inside a |{tikzpicture}| environment. Fortunately, the command |\draw| will only be defined inside this environment, so there is -little chance that you will accidentally do something wrong here. +little chance that you will accidentally do something wrong here. @@ -296,7 +299,7 @@ Here is an example (the control points have been added for clarity): The general syntax for extending a path in a ``curved'' way is |.. controls| \meta{first control point} |and| \meta{second control point} |..| \meta{end point}. You can leave out the |and| -\meta{second control point}, which causes the first one to be used +\meta{second control point}, which causes the first one to be used twice. So, Karl can now add the first half circle to the picture: @@ -328,7 +331,7 @@ the following example: (Note that the previous position is used as the You can also append an ellipse to the path using the |ellipse| operation. Instead of a single radius you can specify two of them, one for the $x$-direction and one for the $y$-direction, separated by -|and|: +|and|: \begin{codeexample}[] \tikz \draw (0,0) ellipse (20pt and 10pt); @@ -339,7 +342,7 @@ point in an arbitrary direction (a ``turned ellipse'' like \tikz \draw[rotate=30] (0,0) ellipse (6pt and 3pt);) you can use transformations, which are explained later. The code for the little ellipse is |\tikz \draw[rotate=30] (0,0) ellipse (6pt and 3pt);|, by -the way. +the way. So, returning to Karl's problem, he can write |\draw (0,0) circle (1cm);| to draw the circle: @@ -357,7 +360,7 @@ At this point, Karl is a bit alarmed that the circle is so small when he wants the final picture to be much bigger. He is pleased to learn that \tikzname\ has powerful transformation options and scaling everything by a factor of three is very easy. But let us leave the -size as it is for the moment to save some space. +size as it is for the moment to save some space. @@ -424,7 +427,7 @@ Karl adds two more options to the |\draw| command that draws the grid. First, he uses the color |gray| for the grid lines. Second, he reduces the line width to |very thin|. Finally, he swaps the ordering of the commands so that the grid is drawn first and everything else on -top. +top. \begin{codeexample}[] \begin{tikzpicture} @@ -449,17 +452,17 @@ instead of |gray|, he could provide the following option somewhere: help lines/.style={color=blue!50,very thin} \end{codeexample} The effect of this ``style setter'' is that in the current -scope or environement the |help lines| option has the same effect as +scope or environment the |help lines| option has the same effect as |color=blue!50,very thin|. Using styles makes your graphics code more flexible. You can -change the way things look easily in a consistent manner. +change the way things look easily in a consistent manner. Normally, styles are defined at the beginning of a picture. However, you may sometimes wish to define a style globally, so that all pictures of your document can use this style. Then you can easily change the way all graphics look by changing this one style. In this situation you can use the |\tikzset| command at the beginning of the -document as in +document as in \begin{codeexample}[code only] \tikzset{help lines/.style=very thin} \end{codeexample} @@ -475,8 +478,8 @@ the |grid| style Karl could say Styles are made even more powerful by parametrization. This means that, like other options, styles can also be used with a -parameter. For instance, Karl could parametrize his grid so that, by -default, it is blue, but he could also use another color. +parameter. For instance, Karl could parameterize his grid so that, by +default, it is blue, but he could also use another color. \begin{codeexample}[code only] \begin{tikzpicture} @@ -522,7 +525,7 @@ and |densely dotted|. If he really, really needs to, Karl can also define much more complex dashing patterns with the |dash pattern| option, but his son insists that dashing is to be used with utmost care and mostly distracts. Karl's son claims that complicated dashing -patterns are evil. Karl's students do not care about dashing patterns. +patterns are evil. Karl's students do not care about dashing patterns. @@ -530,7 +533,7 @@ patterns are evil. Karl's students do not care about dashing patterns. Our next obstacle is to draw the arc for the angle. For this, the |arc| path construction operation is useful, which draws part of a -circle or ellipse. This |arc| operation must be followed by a triple in +circle or ellipse. This |arc| operation must be followed by a triple in rounded brackets, where the components of the triple are separated by colons. The first two components are angles, the last one is a radius. An example would be |(10:80:10pt)|, which means ``an arc from @@ -541,7 +544,7 @@ radius. This gives: |(0:30:3mm)|. When one uses the arc path construction operation, the specified arc will be added with its starting point at the current position. So, we first -have to ``get there.'' +have to ``get there.'' \begin{codeexample}[] \begin{tikzpicture} @@ -584,7 +587,7 @@ graphics a bit so that we can focus on the ``interesting'' parts. Clipping is pretty easy in \tikzname. You can use the |\clip| command clip all subsequent drawing. It works like |\draw|, only it does not draw anything, but uses the given path to clip everything -subsequently. +subsequently. \begin{codeexample}[] \begin{tikzpicture}[scale=3] @@ -603,7 +606,7 @@ option. (This is not the whole picture: You can also use the |\clip| command and add the |draw| option. Well, that is also not the whole picture: In reality, |\draw| is just a shorthand for |\path[draw]| and |\clip| is a shorthand for |\path[clip]| and you could also say -|\path[draw,clip]|.) Here is an example: +|\path[draw,clip]|.) Here is an example: \begin{codeexample}[] \begin{tikzpicture}[scale=3] @@ -719,7 +722,7 @@ Karl briefly considers the possibility of making the angle ``more fancy'' by \emph{shading} it. Instead of filling the with a uniform color, a smooth transition between different colors is used. For this, |\shade| and |\shadedraw|, for shading and drawing at the same time, -can be used: +can be used: \begin{codeexample}[] \tikz \shade (0,0) rectangle (2,1) (3,0.5) circle (.5cm); @@ -770,7 +773,7 @@ the $x$-direction and 1cm in the $y$-direction, respectively. In order to specify points in polar coordinates, use the notation |(30:1cm)|, which means 1cm in direction 30 degree. This is obviously quite useful to ``get to the point $(\cos 30^\circ,\sin 30^\circ)$ on -the circle.'' +the circle.'' You can add a single |+| sign in front of a coordinate or two of them as in |+(1cm,0cm)| or |++(0cm,2cm)|. Such coordinates are interpreted @@ -802,7 +805,7 @@ line through $p$ and a horizontal line through $q$.'' Next, let us draw the cosine line. One way would be to say \verb!(30:1cm |- 0,0) -- (0,0)!. Another way is the following: we -``continue'' from where the sine ends: +``continue'' from where the sine ends: \begin{codeexample}[] \begin{tikzpicture}[scale=3] @@ -818,7 +821,7 @@ Next, let us draw the cosine line. One way would be to say \end{tikzpicture} \end{codeexample} -Note the there is no |--| between |(30:1cm)| and |+(0,-0.5)|. In +Note the there is no |--| between |(30:1cm)| and |++(0,-0.5)|. In detail, this path is interpreted as follows: ``First, the |(30:1cm)| tells me to move by pen to $(\cos 30^\circ,1/2)$. Next, there comes another coordinate specification, so I move my pen there without drawing @@ -849,42 +852,39 @@ By comparison, when using a single |+|, the coordinates are different: Naturally, all of this could have been written more clearly and more -economically like this (either with a single of a double |+|): +economically like this (either with a single of a double |+|): \begin{codeexample}[] \tikz \draw (0,0) rectangle +(1,1) (1.5,0) rectangle +(1,1); \end{codeexample} +\subsection{Intersecting Paths} Karl is left with the line for $\tan \alpha$, which seems difficult to specify using transformations and polar coordinates. For this he needs another way of specifying coordinates: Karl can specify intersections -of lines as coordinates. The line for $\tan \alpha$ starts at $(1,0)$ +of paths as coordinates. The line for $\tan \alpha$ starts at $(1,0)$ and goes upward to a point that is at the intersection of a line going -``up'' and a line going from the origin through |(30:1cm)|. The syntax -for this point is the following: +``up'' and a line going from the origin through |(30:1cm)|. Such +computations are made available by the |intersections| library. -\begin{codeexample}[code only] -\draw[very thick,orange] (1,0) -- (intersection of 1,0--1,1 and 0,0--30:1cm); -\end{codeexample} +What Karl must do is to create two ``invisible'' paths that intersect +at the position of interest. Creating paths that are not otherwise +seen can be done using the |\path| command without any options like +|draw| or |fill|. Then, Karl can add the |name path| option to the +path for later reference. Once the paths have been constructed, Karl +can use the |name intersections| to assign names to the coordinate for +later reference. -In the following, two final examples of how to use relative -positioning are presented. Note that the transformation options, -which are explained later, are often more useful for shifting than -relative positioning. - -\begin{codeexample}[] -\begin{tikzpicture}[scale=0.5] - \draw (0,0) -- (90:1cm) arc (90:360:1cm) arc (0:30:1cm) -- cycle; - \draw (60:5pt) -- +(30:1cm) arc (30:90:1cm) -- cycle; +\begin{codeexample}[code only] +\path [name path=upward line] (1,0) -- (1,1); +\path [name path=sloped line] (0,0) -- (30:1.5cm); % a bit longer, so that there is an intersection - \draw (3,0) +(0:1cm) -- +(72:1cm) -- +(144:1cm) -- +(216:1cm) -- - +(288:1cm) -- cycle; -\end{tikzpicture} +\draw [name intersections={of=upward line and sloped line, by=x}] + [very thick,orange] (1,0) -- (x); \end{codeexample} - \subsection{Adding Arrow Tips} Karl now wants to add the little arrow tips at the end of the axes. He has @@ -907,7 +907,11 @@ It turns out that adding arrow tips is pretty easy: Karl adds the option (0:30:3mm) -- cycle; \draw[red,very thick] (30:1cm) -- +(0,-0.5); \draw[blue,very thick] (30:1cm) ++(0,-0.5) -- (0,0); - \draw[orange,very thick] (1,0) -- (intersection of 1,0--1,1 and 0,0--30:1cm); + + \path [name path=upward line] (1,0) -- (1,1); + \path [name path=sloped line] (0,0) -- (30:1.5cm); + \draw [name intersections={of=upward line and sloped line, by=x}] + [very thick,orange] (1,0) -- (x); \end{tikzpicture} \end{codeexample} @@ -944,7 +948,7 @@ sometimes, he might need to use some other kinds of arrow. To do so, Karl can say |>=|\meta{right arrow tip kind}, where \meta{right arrow tip kind} is a special arrow tip specification. For example, if Karl says |>=stealth|, then he tells \tikzname\ -that he would like ``stealth-fighter-like'' arrow tips: +that he would like ``stealth-fighter-like'' arrow tips: \begin{codeexample}[] \begin{tikzpicture}[>=stealth] @@ -961,7 +965,7 @@ students discuss this at some point. In addition to |stealth| there are several other predefined arrow tip kinds Karl can choose from, see Section~\ref{section-library-arrows}. Furthermore, he can define -arrows types himself, if he needs new ones. +arrows types himself, if he needs new ones. @@ -993,7 +997,7 @@ Here is an example: \draw (1,0) -- (1,1); \draw (2,0) -- (2,1); \end{scope} - \draw (3,0) -- (3,1); + \draw (3,0) -- (3,1); \end{tikzpicture} \end{codeexample} @@ -1022,7 +1026,7 @@ options apply to the whole path. Indeed, all transformation options do \emph{not} apply to the whole path, but only to ``everything following them on the path.'' We will have a more detailed look at this in a moment. Nevertheless, all options given during a path construction -apply only to this path. +apply only to this path. @@ -1032,7 +1036,7 @@ When you specify a coordinate like |(1cm,1cm)|, where is that coordinate placed on the page? To determine the position, \tikzname, \TeX, and \textsc{pdf} or PostScript all apply certain transformations to the given coordinate in order to determine the finally position on -the page. +the page. \tikzname\ provides numerous options that allow you to transform coordinates in \pgfname's private coordinate system. For example, the @@ -1068,7 +1072,7 @@ a flip), and |xslant| and |yslant| for slanting. If these transformation and those that I have not mentioned are not sufficient, the |cm| option allows you to apply an arbitrary transformation matrix. Karl's students, by the way, do not know what a -transformation matrix is. +transformation matrix is. @@ -1079,7 +1083,7 @@ $-1/2$, $1/2$, and $1$. For this, it would be nice to use some kind of ``loop,'' especially since he wishes to do the same thing at each of these positions. There are different packages for doing this. \LaTeX\ has its own internal command for this, |pstricks| comes along with the -powerful |\mulitdo| command. All of these can be used together with +powerful |\multido| command. All of these can be used together with \pgfname\ and \tikzname, so if you are familiar with them, feel free to use them. \pgfname\ introduces yet another command, called |\foreach|, which I introduced since I could never remember the syntax of the other @@ -1127,9 +1131,9 @@ braces. He could also have used, say, Karl is curious what would happen in a more complicated situation where there are, say, 20 ticks. It seems bothersome to explicitly mention all these numbers in the set for |\foreach|. Indeed, it is -possible to use |...| inside the |\foreach| statement to iterate over +possible to use |...| inside the |\foreach| statement to iterate over a large number of values (which must, however, be dimensionless -real numbers) as in the following example: +real numbers) as in the following example: \begin{codeexample}[] \tikz \foreach \x in {1,...,10} @@ -1166,7 +1170,7 @@ gives the idea. \subsection{Adding Text} Karl is, by now, quite satisfied with the picture. However, the most -important parts, namely the labels, are still missing! +important parts, namely the labels, are still missing! \tikzname\ offers an easy-to-use and powerful system for adding text and, more generally, complex shapes to a picture at specific positions. The @@ -1180,7 +1184,7 @@ able to perform some magic so that it is even possible to use verbatim text inside the boxes) and then placed at the current position, that is, at the last specified position (possibly shifted a bit, according to the given options). However, all nodes are drawn only after the -path has been completely drawn/filled/shaded/clipped/whatever. +path has been completely drawn/filled/shaded/clipped/whatever. \begin{codeexample}[] \begin{tikzpicture} @@ -1192,7 +1196,7 @@ path has been completely drawn/filled/shaded/clipped/whatever. \end{codeexample} Obviously, Karl would not only like to place nodes \emph{on} the last -specified position, but also to the left or the +specified position, but also to the left or the right of these positions. For this, every node object that you put in your picture is equipped with several \emph{anchors}. For example, the |north| anchor is in the middle at the upper end of the shape, @@ -1228,7 +1232,7 @@ same as |anchor=north|. Similarly, |above right| does the same as dimension argument. If given, the shape will additionally be shifted downwards by the given amount. So, |below=1pt| can be used to put a text label below some point and, additionally shift it 1pt -downwards. +downwards. Karl is not quite satisfied with the ticks. He would like to have $1/2$ or $\frac{1}{2}$ shown instead of $0.5$, partly to show off the @@ -1248,7 +1252,7 @@ specify two (or even more) variables separated by a slash as in iterates must also be of the form \meta{first}|/|\meta{second}. In each iteration, |\x| will be set to \meta{first} and |\xtext| will be set to \meta{second}. If no \meta{second} is given, the \meta{first} -will be used again. So, here is the new code for the ticks: +will be used again. So, here is the new code for the ticks: \begin{codeexample}[] \begin{tikzpicture}[scale=3] @@ -1272,13 +1276,13 @@ interfere with the numbers and decrease their legibility. Karl is not very concerned by this (his students do not even notice), but his son insists that there is an easy solution: Karl can add the |[fill=white]| option to fill out the background of the text shape -with a white color. +with a white color. The next thing Karl wants to do is to add the labels like $\sin \alpha$. For this, he would like to place a label ``in the middle of line.'' To do so, instead of specifying the label |node {$\sin\alpha$}| directly after one of the endpoints of the line -(which would place +(which would place the label at that endpoint), Karl can give the label directly after the |--|, before the coordinate. By default, this places the label in the middle of the line, but the |pos=| options can be used to modify @@ -1295,18 +1299,20 @@ modify this position: \draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis); \draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis); \draw (0,0) circle (1cm); - + \draw[very thick,red] (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis); \draw[very thick,blue] (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0); - \draw[very thick,orange] (1,0) -- node [right=1pt,fill=white] + \path [name path=upward line] (1,0) -- (1,1); + \path [name path=sloped line] (0,0) -- (30:1.5cm); + \draw [name intersections={of=upward line and sloped line, by=t}] + [very thick,orange] (1,0) -- node [right=1pt,fill=white] {$\displaystyle \tan \alpha \color{black}= - \frac{{\color{red}\sin \alpha}}{\color{blue}\cos \alpha}$} - (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t); + \frac{{\color{red}\sin \alpha}}{\color{blue}\cos \alpha}$} (t); \draw (0,0) -- (t); - + \foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1} \draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] {$\xtext$}; \foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1} @@ -1335,7 +1341,7 @@ desired effect. So, here is the full code: \begin{codeexample}[code only] \begin{tikzpicture} - [scale=3,line cap=round + [scale=3,line cap=round, % Styles axes/.style=, important line/.style={very thick}, @@ -1352,7 +1358,7 @@ desired effect. So, here is the full code: % The graphic \draw[help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4); - + \draw (0,0) circle (1cm); \begin{scope}[axes] @@ -1361,27 +1367,29 @@ desired effect. So, here is the full code: \foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1} \draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) node[below,fill=white] {$\xtext$}; - + \foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1} \draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt) node[left,fill=white] {$\ytext$}; \end{scope} - + \filldraw[fill=green!20,draw=anglecolor] (0,0) -- (3mm,0pt) arc(0:30:3mm); \draw (15:2mm) node[anglecolor] {$\alpha$}; - + \draw[important line,sincolor] (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis); - + \draw[important line,coscolor] (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0); - - \draw[important line,tancolor] (1,0) -- node[right=1pt,fill=white] { - $\displaystyle \tan \alpha \color{black}= - \frac{{\color{sincolor}\sin \alpha}}{\color{coscolor}\cos \alpha}$} - (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t); + + \path [name path=upward line] (1,0) -- (1,1); + \path [name path=sloped line] (0,0) -- (30:1.5cm); + \draw [name intersections={of=upward line and sloped line, by=t}] + [very thick,orange] (1,0) -- node [right=1pt,fill=white] + {$\displaystyle \tan \alpha \color{black}= + \frac{{\color{red}\sin \alpha}}{\color{blue}\cos \alpha}$} (t); \draw (0,0) -- (t); - + \draw[xshift=1.85cm] node[right,text width=6cm,information text] { @@ -1395,4 +1403,3 @@ desired effect. So, here is the full code: }; \end{tikzpicture} \end{codeexample} - diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/texmf.cnf b/Master/texmf-dist/doc/generic/pgf/text-en/texmf.cnf new file mode 100644 index 00000000000..4235f281312 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/text-en/texmf.cnf @@ -0,0 +1,83 @@ +% Part 3: Array and other sizes for TeX (and Metafont and MetaPost). +% +% If you want to change some of these sizes only for a certain TeX +% variant, the usual dot notation works, e.g., +% main_memory.hugetex = 20000000 +% +% If a change here appears to be ignored, try redumping the format file +% with fmtutil-sys. + +% Memory. Must be less than 8,000,000 total. +% +% main_memory is relevant only to initex, extra_mem_* only to non-ini. +% Thus, have to redump the .fmt file after changing main_memory; to add +% to existing fmt files, increase extra_mem_*. (To get an idea of how +% much, try \tracingstats=2 in your TeX source file; +% web2c/tests/memtest.tex might also be interesting.) +% +% To increase space for boxes (as might be needed by, e.g., PiCTeX), +% increase extra_mem_bot. +% +% For some xy-pic samples, you may need as much as 700000 words of memory. +% For the vast majority of documents, 60000 or less will do. +% +main_memory = 9000000 % words of inimemory available; also applies to inimf&mp +extra_mem_top = 6000000 % extra high memory for chars, tokens, etc. +extra_mem_bot = 6000000 % extra low memory for boxes, glue, breakpoints, etc. + +% Words of font info for TeX (total size of all TFM files, approximately). +% Must be >= 20000 and <= 4000000 (without tex.ch changes). +%font_mem_size = 1200000 + +% Total number of fonts. Must be >= 50 and <= 2000 (without tex.ch changes). +%font_max = 2000 + +% Extra space for the hash table of control sequences (which allows 10K +% names as distributed). +hash_extra = 200000 + +% Max number of characters in all strings, including all error messages, +% help texts, font names, control sequences. These values apply to TeX and MP. +pool_size = 3850000 +% Minimum pool space after TeX/MP's own strings; must be at least +% 25000 less than pool_size, but doesn't need to be nearly that large. +%string_vacancies = 90000 +% Maximum number of strings. +%max_strings = 100000 +% min pool space left after loading .fmt +%pool_free = 47500 + +% Buffer size. TeX uses the buffer to contain input lines, but macro +% expansion works by writing material into the buffer and reparsing the +% line. As a consequence, certain constructs require the buffer to be +% very large, even though most documents can be handled with a small value. +%buf_size = 200000 + +% Hyphenation trie. The maximum possible is 4194303 (ssup_trie_size in +% the sources), but we don't need that much. The value here suffices +% for all known free hyphenation patterns to be loaded simultaneously +% (as TeX Live does). +% +%trie_size = 400000 + +%hyph_size = 8191 % prime number of hyphenation exceptions, >610, <32767. + % http://primes.utm.edu/curios/page.php/8191.html +%nest_size = 500 % simultaneous semantic levels (e.g., groups) +%max_in_open = 15 % simultaneous input files and error insertions +%param_size = 10000 % simultaneous macro parameters +%save_size = 5000 % for saving values outside current group +save_size=800000 +stack_size = 500000 % simultaneous input sources + + + + +% It's probably inadvisable to change these. At any rate, we must have: +% 45 < error_line < 255; +% 30 < half_error_line < error_line - 15; +% 60 <= max_print_line; +% These apply to Metafont and MetaPost as well. +error_line = 254 +half_error_line = 127 +max_print_line = 32000 + diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile index 4b504e6d2ce..6ac2cd93235 100644 --- a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile +++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile @@ -17,4 +17,17 @@ pgfmanual.pdf: $(doc).tex $(doc).ind dvipdfm -p a4 $(doc) clean: - rm -f pgfmanual*.aux pgfmanual.{out,log,idx,ind,ilg,pdf,toc,bbl,blg,ps,dvi} + rm -f \ + plots/* \ + pgfmanual.out \ + pgfmanual.log \ + pgfmanual.idx \ + pgfmanual.ind \ + pgfmanual.ilg \ + pgfmanual.pdf \ + pgfmanual.toc \ + pgfmanual.bbl \ + pgfmanual.blg \ + pgfmanual.ps \ + pgfmanual.dvi \ + pgfmanual*.aux diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile new file mode 100644 index 00000000000..b0d1d980eec --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile @@ -0,0 +1,33 @@ +rerun = "(There were undefined references|Rerun to get (cross-references|the bars) right)" +doc = pgfmanual +latex = latex -shell-escape +TEXINPUTS := ../../text-en:$(TEXINPUTS) + +all: $(doc).pdf + +pgfmanual.idx: + touch pgfmanual.idx + +pgfmanual.ind: pgfmanual.idx + makeindex $(doc).idx + +pgfmanual.pdf: $(doc).tex $(doc).ind + (TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true + (egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true + dvipdfmx -p a4 $(doc) + +clean: + rm -f \ + plots/* \ + pgfmanual.out \ + pgfmanual.log \ + pgfmanual.idx \ + pgfmanual.ind \ + pgfmanual.ilg \ + pgfmanual.pdf \ + pgfmanual.toc \ + pgfmanual.bbl \ + pgfmanual.blg \ + pgfmanual.ps \ + pgfmanual.dvi \ + pgfmanual*.aux diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex new file mode 100644 index 00000000000..987b9fdf9c4 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex @@ -0,0 +1,16 @@ +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\documentclass[a4paper]{ltxdoc} + +% pgf version is defined in \pgfversion in file +% generic/pgf/utilities/pgfrcs.code.tex + +\input{../pgfmanual-dvipdfmx.cfg} +\input{../../text-en/pgfmanual-en-main.tex} diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg new file mode 100644 index 00000000000..7d619800b1b --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg @@ -0,0 +1,18 @@ +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\usepackage[dvipdfmx]{graphicx} +% This will tell everyone which driver we are using. + +\usepackage[dvipdfmx,pdfborder={0 0 0}]{hyperref} + +% Make sure to compile this using latex + dvipdfmx. + +\usepackage[dvipdfmx]{xcolor} diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile index 6b59132e600..285575a6f4b 100644 --- a/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile +++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile @@ -18,5 +18,18 @@ pgfmanual.ps: $(doc).tex $(doc).ind gs -dNOPAUSE -sDEVICE=pdfwrite -dBATCH -dCompatibilityLevel=1.4 -sOutputFile=$(doc).pdf $(doc).ps clean: - rm -f pgfmanual*.aux pgfmanual.{out,log,idx,ind,ilg,pdf,toc,bbl,blg,ps,dvi} + rm -f \ + plots/* \ + pgfmanual.out \ + pgfmanual.log \ + pgfmanual.idx \ + pgfmanual.ind \ + pgfmanual.ilg \ + pgfmanual.pdf \ + pgfmanual.toc \ + pgfmanual.bbl \ + pgfmanual.blg \ + pgfmanual.ps \ + pgfmanual.dvi \ + pgfmanual*.aux diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile index 5b023dbae5e..1983d547501 100644 --- a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile +++ b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile @@ -1,10 +1,21 @@ rerun = "(There were undefined references|Rerun to get (cross-references|the bars) right)" doc = pgfmanual latex = pdflatex -TEXINPUTS := ../../text-en:$(TEXINPUTS) +TEXINPUTS := ../../text-en:../../images:$(TEXINPUTS) all: $(doc).pdf +# make dist will also enable automatic cross references in codeexamples. +# This is disabled by default as it requires higher mem limits. +# +# It employs a 'texmf.cnf' which lies in ../../text-en. +dist: FORCE + export TEXMFCNF="../../text-en:$(TEXMFCNF)"; \ + export TEXINPUTS="$(TEXINPUTS)"; \ + $(latex) '\def\pgfautoxrefs{1}\pdfminorversion=5 \pdfobjcompresslevel=2 \input{$(doc)}' + makeindex $(doc).idx + @echo "$(doc).pdf remade with auto-xref support. Check if auto-xrefs work and rerun make dist if not." + pgfmanual.idx: touch pgfmanual.idx @@ -14,6 +25,22 @@ pgfmanual.ind: pgfmanual.idx pgfmanual.pdf: $(doc).tex $(doc).ind TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex (egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true + @echo "Use 'make dist' to generate auto-xrefs." + +FORCE: clean: - rm -f pgfmanual*.aux pgfmanual.{out,log,idx,ind,ilg,pdf,toc,bbl,blg} + rm -f \ + plots/* \ + pgfmanual.out \ + pgfmanual.log \ + pgfmanual.idx \ + pgfmanual.ind \ + pgfmanual.ilg \ + pgfmanual.pdf \ + pgfmanual.toc \ + pgfmanual.bbl \ + pgfmanual.blg \ + pgfmanual.ps \ + pgfmanual.dvi \ + pgfmanual*.aux diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.figlist b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.figlist new file mode 100644 index 00000000000..5bbdfc855da --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.figlist @@ -0,0 +1,1464 @@ +pgfmanual-figure0 +pgfmanual-figure1 +pgfmanual-figure2 +pgfmanual-figure3 +pgfmanual-figure4 +pgfmanual-figure5 +pgfmanual-figure6 +pgfmanual-figure7 +pgfmanual-figure8 +pgfmanual-figure9 +pgfmanual-figure10 +pgfmanual-figure11 +pgfmanual-figure12 +pgfmanual-figure13 +pgfmanual-figure14 +pgfmanual-figure15 +pgfmanual-figure16 +pgfmanual-figure17 +pgfmanual-figure18 +pgfmanual-figure19 +pgfmanual-figure20 +pgfmanual-figure21 +pgfmanual-figure22 +pgfmanual-figure23 +pgfmanual-figure24 +pgfmanual-figure25 +pgfmanual-figure26 +pgfmanual-figure27 +pgfmanual-figure28 +pgfmanual-figure29 +pgfmanual-figure30 +pgfmanual-figure31 +pgfmanual-figure32 +pgfmanual-figure33 +pgfmanual-figure34 +pgfmanual-figure35 +pgfmanual-figure36 +pgfmanual-figure37 +pgfmanual-figure38 +pgfmanual-figure39 +pgfmanual-figure40 +pgfmanual-figure41 +pgfmanual-figure42 +pgfmanual-figure43 +pgfmanual-figure44 +pgfmanual-figure45 +pgfmanual-figure46 +pgfmanual-figure47 +pgfmanual-figure48 +pgfmanual-figure49 +pgfmanual-figure50 +pgfmanual-figure51 +pgfmanual-figure52 +pgfmanual-figure53 +pgfmanual-figure54 +pgfmanual-figure55 +pgfmanual-figure56 +pgfmanual-figure57 +pgfmanual-figure58 +pgfmanual-figure59 +pgfmanual-figure60 +pgfmanual-figure61 +pgfmanual-figure62 +pgfmanual-figure63 +pgfmanual-figure64 +pgfmanual-figure65 +pgfmanual-figure66 +pgfmanual-figure67 +pgfmanual-figure68 +pgfmanual-figure69 +pgfmanual-figure70 +pgfmanual-figure71 +pgfmanual-figure72 +pgfmanual-figure73 +pgfmanual-figure74 +pgfmanual-figure75 +pgfmanual-figure76 +pgfmanual-figure77 +pgfmanual-figure78 +pgfmanual-figure79 +pgfmanual-figure80 +pgfmanual-figure81 +pgfmanual-figure82 +pgfmanual-figure83 +pgfmanual-figure84 +pgfmanual-figure85 +pgfmanual-figure86 +pgfmanual-figure87 +pgfmanual-figure88 +pgfmanual-figure89 +pgfmanual-figure90 +pgfmanual-figure91 +pgfmanual-figure92 +pgfmanual-figure93 +pgfmanual-figure94 +pgfmanual-figure95 +pgfmanual-figure96 +pgfmanual-figure97 +pgfmanual-figure98 +pgfmanual-figure99 +pgfmanual-figure100 +pgfmanual-figure101 +pgfmanual-figure102 +pgfmanual-figure103 +pgfmanual-figure104 +pgfmanual-figure105 +pgfmanual-figure106 +pgfmanual-figure107 +pgfmanual-figure108 +pgfmanual-figure109 +pgfmanual-figure110 +pgfmanual-figure111 +pgfmanual-figure112 +pgfmanual-figure113 +pgfmanual-figure114 +pgfmanual-figure115 +pgfmanual-figure116 +pgfmanual-figure117 +pgfmanual-figure118 +pgfmanual-figure119 +pgfmanual-figure120 +pgfmanual-figure121 +pgfmanual-figure122 +pgfmanual-figure123 +pgfmanual-figure124 +pgfmanual-figure125 +pgfmanual-figure126 +pgfmanual-figure127 +pgfmanual-figure128 +pgfmanual-figure129 +pgfmanual-figure130 +pgfmanual-figure131 +pgfmanual-figure132 +pgfmanual-figure133 +pgfmanual-figure134 +pgfmanual-figure135 +pgfmanual-figure136 +pgfmanual-figure137 +pgfmanual-figure138 +pgfmanual-figure139 +pgfmanual-figure140 +pgfmanual-figure141 +pgfmanual-figure142 +pgfmanual-figure143 +pgfmanual-figure144 +pgfmanual-figure145 +pgfmanual-figure146 +pgfmanual-figure147 +pgfmanual-figure148 +pgfmanual-figure149 +pgfmanual-figure150 +pgfmanual-figure151 +pgfmanual-figure152 +pgfmanual-figure153 +pgfmanual-figure154 +pgfmanual-figure155 +pgfmanual-figure156 +pgfmanual-figure157 +pgfmanual-figure158 +pgfmanual-figure159 +pgfmanual-figure160 +pgfmanual-figure161 +pgfmanual-figure162 +pgfmanual-figure163 +pgfmanual-figure164 +pgfmanual-figure165 +pgfmanual-figure166 +pgfmanual-figure167 +pgfmanual-figure168 +pgfmanual-figure169 +pgfmanual-figure170 +pgfmanual-figure171 +pgfmanual-figure172 +pgfmanual-figure173 +pgfmanual-figure174 +pgfmanual-figure175 +pgfmanual-figure176 +pgfmanual-figure177 +pgfmanual-figure178 +pgfmanual-figure179 +pgfmanual-figure180 +pgfmanual-figure181 +pgfmanual-figure182 +pgfmanual-figure183 +pgfmanual-figure184 +pgfmanual-figure185 +pgfmanual-figure186 +pgfmanual-figure187 +pgfmanual-figure188 +pgfmanual-figure189 +pgfmanual-figure190 +pgfmanual-figure191 +pgfmanual-figure192 +pgfmanual-figure193 +pgfmanual-figure194 +pgfmanual-figure195 +pgfmanual-figure196 +pgfmanual-figure197 +pgfmanual-figure198 +pgfmanual-figure199 +pgfmanual-figure200 +pgfmanual-figure201 +pgfmanual-figure202 +pgfmanual-figure203 +pgfmanual-figure204 +pgfmanual-figure205 +pgfmanual-figure206 +pgfmanual-figure207 +pgfmanual-figure208 +pgfmanual-figure209 +pgfmanual-figure210 +pgfmanual-figure211 +pgfmanual-figure212 +pgfmanual-figure213 +pgfmanual-figure214 +pgfmanual-figure215 +pgfmanual-figure216 +pgfmanual-figure217 +pgfmanual-figure218 +pgfmanual-figure219 +pgfmanual-figure220 +pgfmanual-figure221 +pgfmanual-figure222 +pgfmanual-figure223 +pgfmanual-figure224 +pgfmanual-figure225 +pgfmanual-figure226 +pgfmanual-figure227 +pgfmanual-figure228 +pgfmanual-figure229 +pgfmanual-figure230 +pgfmanual-figure231 +pgfmanual-figure232 +pgfmanual-figure233 +pgfmanual-figure234 +pgfmanual-figure235 +pgfmanual-figure236 +pgfmanual-figure237 +pgfmanual-figure238 +pgfmanual-figure239 +pgfmanual-figure240 +pgfmanual-figure241 +pgfmanual-figure242 +pgfmanual-figure243 +pgfmanual-figure244 +pgfmanual-figure245 +pgfmanual-figure246 +pgfmanual-figure247 +pgfmanual-figure248 +pgfmanual-figure249 +pgfmanual-figure250 +pgfmanual-figure251 +pgfmanual-figure252 +pgfmanual-figure253 +pgfmanual-figure254 +pgfmanual-figure255 +pgfmanual-figure256 +pgfmanual-figure257 +pgfmanual-figure258 +pgfmanual-figure259 +pgfmanual-figure260 +pgfmanual-figure261 +pgfmanual-figure262 +pgfmanual-figure263 +pgfmanual-figure264 +pgfmanual-figure265 +pgfmanual-figure266 +pgfmanual-figure267 +pgfmanual-figure268 +pgfmanual-figure269 +pgfmanual-figure270 +pgfmanual-figure271 +pgfmanual-figure272 +pgfmanual-figure273 +pgfmanual-figure274 +pgfmanual-figure275 +pgfmanual-figure276 +pgfmanual-figure277 +pgfmanual-figure278 +pgfmanual-figure279 +pgfmanual-figure280 +pgfmanual-figure281 +pgfmanual-figure282 +pgfmanual-figure283 +pgfmanual-figure284 +pgfmanual-figure285 +pgfmanual-figure286 +pgfmanual-figure287 +pgfmanual-figure288 +pgfmanual-figure289 +pgfmanual-figure290 +pgfmanual-figure291 +pgfmanual-figure292 +pgfmanual-figure293 +pgfmanual-figure294 +pgfmanual-figure295 +pgfmanual-figure296 +pgfmanual-figure297 +pgfmanual-figure298 +pgfmanual-figure299 +pgfmanual-figure300 +pgfmanual-figure301 +pgfmanual-figure302 +pgfmanual-figure303 +pgfmanual-figure304 +pgfmanual-figure305 +pgfmanual-figure306 +pgfmanual-figure307 +pgfmanual-figure308 +pgfmanual-figure309 +pgfmanual-figure310 +pgfmanual-figure311 +pgfmanual-figure312 +pgfmanual-figure313 +pgfmanual-figure314 +pgfmanual-figure315 +pgfmanual-figure316 +pgfmanual-figure317 +pgfmanual-figure318 +pgfmanual-figure319 +pgfmanual-figure320 +pgfmanual-figure321 +pgfmanual-figure322 +pgfmanual-figure323 +pgfmanual-figure324 +pgfmanual-figure325 +pgfmanual-figure326 +pgfmanual-figure327 +pgfmanual-figure328 +pgfmanual-figure329 +pgfmanual-figure330 +pgfmanual-figure331 +pgfmanual-figure332 +pgfmanual-figure333 +pgfmanual-figure334 +pgfmanual-figure335 +pgfmanual-figure336 +pgfmanual-figure337 +pgfmanual-figure338 +pgfmanual-figure339 +pgfmanual-figure340 +pgfmanual-figure341 +pgfmanual-figure342 +pgfmanual-figure343 +pgfmanual-figure344 +pgfmanual-figure345 +pgfmanual-figure346 +pgfmanual-figure347 +pgfmanual-figure348 +pgfmanual-figure349 +pgfmanual-figure350 +pgfmanual-figure351 +pgfmanual-figure352 +pgfmanual-figure353 +pgfmanual-figure354 +pgfmanual-figure355 +pgfmanual-figure356 +pgfmanual-figure357 +pgfmanual-figure358 +pgfmanual-figure359 +pgfmanual-figure360 +pgfmanual-figure361 +pgfmanual-figure362 +pgfmanual-figure363 +pgfmanual-figure364 +pgfmanual-figure365 +pgfmanual-figure366 +pgfmanual-figure367 +pgfmanual-figure368 +pgfmanual-figure369 +pgfmanual-figure370 +pgfmanual-figure371 +pgfmanual-figure372 +pgfmanual-figure373 +pgfmanual-figure374 +pgfmanual-figure375 +pgfmanual-figure376 +pgfmanual-figure377 +pgfmanual-figure378 +pgfmanual-figure379 +pgfmanual-figure380 +pgfmanual-figure381 +pgfmanual-figure382 +pgfmanual-figure383 +pgfmanual-figure384 +pgfmanual-figure385 +pgfmanual-figure386 +pgfmanual-figure387 +pgfmanual-figure388 +pgfmanual-figure389 +pgfmanual-figure390 +pgfmanual-figure391 +pgfmanual-figure392 +pgfmanual-figure393 +pgfmanual-figure394 +pgfmanual-figure395 +pgfmanual-figure396 +pgfmanual-figure397 +pgfmanual-figure398 +pgfmanual-figure399 +pgfmanual-figure400 +pgfmanual-figure401 +pgfmanual-figure402 +pgfmanual-figure403 +pgfmanual-figure404 +pgfmanual-figure405 +pgfmanual-figure406 +pgfmanual-figure407 +pgfmanual-figure408 +pgfmanual-figure409 +pgfmanual-figure410 +pgfmanual-figure411 +pgfmanual-figure412 +pgfmanual-figure413 +pgfmanual-figure414 +pgfmanual-figure415 +pgfmanual-figure416 +pgfmanual-figure417 +pgfmanual-figure418 +pgfmanual-figure419 +pgfmanual-figure420 +pgfmanual-figure421 +pgfmanual-figure422 +pgfmanual-figure423 +pgfmanual-figure424 +pgfmanual-figure425 +pgfmanual-figure426 +pgfmanual-figure427 +pgfmanual-figure428 +pgfmanual-figure429 +pgfmanual-figure430 +pgfmanual-figure431 +pgfmanual-figure432 +pgfmanual-figure433 +pgfmanual-figure434 +pgfmanual-figure435 +pgfmanual-figure436 +pgfmanual-figure437 +pgfmanual-figure438 +pgfmanual-figure439 +pgfmanual-figure440 +pgfmanual-figure441 +pgfmanual-figure442 +pgfmanual-figure443 +pgfmanual-figure444 +pgfmanual-figure445 +pgfmanual-figure446 +pgfmanual-figure447 +pgfmanual-figure448 +pgfmanual-figure449 +pgfmanual-figure450 +pgfmanual-figure451 +pgfmanual-figure452 +pgfmanual-figure453 +pgfmanual-figure454 +pgfmanual-figure455 +pgfmanual-figure456 +pgfmanual-figure457 +pgfmanual-figure458 +pgfmanual-figure459 +pgfmanual-figure460 +pgfmanual-figure461 +pgfmanual-figure462 +pgfmanual-figure463 +pgfmanual-figure464 +pgfmanual-figure465 +pgfmanual-figure466 +pgfmanual-figure467 +pgfmanual-figure468 +pgfmanual-figure469 +pgfmanual-figure470 +pgfmanual-figure471 +pgfmanual-figure472 +pgfmanual-figure473 +pgfmanual-figure474 +pgfmanual-figure475 +pgfmanual-figure476 +pgfmanual-figure477 +pgfmanual-figure478 +pgfmanual-figure479 +pgfmanual-figure480 +pgfmanual-figure481 +pgfmanual-figure482 +pgfmanual-figure483 +pgfmanual-figure484 +pgfmanual-figure485 +pgfmanual-figure486 +pgfmanual-figure487 +pgfmanual-figure488 +pgfmanual-figure489 +pgfmanual-figure490 +pgfmanual-figure491 +pgfmanual-figure492 +pgfmanual-figure493 +pgfmanual-figure494 +pgfmanual-figure495 +pgfmanual-figure496 +pgfmanual-figure497 +pgfmanual-figure498 +pgfmanual-figure499 +pgfmanual-figure500 +pgfmanual-figure501 +pgfmanual-figure502 +pgfmanual-figure503 +pgfmanual-figure504 +pgfmanual-figure505 +pgfmanual-figure506 +pgfmanual-figure507 +pgfmanual-figure508 +pgfmanual-figure509 +pgfmanual-figure510 +pgfmanual-figure511 +pgfmanual-figure512 +pgfmanual-figure513 +pgfmanual-figure514 +pgfmanual-figure515 +pgfmanual-figure516 +pgfmanual-figure517 +pgfmanual-figure518 +pgfmanual-figure519 +pgfmanual-figure520 +pgfmanual-figure521 +pgfmanual-figure522 +pgfmanual-figure523 +pgfmanual-figure524 +pgfmanual-figure525 +pgfmanual-figure526 +pgfmanual-figure527 +pgfmanual-figure528 +pgfmanual-figure529 +pgfmanual-figure530 +pgfmanual-figure531 +pgfmanual-figure532 +pgfmanual-figure533 +pgfmanual-figure534 +pgfmanual-figure535 +pgfmanual-figure536 +pgfmanual-figure537 +pgfmanual-figure538 +pgfmanual-figure539 +pgfmanual-figure540 +pgfmanual-figure541 +pgfmanual-figure542 +pgfmanual-figure543 +pgfmanual-figure544 +pgfmanual-figure545 +pgfmanual-figure546 +pgfmanual-figure547 +pgfmanual-figure548 +pgfmanual-figure549 +pgfmanual-figure550 +pgfmanual-figure551 +pgfmanual-figure552 +pgfmanual-figure553 +pgfmanual-figure554 +pgfmanual-figure555 +pgfmanual-figure556 +pgfmanual-figure557 +pgfmanual-figure558 +pgfmanual-figure559 +pgfmanual-figure560 +pgfmanual-figure561 +pgfmanual-figure562 +pgfmanual-figure563 +pgfmanual-figure564 +pgfmanual-figure565 +pgfmanual-figure566 +pgfmanual-figure567 +pgfmanual-figure568 +pgfmanual-figure569 +pgfmanual-figure570 +pgfmanual-figure571 +pgfmanual-figure572 +pgfmanual-figure573 +pgfmanual-figure574 +pgfmanual-figure575 +pgfmanual-figure576 +pgfmanual-figure577 +pgfmanual-figure578 +pgfmanual-figure579 +pgfmanual-figure580 +pgfmanual-figure581 +pgfmanual-figure582 +pgfmanual-figure583 +pgfmanual-figure584 +pgfmanual-figure585 +pgfmanual-figure586 +pgfmanual-figure587 +pgfmanual-figure588 +pgfmanual-figure589 +pgfmanual-figure590 +pgfmanual-figure591 +pgfmanual-figure592 +pgfmanual-figure593 +pgfmanual-figure594 +pgfmanual-figure595 +pgfmanual-figure596 +pgfmanual-figure597 +pgfmanual-figure598 +pgfmanual-figure599 +pgfmanual-figure600 +pgfmanual-figure601 +pgfmanual-figure602 +pgfmanual-figure603 +pgfmanual-figure604 +pgfmanual-figure605 +pgfmanual-figure606 +pgfmanual-figure607 +pgfmanual-figure608 +pgfmanual-figure609 +pgfmanual-figure610 +pgfmanual-figure611 +pgfmanual-figure612 +pgfmanual-figure613 +pgfmanual-figure614 +pgfmanual-figure615 +pgfmanual-figure616 +pgfmanual-figure617 +pgfmanual-figure618 +pgfmanual-figure619 +pgfmanual-figure620 +pgfmanual-figure621 +pgfmanual-figure622 +pgfmanual-figure623 +pgfmanual-figure624 +pgfmanual-figure625 +pgfmanual-figure626 +pgfmanual-figure627 +pgfmanual-figure628 +pgfmanual-figure629 +pgfmanual-figure630 +pgfmanual-figure631 +pgfmanual-figure632 +pgfmanual-figure633 +pgfmanual-figure634 +pgfmanual-figure635 +pgfmanual-figure636 +pgfmanual-figure637 +pgfmanual-figure638 +pgfmanual-figure639 +pgfmanual-figure640 +pgfmanual-figure641 +pgfmanual-figure642 +pgfmanual-figure643 +pgfmanual-figure644 +pgfmanual-figure645 +pgfmanual-figure646 +pgfmanual-figure647 +pgfmanual-figure648 +pgfmanual-figure649 +pgfmanual-figure650 +pgfmanual-figure651 +pgfmanual-figure652 +pgfmanual-figure653 +pgfmanual-figure654 +pgfmanual-figure655 +pgfmanual-figure656 +pgfmanual-figure657 +pgfmanual-figure658 +pgfmanual-figure659 +pgfmanual-figure660 +pgfmanual-figure661 +pgfmanual-figure662 +pgfmanual-figure663 +pgfmanual-figure664 +pgfmanual-figure665 +pgfmanual-figure666 +pgfmanual-figure667 +pgfmanual-figure668 +pgfmanual-figure669 +pgfmanual-figure670 +pgfmanual-figure671 +pgfmanual-figure672 +pgfmanual-figure673 +pgfmanual-figure674 +pgfmanual-figure675 +pgfmanual-figure676 +pgfmanual-figure677 +pgfmanual-figure678 +pgfmanual-figure679 +pgfmanual-figure680 +pgfmanual-figure681 +pgfmanual-figure682 +pgfmanual-figure683 +pgfmanual-figure684 +pgfmanual-figure685 +pgfmanual-figure686 +pgfmanual-figure687 +pgfmanual-figure688 +pgfmanual-figure689 +pgfmanual-figure690 +pgfmanual-figure691 +pgfmanual-figure692 +pgfmanual-figure693 +pgfmanual-figure694 +pgfmanual-figure695 +pgfmanual-figure696 +pgfmanual-figure697 +pgfmanual-figure698 +pgfmanual-figure699 +pgfmanual-figure700 +pgfmanual-figure701 +pgfmanual-figure702 +pgfmanual-figure703 +pgfmanual-figure704 +pgfmanual-figure705 +pgfmanual-figure706 +pgfmanual-figure707 +pgfmanual-figure708 +pgfmanual-figure709 +pgfmanual-figure710 +pgfmanual-figure711 +pgfmanual-figure712 +pgfmanual-figure713 +pgfmanual-figure714 +pgfmanual-figure715 +pgfmanual-figure716 +pgfmanual-figure717 +pgfmanual-figure718 +pgfmanual-figure719 +pgfmanual-figure720 +pgfmanual-figure721 +pgfmanual-figure722 +pgfmanual-figure723 +pgfmanual-figure724 +pgfmanual-figure725 +pgfmanual-figure726 +pgfmanual-figure727 +pgfmanual-figure728 +pgfmanual-figure729 +pgfmanual-figure730 +pgfmanual-figure731 +pgfmanual-figure732 +pgfmanual-figure733 +pgfmanual-figure734 +pgfmanual-figure735 +pgfmanual-figure736 +pgfmanual-figure737 +pgfmanual-figure738 +pgfmanual-figure739 +pgfmanual-figure740 +pgfmanual-figure741 +pgfmanual-figure742 +pgfmanual-figure743 +pgfmanual-figure744 +pgfmanual-figure745 +pgfmanual-figure746 +pgfmanual-figure747 +pgfmanual-figure748 +pgfmanual-figure749 +pgfmanual-figure750 +pgfmanual-figure751 +pgfmanual-figure752 +pgfmanual-figure753 +pgfmanual-figure754 +pgfmanual-figure755 +pgfmanual-figure756 +pgfmanual-figure757 +pgfmanual-figure758 +pgfmanual-figure759 +pgfmanual-figure760 +pgfmanual-figure761 +pgfmanual-figure762 +pgfmanual-figure763 +pgfmanual-figure764 +pgfmanual-figure765 +pgfmanual-figure766 +pgfmanual-figure767 +pgfmanual-figure768 +pgfmanual-figure769 +pgfmanual-figure770 +pgfmanual-figure771 +pgfmanual-figure772 +pgfmanual-figure773 +pgfmanual-figure774 +pgfmanual-figure775 +pgfmanual-figure776 +pgfmanual-figure777 +pgfmanual-figure778 +pgfmanual-figure779 +pgfmanual-figure780 +pgfmanual-figure781 +pgfmanual-figure782 +pgfmanual-figure783 +pgfmanual-figure784 +pgfmanual-figure785 +pgfmanual-figure786 +pgfmanual-figure787 +pgfmanual-figure788 +pgfmanual-figure789 +pgfmanual-figure790 +pgfmanual-figure791 +pgfmanual-figure792 +pgfmanual-figure793 +pgfmanual-figure794 +pgfmanual-figure795 +pgfmanual-figure796 +pgfmanual-figure797 +pgfmanual-figure798 +pgfmanual-figure799 +pgfmanual-figure800 +pgfmanual-figure801 +pgfmanual-figure802 +pgfmanual-figure803 +pgfmanual-figure804 +pgfmanual-figure805 +pgfmanual-figure806 +pgfmanual-figure807 +pgfmanual-figure808 +pgfmanual-figure809 +pgfmanual-figure810 +pgfmanual-figure811 +pgfmanual-figure812 +pgfmanual-figure813 +pgfmanual-figure814 +pgfmanual-figure815 +pgfmanual-figure816 +pgfmanual-figure817 +pgfmanual-figure818 +pgfmanual-figure819 +pgfmanual-figure820 +pgfmanual-figure821 +pgfmanual-figure822 +pgfmanual-figure823 +pgfmanual-figure824 +pgfmanual-figure825 +pgfmanual-figure826 +pgfmanual-figure827 +pgfmanual-figure828 +pgfmanual-figure829 +pgfmanual-figure830 +pgfmanual-figure831 +pgfmanual-figure832 +pgfmanual-figure833 +pgfmanual-figure834 +pgfmanual-figure835 +pgfmanual-figure836 +pgfmanual-figure837 +pgfmanual-figure838 +pgfmanual-figure839 +pgfmanual-figure840 +pgfmanual-figure841 +pgfmanual-figure842 +pgfmanual-figure843 +pgfmanual-figure844 +pgfmanual-figure845 +pgfmanual-figure846 +pgfmanual-figure847 +pgfmanual-figure848 +pgfmanual-figure849 +pgfmanual-figure850 +pgfmanual-figure851 +pgfmanual-figure852 +pgfmanual-figure853 +pgfmanual-figure854 +pgfmanual-figure855 +pgfmanual-figure856 +pgfmanual-figure857 +pgfmanual-figure858 +pgfmanual-figure859 +pgfmanual-figure860 +pgfmanual-figure861 +pgfmanual-figure862 +pgfmanual-figure863 +pgfmanual-figure864 +pgfmanual-figure865 +pgfmanual-figure866 +pgfmanual-figure867 +pgfmanual-figure868 +pgfmanual-figure869 +pgfmanual-figure870 +pgfmanual-figure871 +pgfmanual-figure872 +pgfmanual-figure873 +pgfmanual-figure874 +pgfmanual-figure875 +pgfmanual-figure876 +pgfmanual-figure877 +pgfmanual-figure878 +pgfmanual-figure879 +pgfmanual-figure880 +pgfmanual-figure881 +pgfmanual-figure882 +pgfmanual-figure883 +pgfmanual-figure884 +pgfmanual-figure885 +pgfmanual-figure886 +pgfmanual-figure887 +pgfmanual-figure888 +pgfmanual-figure889 +pgfmanual-figure890 +pgfmanual-figure891 +pgfmanual-figure892 +pgfmanual-figure893 +pgfmanual-figure894 +pgfmanual-figure895 +pgfmanual-figure896 +pgfmanual-figure897 +pgfmanual-figure898 +pgfmanual-figure899 +pgfmanual-figure900 +pgfmanual-figure901 +pgfmanual-figure902 +pgfmanual-figure903 +pgfmanual-figure904 +pgfmanual-figure905 +pgfmanual-figure906 +pgfmanual-figure907 +pgfmanual-figure908 +pgfmanual-figure909 +pgfmanual-figure910 +pgfmanual-figure911 +pgfmanual-figure912 +pgfmanual-figure913 +pgfmanual-figure914 +pgfmanual-figure915 +pgfmanual-figure916 +pgfmanual-figure917 +pgfmanual-figure918 +pgfmanual-figure919 +pgfmanual-figure920 +pgfmanual-figure921 +pgfmanual-figure922 +pgfmanual-figure923 +pgfmanual-figure924 +pgfmanual-figure925 +pgfmanual-figure926 +pgfmanual-figure927 +pgfmanual-figure928 +pgfmanual-figure929 +pgfmanual-figure930 +pgfmanual-figure931 +pgfmanual-figure932 +pgfmanual-figure933 +pgfmanual-figure934 +pgfmanual-figure935 +pgfmanual-figure936 +pgfmanual-figure937 +pgfmanual-figure938 +pgfmanual-figure939 +pgfmanual-figure940 +pgfmanual-figure941 +pgfmanual-figure942 +pgfmanual-figure943 +pgfmanual-figure944 +pgfmanual-figure945 +pgfmanual-figure946 +pgfmanual-figure947 +pgfmanual-figure948 +pgfmanual-figure949 +pgfmanual-figure950 +pgfmanual-figure951 +pgfmanual-figure952 +pgfmanual-figure953 +pgfmanual-figure954 +pgfmanual-figure955 +pgfmanual-figure956 +pgfmanual-figure957 +pgfmanual-figure958 +pgfmanual-figure959 +pgfmanual-figure960 +pgfmanual-figure961 +pgfmanual-figure962 +pgfmanual-figure963 +pgfmanual-figure964 +pgfmanual-figure965 +pgfmanual-figure966 +pgfmanual-figure967 +pgfmanual-figure968 +pgfmanual-figure969 +pgfmanual-figure970 +pgfmanual-figure971 +pgfmanual-figure972 +pgfmanual-figure973 +pgfmanual-figure974 +pgfmanual-figure975 +pgfmanual-figure976 +pgfmanual-figure977 +pgfmanual-figure978 +pgfmanual-figure979 +pgfmanual-figure980 +pgfmanual-figure981 +pgfmanual-figure982 +pgfmanual-figure983 +pgfmanual-figure984 +pgfmanual-figure985 +pgfmanual-figure986 +pgfmanual-figure987 +pgfmanual-figure988 +pgfmanual-figure989 +pgfmanual-figure990 +pgfmanual-figure991 +pgfmanual-figure992 +pgfmanual-figure993 +pgfmanual-figure994 +pgfmanual-figure995 +pgfmanual-figure996 +pgfmanual-figure997 +pgfmanual-figure998 +pgfmanual-figure999 +pgfmanual-figure1000 +pgfmanual-figure1001 +pgfmanual-figure1002 +pgfmanual-figure1003 +pgfmanual-figure1004 +pgfmanual-figure1005 +pgfmanual-figure1006 +pgfmanual-figure1007 +pgfmanual-figure1008 +pgfmanual-figure1009 +pgfmanual-figure1010 +pgfmanual-figure1011 +pgfmanual-figure1012 +pgfmanual-figure1013 +pgfmanual-figure1014 +pgfmanual-figure1015 +pgfmanual-figure1016 +pgfmanual-figure1017 +pgfmanual-figure1018 +pgfmanual-figure1019 +pgfmanual-figure1020 +pgfmanual-figure1021 +pgfmanual-figure1022 +pgfmanual-figure1023 +pgfmanual-figure1024 +pgfmanual-figure1025 +pgfmanual-figure1026 +pgfmanual-figure1027 +pgfmanual-figure1028 +pgfmanual-figure1029 +pgfmanual-figure1030 +pgfmanual-figure1031 +pgfmanual-figure1032 +pgfmanual-figure1033 +pgfmanual-figure1034 +pgfmanual-figure1035 +pgfmanual-figure1036 +pgfmanual-figure1037 +pgfmanual-figure1038 +pgfmanual-figure1039 +pgfmanual-figure1040 +pgfmanual-figure1041 +pgfmanual-figure1042 +pgfmanual-figure1043 +pgfmanual-figure1044 +pgfmanual-figure1045 +pgfmanual-figure1046 +pgfmanual-figure1047 +pgfmanual-figure1048 +pgfmanual-figure1049 +pgfmanual-figure1050 +pgfmanual-figure1051 +pgfmanual-figure1052 +pgfmanual-figure1053 +pgfmanual-figure1054 +pgfmanual-figure1055 +pgfmanual-figure1056 +pgfmanual-figure1057 +pgfmanual-figure1058 +pgfmanual-figure1059 +pgfmanual-figure1060 +pgfmanual-figure1061 +pgfmanual-figure1062 +pgfmanual-figure1063 +pgfmanual-figure1064 +pgfmanual-figure1065 +pgfmanual-figure1066 +pgfmanual-figure1067 +pgfmanual-figure1068 +pgfmanual-figure1069 +pgfmanual-figure1070 +pgfmanual-figure1071 +pgfmanual-figure1072 +pgfmanual-figure1073 +pgfmanual-figure1074 +pgfmanual-figure1075 +pgfmanual-figure1076 +pgfmanual-figure1077 +pgfmanual-figure1078 +pgfmanual-figure1079 +pgfmanual-figure1080 +pgfmanual-figure1081 +pgfmanual-figure1082 +pgfmanual-figure1083 +pgfmanual-figure1084 +pgfmanual-figure1085 +pgfmanual-figure1086 +pgfmanual-figure1087 +pgfmanual-figure1088 +pgfmanual-figure1089 +pgfmanual-figure1090 +pgfmanual-figure1091 +pgfmanual-figure1092 +pgfmanual-figure1093 +pgfmanual-figure1094 +pgfmanual-figure1095 +pgfmanual-figure1096 +pgfmanual-figure1097 +pgfmanual-figure1098 +pgfmanual-figure1099 +pgfmanual-figure1100 +pgfmanual-figure1101 +pgfmanual-figure1102 +pgfmanual-figure1103 +pgfmanual-figure1104 +pgfmanual-figure1105 +pgfmanual-figure1106 +pgfmanual-figure1107 +pgfmanual-figure1108 +pgfmanual-figure1109 +pgfmanual-figure1110 +pgfmanual-figure1111 +pgfmanual-figure1112 +pgfmanual-figure1113 +pgfmanual-figure1114 +pgfmanual-figure1115 +pgfmanual-figure1116 +pgfmanual-figure1117 +pgfmanual-figure1118 +pgfmanual-figure1119 +pgfmanual-figure1120 +pgfmanual-figure1121 +pgfmanual-figure1122 +pgfmanual-figure1123 +pgfmanual-figure1124 +pgfmanual-figure1125 +pgfmanual-figure1126 +pgfmanual-figure1127 +pgfmanual-figure1128 +pgfmanual-figure1129 +pgfmanual-figure1130 +pgfmanual-figure1131 +pgfmanual-figure1132 +pgfmanual-figure1133 +pgfmanual-figure1134 +pgfmanual-figure1135 +pgfmanual-figure1136 +pgfmanual-figure1137 +pgfmanual-figure1138 +pgfmanual-figure1139 +pgfmanual-figure1140 +pgfmanual-figure1141 +pgfmanual-figure1142 +pgfmanual-figure1143 +pgfmanual-figure1144 +pgfmanual-figure1145 +pgfmanual-figure1146 +pgfmanual-figure1147 +pgfmanual-figure1148 +pgfmanual-figure1149 +pgfmanual-figure1150 +pgfmanual-figure1151 +pgfmanual-figure1152 +pgfmanual-figure1153 +pgfmanual-figure1154 +pgfmanual-figure1155 +pgfmanual-figure1156 +pgfmanual-figure1157 +pgfmanual-figure1158 +pgfmanual-figure1159 +pgfmanual-figure1160 +pgfmanual-figure1161 +pgfmanual-figure1162 +pgfmanual-figure1163 +pgfmanual-figure1164 +pgfmanual-figure1165 +pgfmanual-figure1166 +pgfmanual-figure1167 +pgfmanual-figure1168 +pgfmanual-figure1169 +pgfmanual-figure1170 +pgfmanual-figure1171 +pgfmanual-figure1172 +pgfmanual-figure1173 +pgfmanual-figure1174 +pgfmanual-figure1175 +pgfmanual-figure1176 +pgfmanual-figure1177 +pgfmanual-figure1178 +pgfmanual-figure1179 +pgfmanual-figure1180 +pgfmanual-figure1181 +pgfmanual-figure1182 +pgfmanual-figure1183 +pgfmanual-figure1184 +pgfmanual-figure1185 +pgfmanual-figure1186 +pgfmanual-figure1187 +pgfmanual-figure1188 +pgfmanual-figure1189 +pgfmanual-figure1190 +pgfmanual-figure1191 +pgfmanual-figure1192 +pgfmanual-figure1193 +pgfmanual-figure1194 +pgfmanual-figure1195 +pgfmanual-figure1196 +pgfmanual-figure1197 +pgfmanual-figure1198 +pgfmanual-figure1199 +pgfmanual-figure1200 +pgfmanual-figure1201 +pgfmanual-figure1202 +pgfmanual-figure1203 +pgfmanual-figure1204 +pgfmanual-figure1205 +pgfmanual-figure1206 +pgfmanual-figure1207 +pgfmanual-figure1208 +pgfmanual-figure1209 +pgfmanual-figure1210 +pgfmanual-figure1211 +pgfmanual-figure1212 +pgfmanual-figure1213 +pgfmanual-figure1214 +pgfmanual-figure1215 +pgfmanual-figure1216 +pgfmanual-figure1217 +pgfmanual-figure1218 +pgfmanual-figure1219 +pgfmanual-figure1220 +pgfmanual-figure1221 +pgfmanual-figure1222 +pgfmanual-figure1223 +pgfmanual-figure1224 +pgfmanual-figure1225 +pgfmanual-figure1226 +pgfmanual-figure1227 +pgfmanual-figure1228 +pgfmanual-figure1229 +pgfmanual-figure1230 +pgfmanual-figure1231 +pgfmanual-figure1232 +pgfmanual-figure1233 +pgfmanual-figure1234 +pgfmanual-figure1235 +pgfmanual-figure1236 +pgfmanual-figure1237 +pgfmanual-figure1238 +pgfmanual-figure1239 +pgfmanual-figure1240 +pgfmanual-figure1241 +pgfmanual-figure1242 +pgfmanual-figure1243 +pgfmanual-figure1244 +pgfmanual-figure1245 +pgfmanual-figure1246 +pgfmanual-figure1247 +pgfmanual-figure1248 +pgfmanual-figure1249 +pgfmanual-figure1250 +pgfmanual-figure1251 +pgfmanual-figure1252 +pgfmanual-figure1253 +pgfmanual-figure1254 +pgfmanual-figure1255 +pgfmanual-figure1256 +pgfmanual-figure1257 +pgfmanual-figure1258 +pgfmanual-figure1259 +pgfmanual-figure1260 +pgfmanual-figure1261 +pgfmanual-figure1262 +pgfmanual-figure1263 +pgfmanual-figure1264 +pgfmanual-figure1265 +pgfmanual-figure1266 +pgfmanual-figure1267 +pgfmanual-figure1268 +pgfmanual-figure1269 +pgfmanual-figure1270 +pgfmanual-figure1271 +pgfmanual-figure1272 +pgfmanual-figure1273 +pgfmanual-figure1274 +pgfmanual-figure1275 +pgfmanual-figure1276 +pgfmanual-figure1277 +pgfmanual-figure1278 +pgfmanual-figure1279 +pgfmanual-figure1280 +pgfmanual-figure1281 +pgfmanual-figure1282 +pgfmanual-figure1283 +pgfmanual-figure1284 +pgfmanual-figure1285 +pgfmanual-figure1286 +pgfmanual-figure1287 +pgfmanual-figure1288 +pgfmanual-figure1289 +pgfmanual-figure1290 +pgfmanual-figure1291 +pgfmanual-figure1292 +pgfmanual-figure1293 +pgfmanual-figure1294 +pgfmanual-figure1295 +pgfmanual-figure1296 +pgfmanual-figure1297 +pgfmanual-figure1298 +pgfmanual-figure1299 +pgfmanual-figure1300 +pgfmanual-figure1301 +pgfmanual-figure1302 +pgfmanual-figure1303 +pgfmanual-figure1304 +pgfmanual-figure1305 +pgfmanual-figure1306 +pgfmanual-figure1307 +pgfmanual-figure1308 +pgfmanual-figure1309 +pgfmanual-figure1310 +pgfmanual-figure1311 +pgfmanual-figure1312 +pgfmanual-figure1313 +pgfmanual-figure1314 +pgfmanual-figure1315 +pgfmanual-figure1316 +pgfmanual-figure1317 +pgfmanual-figure1318 +pgfmanual-figure1319 +pgfmanual-figure1320 +pgfmanual-figure1321 +pgfmanual-figure1322 +pgfmanual-figure1323 +pgfmanual-figure1324 +pgfmanual-figure1325 +pgfmanual-figure1326 +pgfmanual-figure1327 +pgfmanual-figure1328 +pgfmanual-figure1329 +pgfmanual-figure1330 +pgfmanual-figure1331 +pgfmanual-figure1332 +pgfmanual-figure1333 +pgfmanual-figure1334 +pgfmanual-figure1335 +pgfmanual-figure1336 +pgfmanual-figure1337 +pgfmanual-figure1338 +pgfmanual-figure1339 +pgfmanual-figure1340 +pgfmanual-figure1341 +pgfmanual-figure1342 +pgfmanual-figure1343 +pgfmanual-figure1344 +pgfmanual-figure1345 +pgfmanual-figure1346 +pgfmanual-figure1347 +pgfmanual-figure1348 +pgfmanual-figure1349 +pgfmanual-figure1350 +pgfmanual-figure1351 +pgfmanual-figure1352 +pgfmanual-figure1353 +pgfmanual-figure1354 +pgfmanual-figure1355 +pgfmanual-figure1356 +pgfmanual-figure1357 +pgfmanual-figure1358 +pgfmanual-figure1359 +pgfmanual-figure1360 +pgfmanual-figure1361 +pgfmanual-figure1362 +pgfmanual-figure1363 +pgfmanual-figure1364 +pgfmanual-figure1365 +pgfmanual-figure1366 +pgfmanual-figure1367 +pgfmanual-figure1368 +pgfmanual-figure1369 +pgfmanual-figure1370 +pgfmanual-figure1371 +pgfmanual-figure1372 +pgfmanual-figure1373 +pgfmanual-figure1374 +pgfmanual-figure1375 +pgfmanual-figure1376 +pgfmanual-figure1377 +pgfmanual-figure1378 +pgfmanual-figure1379 +pgfmanual-figure1380 +pgfmanual-figure1381 +pgfmanual-figure1382 +pgfmanual-figure1383 +pgfmanual-figure1384 +pgfmanual-figure1385 +pgfmanual-figure1386 +pgfmanual-figure1387 +pgfmanual-figure1388 +pgfmanual-figure1389 +pgfmanual-figure1390 +pgfmanual-figure1391 +pgfmanual-figure1392 +pgfmanual-figure1393 +pgfmanual-figure1394 +pgfmanual-figure1395 +pgfmanual-figure1396 +pgfmanual-figure1397 +pgfmanual-figure1398 +pgfmanual-figure1399 +pgfmanual-figure1400 +pgfmanual-figure1401 +pgfmanual-figure1402 +pgfmanual-figure1403 +pgfmanual-figure1404 +pgfmanual-figure1405 +pgfmanual-figure1406 +pgfmanual-figure1407 +pgfmanual-figure1408 +pgfmanual-figure1409 +pgfmanual-figure1410 +pgfmanual-figure1411 +pgfmanual-figure1412 +pgfmanual-figure1413 +pgfmanual-figure1414 +pgfmanual-figure1415 +pgfmanual-figure1416 +pgfmanual-figure1417 +pgfmanual-figure1418 +pgfmanual-figure1419 +pgfmanual-figure1420 +pgfmanual-figure1421 +pgfmanual-figure1422 +pgfmanual-figure1423 +pgfmanual-figure1424 +pgfmanual-figure1425 +pgfmanual-figure1426 +pgfmanual-figure1427 +pgfmanual-figure1428 +pgfmanual-figure1429 +pgfmanual-figure1430 +pgfmanual-figure1431 +pgfmanual-figure1432 +pgfmanual-figure1433 +pgfmanual-figure1434 +pgfmanual-figure1435 +pgfmanual-figure1436 +pgfmanual-figure1437 +pgfmanual-figure1438 +pgfmanual-figure1439 +pgfmanual-figure1440 +pgfmanual-figure1441 +pgfmanual-figure1442 +pgfmanual-figure1443 +pgfmanual-figure1444 +pgfmanual-figure1445 +pgfmanual-figure1446 +pgfmanual-figure1447 +pgfmanual-figure1448 +pgfmanual-figure1449 +pgfmanual-figure1450 +pgfmanual-figure1451 +pgfmanual-figure1452 +pgfmanual-figure1453 +pgfmanual-figure1454 +pgfmanual-figure1455 +pgfmanual-figure1456 +pgfmanual-figure1457 +pgfmanual-figure1458 +pgfmanual-figure1459 +pgfmanual-figure1460 +pgfmanual-figure1461 +pgfmanual-figure1462 +pgfmanual-figure1463 diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile index 571fd095be8..aebb669ae2e 100644 --- a/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile +++ b/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile @@ -13,5 +13,27 @@ pgfmanual.html: $(doc).tex $(doc).ind TEXINPUTS="$(TEXINPUTS)" htlatex $(doc).tex clean: - rm -f pgfmanual*.aux pgfmanual{.out,.log,.idx,.ind,.ilg,.pdf,.toc,.bbl,.blg,.ps,*.gif,*.html,*.svg,.xref,.css,.4ct,.4tc,.dvi,.lg,.idv} *.png - + rm -f \ + plots/* \ + pgfmanual.out \ + pgfmanual.log \ + pgfmanual.idx \ + pgfmanual.ind \ + pgfmanual.ilg \ + pgfmanual.pdf \ + pgfmanual.toc \ + pgfmanual.bbl \ + pgfmanual.blg \ + pgfmanual.ps \ + pgfmanual.*gif \ + pgfmanual.*html \ + pgfmanual.*svg \ + pgfmanual.xref \ + pgfmanual.css \ + pgfmanual.4ct \ + pgfmanual.4tc \ + pgfmanual.dvi \ + pgfmanual.lg \ + pgfmanual.idv \ + pgfmanual*.aux \ + *.png diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile index 780ecee91b2..ca3fce8d28f 100644 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile +++ b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile @@ -16,5 +16,17 @@ pgfmanual.ps: $(doc).tex $(doc).ind (egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true clean: - rm -f pgfmanual*.aux pgfmanual.{out,log,idx,ind,ilg,pdf,toc,bbl,blg,ps} - + rm -f \ + plots/* \ + pgfmanual.out \ + pgfmanual.log \ + pgfmanual.idx \ + pgfmanual.ind \ + pgfmanual.ilg \ + pgfmanual.pdf \ + pgfmanual.toc \ + pgfmanual.bbl \ + pgfmanual.blg \ + pgfmanual.ps \ + pgfmanual.dvi \ + pgfmanual*.aux diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.gnuplot deleted file mode 100644 index 4c854afda9f..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.gnuplot +++ /dev/null @@ -1,2 +0,0 @@ -set terminal table; set output "plots/pgf-asymptotic-example.table"; set format "%.5f" -set samples 200; set parametric; plot [t=0.4:1.5] (t*t*t)*sin(1/(t*t*t)),(t*t*t)*cos(1/(t*t*t)) diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.table deleted file mode 100644 index 173ab5e9c77..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.table +++ /dev/null @@ -1,204 +0,0 @@ -#Curve 0, 200 points -#x y type -0.00530 -0.06378 i -0.04363 -0.05043 i -0.06711 -0.01790 i -0.06896 0.02170 i -0.05014 0.05606 i -0.01712 0.07631 i --0.02110 0.07849 i --0.05579 0.06337 i --0.08032 0.03512 i --0.09097 -0.00029 i --0.08696 -0.03664 i --0.06987 -0.06850 i --0.04284 -0.09192 i --0.00982 -0.10460 i -0.02515 -0.10585 i -0.05841 -0.09629 i -0.08703 -0.07749 i -0.10892 -0.05162 i -0.12282 -0.02111 i -0.12828 0.01163 i -0.12547 0.04436 i -0.11507 0.07518 i -0.09810 0.10255 i -0.07579 0.12534 i -0.04948 0.14280 i -0.02048 0.15454 i --0.00995 0.16043 i --0.04065 0.16063 i --0.07063 0.15545 i --0.09905 0.14536 i --0.12521 0.13092 i --0.14860 0.11273 i --0.16882 0.09143 i --0.18562 0.06764 i --0.19885 0.04197 i --0.20848 0.01500 i --0.21454 -0.01276 i --0.21712 -0.04083 i --0.21637 -0.06879 i --0.21247 -0.09627 i --0.20565 -0.12295 i --0.19613 -0.14858 i --0.18415 -0.17294 i --0.16996 -0.19585 i --0.15379 -0.21718 i --0.13589 -0.23682 i --0.11647 -0.25471 i --0.09576 -0.27080 i --0.07396 -0.28508 i --0.05126 -0.29753 i --0.02783 -0.30819 i --0.00384 -0.31707 i -0.02057 -0.32421 i -0.04526 -0.32967 i -0.07011 -0.33350 i -0.09502 -0.33576 i -0.11989 -0.33651 i -0.14463 -0.33582 i -0.16917 -0.33376 i -0.19345 -0.33040 i -0.21741 -0.32580 i -0.24100 -0.32003 i -0.26418 -0.31315 i -0.28691 -0.30524 i -0.30918 -0.29634 i -0.33096 -0.28653 i -0.35222 -0.27585 i -0.37297 -0.26437 i -0.39318 -0.25213 i -0.41285 -0.23918 i -0.43197 -0.22557 i -0.45056 -0.21134 i -0.46860 -0.19654 i -0.48611 -0.18119 i -0.50309 -0.16535 i -0.51954 -0.14904 i -0.53547 -0.13229 i -0.55090 -0.11514 i -0.56582 -0.09761 i -0.58026 -0.07972 i -0.59422 -0.06150 i -0.60772 -0.04298 i -0.62076 -0.02416 i -0.63336 -0.00508 i -0.64554 0.01425 i -0.65729 0.03382 i -0.66864 0.05361 i -0.67960 0.07361 i -0.69018 0.09381 i -0.70039 0.11420 i -0.71024 0.13475 i -0.71975 0.15548 i -0.72892 0.17636 i -0.73778 0.19739 i -0.74632 0.21857 i -0.75456 0.23989 i -0.76251 0.26134 i -0.77018 0.28291 i -0.77759 0.30461 i -0.78473 0.32643 i -0.79162 0.34837 i -0.79826 0.37042 i -0.80468 0.39258 i -0.81087 0.41485 i -0.81684 0.43723 i -0.82261 0.45972 i -0.82817 0.48232 i -0.83354 0.50502 i -0.83872 0.52782 i -0.84372 0.55073 i -0.84855 0.57374 i -0.85321 0.59686 i -0.85772 0.62009 i -0.86206 0.64342 i -0.86626 0.66685 i -0.87032 0.69040 i -0.87423 0.71405 i -0.87801 0.73781 i -0.88167 0.76169 i -0.88520 0.78567 i -0.88861 0.80977 i -0.89191 0.83398 i -0.89510 0.85831 i -0.89818 0.88276 i -0.90115 0.90733 i -0.90403 0.93202 i -0.90682 0.95683 i -0.90951 0.98177 i -0.91211 1.00683 i -0.91463 1.03202 i -0.91707 1.05735 i -0.91942 1.08280 i -0.92171 1.10839 i -0.92391 1.13411 i -0.92605 1.15998 i -0.92812 1.18598 i -0.93012 1.21213 i -0.93205 1.23842 i -0.93393 1.26485 i -0.93575 1.29143 i -0.93751 1.31817 i -0.93921 1.34505 i -0.94086 1.37209 i -0.94246 1.39929 i -0.94401 1.42664 i -0.94552 1.45415 i -0.94697 1.48183 i -0.94838 1.50967 i -0.94975 1.53767 i -0.95108 1.56584 i -0.95236 1.59418 i -0.95361 1.62270 i -0.95482 1.65138 i -0.95600 1.68025 i -0.95713 1.70928 i -0.95824 1.73850 i -0.95931 1.76790 i -0.96035 1.79748 i -0.96136 1.82725 i -0.96234 1.85720 i -0.96329 1.88735 i -0.96422 1.91768 i -0.96511 1.94820 i -0.96598 1.97892 i -0.96683 2.00983 i -0.96765 2.04094 i -0.96845 2.07225 i -0.96922 2.10376 i -0.96998 2.13547 i -0.97071 2.16739 i -0.97142 2.19952 i -0.97211 2.23185 i -0.97278 2.26439 i -0.97344 2.29714 i -0.97407 2.33010 i -0.97469 2.36328 i -0.97529 2.39667 i -0.97588 2.43028 i -0.97644 2.46411 i -0.97700 2.49817 i -0.97754 2.53244 i -0.97806 2.56694 i -0.97857 2.60166 i -0.97906 2.63661 i -0.97955 2.67179 i -0.98001 2.70720 i -0.98047 2.74284 i -0.98092 2.77871 i -0.98135 2.81482 i -0.98177 2.85117 i -0.98218 2.88775 i -0.98258 2.92457 i -0.98297 2.96163 i -0.98335 2.99894 i -0.98372 3.03649 i -0.98408 3.07428 i -0.98443 3.11232 i -0.98477 3.15061 i -0.98511 3.18914 i -0.98543 3.22793 i - - diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.gnuplot deleted file mode 100644 index 1d34e313af8..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.gnuplot +++ /dev/null @@ -1,2 +0,0 @@ -set terminal table; set output "plots/pgf-exp.table"; set format "%.5f" -set samples 25; plot [x=0:4] 0.05*exp(x) diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.table deleted file mode 100644 index 8e728570397..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.table +++ /dev/null @@ -1,29 +0,0 @@ -#Curve 0, 25 points -#x y type -0.00000 0.05000 i -0.16667 0.05907 i -0.33333 0.06978 i -0.50000 0.08244 i -0.66667 0.09739 i -0.83333 0.11505 i -1.00000 0.13591 i -1.16667 0.16056 i -1.33333 0.18968 i -1.50000 0.22408 i -1.66667 0.26472 i -1.83333 0.31274 i -2.00000 0.36945 i -2.16667 0.43646 i -2.33333 0.51561 i -2.50000 0.60912 i -2.66667 0.71960 i -2.83333 0.85010 i -3.00000 1.00428 i -3.16667 1.18641 i -3.33333 1.40158 i -3.50000 1.65577 i -3.66667 1.95606 i -3.83333 2.31082 i -4.00000 2.72991 i - - diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.gnuplot deleted file mode 100644 index e1c3f3b52f2..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.gnuplot +++ /dev/null @@ -1,2 +0,0 @@ -set terminal table; set output "plots/pgf-parametric-example.table"; set format "%.5f" -set samples 25; set parametric; plot [t=-3.141:3.141] t*sin(t),t*cos(t) diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.table deleted file mode 100644 index de0c383ddde..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.table +++ /dev/null @@ -1,29 +0,0 @@ -#Curve 0, 25 points -#x y type -0.00186 3.14100 i -0.74672 2.78074 i -1.30987 2.26617 i -1.66651 1.66503 i -1.81387 1.04628 i -1.76998 0.47361 i -1.57050 -0.00047 i -1.26407 -0.33904 i -0.90663 -0.52368 i -0.55517 -0.55534 i -0.26171 -0.45339 i -0.06773 -0.25283 i -0.00000 -0.00000 i -0.06773 0.25283 i -0.26171 0.45339 i -0.55517 0.55534 i -0.90663 0.52368 i -1.26407 0.33904 i -1.57050 0.00047 i -1.76998 -0.47361 i -1.81387 -1.04628 i -1.66651 -1.66503 i -1.30987 -2.26617 i -0.74672 -2.78074 i -0.00186 -3.14100 i - - diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.gnuplot deleted file mode 100644 index 884d534bf4a..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.gnuplot +++ /dev/null @@ -1,2 +0,0 @@ -set terminal table; set output "plots/pgf-sin.table"; set format "%.5f" -set samples 25; plot [x=0:4] sin(x) diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.table deleted file mode 100644 index 9ab8f2c8d56..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.table +++ /dev/null @@ -1,29 +0,0 @@ -#Curve 0, 25 points -#x y type -0.00000 0.00000 i -0.16667 0.16590 i -0.33333 0.32719 i -0.50000 0.47943 i -0.66667 0.61837 i -0.83333 0.74018 i -1.00000 0.84147 i -1.16667 0.91944 i -1.33333 0.97194 i -1.50000 0.99749 i -1.66667 0.99541 i -1.83333 0.96573 i -2.00000 0.90930 i -2.16667 0.82766 i -2.33333 0.72309 i -2.50000 0.59847 i -2.66667 0.45727 i -2.83333 0.30340 i -3.00000 0.14112 i -3.16667 -0.02507 i -3.33333 -0.19057 i -3.50000 -0.35078 i -3.66667 -0.50128 i -3.83333 -0.63788 i -4.00000 -0.75680 i - - diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.gnuplot deleted file mode 100644 index bb95994cd89..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.gnuplot +++ /dev/null @@ -1,2 +0,0 @@ -set terminal table; set output "plots/pgf-x.table"; set format "%.5f" -set samples 25; plot [x=0:4] x diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.table deleted file mode 100644 index 329b9fa56b5..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.table +++ /dev/null @@ -1,29 +0,0 @@ -#Curve 0, 25 points -#x y type -0.00000 0.00000 i -0.16667 0.16667 i -0.33333 0.33333 i -0.50000 0.50000 i -0.66667 0.66667 i -0.83333 0.83333 i -1.00000 1.00000 i -1.16667 1.16667 i -1.33333 1.33333 i -1.50000 1.50000 i -1.66667 1.66667 i -1.83333 1.83333 i -2.00000 2.00000 i -2.16667 2.16667 i -2.33333 2.33333 i -2.50000 2.50000 i -2.66667 2.66667 i -2.83333 2.83333 i -3.00000 3.00000 i -3.16667 3.16667 i -3.33333 3.33333 i -3.50000 3.50000 i -3.66667 3.66667 i -3.83333 3.83333 i -4.00000 4.00000 i - - diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.gnuplot deleted file mode 100644 index 8e3f24b9172..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.gnuplot +++ /dev/null @@ -1,5 +0,0 @@ -set terminal table -set output "pgfmanual-sine.table" -set format "%.5f" -set samples 20 -plot [x=0:10] sin(x) diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.table deleted file mode 100644 index 9d5d248a561..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.table +++ /dev/null @@ -1,24 +0,0 @@ -#Curve 0, 20 points -#x y type -0.00000 0.00000 i -0.52632 0.50235 i -1.05263 0.86873 i -1.57895 0.99997 i -2.10526 0.86054 i -2.63158 0.48819 i -3.15789 -0.01630 i -3.68421 -0.51638 i -4.21053 -0.87669 i -4.73684 -0.99970 i -5.26316 -0.85212 i -5.78947 -0.47390 i -6.31579 0.03260 i -6.84211 0.53027 i -7.36842 0.88441 i -7.89474 0.99917 i -8.42105 0.84348 i -8.94737 0.45948 i -9.47368 -0.04889 i -10.00000 -0.54402 i - - diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.gnuplot deleted file mode 100644 index 3bd81ae92d1..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.gnuplot +++ /dev/null @@ -1,2 +0,0 @@ -set terminal table; set output "plots/pgfplotgnuplot-example.table"; set format "%.5f" -plot [x=0:3.5] x*sin(x) diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.table deleted file mode 100644 index a4e517898a8..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.table +++ /dev/null @@ -1,104 +0,0 @@ -#Curve 0, 100 points -#x y type -0.00000 0.00000 i -0.03535 0.00125 i -0.07071 0.00500 i -0.10606 0.01123 i -0.14141 0.01993 i -0.17677 0.03108 i -0.21212 0.04466 i -0.24747 0.06062 i -0.28283 0.07893 i -0.31818 0.09954 i -0.35354 0.12240 i -0.38889 0.14745 i -0.42424 0.17463 i -0.45960 0.20387 i -0.49495 0.23509 i -0.53030 0.26822 i -0.56566 0.30318 i -0.60101 0.33986 i -0.63636 0.37817 i -0.67172 0.41803 i -0.70707 0.45932 i -0.74242 0.50194 i -0.77778 0.54577 i -0.81313 0.59069 i -0.84848 0.63660 i -0.88384 0.68337 i -0.91919 0.73086 i -0.95455 0.77896 i -0.98990 0.82753 i -1.02525 0.87643 i -1.06061 0.92554 i -1.09596 0.97471 i -1.13131 1.02381 i -1.16667 1.07269 i -1.20202 1.12121 i -1.23737 1.16923 i -1.27273 1.21661 i -1.30808 1.26320 i -1.34343 1.30886 i -1.37879 1.35345 i -1.41414 1.39682 i -1.44949 1.43884 i -1.48485 1.47937 i -1.52020 1.51826 i -1.55556 1.55537 i -1.59091 1.59059 i -1.62626 1.62376 i -1.66162 1.65477 i -1.69697 1.68348 i -1.73232 1.70977 i -1.76768 1.73353 i -1.80303 1.75463 i -1.83838 1.77296 i -1.87374 1.78841 i -1.90909 1.80089 i -1.94444 1.81028 i -1.97980 1.81650 i -2.01515 1.81946 i -2.05051 1.81906 i -2.08586 1.81524 i -2.12121 1.80792 i -2.15657 1.79704 i -2.19192 1.78252 i -2.22727 1.76433 i -2.26263 1.74240 i -2.29798 1.71671 i -2.33333 1.68720 i -2.36869 1.65386 i -2.40404 1.61667 i -2.43939 1.57560 i -2.47475 1.53066 i -2.51010 1.48184 i -2.54545 1.42915 i -2.58081 1.37260 i -2.61616 1.31223 i -2.65152 1.24805 i -2.68687 1.18011 i -2.72222 1.10845 i -2.75758 1.03312 i -2.79293 0.95418 i -2.82828 0.87170 i -2.86364 0.78576 i -2.89899 0.69642 i -2.93434 0.60380 i -2.96970 0.50797 i -3.00505 0.40904 i -3.04040 0.30713 i -3.07576 0.20235 i -3.11111 0.09482 i -3.14646 -0.01533 i -3.18182 -0.12796 i -3.21717 -0.24292 i -3.25253 -0.36007 i -3.28788 -0.47926 i -3.32323 -0.60032 i -3.35859 -0.72308 i -3.39394 -0.84739 i -3.42929 -0.97305 i -3.46465 -1.09990 i -3.50000 -1.22774 i - - diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile new file mode 100644 index 00000000000..4b0b147f908 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile @@ -0,0 +1,33 @@ +rerun = "(There were undefined references|Rerun to get (cross-references|the bars) right)" +doc = pgfmanual +latex = xelatex --no-pdf +TEXINPUTS := ../../text-en:$(TEXINPUTS) + +all: $(doc).pdf + +pgfmanual.idx: + touch pgfmanual.idx + +pgfmanual.ind: pgfmanual.idx + makeindex $(doc).idx + +pgfmanual.pdf: $(doc).tex $(doc).ind + (TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true + (egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true + xdvipdfmx -p a4 $(doc) + +clean: + rm -f \ + plots/* \ + pgfmanual.out \ + pgfmanual.log \ + pgfmanual.idx \ + pgfmanual.ind \ + pgfmanual.ilg \ + pgfmanual.pdf \ + pgfmanual.toc \ + pgfmanual.bbl \ + pgfmanual.blg \ + pgfmanual.ps \ + pgfmanual.dvi \ + pgfmanual*.aux diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex new file mode 100644 index 00000000000..647d821179a --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex @@ -0,0 +1,16 @@ +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\documentclass[a4paper]{ltxdoc} + +% pgf version is defined in \pgfversion in file +% generic/pgf/utilities/pgfrcs.code.tex + +\input{../pgfmanual-xetex.cfg} +\input{../../text-en/pgfmanual-en-main.tex} diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg new file mode 100644 index 00000000000..0466c698f54 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg @@ -0,0 +1,16 @@ +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + + +\usepackage[xetex]{graphics} +% This will tell everyone which driver we are using. + +\usepackage[xetex]{hyperref} + +% Make sure to compile this using xelatex + xdvipdfmx. |