I have multiple table with maths notations to link together. In each equation I need to point to the previous equation if needed so that we can trace back where eveything comes from. I need autmation because I have 48 input in table 1 and 43 equations in table 2.
However I would like to modify the ref number I have, and replace it with letters. It would help differenciate between values coming from an equation and values coming from an input table. Below is the expected example :
For now I achieved this, I "just" need to replace 1. with i and 2. with p. This is done with this solution.
"If" workaround
I have 3 tables to link in this document, could it be possible to insert an if condition inside this line ? Like if \thetable==1 i\arabic{...} else p\arabic{...}
\renewcommand{\therowcntr}{\thetable.\arabic{rowcntr}}
Code for all tables :
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[danish]{babel}
\usepackage{lscape}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{float}
\usepackage{array}
\usepackage[top=2.81cm, bottom=2.75cm,right=2cm, left=2cm]{geometry}
\usepackage{etoolbox}
\usepackage{setspace}
\onehalfspacing
\usepackage{url}
\usepackage[hidelinks]{hyperref}
\hypersetup{breaklinks=true}
\newcounter{rowcntr}[table]
\renewcommand{\therowcntr}{\thetable.\arabic{rowcntr}}
\newcommand{\pref}[1]{(\ref{#1})}
% A new columntype to apply automatic stepping
\newcolumntype{N}{>{\refstepcounter{rowcntr}\therowcntr}c}
% Reset the rowcntr counter at each new tabular
\AtBeginEnvironment{tabular}{\setcounter{rowcntr}{0}}
\begin{document}
Achieved tables :
\begin{table}[H]
\centering
\caption{Input variable (i)} \label{tab:Q1}
\begin{tabular}{|N|l|l|}
\hline
\multicolumn{1}{|c}{Number} & Unité & Notation \ \hline
\label{gva_f} & $/an & $ gva_f $\
\label{dep_f} & $/an & $ dep_f $\
\end{tabular}
\end{table}
\begin{table}[H]
\centering
\caption{Table of parameters (p)} \label{tab:Q2}
\begin{tabular}{|N|l|l|}
\hline
\multicolumn{1}{|c}{Number} & Description & Equation \ \hline
\label{gp_f} & This is a formula & $gp_f= gva_{f\pref{gva_f}} - dep_{f\pref{dep_f}}$\
\label{nc_f} & Another formula & $np_f= gp_{f\pref{gp_f}} - dep_{f\pref{dep_f}}$\
\end{tabular}
\end{table}
Expected tables :
\begin{table}[H]
\centering
\caption{Input variable (i)} \label{tab:Q1}
\begin{tabular}{|c|l|l|}
\hline
Number & Unité & Notation \ \hline
1 & $/an & $ gva_f $\
2 & $/an & $ dep_f $\
\end{tabular}
\end{table}
\begin{table}[H]
\centering
\caption{Table of parameters (p)} \label{tab:Q2}
\begin{tabular}{|c|l|l|}
\hline
Number & Description & Equation \ \hline
1 & This is a formula & $gp_f= gva_{f(i1)} - dep_{f(i2)}$\
2 & Another formula & $np_f= gp_{f(p1)} - dep_{f(i2)}$\
\end{tabular}
\end{table}
\end{document}

