Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I created a command that creates a table and do some computations on it. And I would like to use this command several times.

\documentclass{minimal}
\usepackage{pgfplotstable}
\pgfplotstableset{%
    create on use/tmp/.style={create col/set={2}}}%
\newcommand\createonecol[1]{%
  \pgfplotstablenew[columns={tmp}]{6}{\data}
  \pgfplotstabletranspose{#1}{\data}
}
\begin{document}
\createonecol{\dataA}
\createonecol{\dataB}
\end{document}

The problem is the following one: the second time I call \createonecol, the table in \data is not created, thus pgfplotstabletranspose fails.

If I put curly braces around each call to \createonecol, there is no problem. However I don't want to scope them since I want to access both dataA and dataB at the same time.

share|improve this question
1  
could you provide a full minimal example, i.e. with \dataA and \dataB set. That will make it a lot easier for others to help. –  zeroth Feb 15 '12 at 8:00
add comment

closed as too localized by lockstep, Marco Daniel, percusse, Peter Grill, Jake Apr 5 '12 at 5:42

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.