# Tensors in Latex

1. Nov 6, 2008

### InbredDummy

Hey I was hoping someone could help me on this LaTeX problem. So usually when we have tensors, we have to be careful in how they are spaced and ordered. However in LaTeX it just lines it up and does not give me the order that I want. Can anyone help me with this?

2. Nov 7, 2008

### tiny-tim

Hi InbredDummy!
I'm not following you … how can it change the order?

Anyway, this link may help,

and also you can force it to leave spaces by typing "\ "

3. Nov 7, 2008

### shoehorn

Click on the following for an example of what it is I think you want:

$$T^{i_1i_2\ldots i_r}_{\phantom{i_1i_2\ldots i_r}j_1j_2\ldots j_k[/itex] [tex]T^a = d\omega^a + \theta^a_{\phantom{a}b} \wedge \omega^b$$

$$R^a_{\phantom{a}b} = d\theta^a_{\phantom{a}b} + \theta^a_{\phantom{a}c}\wedge\theta^c_{\phantom{c}b}$$

4. Nov 7, 2008

### tiny-tim

ooh … \phantom … that's spooooky!

Or $$T^a = d\omega^a + \theta^a_{\ b} \wedge \omega^b$$

5. Nov 7, 2008

### shoehorn

Using \ in preference to \phantom will often get you into trouble with hboxes. It's better to use \phantom since that takes care of bounding boxes automatically.

6. Nov 7, 2008

### cristo

Staff Emeritus
You don't need to use phantom characters:

$${T^a}_b$$

7. Nov 7, 2008

### tiny-tim

Hi shoehorn!

wot's an hbox?

8. Nov 7, 2008

### InbredDummy

Thank you so much! I love the \phantom{} command!

9. Nov 7, 2008

### shoehorn

A hbox is a container in which LaTeX puts typeset symbols. Essentially, when LaTeX processes a source file it places characters in hboxes and then its internal magic decides on the layout of the text on the page based on the size and content of the hboxes.

One of the things for which hboxes are important is hyphenation and ligature breaks. If you use, say, the \phantom command to handle index placement, this results in some low-level constraints being placed on the hbox containing those elements. In particular, it passes special flags to the LaTeX processor that prevent nasty hyphenation breaks from mangling your output. On the other hand, if you use \ to handle spacing, LaTeX will typically put each \ character in its own (sub-)hbox, which can result in weird-looking output, particularly in the case of inline equations.

10. Nov 7, 2008

### robphy

Rather than
Code (Text):
T^a = d\omega^a + \theta^a_{\phantom{a}b} \wedge \omega^b
$$T^a = d\omega^a + \theta^a_{\phantom{a}b} \wedge \omega^b$$
or
Code (Text):
T^a = d\omega^a + \theta^a_{\ b} \wedge \omega^b
$$T^a = d\omega^a + \theta^a_{\ b} \wedge \omega^b$$

I use
Code (Text):
T^a = d\omega^a + \theta^a{}_b \wedge \omega^b
$$T^a = d\omega^a + \theta^a{}_b \wedge \omega^b$$

since I might do something like
Code (Text):
T_{i}{}^{jk}{}_l{}^m{}_m
$$T_{i}{}^{jk}{}_l{}^m{}_m$$

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook