3

I would like to build tables using pgfplotstable. Everything works fine so far -- except for one small thing: Although having read the corresponding section in the manual, I experience problems using the add-macro.

This is a MWE that works fine:

\documentclass{scrartcl}

\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pgfplotstable}
\usepackage{booktabs}

\pgfplotstableset{
    naftext/.style={
        string type,
        column type={l},
        empty cells with={--}
        },  
    header=false,
    every head row/.style={before row=\toprule},
    every first row/.style={before row=\midrule},
    every last row/.style={after row=\bottomrule},
    }

\begin{document}

    This is my table.

    \pgfplotstableread{ %some fictional data
            Martin  lemon       strawberry
            Lucy        cake        dessert     
            }\loadedtable
    \pgfplotstabletypeset[
                            columns={0,1,2},
                            columns/0/.style={naftext, column name=label column},
                            columns/1/.style={naftext, column name=column 1},
                            columns/2/.style={naftext, column name=column 2},
                            ]\loadedtable

\end{document}}

I now would like to add a vertical line between label column and column 1 without changing by global style definition. I tried

columns/0/.style={naftext, column name=label column, column type/.add{}{|}}

which (I thought) would add me a | after the l -- but unfortunately pgfplotstable reports an error when doing this:

Package pgfkeys Error: I do not know the key '/pfgplots/table/column type/.add{}{|}' and I am going to ingore it. Perhaps you misspelled it.

Any ideas?

1 Answer 1

5

It can be easily fixed with more coffee; A key needs an equal sign to assign a value

So

.../.add={}{|} 

works.

1
  • Damn! I knew that I must have been overlooking something... Jul 8, 2014 at 17:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .