matrices ty p set complex aesthetics

Upload: tracy-adams

Post on 14-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Matrices Ty p Set Complex Aesthetics

    1/4

    How to typeset complex yet aesthetically rejoicing

    matrices without getting a headache ?

    Vincent Hugot

    19th March 2005

    1 Make ones life easier...

    Here are listed, higgledy-piggledy, some commands I found useful to define. I feel almoststupid giving them (almost) but I found that obvious though they are, they really help.Besides, as I shall use them a lot later on, I have to explain them anyway, even thoughmost of them are not directly related to matrices.

    1.1 Delimiters commands

    \p adjusts a couple of parenthesis to its argument. For instance, \p a produces (a), and\p{\f12} produces

    1

    2

    (one may notice the fraction command \f). There are numerous

    versions of this command, some of which are listed below :

    \newcommand{\p}[1]{\left( #1 \right)} %couple de parentheses\newcommand{\pd}[1]{\left\lvert #1 \right\rvert} %couple ||

    \newcommand{\pdd}[1]{\left\lVert #1 \right\rVert} %couple || ||

    \newcommand{\pc}[1]{\left[ #1 \right]} %couple []

    \newcommand{\pa}[1]{\left\{ #1 \right\}} %couple {}

    \newcommand{\pb}[1]{\left\langle #1 \right\rangle} %couple de par brisees

    \newcommand{\lp}[1]{\left( #1 \right.} %parenthese gauche

    %etc...

    \newcommand{\rp}[1]{\left. #1 \right)} %parenthese droite

    %etc...

    1.2 Matrices-related commands

    \M provides a convenient way to produce a naked matrix (without delimiters) :

    $\M{1&0\\0&1}$ gives1 00 1

    Its variant \pM adds the parenthesis. It is equivalent to \p{\M{...}}.

    Ex : $\pM{1&0\\0&1}$ produces1 0

    0 1

    \mM produces a mini-matrix, suitable for inline use :

    $\mM{1&0\\0&1}$ donne 1 00 1

    1

  • 7/27/2019 Matrices Ty p Set Complex Aesthetics

    2/4

    VincentHugot Matrices

    Licence de

    Maths 4

    The variant pmM, obviously enough, produces a small matrix automatically sur-rounded by parenthesis.

    $\pmM{1&0\\0&1}$ produces ( 1 00 1

    )

    2 Diagonal Matrices

    You might think that those are not really difficult to typeset. And I quite agree withyou on that point. But a final result like this one

    a1 0

    . . .

    0 an

    which was produced by the following code, simple but long for as basic an output,

    \[\pM{

    {a_1 } & {} & 0 \\

    {} & \ddots & {} \\

    0 & {} & {a_n } \\

    }\]

    is nevertheless unfit for unleashing torrents of enthusiasm. Compare it with this :

    \[ \p{\matdiag {a_1}{a_n}} \]

    a1 0 0

    0

    0

    0 0 an

    Please notice the beautiful grey color of the non-diagonal terms. . . which are slightlysmaller than the diagonal ones! Isnt that marvellous? It is to note that the \matdiagcommand admits an optional argument. The complete syntax is given below :\[\matdiag[opt]{a_1}{b_2}\]

    a1 opt opt

    optopt

    opt opt b2

    Keep in mind that this function does not provide any delimiter. It is therefore up to youto use commands such as \p{} whenever you need them.

    3 Simple triangular matrices

    The \mattrig function provides you with a convenient way to typeset fine simple trian-

    gular matrices ; it demands no less than five arguments which are respectively : the a11and ann terms of the matrix, the contents of the upper part of the matrix, that of thelower part of the matrix. As for the last one, it is a very special argument, which mustbe an integer and determines which part of the matrix should be emphasized (typically

    19th March 2005 Amusing LATEX Page 2 sur 4

  • 7/27/2019 Matrices Ty p Set Complex Aesthetics

    3/4

  • 7/27/2019 Matrices Ty p Set Complex Aesthetics

    4/4

    VincentHugot Matrices

    Licence de

    Maths 4

    The one and only difference between the two matrices is that in the right one the 1 inthe upper-left corner is marked as the a node, whereas it is a plain, ordinary 1 in the leftone. One cant tell them apart with the mere output, as the presence of the nodes hasno influence whatsoever on it.

    As soon as two, three or four such nodes are defined, you may : link two of them by a plain line.

    link two of them by dots.

    link three of them by dots.

    link four of them by dots.

    by the means of, respectively :

    \matdrawline Id1 Id2 Id3 Id4

    \matdrawdottedline [size] Id1 Id2 Id3 Id4

    \matdrawtri [size] Id1 Id2 Id3 Id4

    \matdrawbloc [size] Id1 Id2 Id3 Id4

    It is obvious that a single node can be used as many times as necessary. The last threemacros listed do also have an optional argument specifying the size of the dots involved.Example :

    \[

    \pM{

    \mn a{a_{11} } & & \mn b{a_{1n} } \\

    & & \\

    \mn c{a_{m1} } & & \mn d{a_{mn} } \\}\matdrawdottedline[.5pt]ad

    \matdrawbloc abdc

    \]

    a11 a1nam1 amn

    An amusing property of these functions is that they work everywhere. Example :

    En dautres \mn ttermes, les vap de $A$ sont lesracines du polynome caracteristique de $A$.\\

    \mn LLe polynome caracteristique est un invariant de similitude,

    cest-a-dire que deux matrices semblables ont le meme polynome

    \mn ccaracteristique.

    \matdrawtri tLc

    En dautres termes, les vap de A sont les racines du polynome caracteristique de A.

    Le polynome caracteristique est un invariant de similitude, cest-a-dire que deux matrices

    semblables ont le meme polynome caracteristique.

    It is, however, sure that this misuse of those functions isnt of great interest. It is possiblethanks to the magic of pstricks, which is the only one to blame. . . or to praise.

    A matrix of Froebenius or of similar complexity is the typical field of these macros.Thanks to them, they become simple to type, and easy to read.

    19th March 2005 Amusing LATEX Page 4 sur 4