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

Tensors in Latex

  1. Nov 6, 2008 #1
    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. jcsd
  3. Nov 7, 2008 #2

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

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

    Anyway, this link may help,

    and also you can force it to leave spaces by typing "\ " :smile:
     
  4. Nov 7, 2008 #3
    Click on the following for an example of what it is I think you want:

    [tex]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[/tex]

    [tex]R^a_{\phantom{a}b} = d\theta^a_{\phantom{a}b} + \theta^a_{\phantom{a}c}\wedge\theta^c_{\phantom{c}b}[/tex]
     
  5. Nov 7, 2008 #4

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

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

    Or [tex]T^a = d\omega^a + \theta^a_{\ b} \wedge \omega^b[/tex] :wink:
     
  6. Nov 7, 2008 #5
    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.
     
  7. Nov 7, 2008 #6

    cristo

    User Avatar
    Staff Emeritus
    Science Advisor

    You don't need to use phantom characters:

    [tex]{T^a}_b[/tex]
     
  8. Nov 7, 2008 #7

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Hi shoehorn! :smile:

    wot's an hbox? :confused: :confused:
     
  9. Nov 7, 2008 #8
    Thank you so much! I love the \phantom{} command!
     
  10. Nov 7, 2008 #9
    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.
     
  11. Nov 7, 2008 #10

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

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

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

    since I might do something like
    Code (Text):
    T_{i}{}^{jk}{}_l{}^m{}_m
    [tex]
    T_{i}{}^{jk}{}_l{}^m{}_m
    [/tex]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Tensors in Latex
  1. Graphs in LaTeX (Replies: 3)

  2. LaTeX in PowerPoint (Replies: 2)

  3. Latex Help (Replies: 9)

  4. LaTeX help (Replies: 2)

Loading...