Writing Arrays in New Latex: x^k, g_{ij}, Γ^i_jk, Riemann^i_jkl

  • LaTeX
  • Thread starter Philosophaie
  • Start date
  • Tags
    Arrays Latex
In summary, the conversation discusses writing equations in the new LaTeX format, specifically involving matrices and the \Gamma symbol. The conversation provides examples of how to write these equations using the bmatrix and pmatrix environments, and mentions how to view the LaTeX code by right-clicking on the equations.
  • #1
Philosophaie
462
0
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:
Physics news on Phys.org
  • #2
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:
  • #3
Mentz114 said:
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)##

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.
 

1. What is the purpose of using arrays in LaTeX?

Arrays in LaTeX are used to organize and display mathematical equations or data in a structured and easily readable format. They are commonly used for matrices, vectors, and other mathematical expressions.

2. How do I write an array with superscripts and subscripts in LaTeX?

To write an array with superscripts and subscripts in LaTeX, you can use the \array command and include the desired superscript or subscript after the element. For example, x^k will display as x with a superscript of k.

3. Can I use Greek letters in arrays in LaTeX?

Yes, you can use Greek letters in arrays in LaTeX by simply typing the name of the Greek letter within the array. For example, Γ^i_jk will display as Γ with superscript i, subscript j, and k.

4. How do I align the elements in an array in LaTeX?

To align the elements in an array in LaTeX, you can use the & symbol to indicate where each column should start. For example, \begin{array}{ccc} x & y & z \end{array} will create an array with three columns and align the elements in each column.

5. Can I include multiple arrays in one equation in LaTeX?

Yes, you can include multiple arrays in one equation in LaTeX by using the \begin{align} command. This will allow you to align multiple arrays on the same line and display them as one equation.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
5K
  • Cosmology
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
781
  • Advanced Physics Homework Help
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Differential Geometry
Replies
9
Views
3K
  • Introductory Physics Homework Help
2
Replies
40
Views
2K
  • Special and General Relativity
Replies
8
Views
2K
  • Introductory Physics Homework Help
Replies
13
Views
2K
Back
Top