Say you have a figure in your org-mode file like the following one:
#+NAME: fig:first-figure
#+CAPTION: Some caption
#+BEGIN_figure
This is a figure.
#+END_figure
This is exported to LaTeX code where \label
is put inside the argument of \caption
:
\begin{figure}
This is a figure.
\caption{\label{fig:first-figure}
Some caption}
\end{figure}
However, this may cause problems in some templates such that the references to the figure will be ill-formed. This can be repaired by putting the \label
command outside and after \caption
:
\begin{figure}
This is a figure.
\caption{Some caption}
\label{fig:first-figure}
\end{figure}
Right now, I'm using macros to achieve this in the LaTeX file, but this doesn't feel right...
How can I adjust the export routine to change the order of \label
and \caption
?