I am trying to write a formal proof of validity that uses conditional proof (C.P.) arrows. I came across gernot's code for them at https://tex.stackexchange.com/a/581822/277990, and below I have applied their idea to a different example. My question is, how does the syntax of gernot's tikznode command work? In other words, what is the role of each of the parts of [3][]{%\tikz[remember picture,baseline=(#2.base)]\node[minimum size=0pt,inner sep=0pt,#1](#2){#3};%}? In particular I cannot find anything on the use of hashtags in the TikZ manual at https://mirrors.concertpass.com/tex-archive/graphics/pgf/base/doc/pgfmanual.pdf. And why the different kinds of closing devices (i.e., "( )" vs. "{ }" vs. "[ ]")?
\documentclass{article}
\usepackage{amssymb, mathtools}
\usepackage{tikz}
\usetikzlibrary{calc, arrows}
\let\impl\supset
\renewcommand{\lor}{\text{ v }}
\newcommand\tikznode[3][]{%
\tikz[remember picture,baseline=(#2.base)]
\nodeminimum size=0pt,inner sep=0pt,#1{#3};%
}
\begin{document}
(\begin{array}{rll}
1. & (x) { (Bx \lor Wx) \impl [(Ax \lor Fx) \impl Sx]}\mathrlap{\quad/\therefore (x)[Bx \impl (Ax \impl Sx)]}\
\tikznode{2} {$2.$} & By\
3. & Ay\
4. & (By \lor Wy) \impl [(Ay \lor Fy) \impl Sy]\qquad\qquad % This \qquad\qquad is a cheat in order to push the "evidence" column to the right somewhat.
& \text{1, \textbf{UI}}\
5. & By \lor Wy
& \text{2, Add.}\
6. & (Ay \lor Fy) \impl Sy
& \text{4, 5, M.P.}\
7. & Ay \lor Fy
& \text{3, Add.}\
8. & Sy
& \text{6, 7, M.P.}\
\tikznode{9} {$9.$} & Ay \impl Sy
& \text{3--8, C.P.}\
\tikznode{10} {$10.$} & By \impl (Ay \impl Sy)
& \text{2--9, C.P.}\
11. & (x)[Bx \impl (Ax \impl Sx)]
& \text{10, \textbf{UG}}
\end{array}
)
\begin{tikzpicture}[remember picture,overlay]
\draw[stealth'-,shorten <=2pt] (2) -- ++(-2em,0) |- ($(9)!0.5!(10)$) -- ++(10em,0);
% "[shorten <=<length>]" controls shaft of part of arrow right next to "2."]
% "($(<node no. A>)!0.5!(<node no. B>)$)" specifies the coordinate halfway between node no. A and node no. B
\end{tikzpicture}
\end{document}
Thank you!

\tikznodeis provided by thetikzmarkpackage as\tikzmarknode. In particular, it automatically detects the ambient math mode. – Andrew Stacey Aug 11 '22 at 18:51