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

  • Context: LaTeX 
  • Thread starter Thread starter Philosophaie
  • Start date Start date
  • Tags Tags
    Arrays Latex
Click For Summary
SUMMARY

This discussion focuses on writing arrays and matrices in the new LaTeX format, specifically for expressions such as x^k, g_{ij}, and \Gamma^i_{jk}. The correct syntax for creating matrices includes using the bmatrix environment, which automatically adds brackets, as opposed to the array environment. Users are advised to right-click and select 'tex' to view the LaTeX code for these expressions. Additionally, the discussion highlights common errors in LaTeX syntax and provides solutions for proper formatting.

PREREQUISITES
  • Familiarity with LaTeX syntax and environments
  • Understanding of mathematical notation for tensors and matrices
  • Knowledge of the bmatrix and array environments in LaTeX
  • Basic calculus, particularly derivatives as used in tensor notation
NEXT STEPS
  • Explore the LaTeX bmatrix environment for matrix formatting
  • Learn about the pmatrix environment for parentheses in matrices
  • Study advanced LaTeX commands for formatting complex mathematical expressions
  • Investigate common LaTeX errors and troubleshooting techniques
USEFUL FOR

Mathematicians, physicists, and students who require precise formatting of mathematical expressions in LaTeX, as well as educators creating instructional materials in scientific disciplines.

Philosophaie
Messages
456
Reaction score
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
This is the only way I know. Right click and select 'tex' to see the code.

\left[ \begin {array}{cccc}<br /> 1/(1-2m/r) &amp; 0 &amp; 0 &amp; 0 \\ <br /> 0 &amp; r^2 &amp; 0 &amp; 0\\<br /> 0 &amp; 0 &amp; r^2(sin(h))^2 &amp; 0\\<br /> 0 &amp; 0 &amp; 0 &amp; -(1-2m/r)<br /> \end {array} \right]<br />
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:
Mentz114 said:
This is the only way I know. Right click and select 'tex' to see the code.

\left[ \begin {array}{cccc}<br /> 1/(1-2m/r) &amp; 0 &amp; 0 &amp; 0 \\ <br /> 0 &amp; r^2 &amp; 0 &amp; 0\\<br /> 0 &amp; 0 &amp; r^2(sin(h))^2 &amp; 0\\<br /> 0 &amp; 0 &amp; 0 &amp; -(1-2m/r)<br /> \end {array} \right]<br />
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.
 

Similar threads

  • · Replies 71 ·
3
Replies
71
Views
3K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K