summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gauss
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-10-26 22:56:55 +0000
committerKarl Berry <karl@freefriends.org>2011-10-26 22:56:55 +0000
commit05c835a6040bd6fa00faa62d865285e19ee0242c (patch)
treec693af3305552cc870e46a37dd6c81dc1644a60f /Master/texmf-dist/tex/latex/gauss
parent0051d746545faaf2ec13c53c3b3fb8c10fd9c746 (diff)
gauss (26oct11)
git-svn-id: svn://tug.org/texlive/trunk@24411 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/gauss')
-rw-r--r--Master/texmf-dist/tex/latex/gauss/gauss.sty58
1 files changed, 33 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/gauss/gauss.sty b/Master/texmf-dist/tex/latex/gauss/gauss.sty
index 7c1dc7c34f9..a6da7faa147 100644
--- a/Master/texmf-dist/tex/latex/gauss/gauss.sty
+++ b/Master/texmf-dist/tex/latex/gauss/gauss.sty
@@ -1,3 +1,9 @@
+% TODO:
+% * ALLOW FINE TUNING OF ARROW ETC ARRANGEMENT BY PARAMETERS
+% (Suggestion by Antonis Tsolomitis)
+% * BUG: ROWOPMINSIZE AND COLOPMINSIZE DONT WORK IN \swap01 etc.
+% (MAXIMUM COMPUTATION MISSIG)
+% * BUG: ARROWHT HAS TWO CONTRADICTING MEANINGS
%
% \title{\texttt{gauss.sty} -- A Package for Typesetting Matrix Operations}
% \author{Manuel Kauers}
@@ -39,11 +45,11 @@
% \add[-3]01
% \add[-1]02
% \swap34
-% \mult5{\cdot0}
+% \mult5{\cdot 0}
% \add[x^2-1]53
% \colops
% \swap01
-% \mult3{\cdot1}
+% \mult3{\cdot 1}
% \add[0]24
% \end{gmatrix} = \begin{gmatrix}[v]
% 0 & 1 & 5 & 7 & 2 \\
@@ -102,11 +108,11 @@
% commands are specified as follows:
%
% \begin{enumerate}
-% \item |\mult{i}{\cdot b}| typesets the operation ``multiply the $i$th row (or column)
+% \item |\mult{i}{\cdot b}| typesets the operation ``multiply the $i$th row (or column)
% by~$b$'',
% \item |\swap[a][b]{i}{j}| typesets the operation ``swap the $i$th and the $j$th row
% (or column)''.
-% $a$~and~$b$ are labels to typeset at the end of the arrows, similar to the $\cdot b$ of
+% $a$~and~$b$ are labels to typeset at the end of the arrows, similar to the $\cdot b$ of
% the |\mult| command. The command does nothing if $i=j$.
% \item |\add[a][b]{i}{j}| typesets the operation ``add the $a$-fold of row (or column)~$i$ to
% row (or column)~$j$. $b$~is a label for the $j$th line. The command does nothing if $i=j$.
@@ -118,7 +124,7 @@
% Rows are counted top-down, and columns are counted from left to right. The uppermost row
% and the leftmost column have the index~0. There is also the posibility to use |*| as index
% which causes the typesetting of several operations where |*| runs over all indices. For
-% example, |\mult{*}{5}| in the |\rowops| section of a $n\times n$ matrix is equivalent to
+% example, |\mult{*}{5}| in the |\rowops| section of a $n\times n$ matrix is equivalent to
% state |\mult{0}{5}|,\dots,|\mult{|$n-1$|}{5}|.
% \end{macro}
% \end{macro}
@@ -135,12 +141,12 @@
% | 7 & 8 & 9|
% |\rowops|
% | \swap{0}{1}|
-% | \mult{0}{\cdot 7}|
+% | \mult{0}{\cdot 7}|
% | \add[5]{1}{2}|
% |\end{gmatrix}|
% \switch
% \begin{gmatrix}[p] 1&2&3\\4&5&6\\7&8&9 \rowops
-% \swap01\mult0{\cdot 7}\add[5]12
+% \swap01\mult0{\cdot 7}\add[5]12
% \end{gmatrix}
% \end{example}
% \item The same operations in an other ordering
@@ -152,11 +158,11 @@
% |\rowops|
% | \add[5]{1}{2}|
% | \swap{0}{1}|
-% | \mult{0}{\cdot 7}|
+% | \mult{0}{\cdot 7}|
% |\end{gmatrix}|
% \switch
% \begin{gmatrix}[p] 1&2&3\\4&5&6\\7&8&9 \rowops
-% \add[5]12\swap01\mult0{\cdot 7}
+% \add[5]12\swap01\mult0{\cdot 7}
% \end{gmatrix}
% \end{example}
% \item A matrix with column operations
@@ -167,12 +173,12 @@
% | 7 & 8 & 9|
% |\colops|
% | \swap{0}{1}|
-% | \mult{0}{\cdot 7}|
+% | \mult{0}{\cdot 7}|
% | \add[5]{1}{2}|
% |\end{gmatrix}|
% \switch
% \begin{gmatrix}[p] 1&2&3\\4&5&6\\7&8&9 \colops
-% \swap01\mult0{\cdot 7}\add[5]12
+% \swap01\mult0{\cdot 7}\add[5]12
% \end{gmatrix}
% \end{example}
% \item A matrix with both row and column operations
@@ -183,18 +189,18 @@
% | 7 & 8 & 9|
% |\rowops|
% | \swap{1}{2}|
-% | \mult{2}{\cdot 3}|
+% | \mult{2}{\cdot 3}|
% | \add[-5]{1}{0}|
% | \add[-3]{1}{2}|
% |\colops|
% | \swap{0}{1}|
-% | \mult{0}{\cdot 7}|
+% | \mult{0}{\cdot 7}|
% | \add[5]{1}{2}|
% |\end{gmatrix}|
% \switch
% \begin{gmatrix}[v] 1&2&3\\4&5&6\\7&8&9 \rowops
-% \swap12\mult2{\cdot 3}\add[-5]10\add[-3]12 \colops
-% \swap01\mult0{\cdot 7}\add[5]12
+% \swap12\mult2{\cdot 3}\add[-5]10\add[-3]12 \colops
+% \swap01\mult0{\cdot 7}\add[5]12
% \end{gmatrix}
% \end{example}
% \item Multiple operations using the |*| index
@@ -246,16 +252,16 @@
% Even nested |gmatrix|es are possible:
% \[
% \def\littleA#1#2#3#4{\begin{gmatrix}[p]#1&#2\\#3&#4\rowops \add[-#3/#1]01\end{gmatrix}}
-% \def\littleB#1#2#3#4#5{\begin{gmatrix}[p]#1&#2\\#3&#4\rowops \mult0{\cdot#5}\end{gmatrix}}
+% \def\littleB#1#2#3#4#5{\begin{gmatrix}[p]#1&#2\\#3&#4\rowops \mult0{\cdot #5}\end{gmatrix}}
% \def\littleC#1#2#3#4{\begin{gmatrix}[p]#1&#2\\#3&#4\rowops \swap01\end{gmatrix}}
% \kern-1.5em
% \begin{gmatrix}[v]
% \littleA 2233 & \littleC 1234 & \littleA abcd \\
% \rule[-20pt]{0pt}{45pt}\littleB 0110\pi & \littleC vwxy & \littleC 1xx{x^2} \\
-% \littleB 12345 & \littleA \cdot\cdot\cdot\cdot & \littleB 54321
+% \littleB 12345 & \littleA \cdot \cdot \cdot \cdot & \littleB 54321
% \rowops
% \add[\pi^2/6]01
-% \mult1{\cdot42}
+% \mult1{\cdot 42}
% \swap02
% \end{gmatrix}
% \kern-1.5em
@@ -270,7 +276,7 @@
% dimension parameters described in this section.
%
% \def\test{\begin{gmatrix}[p]a&b&c\\d&e&f\\g&h&i\rowops
-% \add[x]01\add[y]12\mult1{\cdot y}\swap02\end{gmatrix}}%
+% \add[x]01\add[y]12\mult1{\cdot y}\swap02\end{gmatrix}}%
% \def\ttest#1=#2.{\[#1=#2\relax\test\]}%
%
% \begin{macro}{\rowarrowsep}
@@ -480,12 +486,14 @@
% The current version of |gauss| therefore redefines all those environments
% using our |\newmatrix| tool, and requires |amsmath| to be loaded prior to
% the |gauss| package.
-% \item Morten H\o gholm suggested the introduction of fontifying macros and
+% \item Morten H{\o}gholm suggested the introduction of fontifying macros and
% the use of changeable lengths as discussed in Section~\ref{ssec:atp}.
% He also suggested some very fine typographic tunings.
% \item Herbert Voss found that a |\unitlength=1pt| was missing to make the
% behaviour of the package independent of redefinitions of |\unitlength|
-% outside |gmatrix|.
+% outside |gmatrix|. (Fixed.)
+% \item Michael Hagedorn noticed that signs in entries a treated like
+% binary relations, i.e., wrong spacing is used. (Fixed.)
% \end{itemize}
%
% \StopEventually
@@ -493,7 +501,7 @@
% \section{Implementation}
%
% \begin{macrocode}
-\ProvidesPackage{gauss}[2002/10/11]
+\ProvidesPackage{gauss}[2003/01/14]
\RequirePackage{amsmath}
\makeatletter
% \end{macrocode}
@@ -1073,7 +1081,7 @@
\setbox\g@trash=\hbox{$\leftarrow$}%
\global\g@arrowwd\wd\g@trash
% 3. What is the minimum height of a vertical arrow?
- \setbox\g@trash=\vbox{\g@vertline}
+ \setbox\g@trash=\vbox{\g@vertline}%
\global\g@arrowht=\ht\g@trash
\global\advance\g@arrowht\dp\g@trash
\global\advance\g@arrowht\lineskip
@@ -1226,7 +1234,7 @@
\def\g@rbox#1#2#3{%
\setbox\g@label=\hbox{$\relax#3\relax$}%
\ht\g@label\z@\dp\g@label\z@
- \setbox\g@label=\hbox{$\mathstrut\box\g@label$}%
+ \setbox\g@label=\hbox{$\mathstrut\box\g@label$}%
\put(\g@double{#1},\g@double{#2})%
{\makebox(0,0)[l]{\kern-\p@\copy\g@label}}%
}
@@ -1764,7 +1772,7 @@
% \begin{environment}{g@matrix}
% Finally, we have the following definition of |g@matrix|:
% \begin{macrocode}
-\edef\g@prae{\hfil$\relax\noexpand\mathstrut}
+\edef\g@prae{\hfil\noexpand\mathstrut$\relax}
\edef\g@post{\relax$\hfil}
\newenvironment{g@matrix}
{\setbox\g@trash=\hbox\bgroup