% !TeX root = tikz-ext-manual.tex
% !TeX spellcheck = en_US
% Copyright 2026 by Qrrbrbirlbel
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Free Documentation License.
%

\section{Nodes}
\begin{tikzlibrary}{ext.nodes}
This library extends \tikzname's functionalities around nodes.
\inspiration{NodesOnLine-Q, NodesOnCurve-Q}{NodesOnLine-A, NodesOnCurve-A}
\end{tikzlibrary}

\begin{multicols*}{2}
\subsection{Pic as a node}
\begin{key}{/\tikzext/pic=\opt{\meta{boolean}} (default true, initially false)}
\keycompat{tikz}
This key allows one to use a pic where usually only nodes are accepted,
for example as a label.
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes}]
\begin{tikzpicture}[
  slsl/.pic={\draw(-2pt, 1.5pt)--( 2pt, .5pt)
                  ( 2pt,-1.5pt)--(-2pt,-.5pt);}]
\node[
  draw, minimum width=3cm, minimum height=1cm,
  label={[ext/pic            ] east:slsl},
  label={[ext/pic, rotate= 90]north:slsl},
  label={[ext/pic            ] west:slsl},
  label={[ext/pic, rotate=-90]south:slsl}]{};
\end{tikzpicture}
\end{codeexample}
\end{key}
\newcolumn

