# org-mode special blocks latex attribute

I am using special blocks to create myself a theorem environment so that I can style it in both HTML and Latex output. For this I do;

#+BEGIN_theorem
---Theorem goes here----
#+END_theorem


and this expands into Latex as

\begin{theorem}
---Theorem goes here----
\end{theorem}


But I want to pass an optional argument to this special block so that when I do;

#+BEGIN_theorem
#+ATTR_LATEX :theorem_name "Mean Value Thorem"
---Theorem goes here----
#+END_theorem


so that it will expand into;

\begin{theorem}[Mean Value Theorem]
---Theorem goes here----
\end{theorem}


So, basically I want to pass argument to Latex expansion through special blocks. How can I achieve this?

The following example

#+ATTR_LATEX: :options [Mean Value Theorem]
#+begin_theorem
This is a theorem
#+end_theorem


produces

\begin{theorem}[Mean Value Theorem]
This is a theorem
\end{theorem}


The :options keyword is in the last section of the manual page for LaTeX block attributes.