0

I would like to take this :

\newenvironment{myfind}[1]
{{\em Find : #1}\begin{eqnarray*}}{\end{eqnarray*}}

\begin{myfind} {$\lim_{x \to -1} f(x)$} \lim_{x \to -1^+} f(x)&=+\infty \ \lim_{x \to -1^-} f(x)&=+\infty \ \ \therefore \lim_{x \to -1} f(x)&=+\infty \end{myfind}

and use align* instead, however if I do it breaks, the tags don't match the align starts but doesn't find the closing align* .

Now it isn't a huge deal, just curious why it happens and is it still possible to use align* vs eqnarray*.

  • I am not an expert at this, someone else may be able to provide a more rigorous answer. Basically, the mechanism of some commands/environments dictates that they cannot be the argument of other commands (e.g. verbatim commands). This is highly implementation-related, which means there does not exist a universal standard. – Alan Xiang Aug 05 '20 at 16:04
  • 1
    The main issue is that the align* environment is set to process its argument twice, first to measure the widths of various lines, then to perform the actual typesetting job. During the first pass, align* searches ahead and looks for \end{align*}. It will come across \end{myfind}, but that will not yet have been expanded to \end{align*}. Eventually LaTeX will crash as it never locates the relevant \end{align*} statement. – Mico Aug 05 '20 at 16:09

0 Answers0