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?