I'd like to let LaTeX split a formula that's inside a fixed-width table. The formula is a group theoretical word (something like $a_1b_3a_5b_3^{-1}$
).
It should automatically split it somewhere between the elements so that it fits in the table. I thought seqsplit
might do the trick, but in the following code example:
\documentclass{article}
\usepackage{seqsplit}
\begin{document}
\begin{tabular}{p{4cm}}
\seqsplit{$a_1b_3a_5b_3^{-1}$}\\
\seqsplit{$a_1$ $b_3$ $a_5$ $b_3^{-1}$}\\
\seqsplit{abcd}
\end{tabular}
\end{document}
Both variants with the formula just raise lots of errors of the form Missing { inserted \seqsplit{$a_1b_3a_5b_3^{-1}$}
, whereas the abcd
-sample works.
The second example actually wouldn't give the desired result anyway, because there should be no spaces between the elements.
Does anyone have a solution to this?
amsmath
package. It offers many environments for "math problems" (including splitting equations over several lines).\seqsplit
(which is not relevant here anyway), works fine.