I want to be able to reference a table value in my text (this is because I often update my tables, and then list the specific values in the text). Here is an example table I would use:
% Example Table
\documentclass{minimal}
\begin{filecontents*}{scientists.csv}
name,surname,age
Albert,Einstein,133
Marie,Curie,145
Thomas,Edison,165
\end{filecontents*}
% Read in Table
\documentclass{article}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstabletypeset[
col sep=comma,
string type,
columns/name/.style={column name=Name, column type={|l}},
columns/surname/.style={column name=Surname, column type={|l}},
columns/age/.style={column name=Age, column type={|c|}},
every head row/.style={before row=\hline,after row=\hline},
every last row/.style={after row=\hline},
]{scientists.csv}
\end{document}
I may want to be able to reference a given scientists age in the text by a reference of his/her name (ie,:)
Albert Einstein is \ref{albert} years old.
Ideally, this would still be using pgfplotstable because it is how I currently read in many tables. Thanks,
\firstname
is not defined. Do you intend it to be\surename
?