Background: I am trying to apply multiple decorations to a path in a TikZ picture. In this particular case, my attempts fail as the maximum dimension PGF can calculate with is exceeded.
This is not exactly the path I had trouble with (as that path is very deeply embedded in a complex tikzpicture
), but it is similar and illustrates the problem in response to a request in the comments. I'm not sure if what I'm trying to do is just somewhat crazy but anyway:
\documentclass[tikz]{standalone}
\usepackage{fp}
\usetikzlibrary{calc,decorations.pathmorphing,decorations.text,fixedpointarithmetic}
\begin{document}
\begin{tikzpicture}
[
nant/.append style={draw=#1, double=#1!25, double distance between line centers=5.5pt, line width=.5pt, decorate, decoration={snake, segment length=10pt, amplitude=.5pt}},
]
\node (n1) [draw] {Some Information};
\node (n2) [anchor=south east, yshift=7.5pt, draw] at (n1.north east) {Terminology};
\node (n3) [anchor=north east, draw, xshift=-25mm] at (n1.south west) {Something};
\coordinate (nant4) at ($(n1.north east |- n2.south)!1/2!(n1.north east)$);
\coordinate (nant3) at ($(n1.north west |- nant4) + (5pt,0)$);
\coordinate (nant2) at ($(n3.east) + (35pt,10pt)$);
\coordinate (nant1) at ($(n3.east |- nant2) + (10pt,-7.5pt)$);
\path [nant=blue,postaction={decoration={text along path, text={|\scriptsize\scshape|the flow of stuff ||}, text color=blue, raise=-.5pt}, decorate}] (nant1) to [out=0, in=-135] (nant2) to [out=45, in=180] (nant3) -- (nant4);
% \path [nant=blue] (nant1) to [out=0, in=-135] (nant2) to [out=45, in=180] (nant3) -- (nant4);
% \path [postaction={decoration={text along path, text={|\scriptsize\scshape|the flow of stuff ||}, text color=blue, raise=-.5pt}, decorate}] ($(nant2) + (0,-4pt)$) to [out=45, in=180] ($(nant3) + (0,-1.25pt)$) -- ($(nant4) + (0,-1.25pt)$);
\end{tikzpicture}
\end{document}
The commented lines show the method I'm using to approximate the result I want, just in case it isn't clear what the intended result is, and to save somebody the trouble of suggesting it.
Guided by Alain Matthes's answer, I tried to use the fixedpointarithmetic
library for the particular path in the picture. However, this seems to cause pdflatex
to hang indefinitely. (I know this library slows things down but I don't think it should take quite this long. At least, when it doesn't hang, it works in a reasonable time.)
Simplifying, I came up with this Minimum (non-)Working Example:
\documentclass[tikz]{standalone}
\usepackage{fp}
\usetikzlibrary{calc,decorations.pathmorphing,decorations.text,fixedpointarithmetic}
\begin{document}
\begin{tikzpicture}
[
nant/.append style={draw=#1, double=#1!25, double distance between line centers=5.5pt, line width=.5pt, decorate, decoration={snake, segment length=10pt, amplitude=.5pt}},
]
\path [nant=red] (0,5) -- (10,10);
\path [nant=blue] (0,0) to [out=190, in=30] (10,5);
\path [fixed point arithmetic, nant=green] (0,10) -- (10,15);
\path [fixed point arithmetic, nant=black] (0,0) to [out=190, in=30] (10,5);
\end{tikzpicture}
\end{document}
The first three paths are drawn fine if I comment out the fourth but the fourth causes the hang. Given that PGF's maths parser can cope with this path without resorting to the used of fixed point, it presumably cannot be a capacity issue. So there is something about trying to draw the curved path, it seems, as opposed to the straight line.
What am I doing wrong here? The manual doesn't say much about situations where you cannot use fixed point so I'm not sure what to look for or where to start. Any suggestions for diagnostics would be appreciated.
fixedpointarithmetic
though. so any reason to include it? – percusse Aug 5 '14 at 23:19fpu
to see if it is so when I have chance. Can oyu include the problematic path? – percusse Aug 5 '14 at 23:25