Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to non-LaTeX formats does not honor labels set with #+name: #1115

Open
drghirlanda opened this issue May 16, 2024 · 6 comments
Open

Comments

@drghirlanda
Copy link

For example:

\begin{equation}
  \label{eq:x}
   x = 1
\end{equation}

cref:eq:x

Exports correctly to markdown, but:

#+name: eq:x
\begin{equation}
   x = 1
\end{equation}

cref:eq:x

exports with a mix of org-generated labels and user-specified labels, which breaks cross-referencing:

\begin{equation}
  \label{orgf29908c}
  x = 1
\end{equation}

equation \ref{eq:x}
@jkitchin
Copy link
Owner

Can you check what the value of org-latex-prefer-user-labels is set to? Mine is set to t, and I don't have the issue you describe.

@drghirlanda
Copy link
Author

drghirlanda commented May 16, 2024 via email

@jkitchin
Copy link
Owner

I see, Probably this is an org-mode issue. org-latex-prefer-user-labels is for latex backends, and there is one for html. I don't think there is a setting for other formats. The issue is with export of the LaTeX fragment. You might be able to fix it with some custom export code, but I would consider raising on the org mailing list. There should be one variable imo called something like org-export-prefer-user-labels that affects all backends.

@drghirlanda
Copy link
Author

Got it! I will report if I get any intel from the org mailing list.

@jkitchin
Copy link
Owner

If you set (setq org-html-prefer-user-labels t) then it does the right thing for markdown too.

@drghirlanda
Copy link
Author

drghirlanda commented May 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants