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

Add reference preview for markdown mode #857

Closed
bdarcus opened this issue Jan 21, 2025 · 4 comments
Closed

Add reference preview for markdown mode #857

bdarcus opened this issue Jan 21, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@bdarcus
Copy link
Contributor

bdarcus commented Jan 21, 2025

Would citar be the right package to include a feature like RefTeX's citation info, i.e. to display the reference of a citekey at point in the echo area?

Originally posted by @tillheilmann in #856

@bdarcus bdarcus added the enhancement New feature or request label Jan 21, 2025
@aikrahguzar
Copy link
Contributor

The standard Emacs interface for this kind of thing is eldoc.

My config has this in it,

(defun +citar-eldoc (callback)
    (when-let ((key (citar-key-at-point)))
      (funcall callback (citar-format-reference `(,key)) :thing key)))

  (add-hook 'LaTeX-mode-hook
            (defun +latex-eldoc ()
              (add-hook 'eldoc-documentation-functions #'+citar-eldoc nil t)
              (eldoc-mode)))

@bdarcus
Copy link
Contributor Author

bdarcus commented Jan 30, 2025

Does the above work for you @tillheilmann?

@tillheilmann
Copy link

Excellent, @aikrahguzar, thank you very much! This, i.e. eldoc, is the exact kind of solution I did not know but hoped would exist. (As you can see, my knowledge of Emacs is still quite basic.) It is, I think, a very neat and elegant thing. Formatting of reference in echo area is not yet perfect (according to my peculiar taste) but I will look into citar-format-reference and see what I can do about that. Thank you, once again!

@tillheilmann
Copy link

Ah, I see: I'll have to configure citar-templates for preview, nice, very good.

@bdarcus bdarcus closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants