TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anybody know about a specific package for handling tensors? Consider, for example, a contraction of the type


Handling the indices in the mixed tensor in the r.h.s. appears particularly annoying and the result is not aesthetically satisfying. Any suggestion?

share|improve this question
How about the tensor package – Peter Grill Aug 17 '11 at 17:11
It may be possible to devise/construct a macro to typeset things to your liking, but that requires some more information. For instance, do you have an example of what an aesthetically satisfying/pleasing tensor handling looks like? – Werner Aug 17 '11 at 17:13
Perhaps the tensind package could be useful. – Gonzalo Medina Aug 17 '11 at 17:14
Looks great! thank you. – user1999 Aug 17 '11 at 17:17
Werner: I think the tensor package pointed by Peter is satisfying. Gonzalo, I'll take a look. Thanks. – user1999 Aug 17 '11 at 17:23
up vote 13 down vote accepted

Is the result you are looking for?



share|improve this answer
Yes, that's it... – user1999 Aug 17 '11 at 17:24

I have defined a new command \newcommand{\tenmix}[3]{{#1}^{#2}_{#3}} where #1 is the tensor name, #2 the contravariant indices and #3 the covariant indices.

But I can't choose the order among the covariant and contravariant index, however it is not necessary to type the signs of superscript and subscript ^ and _. For example, the Riemann tensor: \tenmix{R}{\lambda}{\mu \nu \rho}

share|improve this answer

You can also use phantom:


$g^{\alpha\beta}g^{\gamma\delta}R_{\alpha\mu\gamma\nu}=R^{\beta\;\delta}_{\;\mu\;\nu}$ \\

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.