1

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
\begin{equation}
\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{equation}
#+END_LaTeX

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

\begin{LaTeX}
\begin{equation}
\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{equation}
\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.

0

You need to use

#+begin_export latex
\begin{equation}
\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{equation}
#+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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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