\subsection{Node Pictures}%\hypertarget{NodePictures}{}
A Node Picture is a mix of a pic, a \pgfname matrix and nesting \tikzname\ pictures as well as
using the \referenceLibraryandIndexO{fit} library while sharing advantages and disadvantages with all of these:
\newcommand*\OK{$\checkmark$}%
\newcommand*\NOK{--}%
\newcommand*\MAY{$\dagger$}%
\newcommand*\ROT[1]{\hspace*{-.7em}\rlap{\rotatebox{45}{#1}}}%
\begin{center}
\begin{tabular}{lccccccl}
  \toprule
  Feature                  & \ROT{nest} & \ROT{ref out} & \ROT{ref in} & \ROT{trans} & \ROT{inherit} & \ROT{placing} &  \\ \midrule
  \pgfname\ matrix         &    \NOK    &     \NOK      &     \OK      &    \NOK     &     \MAY      &      \OK      &  \\
  \tikzname\ pic           &    \OK     &      \OK      &     \OK      &     \OK     &      \OK      &     \MAY      &  \\
  Nested \tikzname picture &    \OK     &     \MAY      &     \MAY     &     \OK     &      \OK      &      \OK      &  \\
  |fit|                    &    \MAY    &      \OK      &     \OK      &    \NOK     &     \NOK      &     \NOK      &  \\ \addlinespace
  Node Picture             &    \OK     &     \NOK      &     \OK      &     \OK     &     \MAY      &      \OK      &  \\ \bottomrule
\end{tabular}
\end{center}
In this table, \enquote{\OK} means that the functionality is supported by the feature,
\enquote{\NOK} means it is not and \enquote{\MAY} means the functionality is supported but with some caveat.
The functionalities are:
\begin{description}
\item[nest] whether the feature can be nested

  \pgfname\ matrices cannot be nested.
  Nodes that are |fit|ted don't actually contain the nodes they are fitted to.

\item[ref out] whether one can reference coordinates/nodes outside of a feature

  It is not possible to reference a node in the outer \tikzname picture from inside a matrix.
  Referencing node from the outer scope while inside a Node Picture can be done
  if using the |absolute| key (see below).
  
  \tikzname pictures need |remember picture| to be able to reference a node in the outer \tikzname picture.

\item[ref in] whether one can reference coordinates/nodes from outside of a feature

  \tikzname pictures need |remember picture| to be able to reference a node in the inner \tikzname picture.

\item[trans] whether the feature can be transformed

  A \pgfname\ matrix can only be shifted, a |fit|ted node can be transformed but its \enquote{content} will remain where it has been placed.

\item[inherit] whether settings from outside the feature gets inherited

  This is usually something one has tp fight against and can be quite messy to deal with.
  Only the \pgfname matrix allows some protection against it by using the \referenceKeyandIndexO{every outer matrix} style.
  The content a node is |fit|ted around doesn't inherit any settings.

\item[placing] whether a feature can be placed well

  A \tikzname\ pic doesn't provide any anchors and can't be placed other than at the origin
  but it can be placed along a path.
  A |fit|ted node surely can be placed somewhere else but then it doesn't fit anymore.
  Once its \enquote{content} is placed, it can't be moved anymore.
\end{description}

\subsubsection{Overview}
The Node Picture shall offer a compromise between a \tikzname\ pic and a \pgfname\ matrix
without having to nest \tikzname pictures.
It also shares the visual output with a node that has been |fit|ted around its content but with more flexibility,
after all the whole node including its Node Picture can be moved around.

Here are some rules and guidelines for using this:
\begin{itemize}
\item The Node Picture will be typeset as the text of the node.
\item The baseline of this text is the vertical center of the Node Picture's bounding box.
      This can be changed with the |ext/node picture/baseline| option -- similar to \tikzname's \referenceKeyandIndexO{baseline} option.
      But unlike \tikzname's |baseline| it need to not be set inside the Node Picture.
\item Only the |text| node part is available.
      The \referenceCommandandIndexO{\nodepart} command may not be used.
\item A Node Picture is \emph{not} a matrix. It only contains one \enquote{cell}.
\item Just like with a pic or a matrix, certain settings and values will be inherited by the Node Picture.
      (It's a gift and a curse.)
\item The bounding box of the picture will be evaluated automatically and the result will be used to determine
      the size of the \enquote{text} of the node.
      The key |ext/node picture/ignore line width| changes whether line widths contribute to the size.
      If they do not and with any inner seps set to zero, paths of the (sub)picture
      can lie on the border of the node.
\item You can use a Node Pictures inside a Node Picture.
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes}, width=3cm]
\tikz[
  nodes=draw,
  do/.code={
    \node[
      rounded corners,
      fill=blue!\inteval{\tikzextnodepicture0*2}]
      (L) {\tikzextnodepicture};
    \ifnum\tikzextnodepicture<#1
      \node[
        anchor=north, yshift=-1mm, ext/node picture,
        fill=red!\inteval{100-\tikzextnodepicture0*2}]
        at (L.south) {\tikzset{do=#1}};
    \fi
  },
  do=4]{}
\end{codeexample}
\end{itemize}

Most of the time, all that is needed is to add |/tikz/ext/node picture| to a node 
and it will be a Node Picture node.
(That key's default value is |true| which is actually the key that activates it.)
Let's look at further keys and tools for this.

\subsubsection{Styles}
\begin{stylekey}{/\tikzext/every node picture=\meta{Node Picture level}}
  This style will be applied for every node that is enabled to be a Node Picture's node,
  this will be executed on the same level as \referenceKeyandIndexO{every node},
  i.\,e. not inside the actual Node Picture.

  Its parameter is the current Node Picture level.
\end{stylekey}
\begin{stylekey}{/\tikzext/every outer node picture=\meta{Node Picture level}}
  This style will be applied for every node that is enabled to be a Node Picture's node
  but it will be executed after the Node Picture has been constructed.
  This can be used to change options that don't get inherited by the Node Picture.

  Its parameter is the current Node Picture level.
\end{stylekey}
\begin{stylekey}{/\tikzext/every node picture scope=\meta{Node Picture level}}
  This style will be applied on the scope that encompasses the whole Node Picture.
  
  Its parameter is the current (outer) Node Picture level.
\end{stylekey}

\subsubsection{Settings}
\begin{key}{/\tikzext/node picture=\opt{\meta{true or false or any of the options below}} (default true)}
  This is only a key to set keys in the namespace |/tikz/ext/node picture|.
  However, without any options used, it activates a Node Picture as it uses |true| as the default value.
  To return to a normal node, use the argument |false|.
\end{key}
\begin{key}{/\tikzextnp/prefix name=\opt{\meta{true or false}} (default true, initially true)}
  By default, every node's name inside a Node Picture gets the Node Picture's outer node's name prefixed --
  similar to how a \tikzname\ pic works.
  This can be disabled by setting this to |false|.
  
  It is not possible to set the Node Picture's name to an empty value.
  \begin{key}{/\tikzextnp/name prefix ..}
    Similar to a \tikzname\ pic, \referenceKeyandIndexO{name prefix} is set to the name of the outer node.
    This key will return to the prefix that was set beforehand.
  \end{key}
\end{key}
\begin{key}{/\tikzextnp/ignore line width=\opt{\meta{true or false}} (default true)}
  This changes whether line widths contribute to the size of a Node Picture.
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes}, width=3.5cm]
\begin{tikzpicture}
  \node[
    ext/node picture,
    inner sep=+0pt, line width=2pt, draw=gray]{
    \draw[line width=5pt, black]
      (-1,1) -| (0,0) |- (1,-1);
  };
\end{tikzpicture}
\end{codeexample}
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes}, width=3.5cm]
\begin{tikzpicture}
  \node[
    ext/node picture={true, ignore line width},
    inner sep=+0pt, line width=2pt, draw=gray]{
    \draw[line width=5pt, black]
      (-1,1) -| (0,0) |- (1,-1);
  };
\end{tikzpicture}
\end{codeexample}
\end{key}
\begin{key}{/\tikzextnp/reset graphic state}
  This key sets up |/tikz/ext/every node picture| so that it resets many settings and values
  to their \pgfname/\tikzname\ default.
\end{key}
\begin{key}{/\tikzextnp/baseline=\meta{dimension or coordinate} (default \normalfont{empty})}
  This changes where the baseline of the Node Picture's node lies.
  This must be used \emph{outside} of a Node Picture to have an effect on that Node Picture.
  A coordinate must be enclosed in parenthesis, like in the following example.
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes}]
\begin{tikzpicture}
\foreach[count=\i] \b/\c in {n/orth, b/ase, s/outh}
  \node[
    ext/node picture={true, baseline=(n.\b\c)},
    anchor=base, draw, fill=blue!50
  ] at (right:\i) {
    \node[fill=red!50, draw] (n)
      {\b$\displaystyle\frac12$};
  };
