jkitchin / org-ref

org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools to go with it.
GNU General Public License v3.0
1.36k stars 242 forks source link

bibentry does not correctly export to latex #995

Closed uliw closed 2 years ago

uliw commented 2 years ago

the following statement in my org file

bibentry:&yao-2020-revis-seawat

results in this latex code:

bibentry:\&yao-2021-quant-pyrit

rather than

\bibentry{&yao-2021-quant-pyrit}

not sure how to go about this

jkitchin commented 2 years ago

I can't reproduce that error. It sounds like you don't have a bibentry link defined, but it should be defined here https://github.com/jkitchin/org-ref/blob/master/org-ref-citation-links.el#L796.

That suggests maybe org-ref is not getting fully loaded?

uliw commented 2 years ago

possibly, or the export function. is there a way to track this down?

jkitchin commented 2 years ago

You can check the export function like this


#+BEGIN_SRC emacs-lisp
(org-link-get-parameter "bibentry" :export)
#+END_SRC

#+RESULTS:
: #[128 "\302\300\303\301\"\"\207" [org-ref-cite-export ("bibentry") apply append] 6 "
: 
: (fn &rest ARGS2)"]
uliw commented 2 years ago

I added this to the org file, and exported the file to latex. But there is no output

jkitchin commented 2 years ago

this would just tell you what the export function is, it wouldn't change the export. If you get nil, it may mean there is no bibentry link defined.

you can see the links that are defined with

#+BEGIN_SRC emacs-lisp
(mapcar 'car org-link-parameters)
#+END_SRC
uliw commented 2 years ago

no bibentry in the output from this function. I tried to start with a minimal settings.el to exclude the possibility of a botched configuration, alas, the result is the same. I am running on emacs 28, but that should not really matter?

jkitchin commented 2 years ago

I guess this means that org-ref-citation-links is not getting loaded. I don't know why that would be the case though. if you open that file and eval it, presumably every thing works?

uliw commented 2 years ago

the file executes with no errors, and org-ref-cite-types shows the bibentry entry upon loading an org file. Could it be that this has to do with the export machinery?

jkitchin commented 2 years ago

after you run that (load the file), you can see bibentry in the output of (mapcar 'car org-link-parameters)?

You can run this block:

#+BEGIN_SRC emacs-lisp
(org-link-get-parameter "bibentry" :export)
#+END_SRC

and see that an export is defined,

and it still does not export?

uliw commented 2 years ago

1) go to org-ref-citation-links.el, load test.org, execute the above code: No bibentry in output 2) load test.org, go to org-ref-citation-links.el, execute the above code: No bibentry in output

jkitchin commented 2 years ago

can you check that bibentry is defined in your org-ref-citation-links.el? Maybe you have an older version.

uliw commented 2 years ago

indeed! There is no code for bibentry. The only mention is

(defcustom org-ref-cite-types
  (append
   org-ref-natbib-types
   org-ref-biblatex-types
   org-ref-biblatex-multitypes
   ;; for the bibentry package
   '("bibentry" "Insert the bibtex entry"))
  "List of citation types known in `org-ref'."
  :type '(repeat :tag "List of citation types (type description)" (list string string))
  :group 'org-ref)

I assume that org-ref is installed as part of the scimax install script, and as such does not appear as an installed package when calling package-list-packages. On the other hand, calling update-scimax, appears not to update org-ref. Probably best to install scimax as git clone?

jkitchin commented 2 years ago

That is mostly on me. I didn't realize you were using scimax as the update mechansim for org-ref. I just pushed a version bump commit on scimax for org-ref. that might do it for you.

uliw commented 2 years ago

the straightforward update did not work (some errors that branch is out of sync). Reinstallation did the trick though

uliw commented 2 years ago

As a follow-up. A fresh installation via git clone, complains about missing dash-functional, but dash functional now states that it is obsolete and absorbed in dash. After installing dash-functional, things work as expected

jkitchin commented 2 years ago

that seems to be something in ob-ipython. Probably this summer I will remove this from scimax, in favor of emacs-jupyter.

uliw commented 1 year ago

indeed! There is no code for bibentry. The only mention is

(defcustom org-ref-cite-types
  (append
   org-ref-natbib-types
   org-ref-biblatex-types
   org-ref-biblatex-multitypes
   ;; for the bibentry package
   '("bibentry" "Insert the bibtex entry"))
  "List of citation types known in `org-ref'."
  :type '(repeat :tag "List of citation types (type description)" (list
string string))
  :group 'org-ref)

I assume that org-ref is installed as part of the scimax install script, and as such does not appear as an installed package when calling package-list-packages. On the other hand, calling update-scimax, appears not to update org-ref. Probably best to install scimax as git clone?

On Mon, Mar 21, 2022 at 10:34 AM John Kitchin @.***> wrote:

can you check that bibentry is defined in your org-ref-citation-links.el? Maybe you have an older version.

— Reply to this email directly, view it on GitHub https://github.com/jkitchin/org-ref/issues/995#issuecomment-1073977111, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWSVAX4SAT2QQY3BFF7CCDVBCCI7ANCNFSM5RCDZKCA . You are receiving this because you authored the thread.Message ID: @.***>

-- Ulrich G. Wortmann https://www.es.utoronto.ca/people/faculty/wortmann-ulrich/ Dept. of Earth Sciences Fax : 416 978 3938 University of Toronto Phone: 416 978 7084 22 Ursula Franklin Street, Toronto, ON, Canada M5S 3B1

jkitchin commented 1 year ago

the version of org-ref is pinned in scimax, so it wouldn't change from update-scimax if it was already at the latest version. Maybe there is some funny git business that is making it not update.

You should see code here: https://github.com/jkitchin/org-ref/blob/ec449195438f815698241f0b01a5395221b3306e/org-ref-citation-links.el#L796 that defines the bibentry link.

I think you can delete the org-ref directory, and clone the current version (which is ahead of scimax) and then I guess it should work.

uliw commented 1 year ago

upps., not sure what happened here. I did not comment after closing this in March. Must be a github hickup