如何实现表格中长公式自动换行?

2019-09-07 10:40发布

MWE:\documentclass[10pt]{article}\usepackage{amsmath}\begin{document}\usepackage{tabularx}\begin{cen...

MWE:

\documentclass[10pt]{article}

\usepackage{amsmath}

\begin{document}

\usepackage{tabularx}

\begin{center}

\begin{tabular}{|l|l|l|l|l|}

\hline   monomial($Y_i$)      & i  & $SU(n)$ & ~ & ~ \\ \hline

    $ i\langle  V^{\mu\nu}\{u^\mu u^\nu,u^\alpha u^\alpha\} \rangle$ & 1  & 4       & $i V^{\alpha} \left(-\nabla^{\mu}{u^{\mu}} u^{\alpha} u^{\nu} u^{\nu}-u^{\mu} \nabla^{\mu}{u^{\alpha}} u^{\nu} u^{\nu}-u^{\alpha} u^{\mu} \nabla^{\nu}{u^{\nu}} u^{\mu}-u^{\mu} u^{\mu} u^{\nu} \nabla^{\nu}{u^{\alpha}}+\nabla^{\mu}{u^{\alpha}} u^{\mu} u^{\nu} u^{\nu}+u^{\alpha} \nabla^{\mu}{u^{\mu}} u^{\nu} u^{\nu}+u^{\mu} u^{\mu} \nabla^{\nu}{u^{\alpha}} u^{\nu}+u^{\alpha} u^{\mu} u^{\mu} \nabla^{\nu}{u^{\nu}}\right)$ & ~ \\ \hline

\end{tabular}

\end{center}

\end{document}

    

我想让这段公式自动换行(不在乎是否对齐,只要达到一定的长度能自动换行即可)

2条回答
OsbertWang - 目前是一名 LaTeX 学徒
2019-09-07 11:21 .采纳回答

粗略扫了一下,看到了

\left( \right)

有了它们,在不在表格都不重要了,肯定不能换行啊。

稍微改一下给你:

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{tabularx}
\begin{document}
\begin{tabular}{|l|l|l|p{0.3\linewidth}|l|}
  \hline
  monomial($Y_i$) & i & $SU(n)$ &  & \\
  \hline
  $ i \langle V^{\mu \nu} \{ u^\mu u^\nu, u^\alpha u^\alpha \} \rangle $ & 1 & 4 & $ i V^{\alpha} \bigl( -\nabla^{\mu} u^{\mu} u^{\alpha} u^{\nu} u^{\nu} - u^{\mu} \nabla^{\mu} u^{\alpha} u^{\nu} u^{\nu} - u^{\alpha} u^{\mu} \nabla^{\nu} u^{\nu} u^{\mu} - u^{\mu} u^{\mu} u^{\nu} \nabla^{\nu} u^{\alpha} + \nabla^{\mu} u^{\alpha} u^{\mu} u^{\nu} u^{\nu} + u^{\alpha} \nabla^{\mu} u^{\mu} u^{\nu} u^{\nu} + u^{\mu} u^{\mu} \nabla^{\nu} u^{\alpha} u^{\nu} + u^{\alpha} u^{\mu} u^{\mu} \nabla^{\nu} u^{\nu} \bigr)$ & \\
  \hline
\end{tabular}
\end{document}

一周热门 更多>