pgf-tikz / pgfplots

pgfplots - A TeX package to draw normal and/or logarithmic plots directly in TeX in two and three dimensions with a user-friendly interface and pgfplotstable - a TeX package to round and format numerical tables. Examples in manuals and/or on web site.
http://pgfplots.sourceforge.net/
198 stars 33 forks source link

Certain special characters in .csv files cause LaTeX to throw "Undefined Control Sequence" errors #454

Closed Leonerd-04 closed 1 year ago

Leonerd-04 commented 1 year ago

I believe the error is due to this package; if not I'd appreciate anyone who could direct me to what is likely causing the error.

When trying to read data values from a .csv file, LaTeX throws multiple "Undefined Control Sequence" errors whenever one of the columns is named "θ". I tried multiple fixes and the only one that worked was setting that column's name to "theta" instead.

Even if special characters like θ are not supposed to be supported, a more informative error message is needed here.

hmenke commented 1 year ago

Not reproducible.

% just some bogus data
\begin{filecontents*}[force]{data.csv}
r,θ,φ
0,10,0
1,20,-1
2,30,1
\end{filecontents*}
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
  \begin{axis}
    \addplot table [col sep=comma,x=r,y=θ] {data.csv};
  \end{axis}
\end{tikzpicture}
\end{document}

Live example