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

org-ref inserting invalid link to #+NAME #285

Closed
floli opened this issue Sep 6, 2016 · 4 comments
Closed

org-ref inserting invalid link to #+NAME #285

floli opened this issue Sep 6, 2016 · 4 comments

Comments

@floli
Copy link

floli commented Sep 6, 2016

Hello,

Sorry for this all too frequent support requests...

I have this org document

#+NAME: fig:GaussianExample
#+CAPTION: Gaussian Basis functions with vertex distances marked at $n \cdot \frac{1}{6}$.
#+RESULTS:
[[file:rbf-gaussian-4.pdf]]

Normal link [[fig:GaussianExample]].

Link inserted using org-ref command: ref:fig:GaussianExample

org-ref recognized the NAME and offered it to me when I inserted a ref link. However, it the document converts to

\begin{document}

\tableofcontents

\begin{figure}[htb]
\centering
\includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}
\caption{\label{fig:orgparagraph1}
Gaussian Basis functions with vertex distances marked at \(n \cdot \frac{1}{6}\).}
\end{figure}

Normal link \ref{fig:orgparagraph1}.

Link inserted using org-ref comamnd: \ref{fig:GaussianExample}
\end{document}

org-ref refers the the link name, not a internal name org mode uses. Do I need to set (setq org-latex-prefer-user-labels t)?

Thanks!

@jkitchin
Copy link
Owner

jkitchin commented Sep 6, 2016

(setq org-latex-prefer-user-labels t) does seem to be what you need.

@floli
Copy link
Author

floli commented Sep 7, 2016

Alright, I'm a bit surprised that it isn't mentioned in the documentation. Refering an image/table that have been labeled with #+NAME seem to be a pretty standard use case.

@jkitchin
Copy link
Owner

jkitchin commented Sep 7, 2016

Seems like it, but I always use labels ;) I updated the ref link section of the documentation to note this. Thanks for alerting me to it, and providing the solution!

@floli
Copy link
Author

floli commented Sep 7, 2016

Alright then!

@floli floli closed this as completed Sep 7, 2016
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