Hier ein nur teilweise funktionierender Ansatz zum Problem, Verflixte Hölle!
Habe nun eine tabref.sty erstellt, welche die Zählung der Spalten und Zeilen ermöglicht und die referenzierten Inhalte der Tabelle als Liste mit einigem zusammengeborgten Code:
der Nummer der Anmerkung, der Zeilen - und Spaltennummer versieht. Die Referenzen werden als Liste (\\thetabrefnotes[]) ausgegeben, die die Nummer der Anmerkung, die Zeilen und Spaltennummer in Klammern aufführt und den Inhalt anhängt.
Falls sich jemand auf dieses Code-Monster einläßt: Die relevanten Zeilen der .sty-Datei sind mit %relevant gekennzeichnet. Soweit sogut. Der nächste Schritt wäre, die Anmerkungen nicht als Liste, sondern im Fleißtext verfügbar zu machen und die \\stepcounter-Anweisungen zu optimieren.
tabref.sty
% ****************************************
% * tabrefnotes
% ****************************************
%
% Date of this version: 2014-03-19
% Matthias Borck-Elsner
%
%% Based on endnotes.sty Copyright 2002 John Lavagnino
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
%% of this license or (at your option) any later version.
%% The lambe version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.2 or later is part of all distributions of LaTeX
%% version 1999/12/01 or later.
%%
%% Uses an extra external file, with .tabref extension, to hold the
%% text of the tabrefnotes. This may be deleted after the run; a new
%% version is generated each time--it doesn't require information
%% collected from the previous run.
%%
%% This code does not obey \nofiles. Perhaps it should.
%%
%%
%% To turn all the footnotes in your documents into tabrefnotes, say
%%
%% \let\footnote=\tabrefnote
%%
%% in your preamble, and then add something like
%%
%% \newpage
%% \begingroup
%% \parindent 0pt
%% \parskip 2ex
%% \def\tabrefnotesize{\normalsize}
%% \thetabrefnotes
%% \endgroup
%%
%% as the last thing in your document. (But \thetabrefnotes all
%% by itself will work.)
%%
%% ****************************************
%% * tabrefnote COMMANDS *
%% ****************************************
%%
%%
%% \tabrefnote{NOTE} : User command to insert a tabrefnote.
%%
%% \tabrefnote[NUM]{NOTE} : User command to insert a tabrefnote numbered
%% NUM, where NUM is a number -- 1, 2,
%% etc. For example, if tabrefnotes are numbered
%% *, **, etc. within pages, then \tabrefnote[2]{...}
%% produces tabrefnote '**'. This command does not
%% step the tabrefnote counter.
%%
%% \tabrefnotemark[NUM] : Command to produce just the tabrefnote mark in
%% the text, but no tabrefnote. With no argument,
%% it steps the tabrefnote counter before generating
%% the mark.
%%
%% \tabrefnotetext[NUM]{TEXT} : Command to produce the tabrefnote but no
%% mark. \tabrefnote is equivalent to
%% \tabrefnotemark \tabrefnotetext .
%%
%% \addtotabrefnotes{TEXT} : Command to add text or commands to current
%% tabrefnotes file: for inserting headings,
%% pagebreaks, and the like into tabrefnotes
%% sections. TEXT a moving argument:
%% \protect required for fragile commands.
%%
%% ****************************************
%% * tabrefnote USER COMMANDS *
%% ****************************************
%%
%% tabrefnotes use the following parameters, similar to those relating
%% to footnotes:
%%
%% \tabrefnotesize : Size-changing command for tabrefnotes.
%%
%% \thetabrefnote : In usual LaTeX style, produces the tabrefnote number.
%%
%% \thetabrefmark : Holds the current tabrefnote's mark--e.g., \dag or '1' or 'a'.
%% (You don't want to set this yourself, as it comes
%% either from the autonumbering of notes or from
%% the optional argument to \tabrefnote. But you'll need
%% to use it if you define your own \maketabrefmark.)
%%
%% \maketabrefmark : A macro to generate the tabrefnote marker from \thetabrefmark
%% The default definition is \hbox{$^\thetabrefmark$}.
%%
%% \@maketabreftext{NOTE} :
%% Must produce the actual tabrefnote, using \thetabrefmark as the mark
%% of the tabrefnote and NOTE as the text. It is called when effectively
%% inside a \parbox, with \hsize = \columnwidth. For example, it might
%% be as simple as
%% $^{\thetabrefmark}$ NOTE
%%
%%
%% ****************************************
%% * tabrefnote MACROS *
%% ****************************************
%%
%%
\newcounter{tabcols}%relevant
\newcounter{tabrows}%relevant
\@definecounter{tabrefnote}%
\def\thetabrefnote{\@arabic\c@tabrefnote}%
\def\@maketabrefmark{\hbox{{{\textsuperscript{\tiny(\@thetabrefmark)}}}}}%
\def\maketabrefmark{\@maketabrefmark}%
\def\thetabrefmark{\@thetabrefmark}%
\newdimen\tabrefnotesep%
\def\tabrefnote{\@ifnextchar[\@xtabrefnote{\stepcounter{tabrefnote}%
\protected@xdef\@thetabrefmark{\thetabrefnote}%
\@tabrefnotemark\@tabrefnotetext}}%
\def\@xtabrefnote[#1]{%
\begingroup%
\c@tabrefnote=#1\relax%
\unrestored@protected@xdef\@thetabrefmark{\thetabrefnote}%
\endgroup%
\@tabrefnotemark\@tabrefnotetext}%
\let\@doantabrefnote=0%
\let\@endantabrefnote=0%
\newwrite\@tabrefnotes%
\newif\if@tabrefnotesopen \global\@tabrefnotesopenfalse%
\def\@opentabrefnotes{\immediate\openout\@tabrefnotes=\jobname.tabref\relax%
\global\@tabrefnotesopentrue}%
\long\def\@tabrefnotetext#1#2{% %relevant #2 um tabcols herauafzusetzen
\def\testA{#2}%%relevant als Vergleichsoperator
\def\testB{col}%%relevant als Vergleichsoperator
\ifx\testA\testB\stepcounter{tabcols} \fi%
\if@tabrefnotesopen \else \@opentabrefnotes \fi%
\immediate\write\@tabrefnotes{\@doantabrefnote{(\@thetabrefmark)
\thetabrows.\thetabcols}}%%relevant zur Ausgabe der rows und cols
\begingroup%
\def\next{#1}%
\newlinechar='40%
\immediate\write\@tabrefnotes{\meaning\next}%
\endgroup%
\immediate\write\@tabrefnotes{\@endantabrefnote}}%
\long\def\addtotabrefnotes#1{%
\if@tabrefenotesopen \else \@opentabrefnotes \fi%
\begingroup%
\newlinechar='40%
\let\protect\string%
\immediate\write\@tabrefnotes{#1}%
\endgroup}%
\def\tabrefnotemark{%
\@ifnextchar[\@xtabrefnotemark%
{\stepcounter{tabrefnote}%
\protected@xdef\@thetabrefmark{\thetabrefnote}%
\@tabrefnotemark}}%
%
\def\@xtabrefnotemark[#1]{%
\begingroup%
\c@tabrefnote #1\relax%
\unrestored@protected@xdef\@thetabrefmark{\thetabrefnote}%
\endgroup%
\@tabrefnotemark}%
%
\def\@tabrefnotemark{%
\leavevmode%
\ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi%
\maketabrefmark%
\ifhmode\spacefactor\@x@sf\fi%
\relax}%
%
\def\tabrefnotetext{%
\@ifnextchar [\@xtabrefnotenext%
{\protected@xdef\@thetabrefmark{\thetabrefnote }%
\@tabrefnotetext}}%
%
\def\@xtabrefnotenext[#1]{\begingroup \c@tabrefnote=#1\relax%
\xdef\@thetabrefmark{\thetabrefnote}\endgroup \@tabrefnotetext}%
%
\def\@xtabrefnotenext[#1]{%
\begingroup%
\c@tabrefnote=#1\relax%
\unrestored@protected@xdef\@thetabrefmark{\thetabrefnote}%
\endgroup%
\@tabrefnotetext}%
\def\tabrefnotesname{tabrefnotes} %
\def\tabrefnoteheading{\subsection*{\footnotesize{\tabrefnotesname} \@mkboth{\MakeUppercase{\tabrefnotesname}}{\MakeUppercase{\tabrefnotesname}}}%
}%
\def\tabrefnoteformat{ %
\leavevmode\llap{\maketabrefmark}}%%
\def\tabrefnotesize{\scriptsize}%%relevant für Größe der tabrefnote in \thetabrefnotes
\def\thetabrefnotes[#1]{\def\tabrefnotesname{#1}\immediate\closeout\@tabrefnotes \global\@tabrefnotesopenfalse%
\begingroup%
\makeatletter%
\edef\@tempa{`\string >}%
\ifnum\catcode\@tempa=12%
\let\@ResetGT\relax%
\else%
\edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
\@makeother\>%
\fi%
\def\@doantabrefnote##1##2>{\def\@thetabrefmark{##1}\begingroup%
\@ResetGT%
\edef\@currentlabel{\csname p@tabrefnote\endcsname\@thetabrefmark }%
\tabrefnoteformat }%
\def\@endantabrefnote{\endgroup}%
\tabrefnoteheading %
\tabrefnotesize%
\input{\jobname.tabref}%
\setcounter{tabrefnote}{0} %
\endgroup}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tabref.tex
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{longtable}
\makeatletter
\message{cell-ref,}
\def\G@cellrefundefinedtrue{%
\gdef\@cellrefundefined{%
\@latex@warning@no@line{There were undefined references}}}
\let\@cellrefundefined\relax
\def\@setcellref#1#2#3{%
\ifx#1\relax
\protect\G@cellrefundefinedtrue
\nfss@text{\reset@font\bfseries ??}%
\@latex@warning{Reference `#3' on page \thepage \space
undefined}%
\else
\expandafter#2#1.\the\LT@rows.\the\LT@cols\null
\fi}
\def\cellref#1{\advance \LT@rows by 1\advance \LT@cols by 1 \expandafter\@setcellref\csname r@#1\endcsname\@firstoftwo{#1}}
\makeatother
\usepackage{longtable,tabrefnote}
\usepackage{xcolor}
\parindent=0pt
\begin{document}
\section{Dummy}
Ein Text vor dem Problem.
\section{Problem}
\begin{longtable}[l]{p{2cm}p{2cm}p{2cm}}\caption{First}\\
Zähler&Nenner&Bruch\stepcounter{tabrows}\\
1\tabrefnote{\ Atest }{col}&2\tabrefnote{\ Btest
}{col}&$\frac{1}{2}$\tabrefnote{\ Ctest }{col}\stepcounter{tabrows}\setcounter{tabcols}{0}\\
1\tabrefnote{\ Dtest }{col}&2\tabrefnote{\ Etest
}{col}&$\frac{1}{2}$\tabrefnote{\ Ftest }{col}\stepcounter{tabrows}\setcounter{tabcols}{0}\\
\end{longtable}
\thetabrefnotes[]
\section{Dummy}
Ein Text Text Text Text Text Text Text Text Text Text Text Text nach dem Problem.
\end{document}
\begin{longtable}[l]{p{2cm}p{2cm}p{2cm}}\caption{First}\\
Zähler&Nenner&Bruch\\
\label{Atest}1&\label{Btest}2&$\frac{1}{2}$\\
2&4&$\frac{2}{4}$\\
6&4&$\frac{6}{4}$\\
3&2&$\frac{3}{2}$\\
9&18&$\frac{9}{18}$\\
\end{longtable}
\begin{longtable}[l]{p{2cm}p{2cm}p{2cm}}\caption{Second}\\
Zähler&Nenner&Bruch\\
\label{Ctest}1&2&$\frac{1}{2}$\\
2&4&$\frac{2}{4}$\\
\label{Dtest}6&4&$\frac{6}{4}$\\
3&2&$\frac{3}{2}$\\
9&18&$\frac{9}{18}$\\
\end{longtable}
\makeatletter\LT@rows=0 \LT@cols=0\makeatother
Wie in \cellref{Atest} gezeigt ist, ist der Zähler 1\\
Wie in \cellref{Btest} gezeigt ist, ist der Nenner 2\\
\makeatletter\LT@rows=0 \LT@cols=0\makeatother
Wie in \cellref{Ctest} gezeigt ist,ist der Zähler 1\\
Wie in \cellref{Dtest} gezeigt ist,ist der Zähler 6\\
Text Text Text Text Text Text Text Text Text Text Text Text Text
\end{document}