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.35k stars 242 forks source link

Export PDF without reference citations on M1 MacOS sonoma #1101

Closed yonghuier closed 7 months ago

yonghuier commented 7 months ago

I use the Doom EMACS configuration on an M1 Mac Sonoma system.

Invoke the following command in org-ref-help:

(let ((org-export-with-broken-links t)
      (org-latex-pdf-process
       '("pdflatex -interaction nonstopmode -shell-escape -output-directory %o %f"
     "bibtex %b"
     "makeindex %b"
     "pdflatex -interaction nonstopmode -shell-escape -output-directory %o %f"
     "pdflatex -interaction nonstopmode -shell-escape -output-directory %o %f")))
  (org-open-file (org-latex-export-to-pdf)))

That successfully outputs the PDF, but only shows "org-ref" in the References section without any inserted citations.

The HTML file I generated with the elisp:(org-ref-export-to-html) command is right.

So I generated the tex file, compiled with MacTex's Texshop, prompted biblatex Error: Incompatible package 'natbib'

But I got the same error through overleaf, but it can be compiled to PDF, and there are references.

I'm curious why I can't compile it with mactex on M1 Mac, how should I fix this?

jkitchin commented 7 months ago

this seems like a latex problem, maybe MacTex has some option to force or ignore errors. You might want to try this instead:

("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f") for org-latex-pdf-process/

yonghuier commented 7 months ago

This command does not work, but it does work with the /example/biblatex-examples.org file, and the citations are successfully imported. However it doesn't work for /example/basic.org, there are still no citations imported, and only the path is displayed.

yonghuier commented 7 months ago

I think I found the problem, I exported the tex file for '/example/basic.org' using 'org-ref-export-to-latex'. I found that '\usepackage{biblatex}' was imported, I deleted this line, compiled successfully, and imported the correct citation. The Overleaf was able to compile the previous file successfully because he automatically ignored this line. So why does the org-ref file contain biblatex when using the natbib package?

yonghuier commented 7 months ago

I finally figured out why it kept failing, and org-ref conflicted with Doom EMACS's biblio module! I commented it out in the init.el file, re-synced it, and then recompiled /examples/* and org-ref-help all yielded the correct results.