I would like to create a System of linear equations indeed with pgfplotstable.
How can I add names of variables (x_1, x_2,... or something else: x,y,z), if some strings have been replaced?
string replace={0}{},
string replace={-1}{-x},
string replace={1}{x}
\documentclass[border=5pt, varwidth]{standalone}
\usepackage{pgfplotstable, systeme}
\pgfplotsset{compat=1.13}
\pgfplotstableset{
string type,%
%header=false,
every head row/.style={output empty row},%
column type=r,%
postproc cell content/.append style={
/pgfplots/table/@cell content/.add={$}{$},
},%
}
\begin{document}
\pgfplotstableread{
x y
-1 0
0 1
1 2
3 3
0 4
13 5
-6 6
-\frac{3}{2} 7
-12 8
}\test
Actual: \pgfplotstabletypeset[]{\test}
%
Partially replaced: \pgfplotstabletypeset[
string replace={0}{},
string replace={-1}{-x},
string replace={1}{x},
]{\test} \\
\bigskip
Target: $\newcolumntype{R}{>{{}}r<{{}}}
\setlength\arraycolsep{1pt}
\begin{array}{ r R r R}
- &x_1 & & \\
{} & {} & &x_2 \\
{} &x_1 &+2 &x_2 \\
3 &x_1 &+3 &x_2 \\
{} & {} &+4 &x_2 \\
{} 13 &x_1 &+5 &x_2 \\
- 6 &x_1 &+6 &x_2 \\
-\frac{3}{2} &x_1 &+7 &x_2 \\
-12 &x_1 &+8 &x_2 \\
\end{array}$
\end{document}
x
, sometimes not. It would good, if I could get the coulmn-head (x, y, ... oder x_1, x_2,... for example) and use it in 'string replace'... Mmmhh....