\draw[thick, green] (.5,0) -- (3.5,0);
\end{tikzpicture}
\end{codeexample}
\end{key}
\begin{key}{/\tikzextnp/anchor=\meta{coordinate} (initially \normalfont{empty})}
  Similar to |/tikz/matrix anchor| this allows to specify any coordinate in the Node Picture's coordinate system
  to be used as an anchor for the node.
  Like its inspiration, the parentheses aren't to be included in the \meta{coordinate} specification.
  Unlike its inspiration, any coordinate specification is allowed, not only named nodes/coordinates.
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes}]
\begin{tikzpicture}
\foreach[count=\i] \b/\c in {n/orth, b/ase, s/outh}
  \node[
    ext/node picture={true, anchor=n.\b\c},
    draw, fill=blue!50
  ] at (right:\i) {
    \node[fill=red!50, draw] (n)
    {\b$\displaystyle\frac12$};
  };
\draw[thick, green] (.5,0) -- (3.5,0);
\end{tikzpicture}
\end{codeexample}
\end{key}
\begin{key}{/\tikzextnp/absolute=\opt{\meta{coordinate}} (default 0,0)}
  This applies a transformation so that the \meta{coordinate} inside the Node Picture
  lies at the same \meta{coordinate} in the outer scope.
  This simply sets both |/tikz/ext/node picture/anchor| and |/tikz/at| to the same \meta{coordinate}.
  
  This also may make it possible to sucessfully reference nodes outside of a Node Picture
  unless you add further transformation to the outer node.
  You probably also want to use |overlay| on any connections.
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes},width=3.5cm]
\begin{tikzpicture}[nodes=draw]
\node[fill=red] at (2,1) (ABC) {ABC};
\node[ext/node picture={true, absolute}, fill=green]{
  \node[fill=blue!50] (DEF) at (1,0) {DEF}
    edge[overlay] (ABC);
  \draw (DEF.south west) to[bend right] (DEF.south east);
};
\draw (0,0) grid (2,1);
\end{tikzpicture}
\end{codeexample}
\end{key}

\subsubsection{More and Examples}
A \TeX-macro is available for accessing the current Node Picture level.
\begin{command}{\tikzextnodepicture}
This command returns the current level of Node Picture.
The outside (i.\,e. the original \tikzname picture) is level~0.
Remember that when this command is used on -- not in -- the node that contains
the Node Picture it will not return the level of its picture.
\end{command}
A Node Picture also supports two predefined nodes.
\begin{predefinednode}{current bounding box}
  Just like the original \referenceShapeandIndexO{current bounding box},
  this will be available inside a Node Picture and refers to its bounding box.
\end{predefinednode}
\begin{ext_predefinednode}{current node picture bounding box}
  Similar to |current bounding box| this returns the bounding box of
  the Node Picture with an ignored line width.
\end{ext_predefinednode}

Further more, anchors can be added to a Node Picture's node.
\begin{key}{/\tikzextnp/add anchor=\marg{n}\marg{c}}
  This will add the anchor \meta{n} to the Node Picture's node at \meta{c}
  which will evaluated at the end of the Node Picture.
