4

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?

1 Answer 1

8

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.