7

I can use a mix of text and mathematical input in the first column of a table generated with pgfplots with no problem, and also mathematical input in, e.g. the last column, as this mwe shows:

\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\begin{document}
\pgfplotstabletypeset[
col sep=&,
row sep=\\,
columns/cero/.style={
    string type,    % Change for first column (column index 0)
    column name=$k$
},
columns/1/.style={column name=$X$},
columns/dos/.style={column name=$Y$,dec sep align},
columns/3/.style={column name=$Y$,dec sep align},
columns/4/.style={string type,column name=$Y$},
every head row/.style={before row=\toprule, after row=\midrule},
every last row/.style={after row=\bottomrule},
] {cero & 1& 3& dos & 4 \\
a$\Sigma$             &0.15770748944587207&1.2326557180455233e31&69.1973640&   a$\sigma$\\
8       &0.15770748944587207&1.2326557180455233e31&6.1973640&  $\lambda$\\
8       &0.3532132208423006&20496.519149382926&20.496519149&  a\\
8          &0.021744461199488557&1.5274940707993938e47&0.8544828&a\\
  } 
\end{document}

and then get this

enter image description here

Nevertheless, when I replace the first cell a$\Sigma$ with e.g. $\Sigma$ , the document takes forever to compile. It can be remedied using \vphantom{a}$\Sigma$, but I hope there is other way around...

3
  • 1
    You can just enclose the $\Sigma$ in {...} (so {$\Sigma$})
    – Jake
    Commented Apr 10, 2013 at 19:38
  • Mmm... right. That works, thanks!! In any case, is there a deep reason for the different behaviour in the first cell? Commented Apr 10, 2013 at 19:41
  • The $ is an active character, so that can throw the parser that looks for the next cell off. I don't understand the particular reason for why this example doesn't work, but in general, enclosing "weird" things in {...} is usually worth a try.
    – Jake
    Commented Apr 10, 2013 at 19:47

1 Answer 1

8

You can just enclose the $\Sigma$ in {...} (so {$\Sigma$}).

The $ is an active character, so that can throw the parser that looks for the next cell off. I don't understand the particular reason for why this example doesn't work, but in general, enclosing "weird" things in {...} is usually worth a try.

You must log in to answer this question.

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