# Use the same brackets or parenthesis as equations in an empty style environment

I have the following in my preamble:

\usepackage[overload, ntheorem]{empheq}
\usepackage[amsmath, thmmarks]{ntheorem}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs,showmanualtags}
\newtagform{brackets}{[}{]}
\usetagform{brackets}


Further, I also have

\theoremheaderfont{\upshape}\theorembodyfont{\upshape}
\theoremstyle{nonumberplain}
\theoremseparator{}
\theoremsymbol{}
\newtheorem{optional}{}


So now I can make an empty environment which takes an optional argument like \begin{optional}[$H_2$]. This works but I get to see (H_2) while I would like to see [H_2]. How do I change this? It would be perfect if I could access the mathtools command that gives me the left bracket and the right bracket so I don't have to change it in multiple places if I would want to change it (I could of course define a new command for the left and right bracket but that feels like an ugly hack!).

I forgot to mention that if I give it a label, then refering to it should give the optional argument. Maybe there is a better solution to this problem. I have also tried an equation with \tag but \text doesn't do automatic line breaks.

Thanks for the suggestion. I fixed it like this, but I don't know if it is a good way:

\makeatletter
\newenvironment{optional}[1][Hypothesis]{
\par\noindent \text{[#1]}
\def\@currentlabel{[#1]}
}{\\}

-

Might be a better idea if you provide a full minimal example, for those not knowing it is not obvious that you a using ntheorem. As for you question. You will need to define an alternative theoremstyle, as the braces are hardwired inside it.

Here is the default for nonumberplain

\newtheoremstyle{nonumberplain}%


to make it work you will need something like

\makeatletter
\newtheoremstyle{mynonumberplain}%
\makeatother


(since we are already inside a pair of []'s we need to protect it with a pair of {}'s)

\documentclass[a4paper]{memoir}
\usepackage{mathtools}
\newtagform{brackets}{[}{]}
\usetagform{brackets}
\makeatletter
\let\xxx\tagform@
\makeatother
\begin{document}
\xxx{4}
\end{document}


you can use \tagform@ inside the mynonumberplain definition, but it has to come after the \usetagform{brackets}. The xxx is just to get rid of the @

As for the last question

\makeatletter
\newtheoremstyle{mynonumberplain}%

the trick here is that we need the \@currentlabel outside the \item[...], because it forms a local group, and thus would never get outside, unless we make it global, and that might not be a good idea.
I have added that I use ntheorem. Do you have a suggestion for my other comments? The label and using the brackets as I defined them using mathtools. –  Jonas Teuwen Apr 18 '11 at 8:35
Yes, I'm thinking about it how I can use your suggestions. About the label I think I need to do something like \def\@currentlabel{#1} where #1 refers to the optional argument. I wonder if I can do that using ntheorem. –  Jonas Teuwen Apr 18 '11 at 13:30