5

I want to highlight cells in my pgfplotstable, but the bold font setting overwrites my number format. How to prevent this?

Here is a MWE:

\documentclass[12pt]{standalone}
\usepackage{filecontents}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\begin{document}

\begin{filecontents}{data.csv}
0.563725,0.819520,0.713402
0.563725,0.819520,0.713402
\end{filecontents}

\pgfplotstabletypeset[ 
      col sep=comma,    
      every row 1 column 1/.style={
        postproc cell content/.style={
          @cell content=\textbf{##1}
        }
      },
      fixed,fixed zerofill,
      precision=1,
      multiply with=100,  
    ]{data.csv}
\end{document}

with the output:

enter image description here

4
  • this is a duplicate somewhere
    – percusse
    Oct 13, 2015 at 8:50
  • @percusse I didn't find an exact duplicate. I tried to customize this approach but failed, as it is conditional to the whole table and inserted new cells when applied to a selected cell...
    – fmetz
    Oct 14, 2015 at 13:31
  • *it's *formated why can't I edit my bounty description? ;)
    – fmetz
    Oct 15, 2015 at 8:45
  • @fmetz - Have a look at sergej's answer to this question of mine: tex.stackexchange.com/questions/253897/…
    – Wamseln
    Oct 18, 2015 at 19:27

1 Answer 1

6
+50

You can just replace @cell content=\textbf{##1} with @cell content/.add={$\bf}{$}

Code

\documentclass[12pt]{standalone}
\usepackage{xcolor}
\usepackage{filecontents}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\begin{document}

\begin{filecontents}{data.csv}
0.563725,0.819520,0.713402
0.563725,0.819520,0.713402
\end{filecontents}

\pgfplotstabletypeset[ 
      col sep=comma,    
      every row 1 column 1/.style={
        postproc cell content/.style={
          @cell content/.add={$\bf}{$}
        }
      },
      fixed,fixed zerofill,
      precision=1,
      multiply with=100,  
    ]{data.csv}
\end{document}

Result

enter image description here

1
  • Yeah this is the one combination I did not try... :D Would you mind looking at my other open question, too? Thanks in advance.
    – fmetz
    Oct 18, 2015 at 8:00

You must log in to answer this question.

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