In my LaTeX document I will need often a specific value in a table. So I can define the following macro :
\newcommand{\values}{\pgfplotstablegetelem{0}{0}\of\mydata\pgfplotsretval}
The pgfplotstable manual recommands not to use this command in a loop :
Attention: If possible, avoid using this command inside of loops. It is quite slow.
It would be wise to compute only once the value of \value and then use it as often as I want without slowing down the compilation. What is the best way to do this ?
Here is a sample code.
\documentclass[border=2mm]{standalone}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.8}
\pgfplotstableread[col sep=comma]{
1,15,53
5,74,12
}\mydata
\renewcommand{\value}{\pgfplotstablegetelem{0}{0}\of\mydata\pgfplotsretval}
\begin{document}
This is the first values : \values
\end{document}
\value! Use any other name, but not the one reserved for a very important function of the LaTeX kernel! – egreg Sep 28 '13 at 20:28