Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Arrays in the New Latex

Tags:
  1. Jan 29, 2014 #1
    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. jcsd
  3. Jan 29, 2014 #2

    Mentz114

    User Avatar
    Gold Member

    This is the only way I know. Right click and select 'tex' to see the code.

    [tex]\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]
    [/tex]
    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
  4. Feb 1, 2014 #3

    Mark44

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Arrays in the New Latex
  1. Matlab and arrays (Replies: 0)

  2. Arrays in MATLAB (Replies: 3)

Loading...