2

I was trying to make a table with pgfplotstable and append one csv file to another by \pgfpotstablevertcat. Now I wanted to change the math font with unicode-math, but then I get the error "File ended while scanning use of \pgfplotslistpushback". I am using lualatex from MiKTeX to compile the document. Same problem for xelatex. What could be the issue? Is it a bug or am I missing something obvious? Here is a MWE which produces the error.

\documentclass{article}
\usepackage{unicode-math}
\usepackage{pgfplotstable}

\begin{filecontents}{dataA.csv}
pH,     concentration
1,      1.5
2,      -0.5
3,      -1.5
\end{filecontents}
\begin{filecontents}{dataB.csv}
pH,     concentration
4,      -2.5
5,      -3.5
6,      -4.5
\end{filecontents}


\begin{document}
\pgfplotstableset{col sep=comma}
\pgfplotstablevertcat{\outputa}{dataA.csv} % loads `dataA.csv' -> `\outputa'
\pgfplotstablevertcat{\outputa}{dataB.csv} % appends rows of dataB.csv
\pgfplotstabletypeset[columns={pH, concentration},fixed zerofill]{\outputa};
\end{document}
5

1 Answer 1

4

\to gets defined which breaks the pgf loop construct used here. You can locally make it safe again.

\RequirePackage{luatex85}
\documentclass{article}
\usepackage{unicode-math}
\usepackage{pgfplotstable}




\begin{filecontents}{dataA.csv}
pH,     concentration
1,      1.5
2,      -0.5
3,      -1.5
\end{filecontents}
\begin{filecontents}{dataB.csv}
pH,     concentration
4,      -2.5
5,      -3.5
6,      -4.5
\end{filecontents}


\begin{document}
$a$

\tracingmacros1
{\let\to\relax
\pgfplotstableset{col sep=comma}
\pgfplotstablevertcat{\outputa}{dataA.csv} % loads `dataA.csv' -> `\output'
\pgfplotstablevertcat{\outputa}{dataB.csv} % appends rows of dataB.csv
\pgfplotstabletypeset[columns={pH, concentration},fixed zerofill]{\outputa};
}
\end{document}

Or a global but safe definition such as

\RequirePackage{luatex85}

\documentclass{article}


\usepackage{unicode-math}
\protected\def\to{\rightarrow}


\usepackage{pgfplotstable}




\begin{filecontents}{dataA.csv}
pH,     concentration
1,      1.5
2,      -0.5
3,      -1.5
\end{filecontents}
\begin{filecontents}{dataB.csv}
pH,     concentration
4,      -2.5
5,      -3.5
6,      -4.5
\end{filecontents}


\begin{document}
$a$


\pgfplotstableset{col sep=comma}
\pgfplotstablevertcat{\outputa}{dataA.csv} % loads `dataA.csv' -> `\output'
\pgfplotstablevertcat{\outputa}{dataB.csv} % appends rows of dataB.csv
\pgfplotstabletypeset[columns={pH, concentration},fixed zerofill]{\outputa};

\end{document}
4
  • The error is in pgfplots which shouldn't use \to as argument delimiter for macros passed through \edef, but an internal nonexpandable control sequence. Anyway, \AtBeginDocument{\let\to\rightarrow} fixes the issue more easily.
    – egreg
    Jan 18, 2017 at 12:00
  • Filed ticket: sourceforge.net/p/pgfplots/bugs/149
    – egreg
    Jan 18, 2017 at 12:11
  • Works perfect for me! Is there an advantage/disadvantage of one option? Or are they really equivalent?
    – Schewerle
    Jan 18, 2017 at 12:46
  • @Schewerle the second is better as (in theory) you might want to use some math expression involving \to within the typesetting of the table, but in the first form it is locally made \relax (which does nothing) but in the second form it is still a right arrow. Jan 18, 2017 at 13:38

You must log in to answer this question.

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