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 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...

share|improve this question
1  
You can just enclose the $\Sigma$ in {...} (so {$\Sigma$}) –  Jake Apr 10 '13 at 19:38
    
Mmm... right. That works, thanks!! In any case, is there a deep reason for the different behaviour in the first cell? –  Javier E. Cuchí Apr 10 '13 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 Apr 10 '13 at 19:47
add comment

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

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.