\end{key}
For rectangular nodes, these keys might be helpful as well.
\begin{key}{/\tikzextnp/add anchor/rectangle east=\marg{n}\marg{c}}
  This key works like the previous key but it also shifts
  bhe anchor by the amount of |inner xsep| and |outer xsep| to the right.
\end{key}
\begin{key}{/\tikzextnp/add anchor/rectangle west=\marg{n}\marg{c}}
  As above but to the left.
\end{key}
\begin{key}{/\tikzextnp/add anchor/rectangle north=\marg{n}\marg{c}}
  This key works like the previous keys but it shifts
  the anchor by the amount of |inner ysep| and |outer ysep| upwards.
\end{key}
\begin{key}{/\tikzextnp/add anchor/rectangle south=\marg{n}\marg{c}}
  As above but downwards.
\end{key}
Those are special versions of these more general keys
for which the given factors must be purely numerical as no evaluation are done for them.
\begin{key}{/\tikzextnp/add anchor osep=\marg{n}\marg{c}\marg{o x}\marg{osep y}}
  Thus key works like the |add anchor| key but it shifts the anchor by the |outer xsep| and |outer ysep| values
  multiplied by the given factors \meta{ox} and \meta{oy}.
\end{key}
\begin{key}{/\tikzextnp/add anchor osep=\marg{n}\marg{c}\marg{ix}\marg{iy}}
  As above but with the values of |inner xsep| and |inner ysep|.
\end{key}
\begin{key}{/\tikzextnp/add anchor sep=\marg{n}\marg{c}\marg{ix}\marg{iy}\marg{ox}\marg{oy}}
  This is a combination of the last two keys.
  This is the most general version to add anchors.
\end{key}

A \pgfname\ matrix alone is not able to be transformed but
as part of this construct, it is possible.
As you can see in the next exmaple,
you can reference the nodes defined inside the (sub)picture
from the outside.

Unfortunately, due to how a \tikzname\ matrix sets up the
naming of its nodes, a name prefix would be applied twice (see \cite{MatrixNamePrefix}),
you'll have to \emph{first} name the matrix and \emph{then} clear the name prefix.

The example below also shows that
all nodes include their own inner sep:
The outer node (solid line),
the matrix node (dashed line)
as well as the nodes in the matrix themselves (dotted lines).
\begingroup
\catcode`\|=12
\catcode`\&=\active\relax
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes, matrix}]
\begin{tikzpicture}
\draw (0,0) to[bend left]
  node[ext/node picture, sloped, draw, below] (n) {
    \matrix[
      matrix of nodes, row sep=5mm, column sep=5mm,
      draw, dashed, nodes={draw, dotted},
      name=-m, ext/node picture/name prefix ..
    ] { abc & def \\ ghi & jkl \\ };
    \draw (-m-1-1) -- (-m-2-2);
  } (2,3) [gray];
  \draw (n-m-2-1) -- (n-m-1-2);
\end{tikzpicture}
\end{codeexample}
\endgroup

