edit: Is there a way to accomplish the below without using the flalign environment? As I mentioned in my question, I know that it is possible to achieve what I'm asking using the flalign environment. This environment however, cannot be wrapped in a newenvironment and so the solution can't be automated. Does anyone know of another solution method?
My question is simple. I'm trying to create an equation environment that will tag an equation with both custom text and an equation number. The text should be flush left and the equation number flush right. It should look like the following.
(customTxt) 1 + 1 = 2 (1)
The custom text is generated by a complicated command that does some arithmetic with counters. The equation number is just \theequation as usual.
I can certainly accomplish this using e.g. flalign:
\begin{flalign}
\mycommand && 1 + 1 = 2 &&
\end{flalign}
However, I can't seem to wrap this into a newenvironment. This appears to be a known issue about align cf this question or this question. I'm working on a very long document and every equation needs to be marked like this. I'd really like to have some sort of custom equation environment that sets this up for me:
\begin{myEqn}{\mycommand}
1 + 1 = 2
\end{myEqn}
Can anyone offer suggestions? edit How do I define a shortcut or command to do this succinctly? Every time I use this command, the parts
\mycommand && ... &&
will always be the same. Is there any way to automate this? The trouble is that the solution given in the referred-to questions will not work in a \newenvironment command.
flalign
).equation
environment. Of course, the caveat here is that what is stacked is the text identifier to the left of the equation. If you instead stack multiple equations with the package in anequation
environment, you will still only get one equation number perequation
environment.