# Arrays in the New Latex

Tags:
1. Jan 29, 2014

### Philosophaie

How do you write these in the new Latex:

x^k = Array{r \\ \theta \\ \phi \\ t}

g_{ij} = Array{1/(1-2*m/r) & 0 & 0 & 0 \\ 0 & r^2 & 0 & 0\\0 & 0 & r^2*(sin(h))^2 & 0\\0 & 0 & 0 & -(1-2*m/r)}

\Gamma^i_{jk} = 1/2*g^{il} * (\frac{d g_{lj}}{d x^k} + \frac{d g_{lk}{d x^j} - \frac{d g_{jk}{d x^l})

Riemann^i_{jkl}) = \frac{d \Gamma^i_{jl}}{d x^k} - \frac{d \Gamma^i_{jk}}{d x^l} + \Gamma^i_{km)*\Gamma^m_{jl} - \Gamma^i_{lm} * \Gamma^r_{jk}

Just putting "$" or """ at the beginning and end does not work. Last edited: Jan 29, 2014 2. Jan 29, 2014 ### Mentz114 This is the only way I know. Right click and select 'tex' to see the code. $$\left[ \begin {array}{cccc} 1/(1-2m/r) & 0 & 0 & 0 \\ 0 & r^2 & 0 & 0\\ 0 & 0 & r^2(sin(h))^2 & 0\\ 0 & 0 & 0 & -(1-2m/r) \end {array} \right]$$ This one had some errors in the Tex$\Gamma^i_{jk} = (1/2)g^{il} \left( \frac{d g_{lj}}{d x^k} + \frac{d g_{lk}}{d x^j} - \frac{d g_{jk}}{d x^l}\right)##

Last edited: Jan 29, 2014
3. Feb 1, 2014

### Staff: Mentor

For the matrix, here's how I do them:
$$\begin {bmatrix} 1/(1-2m/r) & 0 & 0 & 0 \\ 0 & r^2 & 0 & 0\\ 0 & 0 & r^2(sin(h))^2 & 0\\ 0 & 0 & 0 & -(1-2m/r) \end {bmatrix}$$

About the only difference from what Mentz114 did was that I used the bmatrix environment rather than the array environment. The bmatrix environment produces a matrix whose left and right sides are brackets, hence the 'b' in bmatrix. For this simpler environment you don't need to supply left and right sides of the matrix, nor do you need to include the {cccc} thing to specify the columns. There is also a pmatrix environment, where the left and right sides of the matrix are parentheses - ( and ).

You can right-click on the matrix to see my LaTeX code.