Tags for Figures

<..caption and ref/tag..>
 \cap:ref{#1}%
 -_-_-

A ‘\Link{}{\cur:th\@currentlabel}#1\EndLink’ will send the rferference to the caption and not the figure, a problematic situation for cases that the captions appear at the bottom.

The ‘\global\let\skip:anchor\:UnDef’ voids ‘\SkipRefstepAnchor’ in \caption.

<..latex ltfloat..>+
 \:CheckOption{refcaption}     \if:Option
    \def\cap:ref#1{\cur:lbl{}\Link{}{\cur:th\:currentlabel}#1\EndLink
                   \global\let\skip:anchor\:UnDef}
 \else
    \Log:Note{for links into captions, instead
        of float heads, use the command line option ‘refcaption’}%
    \def\cap:ref#1{\cur:lbl{}%
       #1\Tag{\float:cnt cAp\capt:cnt}{\cur:th\:currentlabel}%
      \gHAdvance\capt:cnt by 1  }
 \fi
 -_-_-

<..tags for captions..>
 \gHAdvance\float:cnt by 1
 \gHAssign\capt:cnt=0
 \hbox{\def\flt:anchor{#1}\get:cptg}%
 -_-_-

<..tags for captions, empty..>
 \gHAdvance\float:cnt by 1
 \gHAssign\capt:cnt=0
 \hbox{\def\flt:anchor{}\get:cptg}%
 -_-_-

The hbox to preserve vertical mode, and for avoiding extra <P>’s.

<..latex ltfloat..>+
 \HAssign\float:cnt=0
 \def\get:cptg{%
    \ifTag{\float:cnt cAp\capt:cnt}{%
       \Make:Label{\LikeRef{\float:cnt cAp\capt:cnt}}{\flt:anchor}%
       \Advance:\capt:cnt by 1  \expandafter\get:cptg
    }{}}
 -_-_-

<..html tex floats..>
 \let\:ins=\@ins
 \let\:endinsert=\endinsert
 \def\::ns{\:ins \let\endinsert=\:endinsert}
 \def\@ins{\ifx \EndPicture\:UnDef \par\a:insert\par\bgroup
       \def\endinsert{\egroup\par\b:insert\par}
    \else \expandafter\::ns\fi }
 -_-_-

<..config plain utilities..>
 \NewConfigure{insert}{2}
 -_-_-