diff --git a/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex b/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex index 1dea8b28a..2f6fd0161 100644 --- a/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex +++ b/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex @@ -106,6 +106,28 @@ \subsection{Overview and Common Options} \end{key} +\subsection{Handling ``Dimension too large'' errors} + +In case you should run into a ``Dimension too large error'' when using the +|decorations| libraries, there is a pretty high chance that you can resolve +this by using the |fpu| library in combination with +|/pgf/fpu/install only={reciprocal}|. Please note that this key should only be +applied locally to avoid other errors (see also at the definition of this key +on page~\pageref{fpu-install-only}). +% +\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings,fpu}}] +\begin{tikzpicture} + \begin{scope}[/pgf/fpu/install only={reciprocal}] + \draw[postaction=decorate,decoration={ + markings,mark=at position 0.52 with { + \draw circle[radius=2pt]; + }}, + ] plot[smooth,variable=\x,domain=-1:1] (\x*\x*\x,\x*\x); + \end{scope} +\end{tikzpicture} +\end{codeexample} + + \subsection{Path Morphing Decorations} \begin{pgflibrary}{decorations.pathmorphing} diff --git a/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex b/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex index 186c83960..04989eef4 100644 --- a/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex +++ b/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex @@ -148,25 +148,30 @@ \subsection{Usage} \end{command} \begin{key}{/pgf/fpu/install only=\marg{list of names}} + \label{fpu-install-only} Unfortunately, the FPU is currently incompatible with drawing operations. However, it can still be useful to replace single definitions with FPU - counterparts to avoid errors of the kind |Dimension too large| which tend to - happen when transformation matrices are inverted. + counterparts to avoid errors of the kind |Dimension too large| which tend + to happen when transformation matrices are inverted. - This key allows to specify a list of definitions to be pulled into the current - scope. \emph{Note that there is no reverse operation to uninstall these - definitions at the moment}, so it is advisable to do this in a group. - Conveniently, \tikzname\ paths form an implicit group, so you can use this key - on a path as well. + This key allows to specify a list of definitions to be pulled into the + current scope. \emph{Note that there is no reverse operation to uninstall + these definitions at the moment}, so it is advisable to do this in a group. + Conveniently, \tikzname{} paths form an implicit group, so you can use this + key on a path as well. You have to be aware of the limitations that the FPU imposes. It will not - magically give TeX better precision, but it will avoid overflow or underflow - situation for large or small operands by rescaling them. In the following - example, in the first case the FPU variant performs much better than the - normal variant, however, in the second case where a rescaling would not in - fact be needed the rescaling introduces a small round-off error. - % -\begin{codeexample}[preamble={\usepgflibrary{fpu}},pre={\pgfkeys{/pgf/fpu=false}}] + magically give \TeX{} better precision, but it will avoid overflow or + underflow situations for large or small operands by rescaling them. In the + following example, in the first case the FPU variant performs much better + than the normal variant, however, in the second case where a rescaling + would not in fact be needed the rescaling introduces a small round-off + error. + % +\begin{codeexample}[ + preamble={\usepgflibrary{fpu}}, + pre={\pgfkeys{/pgf/fpu=false}}, +] \begingroup \pgfkeys{/pgf/fpu/install only={divide}} \pgfmathparse{12.34/0.001234}\pgfmathresult (good) diff --git a/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex b/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex index 53284b980..816464c0e 100644 --- a/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex +++ b/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex @@ -12,7 +12,8 @@ \section{Matrix Library} \begin{tikzlibrary}{matrix} This library package defines additional styles and options for creating - matrices. + matrices. The basic matrix styles and options can be found in + Section~\ref{section-matrices}. \end{tikzlibrary} diff --git a/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex b/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex index adfb7c045..d5f9e0f54 100644 --- a/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex +++ b/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex @@ -413,7 +413,7 @@ \subsubsection{Cell Styles and Options} columns, or cells. If more than one of these styles is defined, they are executed in the below order (the |every cell| style is executed before all of the below). - % +% \begin{stylekey}{/tikz/column \meta{number}} This style is used for every cell in column \meta{number}. \end{stylekey} @@ -485,7 +485,7 @@ \subsubsection{Cell Styles and Options} \begin{codeexample}[preamble={\usetikzlibrary{matrix,shapes.misc}}] \begin{tikzpicture} [mycol/.style={column #1/.append style={ - every even row/.style={nodes={fill=gray!10}}} + every even row/.style={nodes={fill=gray!20}}} }] \matrix [matrix of nodes, nodes in empty cells, @@ -494,11 +494,11 @@ \subsubsection{Cell Styles and Options} mycol/.list={1,...,5}, % add mycol style to all cols column 1/.style={ row 1 column 1/.style={nodes={fill=none, draw=none}}, - nodes={fill=yellow, chamfered rectangle, inner sep=0, + nodes={fill=yellow!75!black, chamfered rectangle, inner sep=0, chamfered rectangle corners={north west, south east}}, }, row 1/.style={nodes={text depth=0.2ex, text width=2cm, text=white}}, - column 2/.append style={row 1/.append style={nodes={fill=green}}}, + column 2/.append style={row 1/.append style={nodes={fill=green!75!black}}}, column 3/.append style={every even row/.style={nodes={fill=red!10}}, row 1 column 3/.append style={nodes={fill=red}} }, @@ -521,7 +521,6 @@ \subsubsection{Cell Styles and Options} \end{tikzpicture} \end{codeexample} - The order in which these styles are applied is configurable. You can also install your own styles. The following styles (in fact, internally they are |/.code| keys) wrap the styles introduced in the previous paragraph passing the @@ -543,14 +542,14 @@ \subsubsection{Cell Styles and Options} \begin{stylekey}{/tikz/matrix/inner style/even odd row} Wraps |/tikz/every even row| and |/tikz/every odd row|. \end{stylekey} -\begin{stylekey}{/tikz/matrix/inner style/this cell} +\begin{stylekey}{/tikz/matrix/inner style/cell} Wraps |/tikz/row |\meta{number}| column |\meta{number}. \end{stylekey} \begin{stylekey}{/tikz/matrix/inner style order} - The order in which these styles are applied to the matrix cells is specified - by this key. By default it is - % + The order in which these styles are applied to the matrix cells is + specified by this key. By default it is + % \begin{codeexample}[code only] \tikzset{ matrix/inner style order={ @@ -559,16 +558,16 @@ \subsubsection{Cell Styles and Options} even odd column, row, even odd row, - this cell + cell } } \end{codeexample} - % - You can use this to install your own styles here, but only \emph{names} of - styles are permitted here. The style specification has to be placed - outside of |matrix/inner style order| and unless it is installed inside - |/tikz/matrix/inner style/|, it has to be fully qualified. - % + % + You can use this to install your own styles here, but only \emph{names} of + styles are permitted here. The style specification has to be placed + outside of |matrix/inner style order| and unless it is installed inside + |/tikz/matrix/inner style/|, it has to be fully qualified. + % \begin{codeexample}[code only] \tikzset{ my style/.code={% @@ -582,12 +581,12 @@ \subsubsection{Cell Styles and Options} even odd row, column, row, - this cell, + cell, /tikz/my style } } \end{codeexample} - % + % \end{stylekey} In many matrices all cell pictures have nearly the same code. For example, diff --git a/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex b/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex index 5d2e4a7a0..e0767928e 100644 --- a/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex +++ b/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex @@ -1708,11 +1708,11 @@ \subsubsection{Advanced Placement Options} \end{key} -\subsubsection{Advanced Arrangements of Nodes} +\subsubsection{Advanced Arrangements of Nodes} The simple |above| and |right| options may not always suffice for arranging a large number of nodes. For such situations \tikzname\ offers libraries that -make positioning easier: The |graphdrawing| library and the |matrix| library. +make positioning easier: The |matrix| library and the |graphdrawing| library. These libraries for positioning nodes are described in two separate Sections~\ref{section-matrices} and~\ref{section-intro-gd}. diff --git a/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex b/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex index c23308189..d0194f972 100644 --- a/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex +++ b/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex @@ -4023,7 +4023,7 @@ \tikzset{every even row/.try}% \fi }, - matrix/inner style/this cell/.code={% + matrix/inner style/cell/.code={% \tikzset{row \the\pgfmatrixcurrentrow\space column \the\pgfmatrixcurrentcolumn/.try}% }, matrix/inner style order/.store in=\tikz@common@matrix@code@styleorder, @@ -4033,7 +4033,7 @@ even odd column, row, even odd row, - this cell + cell }, }% @@ -4089,8 +4089,12 @@ \let\tikz@options=\pgfutil@empty% \let\tikz@mode=\pgfutil@empty% \pgfutil@for\pgf@temp:=\tikz@common@matrix@code@styleorder\do{% - \expandafter\def\expandafter\pgf@temp\expandafter{\romannumeral-`0\expandafter\pgfutil@trimspaces\expandafter{\pgf@temp}}% - \pgfutil@ifempty\pgf@temp{}{\expandafter\tikzset\expandafter{matrix/inner style/.cd,\pgf@temp/.try}}% + \toks0=\expandafter{\romannumeral-`0\expandafter\pgfutil@trimspaces\expandafter{\pgf@temp}}% + \def\pgf@marshal{}% + \pgfutil@ifempty\pgf@temp{}{% + \edef\pgf@marshal{\noexpand\tikzset{matrix/inner style/.cd,\the\toks0}}% + }% + \pgf@marshal }% \tikz@options% }%