1

I read this thread and ask myself: How can I set bracktes of the \lgroup, \rgroup kind into a pgfplotstable?

BTW: In this MWE below, I wrote the group-commands directly in the table; furthermore, I will will take them out there with '@cell content'.

BTW: I ask in the german latex-forum too. But I think, this is completely coupled with A.M.S typeset.

My first try looks quite terrible:

enter image description here

Note that this is an arbitrary matrix. Brackets should always be in front of the first and last column.

\documentclass[border=3mm, varwidth]{standalone}
\usepackage{pgfplotstable, amsmath}
  \pgfplotsset{compat=1.13}

% Brackets
\def\OL{\rotatebox{180}{$\rgroup$}}
\def\UL{$\lgroup$}
\def\OR{\rotatebox{180}{$\lgroup$}}
\def\UR{$\rgroup$}
\def\Strich{\rule{1.25pt}{1em}}

\begin{document}
%\Strich

Actual: $M =
\pgfplotstabletypeset[header=false,
every head row/.style={output empty row},% 
string type, 
%dec sep align % geht nicht
]{
{\OL  1}         2.0          {3\OR}            abc
{$|$   4}          5           {6 \Strich}       d
{\Strich 7}      -8           {9 \Strich}       e
{\UL 10}         11          {-12\UR}         f
}$
\bigskip

Target: $M = 
\left\lgroup\begin{array}{r r | r}
1 & 2.0 & 3 \\
4 & 5  & 6\\
7 & -8  & 9\\
10 & 11  & -12\\
\end{array}\right\rgroup \begin{array}{l}
abc \\ d \\ e \\ f \\
\end{array}$

\end{document}
2
  • Can you get rid of the \OL $|$ \Strich \UL or are they built in? Oct 9, 2018 at 16:18
  • Yes, the main thing at the end are brackets at the desired positions.
    – cis
    Oct 9, 2018 at 16:29

2 Answers 2

2

Basically the same as cis, with a few extras:

\documentclass[border=3mm, varwidth]{standalone}
\usepackage{pgfplotstable, amsmath}
  \pgfplotsset{compat=1.13}

% Brackets
\def\OL{\rotatebox{180}{$\rgroup$}}
\def\UL{$\lgroup$}
\def\OR{\rotatebox{180}{$\lgroup$}}
\def\UR{$\rgroup$}
\def\Strich{\rule{1.25pt}{1em}}

\pgfplotstableread[header=false,string type]{% store in one macro
1        2.0         3       abc \\
4         5          6       d   \\
7        -8          9       e   \\
10       11         -12      f   \\
}\mytable

\begin{document}
%\Strich


Actual: $M = \left\lgroup 
\pgfplotstabletypeset[header=false,string type,
every head row/.style={output empty row},% 
columns={[index]0, [index]1, [index]2},
columns/0/.style={column type=r},
columns/1/.style={column type=r|},
columns/2/.style={column type=r},
]\mytable \right\rgroup 
\pgfplotstabletypeset[header=false,string type,
every head row/.style={output empty row},% 
columns={[index]3},
columns/3/.style={column type=l,
  postproc cell content/.append style={/pgfplots/table/@cell content/.add={$}{$},}}
]\mytable$

Target: $M = 
\left\lgroup\begin{array}{r r | r}
1 & 2.0 & 3 \\
4 & 5  & 6\\
7 & -8  & 9\\
10 & 11  & -12\\
\end{array}\right\rgroup \begin{array}{l}
abc \\ d \\ e \\ f \\
\end{array}$

\end{document}

demo

1

So this was a silly question, the solution is like this:

(1) \pgfplotstabletypeset[columns={0,1,2}]{\test}

(2) \pgfplotstabletypeset[columns={3}]{\test}

(3) $\left\lgroup \pgfplotstabletypeset[columns={0,1,2}, dec sep align]{\test} \right\rgroup \pgfplotstabletypeset[columns={3}]{\test}$

enter image description here

\documentclass[border=5mm, varwidth]{standalone}
\usepackage{pgfplotstable}
\usepackage{tikz, amsmath}

\pgfplotstableread[header=false]{
1         2.0        3            abc
4         5           6           d
7      -8           9             e
10     11    -12.1               f
}\test

\pgfplotstableset{
every head row/.style={output empty row},% keinen verdammten HEADER!!!
string type
}

\begin{document}
\pgfplotstabletypeset[]{\test}

$\left\lgroup
\pgfplotstabletypeset[columns={0,1,2}, dec sep align]{\test}
\right\rgroup
\pgfplotstabletypeset[columns={3}]{\test}$

\end{document}

You must log in to answer this question.

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