Quantcast Tensors in Latex Text - Physics Forums Library

PDA

View Full Version : Tensors in Latex


InbredDummy
Nov7-08, 12:33 AM
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?

tiny-tim
Nov7-08, 11:40 AM
Hi InbredDummy! :smile:
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?

I'm not following you … how can it change the order? :confused:

Anyway, this link (http://www.physics.udel.edu/~dubois/lshort2e/node54.html#SECTION00830000000000000000) may help,

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

shoehorn
Nov7-08, 11:42 AM
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}

tiny-tim
Nov7-08, 11:50 AM
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}

ooh … \phantom … that's spooooky! :eek:

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

shoehorn
Nov7-08, 12:00 PM
ooh … \phantom … that's spooooky! :eek:

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

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.

cristo
Nov7-08, 12:04 PM
You don't need to use phantom characters:

{T^a}_b

tiny-tim
Nov7-08, 12:07 PM
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.

Hi shoehorn! :smile:

wot's an hbox? :confused: :confused:

InbredDummy
Nov7-08, 03:31 PM
Thank you so much! I love the \phantom{} command!

shoehorn
Nov7-08, 05:19 PM
Hi shoehorn! :smile:

wot's an hbox? :confused: :confused:

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.

robphy
Nov7-08, 11:11 PM
Rather than
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
T^a = d\omega^a + \theta^a_{\ b} \wedge \omega^b

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


I use
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
T_{i}{}^{jk}{}_l{}^m{}_m

T_{i}{}^{jk}{}_l{}^m{}_m