Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have been attempting to typeset tensors using the tensor package and have come across an error when attempting to create subscripts on the subscripts of my tensors.

An example of this would be the following:

\documentclass{report}
\usepackage{mathtools}
\usepackage{tensor}

\begin{document}

\begin{equation} \label{tensor-symmetrize}
T\indices{_{(\mu_1 \mu_2 \cdots \mu_n)}_\rho^\sigma} = \frac{1}{n!} (T \indices{_{\mu_1}_{\mu_2}}_{\cdots}_{\mu_n}_\rho^\sigma 
+ \text{sum over permutations of indices}) .
\end{equation}

\end{document}

On compiling this document I get an error saying

! Double subscript.
l.8 ...frac{1}{n!} (T \indices{_{\mu_1}_{\mu_2}}_
                                              {\cdots}_{\mu_n}_\rho^\sig...
share|improve this question
1  
Welcome to TeX.sx!. Thanks for providing a working example of the error you found. In the future, please trim it down (as I have) to be a minimal example—it should be as small as possible but still exhibit the problem you have. This makes it more readable, and ultimately, more answerable. –  Matthew Leingang Apr 16 '13 at 11:54
    
Sorry about the size of the example! I'll make sure to keep it as concise as possible next time. Thank you so much for editing it down for me. :) –  James Fielder Apr 16 '13 at 12:23
add comment

2 Answers 2

up vote 5 down vote accepted

You have a misbalance in braces:

\begin{equation} \label{tensor-symmetrize}
T\indices{_{(\mu_1 \mu_2 \cdots \mu_n)}_\rho^\sigma} = \frac{1}{n!} (T \indices{_{\mu_1}_{\mu_2}_{\cdots}_{\mu_n}_\rho^\sigma }
+ \text{sum over permutations of indices}) .
\end{equation}

You could take out the extra braces and subscripts on the right-hand side like this:

\begin{equation} 
T\indices{_{(\mu_1 \mu_2 \cdots \mu_n)}_\rho^\sigma} = \frac{1}{n!} (T \indices{_{\mu_1\mu_2\cdots\mu_n}_\rho^\sigma }
+ \text{sum over permutations of indices})
\end{equation}

sample code output

share|improve this answer
    
Sorry this is so trivial. I really should have seen that myself, although the error was somewhat misleading. Thank you so much. –  James Fielder Apr 16 '13 at 12:24
    
@James: Your upvote and check are thanks enough. –  Matthew Leingang Apr 16 '13 at 12:37
add comment

Another way is hiding the "inner indices".

\documentclass[a4paper,11pt]{report}

\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{tensor}

\newcommand{\cind}[2]{#1_{#2}}

\begin{document}

\begin{equation} \label{tensor-symmetrize}
T\indices{_{(\cind{\mu}{1} \cind{\mu}{2} \cdots \cind{\mu}{n})}_\rho^\sigma} =
\frac{1}{n!} (T \indices{_{\cind{\mu}{1}}_{\cind{\mu}{2}}_{\cdots}_{\cind{\mu}{n}}_\rho^\sigma}
+ \text{sum over permutations of indices}) .
\end{equation}

\end{document}

enter image description here

share|improve this answer
    
Defining a new command for it certainly helps with the clarity of the source. Thanks, I'll keep this in mind. –  James Fielder Apr 16 '13 at 16:12
add comment

Your Answer

 
discard

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.