TransWikia.com

Percentage sign in .csv with pgfplotstabletypeset

TeX - LaTeX Asked by SP1 on May 20, 2021

I’m trying to enter a percentage sign (%) into a table. The table is in a .csv format. Using % does not work. The problem might be in the document class, but I can’t change the document class. The error message I get is : "Missing endcsname inserted. ]{mytable.csv}"

documentclass[final,5p,times,twocolumn]{elsarticle}
usepackage{pgfplotstable}
usepackage{booktabs}


begin{filecontents*}{mytable.csv}
    name,percentage(%)
    Maier, 25
    Huber,12
    Weisbaeck,52
end{filecontents*}

begin{document}
Here's my table ref{tab:table}.

begin{table}[h]
    centering
    pgfplotstabletypeset[
    assign column name/.style={/pgfplots/table/column name={textbf{#1}}},
    col sep=comma,
    column type=,
    begin table={begin{tabular}{l c}},
        end table={end{tabular}},
    string type,
    every head row/.style={
        before row={toprule},
        after row=midruleaddlinespace},
    every last row/.style={after row=midrule}
    ]{mytable.csv}  
    caption{Here is my caption.}
    label{tab:table}
end{table}

end{document}

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP