# How to prevent #+BEGIN_LaTeX from generating \begin{LaTeX} when exporting to .tex source?

I am a beginner and have been using emacs for around a month. I'm still finding my way around. Sorry if this is a very basic question.

I'm trying to write a scientific document in org-mode and using org-ref for citations and references. I'm also using CDLaTeX mode for easier math input. To let org-ref find my equation labels, I have to enclose then in a #+BEGIN_LaTeX and #+END_LaTeX block. I have something like this

#+BEGIN_LaTeX
$$\label{eq:unitary-evo-state} \ket{\psi(t)} = U(t) \ket{\psi(0)} \qq{and} \imath\hbar\ket*{\dot{\psi}} = H(t)\ket{\psi}$$
#+END_LaTeX


When I export this to a LaTeX file, it generates the following LaTeX code

\begin{LaTeX}
$$\label{eq:unitary-evo-state} \ket{\psi(t)} = U(t) \ket{\psi(0)} \qq{and} \imath\hbar\ket*{\dot{\psi}} = H(t)\ket{\psi}$$
\end{LaTeX}


The outer \begin{LaTeX} and \end{LaTeX} tags essentially insert a \latex before the equation.

Is there a workaround for this? I was using John Kitchin's org-ref video as a reference and this behavior does not happen there.

I'm using Doom emacs with TeX-Live on Ubuntu. Any help is much appreciated. Thank you very much.

You need to use

#+begin_export latex
$$\label{eq:unitary-evo-state} \ket{\psi(t)} = U(t) \ket{\psi(0)} \qq{and} \imath\hbar\ket*{\dot{\psi}} = H(t)\ket{\psi}$$
#+end_export


If you use the new templating mechanism with C-c C-, you can select the "export latex" entry with l.

If this does not work with org-ref then I suspect that it has not been updated for recent Org mode: try updating and if all fails, contact John Kitchin about it.

• Yeah, thanks. This works. Is the other syntax deprecated or something? – Abhishek Chakraborty May 21 '20 at 13:46
• – NickD May 21 '20 at 13:50