Considering this MWE, I am looking to obtain bold style on a row. The highlight
's style works on columns but not on row.
\documentclass{standalone}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableset{highlight/.append style={
postproc cell content/.append code={
\pgfkeysalso{@cell content=\textbf{##1}}%
}
}}
\pgfplotstabletypeset[
every first column/.style={highlight,/pgf/number format/sci},
every last row/.style={highlight,/pgf/number format/sci}, %does not work
col sep=&,row sep=\\]{
colA & colB & colC \\
11 & 12 & 13 \\
21 & 22 & 23 \\
}
\end{document}
Do you any idea ? This seems that postproc cell content
does not work on rows.
EDIT
Another problem is that the \pgfkeysalso
remove the sci
formatting….
\documentclass{standalone}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableset{hhb/.append style={
postproc cell content/.append code={
\pgfkeysalso{@cell content=\textbf{##1}}%
}
}}
\pgfplotstabletypeset[
every first column/.style={highlight,/pgf/number format/sci},
% every last row/.append style={highlight},
%every first column/.style={sci,postproc cell content/.append style= {/pgfplots/table/@cell content/.add={\bf}{coucou}}},
col sep=&,row sep=\\]{
colA & colB & colC \\
11 & 12 & 13 \\
3E+4 & 22 & 23 \\
}
\end{document}
EDIT 2:
In order to avoid the previous problem, the syntax must be:
\pgfplotstableset{hhc/.style={
postproc cell content/.append style={
/pgfplots/table/@cell content/.add={$\bf}{$},
}
}}
But this works only for the columns and not for rows.
EDIT 3:
Solution to make ith row in bold:
\pgfplotstableset{
highlightrow/.style={
postproc cell content/.append code={
\count0=\pgfplotstablerow
\advance\count0 by1
\ifnum\count0=#1
\pgfkeysalso{@cell content/.add={$\bf}{$}}
%\pgfkeysalso{@cell content=\textbf{##1}}%
\fi
},
},
}
Example of use:
\pgfplotstabletypeset[ highlightrow={2},
col sep=&,row sep=\\]{
colA & colB & colC \\
11 & 12 & 13 \\
3E+4 & 22 & 23 \\
}
Best Answer
You are right, the postproc options apply only to column--specific options.
In order to restrict their application to specific rows, you have to make them dependent on the row index
\pgfplotstablerow
:The manual was quite unclear on this particular aspect; I have improved the manual and introduced a check which detects such issues.