6

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...
  • 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
5

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

  • 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
2

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

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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