TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a new column in a pgfsplotstable which shows the compound growth over the preceding columns. The columns don't have names, and I want to shift the column a little to the right to show that the information it contains isn't part of the main data.

I've got two problems. First the \newcolumntype I've defined below doesn't compile.

Bizarrely the following \newcolumntype{R}[1]{>{\RaggedLeft\hspace{0pt}}p{#1}} compiles just fine..

Secondly and more importantly, I can't figure out how to create on use using column indices.

something like

pgfplotstableset{create on use/cagr/.style={create col/expr={

just causes errors. Any help most gratefully appreciated. Thanks




\pgfplotstabletypeset[string type,debug,
column name={},
format=inline,col sep=&,row sep=\\,header=false,ignore chars={\^^M},
columns/3/.style={column type={x{1cm}}]{


share|improve this question
there is a } missing here: style={column type={x{1cm}}] just before the ]. Also, my version of pgfplots complained that you should put \pgfplotsset{compat=1.7} in the preamble. – Vivi Nov 5 '12 at 8:20
The correct way to access columns by their index is to use \thisrowno{<index>} instead of \thisrow. – Jake Nov 5 '12 at 8:34
@Vivi thank you. Yet another "doh" moment. @Jake, that is exactly what I needed and not in my pgfplotstable manual. I think I need to download a newer version! ... btw struggling to format the newly created column. columns/cagr/.style={...} doesn't seem to register. Is this me doing something wrong again or is this not how to do it? Thanks – Tahnoon Pasha Nov 5 '12 at 9:25
@Jake not sure you got the notification... – Vivi Nov 6 '12 at 0:00
@Vivi: Thanks! I didn't get the notification, but I saw the message anyway. I assume Tahnoon is talking about the problem from his other question – Jake Nov 6 '12 at 7:14
up vote 4 down vote accepted

To access columns by their index number, you have to use \thisrowno{<number>}. The macro \thisrow{<name>} can only be used to refer to columns by their name, the [index]<number> syntax doesn't work in this case.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.