☕◦m̰̱̐y̿q̟̽ <[email protected]> writes:

> Given the following Org document:
>
> ,----
> | #+MACRO: refp \autoref{$1}, \autopageref{$1}
> |
> |
> | * section
> |
> | Please see the results in {{{refp(sec:info)}}}.
> |
> | * info<<sec:info>>
> |
> | The results are here.
> `----
>
> When exporting to LaTex, I expect `autoref' and `autopageref' to
> correctly refer to the target `sec:info'. However, recent versions of
> Org do not do that. I now get the following when exporting to LaTeX:
>
> ,----
> | % Created 2015-10-21 Wed 03:25
> | \documentclass[11pt]{article}
> | % [...]
> | \begin{document}
> | % [...]
> | \section{section}
> | \label{sec:orgheadline1}
> |
> | Please see the results in \autoref{sec:info}, \autopageref{sec:info}.
> |
> | \section{info\label{orgtarget1}}
> | \label{sec:orgheadline2}
> |
> | The results are here.
> | \end{document}
> `----
>
> When compiled, the following warning is issued:
>
> ,----
> | Latex failed to resolve 2 reference(s)
> `----
>
>
> This did not occur in Org Mode 8.3beta.

Can you try (setq org-latex-prefer-user-labels t).

This works as expected:

     #+MACRO: refp \autoref{$1}, \autopageref{$1}

     * section

     Please see the results in {{{refp(sec:info)}}}.

     * info
     :PROPERTIES:
     :CUSTOM_ID: sec:info
     :END:

     The results are here.

Hope it helps,
Rasmus

-- 
Sådan en god dansk lagereddike kan man slet ikke bruge mere


Reply via email to