使用张量包的双下标误差

使用张量包的双下标误差

我一直在尝试使用张量包并在尝试在张量的下标上创建下标时遇到错误。

例如:

\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}

在编译此文档时,我收到一条错误消息

! Double subscript.
l.8 ...frac{1}{n!} (T \indices{_{\mu_1}_{\mu_2}}_
                                              {\cdots}_{\mu_n}_\rho^\sig...

答案1

您的牙套不平衡:

\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}

您可以像这样删除右侧多余的括号和下标:

\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}

示例代码输出

答案2

另一种方法是隐藏“内部索引”。

\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}

在此处输入图片描述

相关内容