document.tex:
\documentclass{article}
\usepackage{standalone}
\usepackage{pgfplotstable}
\begin{document}
\input{plot.tex}
\end{document}
plot.tex:
\documentclass{standalone}
\usepackage{pgfplotstable}
\pgfplotstableread{
X Y
1 2
3 4
}\table
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot table {\table};
\end{axis}
\end{tikzpicture}
\end{document}
Compile with:
pdflatex document.tex
And I obtain:
(./plot.tex
! LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.14 \addplot table {\table};
?
! Emergency stop.
...
l.14 \addplot table {\table};
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on document.log.
The standalone file compiles just fine, I only get that error if I try to include it in another document. Why does this happen and what are my options here?
\pgfplotstableread{ X Y 1 2 3 4 }\table \begin{tikzpicture} \begin{axis} \addplot table {\table}; \end{axis} \end{tikzpicture}– leandriis Jan 10 '20 at 14:16\mytableI get:Undefined control sequence. \pgfplotstableread@filename ->\mytable– cYrus Jan 10 '20 at 14:21plot.texfile alone. Let me take a look at those links... – cYrus Jan 10 '20 at 14:23\tablein this example). – cYrus Jan 10 '20 at 14:37