pgfplotstable: So verwenden Sie \pgfplotstablevertcat in einer Schleife

pgfplotstable: So verwenden Sie \pgfplotstablevertcat in einer Schleife

Ich weiß, es gibtandere Optionenzu.

Aber ich habe mich gefragt: Wie kann ich in einer Schleife einzeilige Tabellen erstellen und diese anschließend zur vorherigen Gesamttabelle hinzufügen?

Beim nächsten Versuch wird nur noch der aktuelle Schleifenwert akzeptiert.

Wie kann ich das beheben?
Mich interessiert insbesondere die Nutzung der \pgfplotstablevertcatFunktion hierfür.
Ist das möglich?

Bildbeschreibung hier eingeben

\documentclass{article}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}


\begin{document}
\section{Create following Table row by row}
\pgfplotstabletypeset[header=true, col sep=comma]{
k, 2k
1, 2
2, 4
3, 6
} 


\section{Try}
\pgfplotstableread[header=false, col sep=comma]{
k,    2k
}{\main}

Startsituation: \pgfplotstabletypeset[string type]{\main} 

\subsection{Loop}
\pgfplotsforeachungrouped \k in {1,2,3} {%%
\pgfmathsetmacro\Double{2*\k}
\pgfplotstableread[header=false, col sep=comma, 
row sep=\\ % <--- seems that he wants that............
]{
\k, \Double \\
}{\temp}

\noindent Temprow (good!): \pgfplotstabletypeset[]{\temp} 

\pgfplotstablevertcat{\main}{\temp} 
\noindent Tempsituation (bad!): \pgfplotstabletypeset[string type]{\main} 
}%%
\end{document}

verwandte Informationen