# Greek letters in pgfplotstable table

trying to create a table using pgfplotstable, but I'm having errors when I want to write Greek letters (actually, any math mode symbol starting with '\'). Where I have 'a' and 'b' I would like to have an alpha and a beta. Can you help me?

Here's my code:

\documentclass{article}
\usepackage{xcolor}
\usepackage{booktabs,colortbl,pgfplotstable}
\definecolor{rulecolor}{RGB}{0,71,171}

\newcommand{\topline}{ %
\arrayrulecolor{rulecolor}\specialrule{0.1em}{\abovetopsep}{0pt}%
\arrayrulecolor{rulecolor}}

\newcommand{\midtopline}{ %
\arrayrulecolor{rulecolor}\specialrule{\lightrulewidth}{0pt}{0pt}%
\arrayrulecolor{white}\specialrule{\belowrulesep}{0pt}{0pt}%
\arrayrulecolor{rulecolor}}

\newcommand{\bottomline}{ %
\arrayrulecolor{white}\specialrule{\aboverulesep}{0pt}{0pt}%
\arrayrulecolor{rulecolor} %
\specialrule{\heavyrulewidth}{0pt}{\belowbottomsep}}%

\pgfplotstableset{mystyle/.style ={%
string type,
column type=c,
every odd row/.style={
before row=
},
every first column/.style={
column type=l
},
after row={\midtopline},
},
every last row/.style={
after row=\bottomline
},
col sep=&,
row sep=\\
}
}

\begin{document}
\begin{table}
\centering
\pgfplotstabletypeset[mystyle]{
{}        & {$a$}                 &  {$b$} \\
{0}        & {10}                &  {$1000$}\\
}
\end{table}
\end{document}

• Welcome to TeX.SE! Probably this answer is related. (I am not saying your question is a duplicate.)
– user121799
Mar 8, 2018 at 18:42
• or see example on the top of page 17, documentation for pgfplotstable. Mar 8, 2018 at 19:06

As Zarko noted, the example shown on pages 17-18 of the manual for pgfplotstablemakes use of one of the possible solutions to your problem.

The format used is explained at the end of page 11 in the same manual:

columns/{lowlevel colname}/.style={column name = display column name}
Here, lowlevel colname refers to the column name that is present in your input table. This lowlevel column name has a couple of restrictions (it has to be expandable, for example - that means many control sequences are forbidden). The value of column name is only used within \pgfplotstabletypeset in order to generate a display name for the column in question.

I have included the solution to your question below, and the result obtained after compilation. You will find my modifications in the [< options >] of \pgfplotstabletypeset.

\documentclass{article}
\usepackage{xcolor}
\usepackage{booktabs,colortbl,pgfplotstable}
\definecolor{rulecolor}{RGB}{0,71,171}

\newcommand{\topline}{ %
\arrayrulecolor{rulecolor}\specialrule{0.1em}{\abovetopsep}{0pt}%
\arrayrulecolor{rulecolor}}

\newcommand{\midtopline}{ %
\arrayrulecolor{rulecolor}\specialrule{\lightrulewidth}{0pt}{0pt}%
\arrayrulecolor{white}\specialrule{\belowrulesep}{0pt}{0pt}%
\arrayrulecolor{rulecolor}}

\newcommand{\bottomline}{ %
\arrayrulecolor{white}\specialrule{\aboverulesep}{0pt}{0pt}%
\arrayrulecolor{rulecolor} %
\specialrule{\heavyrulewidth}{0pt}{\belowbottomsep}}%

\pgfplotstableset{mystyle/.style ={%
string type,
column type=c,
every odd row/.style={
before row=
},
every first column/.style={
column type=l
},
after row={\midtopline},
},
every last row/.style={
after row=\bottomline
},
col sep=&,
row sep=\\
}
}

\begin{document}
\begin{table}
\centering
\pgfplotstabletypeset[mystyle,
columns/a/.style={column name=$\alpha$},
columns/b/.style={column name=$\beta$},
]{
{}        & {a}                 &  {b} \\
{0}        & {10}                &  {$1000$}\\
}
\end{table}
\end{document}