\newcolumn
The following example is adapted from \cite{NodePicQ}.
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes, arrows.meta, positioning, graphs}]
\begin{tikzpicture}[
  ext/node picture={prefix name=false, reset graphic state},
  fixed height/.style={text depth=+0pt, text height=+.7\baselineskip},
  n/.style={shape=rectangle, rounded corners, draw, fixed height},
  b/.style={
    shape=rectangle, draw, ext/node picture, inner xsep=4mm,
    fill=blue!\inteval{50*(\tikzextnodepicture+1)}!red!35,
  },
  h/.style={above=+.333em of current bounding box, fixed height},
  node distance=3mm and 4mm
]
\NewDocumentCommand{\nbox}{O{} m d() m }{%
  \node[{b,#1,style/.expanded=\IfValueT{#3}{ext/node picture/baseline={(#3.base)}}}]{
    #4
    \node[h]{#2};
    \node[
      white, inner xsep=+0pt,
      below left=0pt and 0pt of current bounding box.north east
    ] {L\tikzextnodepicture};
  };
}
\nbox{Pipeline}{
  \node[n](IS){IntSrc};
  \nbox[base right=of IS, name=BPF]{BandPassFilter}(dup){
    \node[n](dup){dupl};
    \node[n, above right=of dup](HPF){HPF};
    \node[n, below right=of dup](LPF){LPF};
    \node[n, below right=of HPF](rr) {rr(1,1)};
  };
  \node[n, base right=of BPF](IP){IntPrnt};
}
\graph[edge=-Latex, use existing nodes]{
  IS -> dup ->[in=180] {HPF[>out= 90, <in= 90],
                        LPF[>out=-90, <in=-90]}
            ->[in distance=5mm, out=0] rr -> IP
};
\end{tikzpicture}
\end{codeexample}
\newcolumn

\subsection{Nodes on paths}
When nodes are placed along paths they don't interrupt
the path at that place.
The decoration \referenceLibraryandIndexO{markings}
and its \referenceKeyandIndexO[/pgf/decoration/]{mark connection node}
key can help but only works for straight paths and
doesn't play nicely with arrow tips.

This library provides alternatives.
These are separated into straight paths, i.\,e. \referencePathOperationandIndexO{--},
and everything else (including any |to path|).

\subsubsection{Nodes on Lines}

\begin{stylekey}{/\tikzext/node on line=\opt{\meta{anchor specification}} (default |\{\}|)}
\keycompat{tikz}
This installs a \referenceKeyandIndexO{to path} that places \emph{one}
node along a straight line but connect the line with it.

This allows a node to be placed \emph{on} a straight line without having to
use |fill = white| or similar tricks to make the line disappear 
beneath the node.

The optional \meta{anchor specification} allows to specify the
anchors to which the line should connect.
It allows one or two anchors divided by | and | to be specified.
\end{stylekey}

\begin{stylekey}{/\tikzext/nodes on line}
\keycompat{tikz}
This is similar to the previous key but allows
multiple nodes to be placed on a straight line
\emph{if} they are in the correct order (from start to target),
don't overlap with each other, the start or the target.

It allows \emph{no} anchor specification.
\end{stylekey}

\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes, quotes}]
\tikz[inner sep=.15em, circle, nodes=draw, sloped]
  \draw[ultra thick, ->, ext/node on line] (0,0) to["0"] (1,1)
                                                 to["1"] (2,0)
    to[ext/nodes on line, "2.1" near start, "2.2", "2.3" near end] (5,1);
\end{codeexample}
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes, quotes}]
\tikz[inner sep=.15em, nodes=draw]
  \draw[thick, ->, ext/node on line=west and east]
     (0,0) to["0"] (1,1)
           to["1"] (2,0)
           to["2"] (4,1);
\end{codeexample}

\subsubsection{Nodes on Curves}
The following keys need the \referenceLibraryandIndexO{intersections}
and the \referenceLibraryandIndexExt{spath3} \cite{spath3}
library to be loaded. They will not be automatically
loaded by this library.

Any \referenceKeyandIndexO[/pgf/]{outer sep} will be ignored.

If you can, use \texttt{fill=\meta{bg color}}
instead of these keys, it will be much faster and easier.

\begin{stylekey}{/\tikzext/nodes on curve=\meta{to path} (default line to)}
\keycompat{tikz}
Similar to |nodes on line|, this key allows
to have nodes on arbitrary paths.

This is not suitable for paths connecting nodes.
\end{stylekey}

