I've got a custom environment made for problem sets, and it uses a tabular to align the question number and question body. When I try to use & to group parts of an equation together - like if I want to align the = sign across multiple equations, I get compile errors. Is there any way I can fix this behavior? I'm all for getting rid of the tabular in my environment if I can use some other method to align the question body in a way that's visually equivalent to what I have now...
MWE:
\documentclass{article}
\RequirePackage{amsmath, amsthm}
\RequirePackage{thmtools}
\newcounter{problem}
\setcounter{problem}{0}
\newlength{\mylen}
\settowidth{\mylen}{100}
\newenvironment{problem}[1][]{%
\refstepcounter{problem}
\par\noindent
\begin{tabular}{m{\mylen}p{\dimexpr\linewidth-\mylen-3\tabcolsep\relax}@{}}
\arabic{problem}. & \ifx\relax#1\relax \else\textbf{#1}\\[1mm]&\fi
}
{\end{tabular}\ignorespacesafterend\medskip}%
\begin{document}
\begin{problem}
\begin{align*}
=&\int_{1}^{3}\left(x+\frac{1}{x}\right)\ dx\\
=&\left.\frac{1}{2}x^{2}+ln\lvert x\rvert\;\right|_{1}^{3}
\end{align*}
\end{problem}
\end{document}



tabularinstead ofalign.&is used both byalignandtabular. Similarly\\. – Harish Kumar Feb 8 at 1:50tabulardoesn't work either. But I don't want to do that - I want bo be able to use the functionality ofalignorgatherinside of my custom environment. – agent154 Feb 9 at 23:39100, and that what follows in a minipage of the remaining width. Which in turn just is a simple always resumingenumeratewhich can be set up withenumitemto work kind of the same way. If not you need to explain better what you want, how it should look like etc. – Qrrbrbirlbel Mar 12 at 5:18alignissue? (Ping, @Qrrbrbirlbel.) – Hendrik Vogt Mar 12 at 9:44