3

Suppose I'm using Beamer, pgfplotstable and the professionalfonts font theme. I'd like to use the computer modern font also in a string type column. Here is a MWE:

\documentclass{beamer}  
\usefonttheme{professionalfonts}  
\usepackage{booktabs}  
\usepackage{pgfplotstable}


\usepackage{filecontents}

\begin{filecontents}{data.csv}  
Strings,1,2  
100/100 = 1, 100,100  
120/125 = 0.96, 120,125  
148/160 = 0.925, 148,160

\end{filecontents}

\begin{document}


\begin{table}  
\centering

\pgfplotstabletypeset[col sep=comma,  
 columns={Strings, 1, 2},  
 columns/Strings/.style={string type,column type/.add={}{|},},  
 columns/1/.style={column name=Values 1,column type/.add={}{|},},  
 columns/2/.style={column name=Values 2,column type/.add={}{},},  
 every head row/.style={before row=\toprule, after row=\midrule},  
 every last row/.style={after row=\bottomrule},  
 ]  
{data.csv}  
\end{table}

\end{document}

I'd like to change the font family of the first column to match the family of the other columns. Glad for the help.

1 Answer 1

1

Would it be acceptable to switch the complete document to serif font?

\documentclass{beamer}  
\usefonttheme{professionalfonts}  
\usepackage{booktabs}  
\usepackage{pgfplotstable}
\usefonttheme{serif}

\usepackage{filecontents}

\begin{filecontents}{data.csv}  
    Strings,1,2  
    100/100 = 1, 100,100  
    120/125 = 0.96, 120,125  
    148/160 = 0.925, 148,160

\end{filecontents}

\begin{document}


    \begin{table}  
        \centering
        \pgfplotstabletypeset[%
            col sep=comma,  
            columns={Strings, 1, 2},  
            columns/Strings/.style={%
                string type,
            },
            columns/1/.style={%
                column name=Values 1,
            },
            columns/2/.style={
                column name=Values 2,
            },  
        ]  
        {data.csv}  
    \end{table}

\end{document}

enter image description here

You must log in to answer this question.

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