\begin{stylekey}{/\tikzext/nodes on curve'=\meta{to path} (default line to)}
\keycompat{tikz}
As above but suitable for connecting nodes.
\end{stylekey}

\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes, intersections, quotes, spath3}]
\begin{tikzpicture}[ultra thick]
  \node (A) at (0, 0) {A} ;
  \node (B) at (3, 0) {B} ;
  \draw [red, ->, ext/nodes on curve'=bend left]
    (A) to node[blue,draw]{label} (B)
        to ["X" {sloped, near start},
            "Z" {sloped, near end},
            "Y"] (A);
\end{tikzpicture}
\end{codeexample}
\begin{codeexample}[preamble=\usetikzlibrary{ext.nodes, intersections, quotes, spath3}]
\tikz[inner sep=.15em, circle, nodes={draw, green}, sloped, ultra thick]
  \draw[->, ext/nodes on curve=bend left] (0,0) to["0"] (1,1)
                                                to["1"] (2,0)
                  to["2" near start, "3", "4" near end] (4,1)
                                                -- ++(down:1);
\end{codeexample}
\newcolumn

\subsection{Automatic placement of nodes}
The \referenceKeyandIndexO{auto} key allows automatic placement of
nodes along a path segment.
This library extends this in various ways.

\subsubsection{More than left and right}
Besides |left| and |right| that are provided by \tikzname\ 
the following placement mechanism are provided:
\begin{itemize}
\item |ext/left| will place a node to the left of the direction of the line,
\item |ext/right| will place a node to the right of the direction of the line,
\item |ext/above| will place a node towards the direction of the line,
\item |ext/below| will place a node against the direction of the line,
\item |ext/west| will place a node towards the left side of the paper,
\item |ext/east| will place a node towards the right side of the paper,
\item |ext/north| will place a node towards the upper side of the paper and
\item |ext/south| will place a node twoards the lower side of the paper.
\end{itemize}
The placement mechanisms |ext/left| and |ext/right| are like the original
|left| and |right| mechanisms but don't swap sides when \referenceKeyandIndexO{sloped}
is used.

Certain cases exist for |ext/west|, |ext/east|, |ext/north| and |ext/south| placements
where it is not clear how a node should be placed.
These cases and their behavior can be seen in the following figure.%~\ref{fig:autoplacements}.
%\begin{figure*}
\begin{center}
\small
\newcommand*\tikzauto[3]{%
  \path[{ext_Centered Circle[black]}-Latex]
    (0,0) edge[auto=ext/#2] node {#2} (left:2) edge[auto=ext/#2] node {#2} (right:2)
          edge[auto=ext/#3] node {#3} (  up:2) edge[auto=ext/#3] node {#3} ( down:2);}
\begin{tikzpicture}[x=+.75cm,y=+.75cm, nodes=draw]
\path[{ext_Centered Circle[black]}-Latex]
    (0,0) edge node[auto=ext/west] {west}
               node[auto=ext/east] {east} (left:2)
          edge node[auto=ext/west] {west}
               node[auto=ext/east] {east} (right:2)
          edge node[auto=ext/north] {north}
               node[auto=ext/south] {south} (  up:2)
          edge node[auto=ext/north] {north}
               node[auto=ext/south] {south} (down:2);
\end{tikzpicture}
\end{center}
%\caption{Behavior of \texttt{ext/est}, \texttt{ext/east}, \texttt{ext/north} and \texttt{ext/south} in certain cases}
%\label{fig:autoplacements}
%\end{figure*}

\subsubsection{Offset}
Nodes are usually placed with their border (including any |outer sep|)
on the line.
With the following option, a node will be shifted a certain offset distance.

\begin{key}{/\tikzext/auto with offset=\opt{\meta{true or false}} (default true)}
  This key activates the offset function.
\end{key}
\begin{key}{/\tikzext/auto offset (initially 1cm)}
The offset distance itself.
\end{key}

For the \referenceDecorationandIndexO{brace} decoration,
the following keys are provided which needs the
\referenceLibraryandIndexO{decorations.pathreplacing} loaded before they
can be used.
\begin{key}{/\tikzext/nodes/install auto offset for brace decoration=\opt{\meta{distance}} (default 0pt)}
This key installs the necessary customizations
for the \referenceKeyandIndexO[/pgf/decoration/]{raise} key
so that the given value is available as an offset.

It also makes available the following keys.
\begin{key}{/\tikzext/auto offset for brace decoration}
This sets \referenceKeyandIndex[/\tikzext/]{auto offset} to
\texttt{\textbackslash pgfdecorationsegmentamplitude+
  (\textbackslash pgfkeysvalueof\{/pgf/decoration/raise\})}.
\end{key}
%\columnbreak
\begin{stylekey}{/\tikzext/every brace node}
Using this key on a node along a path that's decorated by the |brace| decoration
will offset the node so that it will be placed at the tip of the brace.
\end{stylekey}
\end{key}

\paragraph{Implementation note:}
This redefines the keys \referenceKeyandIndexO{auto},
\referenceKeyandIndexO{swap} and \referenceKeyandIndexO{sloped}.
One can install custom auto placement rules by using the following key.
\begin{key}{/\tikzext/nodes/install auto=\marg{left}\marg{right}}
  This key defines \texttt{/tikz/auto/\meta{left}} which activates the auto placement
  and installs the appropriate placement function.
  Further more, the key \texttt{/tikz/swap/\meta{left}} will be defined
  to activate the \meta{right} placement function.
  
  The key |/tikz/swap| has been defined to apply \texttt{/tikz/swap/\meta{dir}}
  where \meta{dir} is the current placement function.
\end{key}
\subsubsection{Precise placement}
The default behavior of the |auto| placement mechanism is
to snap to one of the eight compass directions.
\begin{key}{/\tikzext/precise auto angle=\opt{\meta{true or false}} (default true)}
With this option set to |true|, the |auto| placement won't snap
to one of the eight compass directions.

This key disables the \referenceKeyandIndexO{sloped} option
which in turn will disable this option.
\end{key}
\end{multicols*}
