TechBlox » vector http://techblox.fusun.ch/wordpress Solutions To A Computer Scientist's Daily Problems Tue, 14 Sep 2010 11:11:54 +0000 en-US hourly 1 http://wordpress.org/?v=3.4.1 Advanced Formulae in Latex http://techblox.fusun.ch/wordpress/2010/05/advanced-formulae-in-latex/ http://techblox.fusun.ch/wordpress/2010/05/advanced-formulae-in-latex/#comments Thu, 27 May 2010 17:06:39 +0000 TechBloxWriter http://techblox.fusun.ch/wordpress/?p=15 Remember when you couln’t think of the correct commands to write a certain formula in latex because it’s been a year since you did it the last time? This might help you find the light.

Vectors

Using

1
\newcommand{\ve}[1]{\mbox{\bf #1}}

in your preamble, you can easily write vectors as follows:

1
2
3
\begin{equation}
    \mathscr{L}(\ve v_i) = \ve v_i - \frac{1}{\left| N_i \right|} \sum_{j\in N_i} \ve v_j
\end{equation}

Matrices

You always need matrices. Try this code:

1
2
3
4
5
6
7
8
9
10
\begin{equation}
    \begin{pmatrix}
        A & A_k
    \end{pmatrix}
    \begin{pmatrix}
        D \\
        D_k
    \end{pmatrix}
    = 0
\end{equation}

Multi-case definition

This code comes in handy to define certain funtions or matrices:

1
2
3
4
5
6
7
8
\begin{equation}
    A_{ij} = \left\{
        \begin{array}{l l}
            1 & \quad (i,j) \in K \\
            0 & \quad \text{otherwise} \\
        \end{array}
        \right
\end{equation}
]]>
http://techblox.fusun.ch/wordpress/2010/05/advanced-formulae-in-latex/feed/ 2