Max Nikulin <maniku...@gmail.com> writes: > On 02/11/2023 09:11, David Masterson wrote: >> If I understand what you mean by "anchor", does Org create an anchor in >> exporting to Latex when it sees a CUSTOM_ID property in an item? Then, >> would the search in the hyperlink reference the anchor? Your examples >> weren't precise enough for me to follow. > > You are right. Despite `org-latex-prefer-user-labels' exists, it > currently affects LaTeX label names only, so it is possible to > reference them as #page.2, #section.3, but not as > #custom_id. ox-beamer however adds \hypertarget{anchor}... for Org > <<anchor>>, so in PDF it can be referenced as #anchor. > > So ox-latex should be improved to add \hypertarget commands for CUSTOM_ID.
I agree. For a link of: [[file:contacts.org::#custom_id][My text]] the generated LaTeX href looks like \href{contacts.tex}{My text} which looks wrong. > Originally I suspected only issues with links. > > To get links between HTML documents where CUSTOM_ID are not used, it > is necessary to rely on org-publish to track autogenerated anchors. I > am unsure if publish works for LaTeX. I use publish for LaTex (org-latex-publish-to-pdf) -- David Masterson