I like to use \tag and \label on an self-defined environment in the same style as for equations. But so far this leads to an error, because the amsmath equation-environment is not happy with tags not placed right behind the opening \begin{equation}.
How can I solve this?
Below is my minimal-example. I indeed use the \varwidth environment in my application in order to embed a bussproofs tree, but I omitted the latter, because it is not of interest I think
\documentclass[]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%opening
\title{Test}
\author{aiquita}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{varwidth}
\newenvironment{myenv}
{\begin{equation*}\varwidth{.9\textwidth}}
{\endvarwidth\end{equation*}}
\begin{document}
\maketitle
\begin{myenv} \tag{abc} \label{cba}
1234
\end{myenv}
\end{document}
Thanks for your help!
equation*
andvarwidth
insidevarwidth
you are in text, there\tag
is not well defined.varwidth
needs to be in text mode. In the end, I don't even need the math mode, but the capabilities of the equation environment.\newenvironment{eqprooftree} {\varwidth{.9\textwidth}\centering\leavevmode} {\DisplayProof\endvarwidth}