I'm interested in the TikZ pipeline, i.e. the sequence of low-level actions that a TikZ path is converted to as it is being "executed". Unfortunately, this is described only fragmentarily in the TikZ & PGF manual (for version 3.0.1a), so there is no escape from rolling up the metaphoric sleeves and diving into the source code. According to this comment by Mark Wibrow, the pipeline is implemented by the
\tikz@finish macro in
<tex installation directory>/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex.
\tikz@finish macro has the following structure:
% Step 1: The path background box ... % Step 2: Decorate path ... % Step 3: Preactions ... ... % Step 13: Add labels and nodes ...
As can be seen, the pre-actions are applied before any node is inserted. However, the manual states in the description of the node option
/tikz/behind path on p. 215:
When this key is set, [...] TikZ collects all nodes defined on the current path with this option set and then inserts all of them, in the order they appear, just before it draws the path. [...] "Just before it draws the path” actually means that the nodes are inserted into the page output just before any pre-actions are applied to the path
There seems to be a discrepancy between the manual and the source code. Is this a bug in the manual, or am I missing something?