Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

14 Okt '18, 22:18

cis's gravatar image

cis
9.6k103460491

Mit einer simplen Bauart \tikzset{matrixstyle/.style={ %nodes={}, %column sep=5mm, row sep=3mm, }, } Bekomme ich an sich ein brauchbares Ergebnis. `text width = <Wert>` sollte hier m.E. vermieden werden, da die Annotationszeile *Annotationsspalte* eine Extra-pgfplotstable ist und umgebrochen werden könnte (es sei denn, man passt halt an). [![alt text][1]][1] %\documentclass[]{article} \documentclass[border=3mm, tikz]{standalone} \usepackage{pgfplotstable, amsmath} \usepackage{tikz} \usetikzlibrary{matrix} % Applet für die Eingabe von Linearen Gleichungssystemen % v2.0 \pgfplotsset{compat=1.13} \pgfplotstableset{header=false} % Eingabe 1/3 "Matrizen eingeben": \pgfplotstableread[]{ 1 2 -1 1 {} 0 1 1 2 {} 2 1 1 1 {-2\mal I} 3 2 1 1 {-3\mal I} }\matrixI \pgfplotstableread[]{ 1 2 -1 1 {} 0 1 1 2 {} 0 -3 3 -1 {} 0 -4 4 -2 {:2} }\matrixII \pgfplotstableread[]{ 1 2 -1 1 {-2\mal II} 0 1 1 2 {} 0 -3 3 -1 {+3\mal II} 0 -2 2 -1 {+2\mal II} }\matrixIII \pgfplotstableread[]{ 1 0 -3 -3 {} 0 1 1 2 {} 0 0 6 5 {} 0 0 4 3 {3\mal IV-2\mal III} }\matrixIV \pgfplotstableread[]{ 1 0 -3 -3 {} 0 1 1 2 {} 0 0 6 5 {} 0 0 0 -1 {\Error} }\matrixV % Eingabe 2/3 "Ausgabe festlegen": \newcommand{\Ausgabe}{% {\MatrixI} \& \step \& {\MatrixII} \& \step \\ {\MatrixIII} \& \step \& {\MatrixIV} \& \step \\ {\MatrixV} \& \& \& \\ } % % Eingabe 3/3 "Eventuell Stil für Matrizen festlegen" \tikzset{matrixstyle/.style={ %nodes={}, %column sep=5mm, row sep=3mm, }, } % =================================== % Sonderzeichen \newcommand\mal{$\cdot$} % Malpunkt \newcommand\Error{% \begin{tikzpicture}[baseline=-1ex, scale=0.05, outer sep=0pt] \draw[->] (3,3)--(0,0)--(3,1)--(0,-3); \end{tikzpicture}} \newcommand\step{$\rightarrow$} % Allgemeine und spezielle Einstellungen \pgfplotstableset{%header=false, % da bereits oben string type, every head row/.style={output empty row},% ErweiterteKoeffizientenMatrix/.style={ column type=r, postproc cell content/.append style={/pgfplots/table/@cell content/.add={$}{$}}, },% AnnotationsSpalte/.style={ column type=l, postproc cell content/.append style={/pgfplots/table/@cell content/.add={\ttfamily\footnotesize\hspace{-0.75em}}{},} }% } % Matrizen erstellen ============================ \newcommand{\Dimensionen}[1]{% \pgfplotstablegetcolsof{#1} \pgfmathtruncatemacro{\LetzteSpalteNummer}{\pgfplotsretval-1} \pgfplotstablegetcolsof{#1} \pgfmathtruncatemacro{\VorletzteSpalteNummer}{\pgfplotsretval-2} \pgfplotstablegetcolsof{#1} \pgfmathtruncatemacro{\VorvorletzteSpalteNummer}{\pgfplotsretval-3} } % Kommandos \MatrixI, \MatrixII,... erstellen ============= \newcounter{MatrixNummer} \loop % Kommandos für Matrizen erstellen === \ifnum\value{MatrixNummer}<99 \stepcounter{MatrixNummer} \expandafter\edef\csname Matrix\Roman{MatrixNummer}\endcsname {% \noexpand\Dimensionen{\expandafter\noexpand\csname matrix\Roman{MatrixNummer}\endcsname} {$\left\lgroup \noexpand\pgfplotstabletypeset[ErweiterteKoeffizientenMatrix, columns={0,...,\noexpand\VorletzteSpalteNummer\noexpand}, columns/\noexpand\VorvorletzteSpalteNummer\noexpand/.style={column type=r|}, ]{\expandafter\noexpand\csname matrix\Roman{MatrixNummer}\endcsname}\right\rgroup$}% % \noexpand\pgfplotstabletypeset[AnnotationsSpalte, columns={\noexpand\LetzteSpalteNummer\noexpand} ]{\expandafter\noexpand\csname matrix\Roman{MatrixNummer}\endcsname}% }% === \repeat % ================================= \begin{document} \begin{tikzpicture}[] \matrix[ matrix of nodes, nodes in empty cells, nodes={align=left, anchor=west}, ampersand replacement={\&}, matrixstyle] (m) {\Ausgabe}; %\fill[red] (m-1-2.center) circle(1mm); \end{tikzpicture} \end{document} [1]: https://texwelt.de/wissen/upfiles/55555555_245.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

14 Okt '18, 22:09

cis's gravatar image

cis
9.6k103460491

Mit einer simplen Bauart \tikzset{matrixstyle/.style={ %nodes={}, %column sep=5mm, row sep=3mm, }, } Bekomme ich an sich ein brauchbares Ergebnis. `text width = <Wert>` sollte hier m.E. vermieden werden, da die Annotationszeile eine Extra-pgfplotstable ist und umgebrochen werden könnte (es sei denn, man passt halt an). [![alt text][1]][1] %\documentclass[]{article} \documentclass[border=3mm, tikz]{standalone} \usepackage{pgfplotstable, amsmath} \usepackage{tikz} \usetikzlibrary{matrix} % Applet für die Eingabe von Linearen Gleichungssystemen % v2.0 \pgfplotsset{compat=1.13} \pgfplotstableset{header=false} % Eingabe 1/3 "Matrizen eingeben": \pgfplotstableread[]{ 1 2 -1 1 {} 0 1 1 2 {} 2 1 1 1 {-2\mal I} 3 2 1 1 {-3\mal I} }\matrixI \pgfplotstableread[]{ 1 2 -1 1 {} 0 1 1 2 {} 0 -3 3 -1 {} 0 -4 4 -2 {:2} }\matrixII \pgfplotstableread[]{ 1 2 -1 1 {-2\mal II} 0 1 1 2 {} 0 -3 3 -1 {+3\mal II} 0 -2 2 -1 {+2\mal II} }\matrixIII \pgfplotstableread[]{ 1 0 -3 -3 {} 0 1 1 2 {} 0 0 6 5 {} 0 0 4 3 {3\mal IV-2\mal III} }\matrixIV \pgfplotstableread[]{ 1 0 -3 -3 {} 0 1 1 2 {} 0 0 6 5 {} 0 0 0 -1 {\Error} }\matrixV % Eingabe 2/3 "Ausgabe festlegen": \newcommand{\Ausgabe}{% {\MatrixI} \& \step \& {\MatrixII} \& \step \\ {\MatrixIII} \& \step \& {\MatrixIV} \& \step \\ {\MatrixV} \& \& \& \\ } % % Eingabe 3/3 "Eventuell Stil für Matrizen festlegen" \tikzset{matrixstyle/.style={ %nodes={}, %column sep=5mm, row sep=3mm, }, } % =================================== % Sonderzeichen \newcommand\mal{$\cdot$} % Malpunkt \newcommand\Error{% \begin{tikzpicture}[baseline=-1ex, scale=0.05, outer sep=0pt] \draw[->] (3,3)--(0,0)--(3,1)--(0,-3); \end{tikzpicture}} \newcommand\step{$\rightarrow$} % Allgemeine und spezielle Einstellungen \pgfplotstableset{%header=false, % da bereits oben string type, every head row/.style={output empty row},% ErweiterteKoeffizientenMatrix/.style={ column type=r, postproc cell content/.append style={/pgfplots/table/@cell content/.add={$}{$}}, },% AnnotationsSpalte/.style={ column type=l, postproc cell content/.append style={/pgfplots/table/@cell content/.add={\ttfamily\footnotesize\hspace{-0.75em}}{},} }% } % Matrizen erstellen ============================ \newcommand{\Dimensionen}[1]{% \pgfplotstablegetcolsof{#1} \pgfmathtruncatemacro{\LetzteSpalteNummer}{\pgfplotsretval-1} \pgfplotstablegetcolsof{#1} \pgfmathtruncatemacro{\VorletzteSpalteNummer}{\pgfplotsretval-2} \pgfplotstablegetcolsof{#1} \pgfmathtruncatemacro{\VorvorletzteSpalteNummer}{\pgfplotsretval-3} } % Kommandos \MatrixI, \MatrixII,... erstellen ============= \newcounter{MatrixNummer} \loop % Kommandos für Matrizen erstellen === \ifnum\value{MatrixNummer}<99 \stepcounter{MatrixNummer} \expandafter\edef\csname Matrix\Roman{MatrixNummer}\endcsname {% \noexpand\Dimensionen{\expandafter\noexpand\csname matrix\Roman{MatrixNummer}\endcsname} {$\left\lgroup \noexpand\pgfplotstabletypeset[ErweiterteKoeffizientenMatrix, columns={0,...,\noexpand\VorletzteSpalteNummer\noexpand}, columns/\noexpand\VorvorletzteSpalteNummer\noexpand/.style={column type=r|}, ]{\expandafter\noexpand\csname matrix\Roman{MatrixNummer}\endcsname}\right\rgroup$}% % \noexpand\pgfplotstabletypeset[AnnotationsSpalte, columns={\noexpand\LetzteSpalteNummer\noexpand} ]{\expandafter\noexpand\csname matrix\Roman{MatrixNummer}\endcsname}% }% === \repeat % ================================= \begin{document} \begin{tikzpicture}[] \matrix[ matrix of nodes, nodes in empty cells, nodes={align=left, anchor=west}, ampersand replacement={\&}, matrixstyle] (m) {\Ausgabe}; %\fill[red] (m-1-2.center) circle(1mm); \end{tikzpicture} \end{document} [1]: https://texwelt.de/wissen/upfiles/55555555_245.png

Willkommen, erstes Mal hier? Schau mal unter FAQ!

×